Skip to content

Add extra_cargo_args support for prepare phase#119

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

Add extra_cargo_args support for prepare phase#119
enthropy7 wants to merge 2 commits into
rust-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/.

@enthropy7
Copy link
Copy Markdown
Author

added and tested :)

@syphar
Copy link
Copy Markdown
Member

syphar commented May 22, 2026

added and tested :)

I realized that I totally missed this comment, and in my "reviews requested" this PR didn't pop up. Will recheck.

( generally: I did "some" refactoring in the codebase that means you need to update this PR too

enthropy7 added 2 commits May 22, 2026 14:16
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

done! :)

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