Repository navigation
fix: warn that layout is ignored in lib mode, add flatten opt-out - #36
Merged
Merged
Conversation
…/<lang>/ A lib-mode target silently dropped its `layout` entirely — only `out` mattered, with `<language>/` unconditionally appended — so setting `layout` to anything gave no error and no effect, just a confusingly nested directory. Now warns when that happens, and adds a `flatten` per-target bool so a target with `out` already to itself can skip the `<out>/<language>/` nesting and land the crate straight into `out`.
1 task done
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.
Summary
libmode never consultedlayoutat all — onlyoutmattered, with<language>/always appended (src/commands/generate.rs). A target settinglayoutgot no error and no effect, just a silently-nested directory nobody warned about. Reported against a real repro:out = "../test-cl-rs/",layout = "{{namespace}}.{{ext}}",mode = "lib"landed at../test-cl-rs/rust/..., not../test-cl-rs/....comline generatenow warns when alib-mode target sets a non-defaultlayout, naming where the crate actually lands.flatten = true(lib/dylibonly) that writes the crate straight intoout, skipping the<out>/<language>/nesting — for exactly the case above, where the target already hasoutto itself and the nesting serves no purpose.flattenis target-only, no[generate]-level default, no CLI flag/env — flattening a sharedoutacross severallibtargets would reintroduce the collision the nesting exists to avoid.docs/cli.mdgets the same stale "rust is the only generator" fix already applied across the docs site this week.Test plan
cargo test— 49 passed, including 2 new (lib_mode_flatten_skips_the_language_directory,lib_mode_warns_that_layout_has_no_effect) plus agen_configunit test forflattenresolutionflatten = truelands the crate directly in the target'sout, norust/nesting