-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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
Crash with configuration transition when .so in deps #9357
Comments
A little background - currently when linking against dynamic libraries, we require all shared libraries to be put into a single _solib directory, so the program loader doesn't have to search through multiple directories (which is quadratic in the number of directories) when loading dynamic libraries. Now with configuration transitions this breaks - the _solib directory is created per configuration. That's what the preconditions error tells us, your library is present in the different _solib directory than what we expected. Our options:
I'll wait for feedback from gregce@ re number of configurations we expect in the build. Until then I'm afraid we have to default to the option 0. |
Thanks for the rundown. If it helps, for my use case, the library in question is actually a prebuilt |
This should have stopped crashing with: https://cs.opensource.google/bazel/bazel/+/a90c4084315a490c4fecc864d0b3435cc7b2bd64 |
Description of the problem:
When using a configuration transition with a C++ build rule, if there is a
.so
file in the transitive deps of the transitioned target, Bazel crashes with the following stack trace:Stack trace
Bugs: what's the simplest, easiest way to reproduce this bug? Please provide a minimal example if possible.
Apply the following patch to an empty directory (with
patch -p1 < 0001-Repro-Bazel-crash.patch.txt
) and runbazel build //:foo-getter-opt
0001-Repro-Bazel-crash.patch.txt
Basically, this is a seemingly straightforward use of configuration transitions that works fine unless a
.so
file appears in thesrcs
of something upstream of the transition. In this example, I transitioned on//command_line_option:compilation_mode
, but when I encountered the problem I was transitioning on a user-defined build setting.What operating system are you running Bazel on?
Ubuntu 16.04, x86_64
What's the output of
bazel info release
?Discovered on 0.28.1, reproduced on 6392e5c
If
bazel info release
returns "development version" or "(@non-git)", tell us how you built Bazel.Clean clone of Bazel,
bazel build //src:bazel
using Bazel 0.28.1.What's the output of
git remote get-url origin ; git rev-parse master ; git rev-parse HEAD
?Have you found anything relevant by searching the web?
Different crash related to configuration transitions -- #8936
Any other information, logs, or outputs that you want to share?
Appears to be a failure of the precondition at
bazel/src/main/java/com/google/devtools/build/lib/rules/cpp/LibrariesToLinkCollector.java
Line 245 in 0bb860d
In particular, here is the value of
libDir
andsolibDir
:bazel-out/k8-opt-ST-f87b14d253ada1bf84e725ab51e04286/bin/_solib_k8/_U_S_S_Cfoo-user___U
bazel-out/k8-fastbuild/bin/_solib_k8
Note that the
solibDir
is not a prefix oflibDir
, violating the tested precondition. This appears to be due to the alternative bazel-out subdirectory used when building with configuration transitions.The text was updated successfully, but these errors were encountered: