Skip to content

Add extra_cargo_args support for prepare phase#119

Open
enthropy7 wants to merge 2 commits intorust-lang:mainfrom
enthropy7:extra-cargo-args
Open

Add extra_cargo_args support for prepare phase#119
enthropy7 wants to merge 2 commits intorust-lang:mainfrom
enthropy7:extra-cargo-args

Conversation

@enthropy7
Copy link
Copy Markdown

this adds an extra_cargo_args() method to BuildBuilder that forwards extra arguments to all cargo commands during Prepare::prepare(): validate_manifest, capture_lockfile, and fetch_deps. without this, crates that require unstable cargo flags for manifest parsing (e.g. -Zbindeps for artifact dependencies) fail at the prepare phase with InvalidCargoTomlSyntax, because there's no way for callers to pass these flags.

needed by docs.rs: rust-lang/docs.rs#3111

@syphar syphar self-requested a review April 7, 2026 05:41
Copy link
Copy Markdown
Member

@syphar syphar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

This is missing tests.

we have "integration-like" tests / examples in tests/.

Test that extra cargo args are forwarded to cargo during the prepare
phase: a positive test with --quiet and a negative test with an invalid
flag to prove args are actually passed through.
@enthropy7
Copy link
Copy Markdown
Author

added and tested :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants