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

Bazel crashes on Windows with --compiler=msys-gcc #6651

Closed
ulfjack opened this issue Nov 11, 2018 · 14 comments
Closed

Bazel crashes on Windows with --compiler=msys-gcc #6651

ulfjack opened this issue Nov 11, 2018 · 14 comments
Assignees
Labels
area-Windows Windows-specific issues and feature requests P4 This is either out of scope or we don't have bandwidth to review a PR. (No assignee) platform: windows team-OSS Issues for the Bazel OSS team: installation, release processBazel packaging, website type: bug

Comments

@ulfjack
Copy link
Contributor

ulfjack commented Nov 11, 2018

Exception stack trace:

Caused by: java.lang.IllegalStateException: "bazel.windows_unix_root" JVM flag is not set. Use the --host_jvm_args flag. For example: "--host_jvm_args=-Dbazel.windows_unix_root=c:/tools/msys64".
        at com.google.devtools.build.lib.util.DependencySet$WindowsPath.getUnixRoot(DependencySet.java:285)
        at com.google.devtools.build.lib.util.DependencySet$WindowsPath.translateWindowsPath(DependencySet.java:269)
        at com.google.devtools.build.lib.util.DependencySet$WindowsPath.access$000(DependencySet.java:254)
        at com.google.devtools.build.lib.util.DependencySet.translatePath(DependencySet.java:112)
        at com.google.devtools.build.lib.util.DependencySet.addDependency(DependencySet.java:103)
        at com.google.devtools.build.lib.util.DependencySet.process(DependencySet.java:154)
        at com.google.devtools.build.lib.util.DependencySet.read(DependencySet.java:121)
        at com.google.devtools.build.lib.rules.cpp.CppCompileAction.processDepset(CppCompileAction.java:1277)
        at com.google.devtools.build.lib.rules.cpp.CppCompileAction.discoverInputsFromDotdFiles(CppCompileAction.java:1249)
        at com.google.devtools.build.lib.rules.cpp.CppCompileAction.execute(CppCompileAction.java:1188)
        at com.google.devtools.build.lib.skyframe.SkyframeActionExecutor.executeActionTask(SkyframeActionExecutor.java:941)
        at com.google.devtools.build.lib.skyframe.SkyframeActionExecutor.prepareScheduleExecuteAndCompleteAction(SkyframeActionExecutor.java:872)
        at com.google.devtools.build.lib.skyframe.SkyframeActionExecutor.access$900(SkyframeActionExecutor.java:114)
        at com.google.devtools.build.lib.skyframe.SkyframeActionExecutor$ActionRunner.call(SkyframeActionExecutor.java:731)
        at com.google.devtools.build.lib.skyframe.SkyframeActionExecutor$ActionRunner.call(SkyframeActionExecutor.java:685)
        at java.util.concurrent.FutureTask.run(FutureTask.java:266)
        at com.google.devtools.build.lib.skyframe.SkyframeActionExecutor.executeAction(SkyframeActionExecutor.java:426)
        at com.google.devtools.build.lib.skyframe.ActionExecutionFunction.checkCacheAndExecuteIfNeeded(ActionExecutionFunction.java:490)
        at com.google.devtools.build.lib.skyframe.ActionExecutionFunction.compute(ActionExecutionFunction.java:208)
        at com.google.devtools.build.skyframe.AbstractParallelEvaluator$Evaluate.run(AbstractParallelEvaluator.java:363)
        ... 4 more
@irengrig irengrig added area-Windows Windows-specific issues and feature requests untriaged labels Nov 12, 2018
@laszlocsomor
Copy link
Contributor

Do you have a repro?

I can build cc_* targets with --compiler=msys-gcc with Bazel 0.20.0

@laszlocsomor laszlocsomor added type: bug P4 This is either out of scope or we don't have bandwidth to review a PR. (No assignee) and removed untriaged labels Dec 4, 2018
@laszlocsomor laszlocsomor self-assigned this Dec 4, 2018
@ulfjack
Copy link
Contributor Author

ulfjack commented Jan 18, 2019

git clone https://github.com/ulfjack/ryu.git
cd ryu
bazel test --compiler=msys-gcc //ryu/tests:d2s_test

This is in a normal command prompt, not bash.

If I set the flag, I get a bunch of inclusion missing errors:

C:\Projects\ryu>bazel --host_jvm_args=-Dbazel.windows_unix_root=c:/tools/msys64 test --compiler=msys-gcc //ryu/tests:d2s_test
WARNING: Running Bazel server needs to be killed, because the startup options are different.
Starting local Bazel server and connecting to it...
INFO: Invocation ID: 281909bf-3ad4-44a2-81b0-accd11764680
INFO: Analysed target //ryu/tests:d2s_test (17 packages loaded, 292 targets configured).
INFO: Found 1 test target...
ERROR: C:/projects/ryu/ryu/BUILD:3:1: undeclared inclusion(s) in rule '//ryu:ryu':
this rule is missing dependency declarations for the following files included by 'ryu/f2s.c':
  'c:/tools/msys64/usr/include/assert.h'
  'c:/tools/msys64/usr/include/_ansi.h'
  'c:/tools/msys64/usr/include/newlib.h'
  'c:/tools/msys64/usr/include/_newlib_version.h'
  'c:/tools/msys64/usr/include/sys/config.h'
  'c:/tools/msys64/usr/include/machine/ieeefp.h'
  'c:/tools/msys64/usr/include/sys/features.h'
  'c:/tools/msys64/usr/include/cygwin/config.h'
  'c:/tools/msys64/usr/lib/gcc/x86_64-pc-msys/7.3.0/include/stdbool.h'
  'c:/tools/msys64/usr/lib/gcc/x86_64-pc-msys/7.3.0/include/stdint.h'
  'c:/tools/msys64/usr/include/stdint.h'
  'c:/tools/msys64/usr/include/machine/_default_types.h'
  'c:/tools/msys64/usr/include/sys/_intsup.h'
  'c:/tools/msys64/usr/include/sys/_stdint.h'
  'c:/tools/msys64/usr/include/stdlib.h'
  'c:/tools/msys64/usr/lib/gcc/x86_64-pc-msys/7.3.0/include/stddef.h'
  'c:/tools/msys64/usr/include/sys/reent.h'
  'c:/tools/msys64/usr/include/_ansi.h'
  'c:/tools/msys64/usr/include/sys/_types.h'
  'c:/tools/msys64/usr/include/machine/_types.h'
  'c:/tools/msys64/usr/include/sys/lock.h'
  'c:/tools/msys64/usr/include/sys/cdefs.h'
  'c:/tools/msys64/usr/include/machine/stdlib.h'
  'c:/tools/msys64/usr/include/alloca.h'
  'c:/tools/msys64/usr/include/cygwin/stdlib.h'
  'c:/tools/msys64/usr/include/cygwin/wait.h'
  'c:/tools/msys64/usr/include/string.h'
  'c:/tools/msys64/usr/include/xlocale.h'
  'c:/tools/msys64/usr/include/strings.h'
  'c:/tools/msys64/usr/include/sys/string.h'
  'c:/tools/msys64/usr/lib/gcc/x86_64-pc-msys/7.3.0/include-fixed/limits.h'
  'c:/tools/msys64/usr/lib/gcc/x86_64-pc-msys/7.3.0/include-fixed/syslimits.h'
  'c:/tools/msys64/usr/include/limits.h'
  'c:/tools/msys64/usr/include/features.h'
  'c:/tools/msys64/usr/include/bits/wordsize.h'
Target //ryu/tests:d2s_test failed to build
Use --verbose_failures to see the command lines of failed build steps.
INFO: Elapsed time: 3.708s, Critical Path: 0.21s
INFO: 0 processes.
FAILED: Build did NOT complete successfully

I don't have a .bazelrc.

@ulfjack
Copy link
Contributor Author

ulfjack commented Jan 18, 2019

I see the same behavior when running in an msys shell.

@laszlocsomor
Copy link
Contributor

Tried reproing but everything works fine for me.

Do you see the same crash as in #6651 (comment)?
Which Bazel version is it? Mine is 0.21.0.
Where is MSYS installed?

@ulfjack
Copy link
Contributor Author

ulfjack commented Jan 21, 2019

I saw the same crash as originally posted. I believe I was running 0.21 in my repro. The C++ error occurs when I add --host_jvm_args=-Dbazel.windows_unix_root=c:/tools/msys64 as a startup flag. I don't know where msys is installed, but I suppose it's in c:/tools/msys64.

@ulfjack
Copy link
Contributor Author

ulfjack commented Jan 21, 2019

The original post was for 0.14, IIRC.

@laszlocsomor
Copy link
Contributor

Please try running with --client_debug and paste the output here.

@ulfjack
Copy link
Contributor Author

ulfjack commented Jan 24, 2019

[bazel INFO src/main/cpp/blaze_util_windows.cc:1362] Getting install location of HKCU\Software\Microsoft\Windows\CurrentVersion\Uninstall\{3d633ed2-5ece-47bf-8347-c49a5f481a1d}
[bazel INFO src/main/cpp/blaze_util_windows.cc:1387] Install location of HKCU\Software\Microsoft\Windows\CurrentVersion\Uninstall\{3d633ed2-5ece-47bf-8347-c49a5f481a1d} is 0000008EC33FF150
[bazel INFO src/main/cpp/blaze_util_windows.cc:1396] Detected msys bash at C:\msys64\usr\bin\bash.exe
[bazel INFO src/main/cpp/blaze_util_windows.cc:1459] BAZEL_SH detection took 0 msec, found C:\msys64\usr\bin\bash.exe
[bazel INFO src/main/cpp/option_processor.cc:359] Looking for the following rc files: c:\programdata\bazel.bazelrc,c:\projects\ryu/.bazelrc,C:\Users\Ulf Adams/.bazelrc
[bazel INFO src/main/cpp/blaze.cc:1552] Debug logging requested, sending all client log statements to stderr
[bazel INFO src/main/cpp/blaze.cc:1572] Acquired the client lock, waited 0 milliseconds
[bazel USER src/main/cpp/blaze.cc:853] Starting local Bazel server and connecting to it...
[bazel INFO src/main/cpp/blaze.cc:1631] Trying to connect to server (timeout: 30 secs)...
[bazel INFO src/main/cpp/blaze.cc:1307] Connected (server pid=4360).
[bazel INFO src/main/cpp/blaze.cc:1896] Releasing client lock, let the server manage concurrent requests.
INFO: Invocation ID: 1859ac2b-0cd1-4154-8b71-b5b7a2ff795c
INFO: Analysed target //ryu/tests:d2s_test (17 packages loaded, 293 targets configured).
INFO: Found 1 test target...
Target //ryu/tests:d2s_test failed to build
Use --verbose_failures to see the command lines of failed build steps.
Internal error thrown during build. Printing stack trace: java.lang.RuntimeException: Unrecoverable error while evaluating node 'ActionLookupData{actionLookupKey=//ryu:ryu BuildConfigurationValue.Key[bbdbc1207e00f02b4f284509a817e9e7] false, actionIndex=2}' (requested by nodes 'File:[[<execution_root>]bazel-out/x64_windows-fastbuild/bin]ryu/_objs/ryu/d2s.o')
        at com.google.devtools.build.skyframe.AbstractParallelEvaluator$Evaluate.run(AbstractParallelEvaluator.java:499)
        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: "bazel.windows_unix_root" JVM flag is not set. Use the --host_jvm_args flag. For example: "--host_jvm_args=-Dbazel.windows_unix_root=c:/tools/msys64".
        at com.google.devtools.build.lib.util.DependencySet$WindowsPath.getUnixRoot(DependencySet.java:282)
        at com.google.devtools.build.lib.util.DependencySet$WindowsPath.translateWindowsPath(DependencySet.java:266)
        at com.google.devtools.build.lib.util.DependencySet$WindowsPath.access$000(DependencySet.java:251)
        at com.google.devtools.build.lib.util.DependencySet.translatePath(DependencySet.java:112)
        at com.google.devtools.build.lib.util.DependencySet.addDependency(DependencySet.java:103)
        at com.google.devtools.build.lib.util.DependencySet.process(DependencySet.java:154)
        at com.google.devtools.build.lib.util.DependencySet.read(DependencySet.java:121)
        at com.google.devtools.build.lib.rules.cpp.CppCompileAction.processDepset(CppCompileAction.java:1295)
        at com.google.devtools.build.lib.rules.cpp.CppCompileAction.discoverInputsFromDotdFiles(CppCompileAction.java:1267)
        at com.google.devtools.build.lib.rules.cpp.CppCompileAction.execute(CppCompileAction.java:1206)
        at com.google.devtools.build.lib.skyframe.SkyframeActionExecutor$ActionRunner.executeAction(SkyframeActionExecutor.java:818)
        at com.google.devtools.build.lib.skyframe.SkyframeActionExecutor$ActionRunner.call(SkyframeActionExecutor.java:792)
        at com.google.devtools.build.lib.skyframe.SkyframeActionExecutor$ActionRunner.call(SkyframeActionExecutor.java:726)
        at java.base/java.util.concurrent.FutureTask.run(Unknown Source)
        at com.google.devtools.build.lib.skyframe.SkyframeActionExecutor.executeAction(SkyframeActionExecutor.java:488)
        at com.google.devtools.build.lib.skyframe.ActionExecutionFunction.checkCacheAndExecuteIfNeeded(ActionExecutionFunction.java:557)
        at com.google.devtools.build.lib.skyframe.ActionExecutionFunction.compute(ActionExecutionFunction.java:217)
        at com.google.devtools.build.skyframe.AbstractParallelEvaluator$Evaluate.run(AbstractParallelEvaluator.java:422)
        ... 4 more

INFO: Elapsed time: 3.036s, Critical Path: 0.19s
INFO: 0 processes.
FAILED: Build did NOT complete successfully
Internal error thrown during build. Printing stack trace: java.lang.RuntimeException: Unrecoverable error while evaluating node 'ActionLookupData{actionLookupKey=//ryu:ryu BuildConfigurationValue.Key[bbdbc1207e00f02b4f284509a817e9e7] false, actionIndex=2}' (requested by nodes 'File:[[<execution_root>]bazel-out/x64_windows-fastbuild/bin]ryu/_objs/ryu/d2s.o')
        at com.google.devtools.build.skyframe.AbstractParallelEvaluator$Evaluate.run(AbstractParallelEvaluator.java:499)
        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: "bazel.windows_unix_root" JVM flag is not set. Use the --host_jvm_args flag. For example: "--host_jvm_args=-Dbazel.windows_unix_root=c:/tools/msys64".
        at com.google.devtools.build.lib.util.DependencySet$WindowsPath.getUnixRoot(DependencySet.java:282)
        at com.google.devtools.build.lib.util.DependencySet$WindowsPath.translateWindowsPath(DependencySet.java:266)
        at com.google.devtools.build.lib.util.DependencySet$WindowsPath.access$000(DependencySet.java:251)
        at com.google.devtools.build.lib.util.DependencySet.translatePath(DependencySet.java:112)
        at com.google.devtools.build.lib.util.DependencySet.addDependency(DependencySet.java:103)
        at com.google.devtools.build.lib.util.DependencySet.process(DependencySet.java:154)
        at com.google.devtools.build.lib.util.DependencySet.read(DependencySet.java:121)
        at com.google.devtools.build.lib.rules.cpp.CppCompileAction.processDepset(CppCompileAction.java:1295)
        at com.google.devtools.build.lib.rules.cpp.CppCompileAction.discoverInputsFromDotdFiles(CppCompileAction.java:1267)
        at com.google.devtools.build.lib.rules.cpp.CppCompileAction.execute(CppCompileAction.java:1206)
        at com.google.devtools.build.lib.skyframe.SkyframeActionExecutor$ActionRunner.executeAction(SkyframeActionExecutor.java:818)
        at com.google.devtools.build.lib.skyframe.SkyframeActionExecutor$ActionRunner.call(SkyframeActionExecutor.java:792)
        at com.google.devtools.build.lib.skyframe.SkyframeActionExecutor$ActionRunner.call(SkyframeActionExecutor.java:726)
        at java.base/java.util.concurrent.FutureTask.run(Unknown Source)
        at com.google.devtools.build.lib.skyframe.SkyframeActionExecutor.executeAction(SkyframeActionExecutor.java:488)
        at com.google.devtools.build.lib.skyframe.ActionExecutionFunction.checkCacheAndExecuteIfNeeded(ActionExecutionFunction.java:557)
        at com.google.devtools.build.lib.skyframe.ActionExecutionFunction.compute(ActionExecutionFunction.java:217)
        at com.google.devtools.build.skyframe.AbstractParallelEvaluator$Evaluate.run(AbstractParallelEvaluator.java:422)
        ... 4 more
java.lang.RuntimeException: Unrecoverable error while evaluating node 'ActionLookupData{actionLookupKey=//ryu:ryu BuildConfigurationValue.Key[bbdbc1207e00f02b4f284509a817e9e7] false, actionIndex=2}' (requested by nodes 'File:[[<execution_root>]bazel-out/x64_windows-fastbuild/bin]ryu/_objs/ryu/d2s.o')
        at com.google.devtools.build.skyframe.AbstractParallelEvaluator$Evaluate.run(AbstractParallelEvaluator.java:499)
        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: "bazel.windows_unix_root" JVM flag is not set. Use the --host_jvm_args flag. For example: "--host_jvm_args=-Dbazel.windows_unix_root=c:/tools/msys64".
        at com.google.devtools.build.lib.util.DependencySet$WindowsPath.getUnixRoot(DependencySet.java:282)
        at com.google.devtools.build.lib.util.DependencySet$WindowsPath.translateWindowsPath(DependencySet.java:266)
        at com.google.devtools.build.lib.util.DependencySet$WindowsPath.access$000(DependencySet.java:251)
        at com.google.devtools.build.lib.util.DependencySet.translatePath(DependencySet.java:112)
        at com.google.devtools.build.lib.util.DependencySet.addDependency(DependencySet.java:103)
        at com.google.devtools.build.lib.util.DependencySet.process(DependencySet.java:154)
        at com.google.devtools.build.lib.util.DependencySet.read(DependencySet.java:121)
        at com.google.devtools.build.lib.rules.cpp.CppCompileAction.processDepset(CppCompileAction.java:1295)
        at com.google.devtools.build.lib.rules.cpp.CppCompileAction.discoverInputsFromDotdFiles(CppCompileAction.java:1267)
        at com.google.devtools.build.lib.rules.cpp.CppCompileAction.execute(CppCompileAction.java:1206)
        at com.google.devtools.build.lib.skyframe.SkyframeActionExecutor$ActionRunner.executeAction(SkyframeActionExecutor.java:818)
        at com.google.devtools.build.lib.skyframe.SkyframeActionExecutor$ActionRunner.call(SkyframeActionExecutor.java:792)
        at com.google.devtools.build.lib.skyframe.SkyframeActionExecutor$ActionRunner.call(SkyframeActionExecutor.java:726)
        at java.base/java.util.concurrent.FutureTask.run(Unknown Source)
        at com.google.devtools.build.lib.skyframe.SkyframeActionExecutor.executeAction(SkyframeActionExecutor.java:488)
        at com.google.devtools.build.lib.skyframe.ActionExecutionFunction.checkCacheAndExecuteIfNeeded(ActionExecutionFunction.java:557)
        at com.google.devtools.build.lib.skyframe.ActionExecutionFunction.compute(ActionExecutionFunction.java:217)
        at com.google.devtools.build.skyframe.AbstractParallelEvaluator$Evaluate.run(AbstractParallelEvaluator.java:422)
        ... 4 more
java.lang.RuntimeException: Unrecoverable error while evaluating node 'ActionLookupData{actionLookupKey=//ryu:ryu BuildConfigurationValue.Key[bbdbc1207e00f02b4f284509a817e9e7] false, actionIndex=2}' (requested by nodes 'File:[[<execution_root>]bazel-out/x64_windows-fastbuild/bin]ryu/_objs/ryu/d2s.o')
        at com.google.devtools.build.skyframe.AbstractParallelEvaluator$Evaluate.run(AbstractParallelEvaluator.java:499)
        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: "bazel.windows_unix_root" JVM flag is not set. Use the --host_jvm_args flag. For example: "--host_jvm_args=-Dbazel.windows_unix_root=c:/tools/msys64".
        at com.google.devtools.build.lib.util.DependencySet$WindowsPath.getUnixRoot(DependencySet.java:282)
        at com.google.devtools.build.lib.util.DependencySet$WindowsPath.translateWindowsPath(DependencySet.java:266)
        at com.google.devtools.build.lib.util.DependencySet$WindowsPath.access$000(DependencySet.java:251)
        at com.google.devtools.build.lib.util.DependencySet.translatePath(DependencySet.java:112)
        at com.google.devtools.build.lib.util.DependencySet.addDependency(DependencySet.java:103)
        at com.google.devtools.build.lib.util.DependencySet.process(DependencySet.java:154)
        at com.google.devtools.build.lib.util.DependencySet.read(DependencySet.java:121)
        at com.google.devtools.build.lib.rules.cpp.CppCompileAction.processDepset(CppCompileAction.java:1295)
        at com.google.devtools.build.lib.rules.cpp.CppCompileAction.discoverInputsFromDotdFiles(CppCompileAction.java:1267)
        at com.google.devtools.build.lib.rules.cpp.CppCompileAction.execute(CppCompileAction.java:1206)
        at com.google.devtools.build.lib.skyframe.SkyframeActionExecutor$ActionRunner.executeAction(SkyframeActionExecutor.java:818)
        at com.google.devtools.build.lib.skyframe.SkyframeActionExecutor$ActionRunner.call(SkyframeActionExecutor.java:792)
        at com.google.devtools.build.lib.skyframe.SkyframeActionExecutor$ActionRunner.call(SkyframeActionExecutor.java:726)
        at java.base/java.util.concurrent.FutureTask.run(Unknown Source)
        at com.google.devtools.build.lib.skyframe.SkyframeActionExecutor.executeAction(SkyframeActionExecutor.java:488)
        at com.google.devtools.build.lib.skyframe.ActionExecutionFunction.checkCacheAndExecuteIfNeeded(ActionExecutionFunction.java:557)
        at com.google.devtools.build.lib.skyframe.ActionExecutionFunction.compute(ActionExecutionFunction.java:217)
        at com.google.devtools.build.skyframe.AbstractParallelEvaluator$Evaluate.run(AbstractParallelEvaluator.java:422)
FAILED: Build did NOT complete successfully
[bazel USER src/main/cpp/blaze.cc:1972]
Server terminated abruptly (error code: 14, error message: '', log file: 'c:\users\ulf adams\_bazel_ulf adams\36okgjor/server/jvm.out')

[bazel INFO src/main/cpp/blaze.cc:1491] Looking for a custom exit-code.
[bazel INFO src/main/cpp/blaze.cc:1496] Unable to read the custom exit-code file. Exiting with an INTERNAL_ERROR.

@ulfjack
Copy link
Contributor Author

ulfjack commented Jan 24, 2019

It works when I run it with the correct directory:
bazel --host_jvm_args=-Dbazel.windows_unix_root=c:/msys64 test --compiler=msys-gcc //ryu/tests:d2s_test

It's funny that the client detects the msys location correctly, but then still doesn't work.

@ulfjack
Copy link
Contributor Author

ulfjack commented Jan 24, 2019

It seems to work if I set BAZEL_SH:

set BAZEL_SH=C:/msys64/usr/bin/bash.exe
bazel test --compiler=msys-gcc //ryu/tests:d2s_test

@laszlocsomor
Copy link
Contributor

Thanks, I could repro with Bazel 0.22 by unsetting all envvars except for JAVA_HOME, SYSTEMROOT, and SYSTEMDRIVE and building after a bazel clean --expunge.

@laszlocsomor
Copy link
Contributor

laszlocsomor commented Jan 29, 2019

Culprit: the client detects Bash later than it creates the --windows_unix_root startup flag, which is a host JVM flag created in the StartupOptions ctor.

laszlocsomor added a commit to laszlocsomor/bazel that referenced this issue Jan 29, 2019
Detect Bash's path early enough to compute the
--windows_unix_root host JVM flag's value.

Now Bazel forwards Bash's location to the Bazel
server even if BAZEL_SH is undefined, and no
longer crashes when --compiler=msys-gcc but
BAZEL_SH is undefined.

Fixes bazelbuild#6651
laszlocsomor added a commit to laszlocsomor/bazel that referenced this issue Jan 29, 2019
Detect Bash's path early enough to compute the
--windows_unix_root host JVM flag's value.

Now Bazel forwards Bash's location to the Bazel
server even if BAZEL_SH is undefined, and no
longer crashes when --compiler=msys-gcc but
BAZEL_SH is undefined.

Fixes bazelbuild#6651
laszlocsomor added a commit to laszlocsomor/bazel that referenced this issue Jan 31, 2019
Detect Bash's path early enough to compute the
--windows_unix_root host JVM flag's value.

Now Bazel forwards Bash's location to the Bazel
server even if BAZEL_SH is undefined, and no
longer crashes when --compiler=msys-gcc but
BAZEL_SH is undefined.

Fixes bazelbuild#6651
@laszlocsomor
Copy link
Contributor

@sallybelly : what is your Bazel version? How did you run it?

@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 P4 This is either out of scope or we don't have bandwidth to review a PR. (No assignee) platform: windows team-OSS Issues for the Bazel OSS team: installation, release processBazel packaging, website type: bug
Projects
None yet
Development

No branches or pull requests

5 participants
@philwo @irengrig @ulfjack @laszlocsomor and others