cc_test(
name = "flag_opts_test",
srcs = [
"flag_opts_test.cc",
],
deps = [
":flag_opts",
":flag_opts_test_proto",
"//external:googletest",
],
)
If I change it to a cc_binary, it builds fine and runs as expected. It appears the difference is the static linking for the binary vs. the dynamic linking for the test.
This seems like a bug?
Synced to commit 7db6d74
Michiel.
$ bazel build -s --verbose_failures --config=k8clang suteki/base/flag_opts:flag_opts_test
WARNING: /home/michiel/.cache/bazel/_bazel_michiel/c301ca0eb36ba0d6e8eac3687ad28ad4/external/protobuf_git/protobuf.bzl:90:19: Variables HOST_CFG and DATA_CFG are deprecated in favor of strings "host" and "data" correspondingly.
WARNING: /home/michiel/.cache/bazel/_bazel_michiel/c301ca0eb36ba0d6e8eac3687ad28ad4/external/protobuf_git/protobuf.bzl:96:28: Variables HOST_CFG and DATA_CFG are deprecated in favor of strings "host" and "data" correspondingly.
Unhandled exception thrown during build; message: Unrecoverable error while evaluating node 'CONFIGURED_TARGET://suteki/base/flag_opts:flag_opts_test 6525539c28b33e9b1b2ebad70a69375c (1499310511 2138362003)' (requested by nodes )
INFO: Elapsed time: 0.265s
java.lang.RuntimeException: Unrecoverable error while evaluating node 'CONFIGURED_TARGET://suteki/base/flag_opts:flag_opts_test 6525539c28b33e9b1b2ebad70a69375c (1499310511 2138362003)' (requested by nodes )
at com.google.devtools.build.skyframe.ParallelEvaluator$Evaluate.run(ParallelEvaluator.java:447)
at com.google.devtools.build.lib.concurrent.AbstractQueueVisitor$WrappedRunnable.run(AbstractQueueVisitor.java:496)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
Caused by: java.lang.IllegalStateException: Artifact 'Artifact:[[/home/michiel/.cache/bazel/_bazel_michiel/c301ca0eb36ba0d6e8eac3687ad28ad4]execroot/gflags_git/bazel-out/suteki_k8_clang-fastbuild/bin]_solib_local/liblibgflags.so' is not under directory 'bazel-out/suteki_k8_clang-fastbuild/bin/_solib_local'.
at com.google.common.base.Preconditions.checkState(Preconditions.java:199)
at com.google.devtools.build.lib.util.Preconditions.checkState(Preconditions.java:238)
at com.google.devtools.build.lib.rules.cpp.CppLinkActionBuilder$CppLinkVariablesExtension.addInputFileLinkOptions(CppLinkActionBuilder.java:1426)
at com.google.devtools.build.lib.rules.cpp.CppLinkActionBuilder$CppLinkVariablesExtension.<init>(CppLinkActionBuilder.java:1206)
at com.google.devtools.build.lib.rules.cpp.CppLinkActionBuilder.build(CppLinkActionBuilder.java:548)
at com.google.devtools.build.lib.rules.cpp.CcBinary.init(CcBinary.java:263)
at com.google.devtools.build.lib.rules.cpp.CcTest.create(CcTest.java:35)
at com.google.devtools.build.lib.rules.cpp.CcTest.create(CcTest.java:24)
at com.google.devtools.build.lib.analysis.ConfiguredTargetFactory.createRule(ConfiguredTargetFactory.java:269)
at com.google.devtools.build.lib.analysis.ConfiguredTargetFactory.createConfiguredTarget(ConfiguredTargetFactory.java:169)
at com.google.devtools.build.lib.skyframe.SkyframeBuildView.createConfiguredTarget(SkyframeBuildView.java:488)
at com.google.devtools.build.lib.skyframe.ConfiguredTargetFunction.createConfiguredTarget(ConfiguredTargetFunction.java:927)
at com.google.devtools.build.lib.skyframe.ConfiguredTargetFunction.compute(ConfiguredTargetFunction.java:233)
at com.google.devtools.build.skyframe.ParallelEvaluator$Evaluate.run(ParallelEvaluator.java:388)
... 4 more
java.lang.RuntimeException: Unrecoverable error while evaluating node 'CONFIGURED_TARGET://suteki/base/flag_opts:flag_opts_test 6525539c28b33e9b1b2ebad70a69375c (1499310511 2138362003)' (requested by nodes )
at com.google.devtools.build.skyframe.ParallelEvaluator$Evaluate.run(ParallelEvaluator.java:447)
at com.google.devtools.build.lib.concurrent.AbstractQueueVisitor$WrappedRunnable.run(AbstractQueueVisitor.java:496)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
Caused by: java.lang.IllegalStateException: Artifact 'Artifact:[[/home/michiel/.cache/bazel/_bazel_michiel/c301ca0eb36ba0d6e8eac3687ad28ad4]execroot/gflags_git/bazel-out/suteki_k8_clang-fastbuild/bin]_solib_local/liblibgflags.so' is not under directory 'bazel-out/suteki_k8_clang-fastbuild/bin/_solib_local'.
at com.google.common.base.Preconditions.checkState(Preconditions.java:199)
at com.google.devtools.build.lib.util.Preconditions.checkState(Preconditions.java:238)
at com.google.devtools.build.lib.rules.cpp.CppLinkActionBuilder$CppLinkVariablesExtension.addInputFileLinkOptions(CppLinkActionBuilder.java:1426)
at com.google.devtools.build.lib.rules.cpp.CppLinkActionBuilder$CppLinkVariablesExtension.<init>(CppLinkActionBuilder.java:1206)
at com.google.devtools.build.lib.rules.cpp.CppLinkActionBuilder.build(CppLinkActionBuilder.java:548)
at com.google.devtools.build.lib.rules.cpp.CcBinary.init(CcBinary.java:263)
at com.google.devtools.build.lib.rules.cpp.CcTest.create(CcTest.java:35)
at com.google.devtools.build.lib.rules.cpp.CcTest.create(CcTest.java:24)
at com.google.devtools.build.lib.analysis.ConfiguredTargetFactory.createRule(ConfiguredTargetFactory.java:269)
at com.google.devtools.build.lib.analysis.ConfiguredTargetFactory.createConfiguredTarget(ConfiguredTargetFactory.java:169)
at com.google.devtools.build.lib.skyframe.SkyframeBuildView.createConfiguredTarget(SkyframeBuildView.java:488)
at com.google.devtools.build.lib.skyframe.ConfiguredTargetFunction.createConfiguredTarget(ConfiguredTargetFunction.java:927)
at com.google.devtools.build.lib.skyframe.ConfiguredTargetFunction.compute(ConfiguredTargetFunction.java:233)
at com.google.devtools.build.skyframe.ParallelEvaluator$Evaluate.run(ParallelEvaluator.java:388)
... 4 more
linkstatic=1
to the test makes it compile and run fine.
Michiel.
To view this discussion on the web visit https://groups.google.com/d/msgid/bazel-discuss/d437b181-2d01-4109-9fe4-93bbe61b2233%40googlegroups.com.--
You received this message because you are subscribed to the Google Groups "bazel-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to bazel-discuss+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
To unsubscribe from this group and stop receiving emails from it, send an email to bazel-discus...@googlegroups.com.