TASK-20250524-WILLBE-CARGO-WILL-COLLISION-FIX
- Requesting Crate/Project: Workspace-wide build (
wTools) - Driving Feature/Task: Final verification of
unilang_instruction_parser(and overall workspace health) is affected by output filename collisions betweenwillbeandcargo_will. - Link to Requester's Plan:
../unilang_instruction_parser/plan.md - Date Proposed: 2025-05-24
- Resolve output filename collisions between
willbeandcargo_willcrates to ensure a clean workspace build.
- During
cargo test --workspace(andcargo build --workspace), Cargo reports multiple warnings about "output filename collision" for binary targets namedcargo-willandwillandwillbefrom bothwillbeandcargo_willcrates. This indicates that both crates are trying to produce executables with the same names, leading to conflicts in thetarget/debug/(ortarget/release/) directory. While currently warnings, Cargo explicitly states this "may become a hard error in the future". This issue affects the cleanliness and reliability of workspace builds.
- Option 1 (Preferred): Rename binary targets in one of the crates.
- For example, in
module/alias/cargo_will/Cargo.toml, rename the[[bin]]sections to have unique names (e.g.,cargo-will-alias,will-alias,willbe-alias). This is generally preferred ifcargo_willis intended as an alias or wrapper.
- For example, in
- Option 2: Configure
Cargo.tomlto compile separately.- If both crates are intended to produce binaries with the same names but are used in different contexts, their
Cargo.tomlfiles could be configured to compile them separately (e.g., by usingpackage.default-runor by ensuring they are not built simultaneously in a way that causes collision). However, renaming is usually simpler.
- If both crates are intended to produce binaries with the same names but are used in different contexts, their
cargo test --workspaceandcargo build --workspaceshould complete without any "output filename collision" warnings.- The functionality of both
willbeandcargo_willshould remain as intended, with their respective binaries accessible by their (potentially new) names.
cargo test --workspaceandcargo build --workspaceexit with code 0 and no "output filename collision" warnings.- The binaries produced by
willbeandcargo_willare distinct and functional.
- Breaking Changes: Renaming binary targets would be a breaking change for any scripts or users directly invoking
cargo-will,will, orwillbefrom the affected crate by its old name. This should be communicated. - Dependencies: No new dependencies.
- Performance: No significant performance impact.
- Security: No security implications.
- Testing: Existing tests for both
willbeandcargo_willshould continue to pass.
- Which crate should be prioritized for renaming?
cargo_willseems like a more likely candidate for renaming its binaries ifwillbeis the primary tool.