-
Notifications
You must be signed in to change notification settings - Fork 486
"No such file or directory" crash for build scripts of 3rd party crates #3201
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
Comments
Bump. Running into a similar issue. It was clearly documented that for build scripts, if
I was unable to bisect it but looking at the commit history I'm suspecting #2891. You can reproduce by adding https://github.com/EmbarkStudios/spirt as a dependency. cc @UebelAndre |
pq-sys is also affected as of 0.7.0 (see build.rs in this commit). I think the cause is:
I verified this by adding some eprintln!s into build.rs:
There's one thing I do not understand. aquery of the builds script compilation shows:
What replaces |
Anyone found a workaround in the meantime? |
What happens if you build with |
In my case, this happens even without remote execution. |
|
And does this occur on 0.58.0? |
For me, no difference.
I ran into it on 0.58.0. |
@UebelAndre I just tested this against 0.58.0 and the bug still exists. |
This issue is reproducible locally with these files:
Then:
Produces:
Same with |
I reproduced this on 0.59.0 too |
This seems like a different issue. This is the |
@Neo-Zhixing
Interesting you say |
@UebelAndre you are right, these are symlinks.
|
@UebelAndre is there any information that I can provide to help debug this? This is sadly blocking us from upgrading to newer rust versions so I'd love to help in any way I can. |
I could use a repro that 100% reproduces the issue. We definitely have tests for cargo_build_script which don’t seem to hit this and I can’t find a delta 😞 |
Try this:
BUILD: empty build command:
Output:
|
re @Neo-Zhixing #3201 (comment) This looks like a different error than what was originally posted. If you download the
I'm not sure how this crate is intended to be fetched but seems like the crates.io publish is insufficient. That being said, this problem exists past the original issue of build scripts being completely unable to start so if anyone has a repro for that I can try to take a look. |
@UebelAndre would it be better to file a separate issue for what @erenon mentioned above, i.e. I think it has a reliable reproduction at least. |
Yeah, that’s a separate issue that I think is just unique to the crate |
Filed a new ticket: #3369 |
@UebelAndre The name of the crate was I manually downloaded |
Hey! 👋 I've done some extensive research with OP's issue (me and OP are in the same team 😄) and came to the conclusion that #2826 is the root cause. The premise of this problem is that we have more than 1 execution platform registered in our setup, via
We mean to use different libc/gcc toolchain registered at different paths in different execution platforms with this setup. Back to the PR above, the change introduces a This becomes a problem for Bazel workspaces/modules with more than 1 execution platforms registered, because the execution platform can be different between the rules_rust/cargo/private/cargo_build_script_wrapper.bzl Lines 189 to 196 in f525346
and the rules_rust/cargo/private/cargo_build_script_wrapper.bzl Lines 206 to 222 in f525346
This is because the Question for @UebelAndre -- what problems are #2826 trying to solve exactly? If it is simply trying to avoid the need for multiple configurations, and maintain that the |
This is similar to an issue we found in Bazel resolves the execution platform per target, per configuration, so you can't reliably pass information about "the" exec platform between targets. Which is what's happening with |
@UebelAndre have you had a chance to take a look at this? |
I'm working to upgrade my company's codebase to a newer
rules_rust
version.We're currently on 0.49.3.
I originally tried just jumping to 0.57.0 as a bit of a yolo and dealt with the various breaking changes just fine and found a few issues with it. However I ran into one crash that I can't seem to figure out. All 3rd party crates with build scripts are crashing with the following error:
I spent a while poking at our setup and tried things like updating the packages that appear broken -- but I can't seem to puzzle it out or fix it.
I have inspected the bazel output and it looks like the the required file exists on disk according to our tooling. In the above example I can clearly see
bazel-out/k8-fastbuild-ST-921160b699d3/bin/external/crate_index__crossbeam-utils-0.8.20/_bs-
is listed as an input, it exists on disk and it is an executable (I can even execute it locally and it works).I've done some bisecting and it looks like the 0.50.0 release is the first version that started breaking.
The text was updated successfully, but these errors were encountered: