pub struct RealFs { /* private fields */ }Expand description
Real-filesystem SourceTree: walks a root directory and enumerates
.brink keys, keyed by root-relative path. Enumeration goes through the
shared brink_source_tree::Walk, so it never descends into
brink_source_tree::IGNORED_DIR_NAMES (target/, .git/,
node_modules/ — issue #1381 hand-rolled that prune here; issue #1433
moved the enforcement into the walk itself, where it can’t be forgotten),
so a stray build-output or dependency tree under root is never
enumerated. read serves any key lazily off disk — it never eagerly
reads the tree, so one malformed/unreadable file elsewhere under root
cannot fail a read of an unrelated key (issue #1357).
list also reads root’s own brink.toml (if any) for [project] unprune-dirs, issue #1407’s escape hatch for a project that legitimately
keeps .brink sources under one of those pruned names — see
[unprune_dirs] — and, when a pruned directory shallowly contains a
.brink file that unprune-dirs didn’t name, logs a tracing::warn!
naming it (#1407’s silent-skip diagnostic) rather than saying nothing.
Neither behavior changes what a clean tree with no config or no pruned
sources enumerates.
list’s .brink-only scope is fixed — there used to be a second,
.brink + .ink scope reachable via a RealFs::project constructor
(issue #1357’s CLI producer mount), but every caller of that wider scope
either filtered list()’s output back down to .brink itself
(brink-environment’s collect_sources, for a native entry) or never
called list() at all (the same function’s ink-entry branch, which reads
through the tree via INCLUDE BFS instead). The extra .ink keys were
therefore never observable through any real call path, so issue #1404
deleted the second scope and collapsed RealFs::project’s callers onto
this single .brink-only constructor.
Both list and read resolve against the root this instance was
constructed with — neither takes a root parameter (issue #1371:
SourceTree::list used to take one, but RealFs always ignored it in
favor of its own constructor-held root, while GitRev’s pre-#1371
list used the passed-in root instead of its own constructor-held
one — two impls silently disagreeing on which root governed the same
call. Dropping the parameter everywhere makes “root is constructor-held”
the only contract left to honor).