-
Notifications
You must be signed in to change notification settings - Fork 426
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
rust_doc_test
failing with "Failed to load argument file"
#1233
Comments
In case it helps, we're also seeing this error, on both Linux and MacOS. |
Could you share what commit of |
I also hit this error in #1252. Since the |
We're on |
I'm also noticing the issue on the project I'm porting to Bazel
I'm using |
**Context** Today `rust_doc_test` fails when Bazel [Args](https://docs.bazel.build/versions/main/skylark/lib/Args.html) "spill" over to a file. To a user this failure is seemingly random because Bazel will auto-magically spill `Args` onto a file when there are too many args for the command line, or when it can improve performance. The generated test script, e.g. `hellolib.rustdoc_test.sh`, is then run from runfiles, which is separate from the Arg file Bazel created. It's especially tricky because the amount of command line args Windows supports is < macOS < Linux, so there's a "silent" OS dependency here too. **Solution** This PR fixes the issue by manually declaring a params file, e.g. `hellolib.rustdoc_opt_params`, that is a sibling file to our test runner, `hellolib.rustdoc_test.sh`. We then pass the path of this optional params file to our test writer. The test writer checks for the presence of the Bazel Args file, and if it finds one, copies the content into our manually declared params file. Our manually declared params file then gets moved into runfiles with our test script. The test script can then find the file, and `rustdoc` picks up the args. Note: Today we detect the params file by matching a prefix of `@` and suffix of `.rustdoc_test.sh-0.params`. I'm not sure if this is accurate for all systems, or all versions of bazel. I tried the [`use_param_file`](https://docs.bazel.build/versions/main/skylark/lib/Args.html#use_param_file) option on `Args` to make it easier to detect a params file, but that seem to overwrite (or just generally effect) the other arguments we'd pass to `rustdoc_test_writer.rs`. Fixes #1233
I'm not entirely sure when this started occurring but I'm seeing the following error in some
rust_doc_test
targetsThrough some bisecting I found the change in behavior to happen between bbccf77 and c435cf4 but that delta doesn't make much sense to me since neither of these commits look like they'd impact this behavior. Perhaps the error message is not deterministic. This also no longer seems to happen for hosts other than windows. More info is needed.
The text was updated successfully, but these errors were encountered: