Add extra_cargo_args support for prepare phase - #119
Conversation
syphar
left a comment
There was a problem hiding this comment.
Thanks!
This is missing tests.
we have "integration-like" tests / examples in tests/.
|
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 |
|
done! :) |
syphar
left a comment
There was a problem hiding this comment.
One small API change, two small things for the tests.
Generally:
Right now we assume that the same extra_cargo_args are accepted by cargo metadata, generate-lockfile andfetch, and probably other commands that come later.
Also I wonder if users of the lib would expect that these commands are also automatically added to other cargo calls in the same build.
But: I think when we do the small things from above, we can merge / release this.
|
thanks! fixed the review comments. also yeah, I agree the naming is a bit subtle here. for this PR I kept the scope to prepare-time cargo invocations only, since that’s the docs.rs use case and matches the current method docs. I don’t think we should automatically add these args to rebased on latest main, ci is running again. |
one test was failing cause of cargo updates |
|
The user has been banned from the rust-lang org and will not be providing more updates here |
oh, thanks for the info! |
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.
this adds an
extra_cargo_args()method toBuildBuilderthat forwards extra arguments to all cargo commands duringPrepare::prepare():validate_manifest,capture_lockfile, andfetch_deps. without this, crates that require unstable cargo flags for manifest parsing (e.g.-Zbindepsfor artifact dependencies) fail at the prepare phase withInvalidCargoTomlSyntax, because there's no way for callers to pass these flags.needed by docs.rs: rust-lang/docs.rs#3111