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

Running bazel test on Linux fails on dynamically linked cc_test targets #192

Open
FabianHahn opened this issue Aug 11, 2024 · 2 comments
Open

Comments

@FabianHahn
Copy link
Collaborator

Running bazel test on cc_test targets that do not specify linkstatic = 1 seems to be broken since v2.1.0. The last working version was v2.0.0.

Minimal reproduction case: https://github.com/FabianHahn/dynamic_test_repro

Example output:

$ bazel test //:dynamic --config=zig_linux --test_output=streamed
INFO: Invocation ID: 24da0913-0973-4b94-b8f7-b978523b237f
WARNING: Streamed test output requested. All tests will be run locally, without sharding, one at a time
INFO: Analyzed target //:dynamic (24 packages loaded, 168 targets configured).
INFO: Found 1 test target...
/home/fabian/.cache/bazel/_bazel_fabian/2cc9cc00e657a7c72ea56ec288228eca/sandbox/linux-sandbox/51/execroot/__main__/bazel-out/k8-fastbuild/bin/dynamic.runfiles/__main__/dynamic: error while loading shared libraries: bazel-out/k8-fastbuild/bin/_solib_k8/liblib_Sliblib.so: cannot open shared object file: No such file or directory
FAIL: //:dynamic (see /home/fabian/.cache/bazel/_bazel_fabian/2cc9cc00e657a7c72ea56ec288228eca/execroot/__main__/bazel-out/k8-fastbuild/testlogs/dynamic/test.log)
Target //:dynamic up-to-date:
  bazel-bin/dynamic
INFO: Elapsed time: 0.371s, Critical Path: 0.20s
INFO: 2 processes: 2 linux-sandbox.
INFO: Build completed, 1 test FAILED, 2 total actions
//:dynamic                                                               FAILED in 0.0s
  /home/fabian/.cache/bazel/_bazel_fabian/2cc9cc00e657a7c72ea56ec288228eca/execroot/__main__/bazel-out/k8-fastbuild/testlogs/dynamic/test.log

Executed 1 out of 1 test: 1 fails locally.

Environment details:

$ lsb_release -ds
Ubuntu 20.04.6 LTS
$ bazel --version
bazel 6.3.0

From the error message, I suspect this is the same issue as #188.

@FabianHahn
Copy link
Collaborator Author

Bisecting commits between v2.0.0 and v2.1.0 shows that the breaking commit was 0af7160, which is the merge of the zig 0.11.0 upgrade in #111.

This is somewhat worrying because it didn't follow any change of the rules in this repository, but rather a toolchain upgrade that seems to have changed behavior and is no longer compatible.

@FabianHahn
Copy link
Collaborator Author

Filed an upstream bug here: ziglang/zig#21219

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant