【问题标题】:bazel: Using WSL's bash instead of MSYS64bazel:使用 WSL 的 bash 而不是 MSYS64
【发布时间】:2018-06-25 10:10:26
【问题描述】:

由于 MSYS64,我在 Windows 上使用 Bazel 时遇到问题:

ERROR: C:/users/ximo.hi/_bazel_ximo/4qw2ezwb/external/java_image_base/image/BUILD:6:1: error executing shell command: 'bazel-out/host/bin/external/gzip/gzip.exe -d < external/java_image_base/image/000.tar.gz > bazel-out/x64_windows-fastbuild/bin/external/java_image_base/image/000.tar.gz.nogz' failed (Exit 127): bash.exe failed: error executing command
  cd C:/users/ximo.hi/_bazel_ximo/4qw2ezwb/execroot/com_telefonica_baikal
C:/msys64/usr/bin/bash.exe -c bazel-out/host/bin/external/gzip/gzip.exe -d < external/java_image_base/image/000.tar.gz > bazel-out/x64_windows-fastbuild/bin/external/java_image_base/image/000.tar.gz.nogz
C:/users/ximo.hi/_bazel_ximo/4qw2ezwb/execroot/com_telefonica_baikal/bazel-out/host/bin/external/gzip/gzip: error while loading shared libraries: ?: cannot open shared object file: No such file or directory

我尝试过使用 WSL 的 bash 和 gzip 运行相同的命令,并且效果很好。有什么简单的方法可以告诉 Bazel 使用内置的 WSL bash 而不是 MSYS64?

【问题讨论】:

  • BAZEL_SH 环境变量应该允许您根据需要选择 bazel 使用的 shell/bash。但是看看@Biswapriyo 的评论,它可能真的不是你要找的机器人。
  • 不幸的是,将 BAZEL_SH 指向 WSL bash 不起作用:Auto-Configuration Error: Could not determine MSYS/Cygwin root from BAZEL_SH (c:/windows/system32/bash.exe)
  • @edrevo Bazel 正在工作。我已经对其进行了测试,Windows Insider build 17704。这是screenshot。您可以尝试在您的 Windows Spring Creator 更新中。

标签: bazel windows-subsystem-for-linux msys


【解决方案1】:

抱歉,Bazel 还不支持 WSL。见https://github.com/bazelbuild/bazel/issues/1608

如果有足够的兴趣,我们可以把这个 issue 的优先级抛掉。

【讨论】:

    猜你喜欢
    • 2020-09-18
    • 2020-11-18
    • 2023-01-17
    • 2017-11-10
    • 2018-03-18
    • 2021-02-22
    • 1970-01-01
    • 1970-01-01
    • 2019-03-19
    相关资源
    最近更新 更多