-
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
IllegalStateException while building C++ on Windows #6292
Comments
Thank you @scottminor-google, they are indeed seem duplicates. (However I want people from C++ team to confirm this @mhlopko @oquenchil ) |
I believe this issue (along with #6169 and #6171) are caused by 4e42e17 I added this precondition to prevent passing a shared library (DLL file) to linker on Windows. Because on Windows, we need its interface library for linking. However, I just found this was not true for mingw (http://www.mingw.org/wiki/sampledll)
So for #6169, we should disable this precondition check for mingw gcc. For this issue and #6171, I'm not sure which toolchain is used, I guess it's still the native MSVC toolchain? |
@meteorcloudy I was using the Windows virtual machine, and did not pass any specific flags, so it must be MSVC toolchain yes. It is really easy to reproduce. |
@irengrig I'll leave this to you to decide if it should be cherry-picked for 0.19.0 release. |
Can the fix be included in the next closest release? I want to try to enable native singlejar on Windows as soon as possible (see #2241), but it will require the Bazel executable that it building the binary to have the fix. |
Unfortunately, we can not include it, since 0.19.0 is already branched and it is not a regression (this is the policy...). Sorry. |
Too bad. I hope it can at least be included in 0.20.0 so that I can enable native singlejar in 0.21.0? (Not familiar with how Bazel release works). |
@rongjiecomputer We'll have release every month, yes I think it will be included 0.20.0. |
I'm not sure I follow - the (rather trivial) example in #6171 builds using 0.16.1, but not 0.17.x. How is this not a regression? Seeing as 0.18.0 was released today, it is 2 months until 0.20.0. Why do we need to wait two months to finally be able to build with the latest release on Windows again? |
@scottminor-google You are right! It is a regression in 0.17.0, so we indeed should cherry-pick it into 0.19.0. |
If it's a regression, it should be cherry-picked into a patch release of 0.18. (we could consider a patch on top of 0.17, but I hope we can avoid it) |
I advice to create both patch 0.18 release, and to cherrypick the fix into 0.19. I consider this issue serious enough since:
BUT. Last known working version was (reportedly) 0.16.1, so if we want to be pedantic, the issue is too old to be considered a regression. Therefore I'm fine with applying this policy strictly, I don't want to create a precedent. I leave the decision to the release team, and John in particular. |
@mhlopko Thanks for your support - our team is blocked from upgrading past 0.16.1 by this issue so I definitely agree with the first part of your assessment.
This I don't understand - can you help clarify the policy here? Related issues #6169 and #6171 were reported on 17 September, 3 days after the release of 0.17.1 and 28 days prior to the release of 0.18.0. The regression might seem older than it is because it did not gain any visibility until this issue was created on 02 October. Regardless, this was reported three days after a patch release, with almost a month until the next minor release. When should regressions be reported to be considered worth fixing? |
@meteorcloudy Which commits should be cherry-picked? Only 914b4ce? |
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
@laurentlb Yes, only 914b4ce |
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
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
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
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
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
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
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
@meteorcloudy can I close it already? |
Yes, this is fixed. |
I was able to reproduce the issue first reported here: envoyproxy/envoy#4516
git clone https://github.com/envoyproxy/envoy.git
bazel build //source/exe:envoy-static
181002 16:43:21.375:WT 903 [com.google.devtools.build.lib.concurrent.AbstractQueueVisitor.maybeSaveUnhandledThrowable] Found critical error in queue visitor java.lang.RuntimeException: Unrecoverable error while evaluating node '@envoy_api//envoy/config/filter/http/transcoder/v2:transcoder_cc BuildConfigurationValue.Key[297ab5962734d5a7c3f893fa49bcd72c] false' (requested by nodes '//source/common/config:filter_json_lib BuildConfigurationValue.Key[297ab5962734d5a7c3f893fa49bcd72c] 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.CcLibrary.init(CcLibrary.java:286) at com.google.devtools.build.lib.rules.cpp.CcLibrary.create(CcLibrary.java:74) at com.google.devtools.build.lib.rules.cpp.CcLibrary.create(CcLibrary.java:55) at com.google.devtools.build.lib.analysis.ConfiguredTargetFactory.createRule(ConfiguredTargetFactory.java:320) at com.google.devtools.build.lib.analysis.ConfiguredTargetFactory.createConfiguredTarget(ConfiguredTargetFactory.java:205) at com.google.devtools.build.lib.skyframe.SkyframeBuildView.createConfiguredTarget(SkyframeBuildView.java:631) at com.google.devtools.build.lib.skyframe.ConfiguredTargetFunction.createConfiguredTarget(ConfiguredTargetFunction.java:770) at com.google.devtools.build.lib.skyframe.ConfiguredTargetFunction.compute(ConfiguredTargetFunction.java:320) at com.google.devtools.build.skyframe.AbstractParallelEvaluator$Evaluate.run(AbstractParallelEvaluator.java:420) ... 4 more
output in the command line:
FAILED: Build did NOT complete successfully (203 packages loaded)
java.lang.RuntimeException: Unrecoverable error while evaluating node '@envoy_api//envoy/config/filter/http/transcoder/v2:transcoder_cc BuildConfigurationValue.Key[297ab5962734d5a7c3f893fa49bcd72c] false' (requested by nodes '//source/common/config:filter_json_lib BuildConfigurationValue.Key[297ab5962734d5a7c3f893fa49bcd72c] 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.CcLibrary.init(CcLibrary.java:286)
at com.google.devtools.build.lib.rules.cpp.CcLibrary.create(CcLibrary.java:74)
at com.google.devtools.build.lib.rules.cpp.CcLibrary.create(CcLibrary.java:55)
at com.google.devtools.build.lib.analysis.ConfiguredTargetFactory.createRule(ConfiguredTargetFactory.java:320)
at com.google.devtools.build.lib.analysis.ConfiguredTargetFactory.createConfiguredTarget(ConfiguredTargetFactory.java:205)
at com.google.devtools.build.lib.skyframe.SkyframeBuildView.createConfiguredTarget(SkyframeBuildView.java:631)
at com.google.devtools.build.lib.skyframe.ConfiguredTargetFunction.createConfiguredTarget(ConfiguredTargetFunction.java:770)
at com.google.devtools.build.lib.skyframe.ConfiguredTargetFunction.compute(ConfiguredTargetFunction.java:320)
at com.google.devtools.build.skyframe.AbstractParallelEvaluator$Evaluate.run(AbstractParallelEvaluator.java:420)
... 4 more
java.lang.RuntimeException: Unrecoverable error while evaluating node '@envoy_api//envoy/config/filter/http/transcoder/v2:transcoder_cc BuildConfigurationValue.Key[297ab5962734d5a7c3f893fa49bcd72c] false' (requested by nodes '//source/common/config:filter_json_lib BuildConfigurationValue.Key[297ab5962734d5a7c3f893fa49bcd72c] 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.CcLibrary.init(CcLibrary.java:286)
at com.google.devtools.build.lib.rules.cpp.CcLibrary.create(CcLibrary.java:74)
at com.google.devtools.build.lib.rules.cpp.CcLibrary.create(CcLibrary.java:55)
at com.google.devtools.build.lib.analysis.ConfiguredTargetFactory.createRule(ConfiguredTargetFactory.java:320)
at com.google.devtools.build.lib.analysis.ConfiguredTargetFactory.createConfiguredTarget(ConfiguredTargetFactory.java:205)
at com.google.devtools.build.lib.skyframe.SkyframeBuildView.createConfiguredTarget(SkyframeBuildView.java:631)
at com.google.devtools.build.lib.skyframe.ConfiguredTargetFunction.createConfiguredTarget(ConfiguredTargetFunction.java:770)
at com.google.devtools.build.lib.skyframe.ConfiguredTargetFunction.compute(ConfiguredTargetFunction.java:320)
at com.google.devtools.build.skyframe.AbstractParallelEvaluator$Evaluate.run(AbstractParallelEvaluator.java:420)
... 4 more
FAILED: Build did NOT complete successfully (203 packages loaded)
The text was updated successfully, but these errors were encountered: