Repository navigation
Conversation
The materializer already existed (`materialize_all` / `materialize_one`) but only `buildfs` and the ESP32 embed stage could reach it: `fbuild lnk pull` stopped at the disk cache, so an SD-card user, a release script or the fastled-wasm VFS packer had no way to get a real file. Adds the destination to the command line instead of to the descriptor, per the #1356 audit (Q1: git-LFS, DVC, Bazel and Nix all keep placement out of the pointer): * `--materialize` — the build tree's `resources/` projection (default), * `--materialize-dir <DIR>` — an explicit root; the pointer's relative path is preserved (`data/a.bin.fetch` -> `<DIR>/data/a.bin`), * `--in-place` — beside the pointer, and the generated name is recorded in the scanned root's `.gitignore` (idempotently), which is the audit's mitigation for the accidental-commit risk that in-place mode reintroduces. One unresolvable pointer no longer hides the rest: materialization collects per-pointer failures and reports them with the cache-only summary shape. Plain `lnk pull` behaviour is unchanged.
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the
|
The Dylint gates run on new code, including test modules, and three path lints fired on lnk_materialize.rs: `ban_std_pathbuf` (owned PathBuf in the failure type, the target/root return types and the test helper), `ban_raw_path_prefix_compare` (`Path::strip_prefix` against the scan root) and `ban_manual_slash_normalize` (hand-rolled backslash rewrite for the .gitignore entry). Carry `NormalizedPath` through the module instead: destinations, targets and recorded gitignore names are normalized values, the relative projection uses `relative_to`, and the gitignore name uses `display_slash()`. Behaviour is unchanged -- same three destinations, same bytes, same idempotent gitignore.
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes no issue on its own — it is the item the #1356 audit called
"the missing consumer", and the last ruling-free piece of that issue's
materialization half.
Why
fbuild lnk pullstopped at the disk cache. The materializer itself alreadyexisted (
materialize_all/materialize_one, used bybuildfsand by theESP32
embed_filesstage), but nothing exposed it to the CLI, so the twoconsumers the audit named — an SD-card copy and the fastled-wasm VFS packer —
had no supported way to get a real file. The audit's Q2 recommendation is
exactly this flag pair, and Q1 settles where the destination comes from:
the pointer names a source, so placement belongs to the consumer, never to a
destfield on the descriptor.What
Three destinations, all opt-in; plain
lnk pullis byte-for-byte unchanged:--materialize<build root>/resources/— the projection a real build uses--materialize-dir <DIR>--in-placedata/a.bin.fetch→data/a.bin)data/video1.rgb.fetchnever becomes a flat pile entry.--in-placewrites generated files into the source tree, so each name isrecorded in the scanned root's
.gitignore, idempotently — the audit'smitigation for the stale-file / accidental-commit risk.
reported and the others are still written (the same shape the cache-only
summary already had). Exit status is still non-zero on any failure.
--materialize-dirwith--in-placeis refused with an error naming both.Files: new
crates/fbuild-cli/src/cli/lnk_materialize.rs(mode + targetresolution +
.gitignorebookkeeping + 9 unit tests),lnk.rsdispatch,args.rsflags,fbuild-toolchain/src/lnk/README.mdanddocs/reference/cli.md.Tests
soldr cargo test -p fbuild-cli --bin fbuild lnk— 12 passed / 0 failed(9 new; the 3 pre-existing
lnktests still pass). New coverage: flagcombination rules, relative-path preservation, in-place target, sha-identical
materialization through the real
scan → resolve → materializepath with acache-staged blob, per-pointer failure isolation, and
.gitignoreidempotency.
soldr cargo clippy -p fbuild-cli --all-targets --no-deps -- -D warnings—exit 0.
soldr cargo fmt --check— exit 0.Wiring verified through the real binary against a local HTTP server (not just
the helper):
args.rsis already over the 1000-LOC gate at base (baselined); the new fileis 480 lines and
lnk.rs302.Not in this PR
The other two open cells of #1356 stay open, unchanged: the end-of-build
"fetched but unconsumed" warning (its suppression knob is a maintainer
decision) and the capability matrix as data in the board JSONs.