bazel: cannot run binary that dlopens shared objects from a {py,sh}_test
Description of the problem / feature request:
I am trying to run a cc_binary target as part of an sh_test. Passing the binary target as a data dependency causes Bazel to build it, but it does not create the runfiles hierarchy.
Feature requests: what underlying problem are you trying to solve with this feature?
The binary I am trying to run depends on the runfiles hierarchy existing so that its dependencies are met. Without this my test is failing unless I explicitly build the cc_binary target first.
Bugs: what’s the simplest, easiest way to reproduce this bug? Please provide a minimal example if possible.
chris@remi ~/code $ git clone https://github.com/crorvick/bazel-hello.git
Cloning into 'bazel-hello'...
remote: Enumerating objects: 11, done.
remote: Counting objects: 100% (11/11), done.
remote: Compressing objects: 100% (10/10), done.
remote: Total 22 (delta 0), reused 9 (delta 0), pack-reused 11
Unpacking objects: 100% (22/22), done.
chris@remi ~/code $ cd bazel-hello
chris@remi ~/code/bazel-hello (master=) $ bazel run //test:hello_test
Starting local Bazel server and connecting to it...
INFO: Analysed target //test:hello_test (20 packages loaded).
INFO: Found 1 target...
Target //test:hello_test up-to-date:
bazel-bin/test/hello_test
INFO: Elapsed time: 4.226s, Critical Path: 0.60s
INFO: 5 processes: 5 linux-sandbox.
INFO: Build completed successfully, 13 total actions
INFO: Build completed successfully, 13 total actions
exec ${PAGER:-/usr/bin/less} "$0" || exit 1
Executing tests from //test:hello_test
-----------------------------------------------------------------------------
Running src/hello/hello
Hello, world!
chris@remi ~/code/bazel-hello (master %=) $ ls bazel-bin/src/hello
hello
hello-2.params
_objs
chris@remi ~/code/bazel-hello (master %=) $ bazel build //src/hello:hello
INFO: Analysed target //src/hello:hello (0 packages loaded).
INFO: Found 1 target...
Target //src/hello:hello up-to-date:
bazel-bin/src/hello/hello
INFO: Elapsed time: 0.179s, Critical Path: 0.01s
INFO: 0 processes.
INFO: Build completed successfully, 3 total actions
chris@remi ~/code/bazel-hello (master %=) $ ls bazel-bin/src/hello
hello
hello-2.params
hello.runfiles
hello.runfiles_manifest
_objs
chris@remi ~/code/bazel-hello (master %=) $
What operating system are you running Bazel on?
Gentoo
What’s the output of bazel info release?
release 0.18.0- (@non-git)
If bazel info release returns “development version” or “(@non-git)”, tell us how you built Bazel.
emerge bazel
About this issue
- Original URL
- State: closed
- Created 8 years ago
- Comments: 19 (3 by maintainers)
EXEC_ORIGIN was never merged, no.