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

Runtime exception on Windows when evaluating BazelCcProtoAspect nodes #6171

Closed
scottmin0r opened this issue Sep 18, 2018 · 1 comment
Closed
Labels
area-Windows Windows-specific issues and feature requests team-OSS Issues for the Bazel OSS team: installation, release processBazel packaging, website untriaged

Comments

@scottmin0r
Copy link

Description of the problem / feature request:

Build causes a RuntimeException on Windows; this appears to happen when one proto_library rule depends on another proto_library rule.

Bugs: what's the simplest, easiest way to reproduce this bug? Please provide a minimal example if possible.

Command

bazel.exe build //some_proto/...

Output

Loading: 
Loading: 0 packages loaded
Analyzing: 2 targets (4 packages loaded)
Unhandled exception thrown during build; message: Unrecoverable error while evaluating node '[]#BazelCcProtoAspect BuildConfigurationValue.Key[3213e4172e1985f81933e1323d6f6468] //some_proto:foo_proto BuildConfigurationValue.Key[3213e4172e1985f81933e1323d6f6468] false {}' (requested by nodes '//some_proto:foo_cc_proto BuildConfigurationValue.Key[3213e4172e1985f81933e1323d6f6468] false')
INFO: Elapsed time: 2.187s
INFO: 0 processes.
Analyzing: 2 targets (12 packages loaded)
FAILED: Build did NOT complete successfully (12 packages loaded)
java.lang.RuntimeException: Unrecoverable error while evaluating node '[]#BazelCcProtoAspect BuildConfigurationValue.Key[3213e4172e1985f81933e1323d6f6468] //some_proto:foo_proto BuildConfigurationValue.Key[3213e4172e1985f81933e1323d6f6468] false {}' (requested by nodes '//some_proto:foo_cc_proto BuildConfigurationValue.Key[3213e4172e1985f81933e1323d6f6468] false')
	at com.google.devtools.build.skyframe.AbstractParallelEvaluator$Evaluate.run(AbstractParallelEvaluator.java:497)
	at com.google.devtools.build.lib.concurrent.AbstractQueueVisitor$WrappedRunnable.run(AbstractQueueVisitor.java:368)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
	at java.base/java.lang.Thread.run(Unknown Source)
Caused by: java.lang.IllegalStateException
	at com.google.common.base.Preconditions.checkState(Preconditions.java:491)
	at com.google.devtools.build.lib.rules.cpp.LibrariesToLinkCollector.addDynamicInputLinkOptions(LibrariesToLinkCollector.java:290)
	at com.google.devtools.build.lib.rules.cpp.LibrariesToLinkCollector.addLinkerInputs(LibrariesToLinkCollector.java:258)
	at com.google.devtools.build.lib.rules.cpp.LibrariesToLinkCollector.collectLibrariesToLink(LibrariesToLinkCollector.java:203)
	at com.google.devtools.build.lib.rules.cpp.CppLinkActionBuilder.build(CppLinkActionBuilder.java:916)
	at com.google.devtools.build.lib.rules.cpp.CcLinkingHelper.createDynamicLibrary(CcLinkingHelper.java:923)
	at com.google.devtools.build.lib.rules.cpp.CcLinkingHelper.createCcLinkActions(CcLinkingHelper.java:713)
	at com.google.devtools.build.lib.rules.cpp.CcLinkingHelper.link(CcLinkingHelper.java:462)
	at com.google.devtools.build.lib.rules.cpp.proto.CcProtoAspect$Impl.<init>(CcProtoAspect.java:192)
	at com.google.devtools.build.lib.rules.cpp.proto.CcProtoAspect.create(CcProtoAspect.java:102)
	at com.google.devtools.build.lib.analysis.ConfiguredTargetFactory.createAspect(ConfiguredTargetFactory.java:411)
	at com.google.devtools.build.lib.skyframe.AspectFunction.createAspect(AspectFunction.java:613)
	at com.google.devtools.build.lib.skyframe.AspectFunction.compute(AspectFunction.java:460)
	at com.google.devtools.build.skyframe.AbstractParallelEvaluator$Evaluate.run(AbstractParallelEvaluator.java:420)
	... 4 more
java.lang.RuntimeException: Unrecoverable error while evaluating node '[]#BazelCcProtoAspect BuildConfigurationValue.Key[3213e4172e1985f81933e1323d6f6468] //some_proto:foo_proto BuildConfigurationValue.Key[3213e4172e1985f81933e1323d6f6468] false {}' (requested by nodes '//some_proto:foo_cc_proto BuildConfigurationValue.Key[3213e4172e1985f81933e1323d6f6468] false')
	at com.google.devtools.build.skyframe.AbstractParallelEvaluator$Evaluate.run(AbstractParallelEvaluator.java:497)
	at com.google.devtools.build.lib.concurrent.AbstractQueueVisitor$WrappedRunnable.run(AbstractQueueVisitor.java:368)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
	at java.base/java.lang.Thread.run(Unknown Source)
Caused by: java.lang.IllegalStateException
	at com.google.common.base.Preconditions.checkState(Preconditions.java:491)
	at com.google.devtools.build.lib.rules.cpp.LibrariesToLinkCollector.addDynamicInputLinkOptions(LibrariesToLinkCollector.java:290)
	at com.google.devtools.build.lib.rules.cpp.LibrariesToLinkCollector.addLinkerInputs(LibrariesToLinkCollector.java:258)
	at com.google.devtools.build.lib.rules.cpp.LibrariesToLinkCollector.collectLibrariesToLink(LibrariesToLinkCollector.java:203)
	at com.google.devtools.build.lib.rules.cpp.CppLinkActionBuilder.build(CppLinkActionBuilder.java:916)
	at com.google.devtools.build.lib.rules.cpp.CcLinkingHelper.createDynamicLibrary(CcLinkingHelper.java:923)
	at com.google.devtools.build.lib.rules.cpp.CcLinkingHelper.createCcLinkActions(CcLinkingHelper.java:713)
	at com.google.devtools.build.lib.rules.cpp.CcLinkingHelper.link(CcLinkingHelper.java:462)
	at com.google.devtools.build.lib.rules.cpp.proto.CcProtoAspect$Impl.<init>(CcProtoAspect.java:192)
	at com.google.devtools.build.lib.rules.cpp.proto.CcProtoAspect.create(CcProtoAspect.java:102)
	at com.google.devtools.build.lib.analysis.ConfiguredTargetFactory.createAspect(ConfiguredTargetFactory.java:411)
	at com.google.devtools.build.lib.skyframe.AspectFunction.createAspect(AspectFunction.java:613)
	at com.google.devtools.build.lib.skyframe.AspectFunction.compute(AspectFunction.java:460)
	at com.google.devtools.build.skyframe.AbstractParallelEvaluator$Evaluate.run(AbstractParallelEvaluator.java:420)
	... 4 more
FAILED: Build did NOT complete successfully (12 packages loaded)

WORKSPACE

http_archive(
    name = "com_google_protobuf",
    sha256 = "cef7f1b5a7c5fba672bec2a319246e8feba471f04dcebfe362d55930ee7c1c30",
    strip_prefix = "protobuf-3.5.0",
    urls = ["https://github.com/google/protobuf/archive/v3.5.0.zip"],
)

some_proto/BUILD

cc_proto_library(
	name = "foo_cc_proto",
	deps = [":foo_proto"],
)

proto_library(
	name = "foo_proto",
	srcs = [":foo.proto"],
	deps = ["//some_other_proto:bar_proto"],
)

some_proto/foo.proto

syntax = "proto3";

import "some_other_proto/bar.proto";

message Foo {
	Bar bar = 1;
}

some_other_proto/BUILD

package(default_visibility=["//visibility:public"])

cc_proto_library(
	name = "bar_cc_proto",
	deps = [":bar_proto"],
)

proto_library(
	name = "bar_proto",
	srcs = ["bar.proto"],
)

some_other_proto/bar.proto

syntax = "proto3";

message Bar {
	int32 baz = 1;
}

What operating system are you running Bazel on?

Windows Server 2012 R2 Datacenter

What's the output of bazel info release?

release 0.17.1

Have you found anything relevant by searching the web?

I seem to be hitting this precondition which was introduced in this commit.

Symptoms are similar to #6169, and this may be a dupe. However:

Any other information, logs, or outputs that you want to share?

  • bazel 0.16.1 builds the above fine, but 0.17.1 does not.
  • bazel 0.17.1 can build protos with no dependencies (bazel.exe build //some_other_proto/... is fine); asking bazel to analyze a proto_library with another proto_library rule in its deps attribute seems to cause the issue.
@aiuto aiuto added area-Windows Windows-specific issues and feature requests untriaged labels Sep 18, 2018
@scottmin0r
Copy link
Author

scottmin0r commented Oct 2, 2018

I can reproduce the above example with Windows 10, release 0.17.2 and protobuf v3.6.1. release 0.16.1 is the latest release with the above example that appears to work. Is there anything I can do to troubleshoot this issue?

katre pushed a commit that referenced this issue Oct 16, 2018
The MSYS gcc and MINGW gcc toolchains do support linking against shared library. So the precondition check should be disabled for them.

CcProtoAspect.java should set emitInterfaceSharedObjects to true when the toolchain supports interface shared library.

Fixes #6171
Fixes #6292
Fixes #6169

RELNOTES: None
PiperOrigin-RevId: 216258674
katre pushed a commit that referenced this issue Oct 17, 2018
The MSYS gcc and MINGW gcc toolchains do support linking against shared library. So the precondition check should be disabled for them.

CcProtoAspect.java should set emitInterfaceSharedObjects to true when the toolchain supports interface shared library.

Fixes #6171
Fixes #6292
Fixes #6169

RELNOTES: None
PiperOrigin-RevId: 216258674
aehlig pushed a commit that referenced this issue Oct 23, 2018
The MSYS gcc and MINGW gcc toolchains do support linking against shared library. So the precondition check should be disabled for them.

CcProtoAspect.java should set emitInterfaceSharedObjects to true when the toolchain supports interface shared library.

Fixes #6171
Fixes #6292
Fixes #6169

RELNOTES: None
PiperOrigin-RevId: 216258674
katre pushed a commit that referenced this issue Oct 23, 2018
The MSYS gcc and MINGW gcc toolchains do support linking against shared library. So the precondition check should be disabled for them.

CcProtoAspect.java should set emitInterfaceSharedObjects to true when the toolchain supports interface shared library.

Fixes #6171
Fixes #6292
Fixes #6169

RELNOTES: None
PiperOrigin-RevId: 216258674
katre pushed a commit that referenced this issue Oct 23, 2018
The MSYS gcc and MINGW gcc toolchains do support linking against shared library. So the precondition check should be disabled for them.

CcProtoAspect.java should set emitInterfaceSharedObjects to true when the toolchain supports interface shared library.

Fixes #6171
Fixes #6292
Fixes #6169

RELNOTES: None
PiperOrigin-RevId: 216258674
aehlig pushed a commit that referenced this issue Oct 24, 2018
The MSYS gcc and MINGW gcc toolchains do support linking against shared library. So the precondition check should be disabled for them.

CcProtoAspect.java should set emitInterfaceSharedObjects to true when the toolchain supports interface shared library.

Fixes #6171
Fixes #6292
Fixes #6169

RELNOTES: None
PiperOrigin-RevId: 216258674
katre pushed a commit that referenced this issue Oct 24, 2018
The MSYS gcc and MINGW gcc toolchains do support linking against shared library. So the precondition check should be disabled for them.

CcProtoAspect.java should set emitInterfaceSharedObjects to true when the toolchain supports interface shared library.

Fixes #6171
Fixes #6292
Fixes #6169

RELNOTES: None
PiperOrigin-RevId: 216258674
aehlig pushed a commit that referenced this issue Oct 29, 2018
The MSYS gcc and MINGW gcc toolchains do support linking against shared library. So the precondition check should be disabled for them.

CcProtoAspect.java should set emitInterfaceSharedObjects to true when the toolchain supports interface shared library.

Fixes #6171
Fixes #6292
Fixes #6169

RELNOTES: None
PiperOrigin-RevId: 216258674
@philwo philwo added the team-OSS Issues for the Bazel OSS team: installation, release processBazel packaging, website label Jun 15, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-Windows Windows-specific issues and feature requests team-OSS Issues for the Bazel OSS team: installation, release processBazel packaging, website untriaged
Projects
None yet
Development

No branches or pull requests

3 participants