Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support argfiles in all our argument munching #3412

Open
1 of 2 tasks
RalfJung opened this issue Mar 25, 2024 · 1 comment
Open
1 of 2 tasks

Support argfiles in all our argument munching #3412

RalfJung opened this issue Mar 25, 2024 · 1 comment
Labels
A-cargo Area: affects the cargo wrapper (cargo miri) C-bug Category: This is a bug.

Comments

@RalfJung
Copy link
Member

RalfJung commented Mar 25, 2024

cargo-miri and the Miri driver do a bunch of processing with the arguments passed to rustc -- that's terrible but currently not really avoidable. However we are entirely ignoring the existence of argument files, which already caused #3404 and could cause further issues in the future. So we should fix that.

  • cargo-miri: this is where most of the argument parsing and patching happens
    • For things that just scan the arguments, we should recurse into argument files so we can scan them as well.
    • When we are patching arguments (like replacing rlib by rmeta in --extern or filtering out certain flags), I'm not sure what to do -- either we just say argument files are not supported there, or we pass these arguments directly without files (which risks issues on Windows), or we have to generate our own argument files.
  • miri driver: needs to do argument parsing to set a default sysroot. Ideally we can just avoid having to do that. I tied two approaches for that:
@RalfJung
Copy link
Member Author

Turns out cargo will use argfiles "on demand": if spawning the process fails because the argument list was too long, it falls back to an argfile. So that could lead to some very strange failures modes for Miri where when the number of dependencies exceeds some limit, suddenly cargo miri stops working on Windows...

@RalfJung RalfJung added C-bug Category: This is a bug. A-cargo Area: affects the cargo wrapper (cargo miri) labels May 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-cargo Area: affects the cargo wrapper (cargo miri) C-bug Category: This is a bug.
Projects
None yet
Development

No branches or pull requests

1 participant