-
Notifications
You must be signed in to change notification settings - Fork 13.3k
ICE while attempting to resolve against symlinked rlibs #26006
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
Whoa, awesome!
Isn't the
This is a bug regardless! |
Could reproduce. I think I found the issue, waiting for compile. |
Ah, that solves the problem. Many other Bazel mechanisms reference files relative to the workspace root, but in this case, the symlink is indeed resolved relative to the directory where the symlink is located. Thanks for the catch!
Thanks for looking into this so quickly! |
…chton This might fail when --extern library is a symlink to an invalid location. Instead just pretend it doesn’t exist at all. Fixes #26006
I am working on adding Rust support to Bazel. I encountered an ICE when running
rustc
while building a crate where the following are true:dependency
search directory contains symlinks to rlibs.In this case, I am building time using the following command:
RUST_BACKTRACE=1 rustc third_party/time/upstream/src/lib.rs \ --crate-name time \ --crate-type lib \ -g \ --out-dir bazel-out/local_darwin-fastbuild/bin/third_party/time \ --emit=dep-info,link \ -L dependency=bazel-out/local_darwin-fastbuild/bin/third_party/time/time.deps \ --extern libc=bazel-out/local_darwin-fastbuild/bin/third_party/time/time.deps/liblibc.rlib \ -L native=bazel-out/local_darwin-fastbuild/bin/third_party/time \ -l static=time_helpers
where the
bazel-out/local_darwin-fastbuild/bin/third_party/time
directory contains the following:The main difference between this
rustc
command and the one that Cargo runs fortime
is that the dependencies directory here contains symlinks to the rlibs.Running the above
rustc
command results in the following ICE:From what I understand, this panic is caused by some file not being found when resolving crates (hence the
Os(2)
result). It appears to me that the file thatFileSearch
is unable to find is the libc rlib due toliblibc.rlib
being a symlink in the search directory, especially since if I remove the symlink and copyliblibc.rlib
intobazel-out/local_darwin-fastbuild/bin/third_party/time/time.deps/
, therustc
command runs just fine.What's also curious is that when I build other crates that have dependencies but do not link native libraries, such as url,
rustc
is able to resolve the crates without any issues, even though they are symlinked.Output of
rustc --version --verbose
:This also reproduces on 1.0.0 stable.
The text was updated successfully, but these errors were encountered: