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

Windows issue: missing $GOPATH when pure="on" is set #1987

Closed
christian-roggia opened this issue Mar 12, 2019 · 11 comments
Closed

Windows issue: missing $GOPATH when pure="on" is set #1987

christian-roggia opened this issue Mar 12, 2019 · 11 comments
Labels
bug cgo windows Affects Windows hosts or targets

Comments

@christian-roggia
Copy link

christian-roggia commented Mar 12, 2019

This error pops up whenever we try to build a Golang application on Windows with rules_go 0.18.0 and rules_go 0.17.1.

Git installation path: C:\Users\Bazeluser\AppData\Local\Programs\Git\bin
MSYS installation path: C:\msys64
Visual Studio: C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.16.27023\bin\Hostx64\x64

The application is being built with pure = "on" on a Windows 10 machine.

The error being shown from the logs is missing $GOPATH.

(10:37:44) ERROR: C:/users/bazeluser/_bazel_bazeluser/uc25hd4l/external/io_bazel_rules_go/BUILD.bazel:8:1: GoStdlib external/io_bazel_rules_go/windows_amd64_pure_stripped/stdlib%/pkg failed (Exit 1): builder.exe failed: error executing command
  cd C:/users/bazeluser/_bazel_bazeluser/uc25hd4l/execroot/__main__
  SET CC=C:/Program Files (x86)/Microsoft Visual Studio/2017/Community/VC/Tools/MSVC/14.16.27023/bin/HostX64/x64/cl.exe
    SET CGO_CFLAGS=/nologo /DCOMPILER_MSVC /DNOMINMAX /D_WIN32_WINNT=0x0601 /D_CRT_SECURE_NO_DEPRECATE /D_CRT_SECURE_NO_WARNINGS /bigobj /Zm500 /EHsc /wd4351 /wd4291 /wd4250 /wd4996 /showIncludes /MD /Od /Z7 /wd4117 -D__DATE__="redacted" -D__TIMESTAMP__="redacted" -D__TIME__="redacted"
    SET CGO_ENABLED=0
    SET CGO_LDFLAGS=/nologo /SUBSYSTEM:CONSOLE /MACHINE:X64 /DEFAULTLIB:msvcrt.lib /DEBUG:FASTLINK /INCREMENTAL:NO
    SET GOARCH=amd64
    SET GOOS=windows
    SET GOROOT=external/go_sdk
    SET GOROOT_FINAL=GOROOT
    SET INCLUDE=C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.16.27023\ATLMFC\include;C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.16.27023\include;C:\Program Files (x86)\Windows Kits\10\include\10.0.17763.0\ucrt;C:\Program Files (x86)\Windows Kits\10\include\10.0.17763.0\shared;C:\Program Files (x86)\Windows Kits\10\include\10.0.17763.0\um;C:\Program Files (x86)\Windows Kits\10\include\10.0.17763.0\winrt;C:\Program Files (x86)\Windows Kits\10\include\10.0.17763.0\cppwinrt
    SET LIB=C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.16.27023\ATLMFC\lib\x64;C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.16.27023\lib\x64;C:\Program Files (x86)\Windows Kits\10\lib\10.0.17763.0\ucrt\x64;C:\Program Files (x86)\Windows Kits\10\lib\10.0.17763.0\um\x64;
    SET PATH=;C:/Program Files (x86)/Microsoft Visual Studio/2017/Community/VC/Tools/MSVC/14.16.27023/bin/HostX64/x64;C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\;C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\CommonExtensions\Microsoft\CMake\CMake\bin;C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\CommonExtensions\Microsoft\CMake\Ninja;C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\CommonExtensions\Microsoft\TeamFoundation\Team Explorer;C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\CommonExtensions\Microsoft\TestWindow;C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\VC\VCPackages;C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\Tools\;C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\15.0\bin\Roslyn;C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Team Tools\Performance Tools;C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Team Tools\Performance Tools\x64;C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.16.27023\bin\HostX64\x64;C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\\MSBuild\15.0\bin;C:\Program Files (x86)\Microsoft Visual Studio\Shared\Common\VSPerfCollectionTools\;C:\Program Files (x86)\Microsoft Visual Studio\Shared\Common\VSPerfCollectionTools\\x64;C:\Program Files (x86)\Windows Kits\10\bin\10.0.17763.0\x64;C:\Program Files (x86)\Windows Kits\10\bin\x64;C:\Windows\Microsoft.NET\Framework64\v4.0.30319;C:\Windows\system32
    SET TEMP=C:\Users\BAZELUSER\AppData\Local\Temp
    SET TMP=C:\Users\BAZELUSER\AppData\Local\Temp
  bazel-out/host/bin/external/go_sdk/builder.exe stdlib -sdk external/go_sdk -installsuffix windows_amd64 -out bazel-out/x64_windows-fastbuild/bin/external/io_bazel_rules_go/windows_amd64_pure_stripped/stdlib%
Execution platform: @bazel_tools//platforms:host_platform
missing $GOPATH
stdlib: error running subcommand: exit status 1
Target //cmd/address-service:address_service failed to build
(10:37:44) ERROR: C:/users/bazeluser/git/address-service/cmd/address-service/BUILD.bazel:29:1 GoStdlib external/io_bazel_rules_go/windows_amd64_pure_stripped/stdlib%/pkg failed (Exit 1): builder.exe failed: error executing command
  cd C:/users/bazeluser/_bazel_bazeluser/uc25hd4l/execroot/__main__
  SET CC=C:/Program Files (x86)/Microsoft Visual Studio/2017/Community/VC/Tools/MSVC/14.16.27023/bin/HostX64/x64/cl.exe
    SET CGO_CFLAGS=/nologo /DCOMPILER_MSVC /DNOMINMAX /D_WIN32_WINNT=0x0601 /D_CRT_SECURE_NO_DEPRECATE /D_CRT_SECURE_NO_WARNINGS /bigobj /Zm500 /EHsc /wd4351 /wd4291 /wd4250 /wd4996 /showIncludes /MD /Od /Z7 /wd4117 -D__DATE__="redacted" -D__TIMESTAMP__="redacted" -D__TIME__="redacted"
    SET CGO_ENABLED=0
    SET CGO_LDFLAGS=/nologo /SUBSYSTEM:CONSOLE /MACHINE:X64 /DEFAULTLIB:msvcrt.lib /DEBUG:FASTLINK /INCREMENTAL:NO
    SET GOARCH=amd64
    SET GOOS=windows
    SET GOROOT=external/go_sdk
    SET GOROOT_FINAL=GOROOT
    SET INCLUDE=C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.16.27023\ATLMFC\include;C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.16.27023\include;C:\Program Files (x86)\Windows Kits\10\include\10.0.17763.0\ucrt;C:\Program Files (x86)\Windows Kits\10\include\10.0.17763.0\shared;C:\Program Files (x86)\Windows Kits\10\include\10.0.17763.0\um;C:\Program Files (x86)\Windows Kits\10\include\10.0.17763.0\winrt;C:\Program Files (x86)\Windows Kits\10\include\10.0.17763.0\cppwinrt
    SET LIB=C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.16.27023\ATLMFC\lib\x64;C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.16.27023\lib\x64;C:\Program Files (x86)\Windows Kits\10\lib\10.0.17763.0\ucrt\x64;C:\Program Files (x86)\Windows Kits\10\lib\10.0.17763.0\um\x64;
    SET PATH=;C:/Program Files (x86)/Microsoft Visual Studio/2017/Community/VC/Tools/MSVC/14.16.27023/bin/HostX64/x64;C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\;C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\CommonExtensions\Microsoft\CMake\CMake\bin;C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\CommonExtensions\Microsoft\CMake\Ninja;C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\CommonExtensions\Microsoft\TeamFoundation\Team Explorer;C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\CommonExtensions\Microsoft\TestWindow;C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\VC\VCPackages;C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\Tools\;C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\15.0\bin\Roslyn;C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Team Tools\Performance Tools;C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Team Tools\Performance Tools\x64;C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.16.27023\bin\HostX64\x64;C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\\MSBuild\15.0\bin;C:\Program Files (x86)\Microsoft Visual Studio\Shared\Common\VSPerfCollectionTools\;C:\Program Files (x86)\Microsoft Visual Studio\Shared\Common\VSPerfCollectionTools\\x64;C:\Program Files (x86)\Windows Kits\10\bin\10.0.17763.0\x64;C:\Program Files (x86)\Windows Kits\10\bin\x64;C:\Windows\Microsoft.NET\Framework64\v4.0.30319;C:\Windows\system32
    SET TEMP=C:\Users\BAZELUSER\AppData\Local\Temp
    SET TMP=C:\Users\BAZELUSER\AppData\Local\Temp
  bazel-out/host/bin/external/go_sdk/builder.exe stdlib -sdk external/go_sdk -installsuffix windows_amd64 -out bazel-out/x64_windows-fastbuild/bin/external/io_bazel_rules_go/windows_amd64_pure_stripped/stdlib%
Execution platform: @bazel_tools//platforms:host_platform
(10:37:44) INFO: Elapsed time: 273,021s, Critical Path: 87,25s
(10:37:44) INFO: 198 processes: 198 local.
(10:37:44) FAILED: Build did NOT complete successfully
@christian-roggia
Copy link
Author

By disabling pure = "on" the following error is shown: exec: "C:/Program": file does not exist.

(14:15:05) ERROR: C:/users/bazeluser/_bazel_bazeluser/uc25hd4l/external/org_golang_x_sys/unix/BUILD.bazel:3:1: CGoCodeGen @org_golang_x_sys//unix:go_default_library%windows_amd64%cgo_codegen failed (Exit 1): cgo.exe failed: error executing command
  cd C:/users/bazeluser/_bazel_bazeluser/uc25hd4l/execroot/__main__
  SET CC=C:/Program Files (x86)/Microsoft Visual Studio/2017/Community/VC/Tools/MSVC/14.16.27023/bin/HostX64/x64/cl.exe
    SET CGO_ENABLED=1
    SET CGO_LDFLAGS=/nologo /SUBSYSTEM:CONSOLE /MACHINE:X64 /DEFAULTLIB:msvcrt.lib /DEBUG:FASTLINK /INCREMENTAL:NO
    SET GOARCH=amd64
    SET GOOS=windows
    SET GOROOT=external/go_sdk
    SET GOROOT_FINAL=GOROOT
    SET INCLUDE=C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.16.27023\ATLMFC\include;C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.16.27023\include;C:\Program Files (x86)\Windows Kits\10\include\10.0.17763.0\ucrt;C:\Program Files (x86)\Windows Kits\10\include\10.0.17763.0\shared;C:\Program Files (x86)\Windows Kits\10\include\10.0.17763.0\um;C:\Program Files (x86)\Windows Kits\10\include\10.0.17763.0\winrt;C:\Program Files (x86)\Windows Kits\10\include\10.0.17763.0\cppwinrt
    SET LIB=C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.16.27023\ATLMFC\lib\x64;C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.16.27023\lib\x64;C:\Program Files (x86)\Windows Kits\10\lib\10.0.17763.0\ucrt\x64;C:\Program Files (x86)\Windows Kits\10\lib\10.0.17763.0\um\x64;
    SET PATH=;C:/Program Files (x86)/Microsoft Visual Studio/2017/Community/VC/Tools/MSVC/14.16.27023/bin/HostX64/x64;C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\;C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\CommonExtensions\Microsoft\CMake\CMake\bin;C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\CommonExtensions\Microsoft\CMake\Ninja;C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\CommonExtensions\Microsoft\TeamFoundation\Team Explorer;C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\CommonExtensions\Microsoft\TestWindow;C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\VC\VCPackages;C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\Tools\;C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\15.0\bin\Roslyn;C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Team Tools\Performance Tools;C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Team Tools\Performance Tools\x64;C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.16.27023\bin\HostX64\x64;C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\\MSBuild\15.0\bin;C:\Program Files (x86)\Microsoft Visual Studio\Shared\Common\VSPerfCollectionTools\;C:\Program Files (x86)\Microsoft Visual Studio\Shared\Common\VSPerfCollectionTools\\x64;C:\Program Files (x86)\Windows Kits\10\bin\10.0.17763.0\x64;C:\Program Files (x86)\Windows Kits\10\bin\x64;C:\Windows\Microsoft.NET\Framework64\v4.0.30319;C:\Windows\system32
    SET TEMP=C:\Users\BAZELUSER\AppData\Local\Temp
    SET TMP=C:\Users\BAZELUSER\AppData\Local\Temp
  bazel-out/host/bin/external/io_bazel_rules_go/go/tools/builders/windows_amd64_stripped/cgo.exe -param=bazel-out/x64_windows-fastbuild/bin/external/org_golang_x_sys/unix/windows_amd64_stripped/go_default_library%windows_amd64%cgo_codegen%/_cgo_export.h-0.params -- -objdir bazel-out/x64_windows-fastbuild/bin/external/org_golang_x_sys/unix/windows_amd64_stripped/go_default_library%windows_amd64%cgo_codegen% -- -I external/org_golang_x_sys/unix /nologo /DCOMPILER_MSVC /DNOMINMAX /D_WIN32_WINNT=0x0601 /D_CRT_SECURE_NO_DEPRECATE /D_CRT_SECURE_NO_WARNINGS /bigobj /Zm500 /EHsc /wd4351 /wd4291 /wd4250 /wd4996 /showIncludes /MD /Od /Z7 /wd4117 -D__DATE__="redacted" -D__TIMESTAMP__="redacted" -D__TIME__="redacted"
Execution platform: @bazel_tools//platforms:host_platform
exec: "C:/Program": file does not exist
CgoCodegen: error running subcommand: exit status 2
Target //cmd/my-service:my_service failed to build
(14:15:06) INFO: Elapsed time: 171,007s, Critical Path: 38,42s
(14:15:06) INFO: 175 processes: 175 local.
(14:15:06) FAILED: Build did NOT complete successfully

@jayconrod
Copy link
Contributor

Are you using Gazelle (in WORKSPACE)? If so, what version? Older versions of Gazelle don't support Go 1.12 and error out with a message like this.

For the second series of errors, MSVC is not compatible with Go. There are some draft setup instructions for msys and mingw in windows.rst if that's useful.

@christian-roggia
Copy link
Author

Are you using Gazelle (in WORKSPACE)? If so, what version?

We are currently using the latest version (0.17.0) but we tried with the previous version as well (0.16.0) the output is the same.

For the second series of errors, MSVC is not compatible with Go.

This is the first installation attempt on a Windows machine, I definitely missed this information during the installation of Bazel. Thank you for the link.

I am pretty sure that the first issue is also related to MSVC, therefore I will close this issue.

@jayconrod
Copy link
Contributor

To clarify about MSVC: Bazel is compatible with MSVC (and will use it by default for cc_library / cc_binary if it's present). Go is not compatible with MSVC, whether used through Bazel or through the Go SDK.

This is due to how cgo works. go tool cgo determines the types of definitions in C code by attempting to compile specially crafted C files, then parsing expected types out of error messages. It only recognizes error messages from GCC and Clang. If that sounds crazy, well, I wont try and convince anyone otherwise :) There very likely some issues with linking and command-line flags, but the cgo error message thing is the first thing we run into.

@christian-roggia
Copy link
Author

I am reopening this issue because after a successful configuration of GCC it is now correctly compiling without the pure="on" settings, but it's failing with this option enabled.

The output error is the same as before:

(14:16:02) ERROR: C:/users/bazeluser/_bazel_bazeluser/ksjpgs5k/external/io_bazel_rules_go/BUILD.bazel:8:1: GoStdlib external/io_bazel_rules_go/windows_amd64_pure_stripped/stdlib%/pkg failed (Exit 1): builder.exe failed: error executing command  cd C:/users/bazeluser/_bazel_bazeluser/ksjpgs5k/execroot/__main__  SET CC=c:/msys64/mingw64/bin/gcc    SET CGO_CFLAGS=    SET CGO_ENABLED=0    SET CGO_LDFLAGS=-lstdc++    SET GOARCH=amd64
    SET GOOS=windows
    SET GOROOT=external/go_sdk
    SET GOROOT_FINAL=GOROOT
    SET PATH=c:/msys64/mingw64/bin
  bazel-out/host/bin/external/go_sdk/builder.exe stdlib -sdk external/go_sdk -installsuffix windows_amd64 -out bazel-out/x64_windows-fastbuild/bin/external/io_bazel_rules_go/windows_amd64_pure_stripped/stdlib%Execution platform: @bazel_tools//platforms:host_platform
missing $GOPATH
stdlib: error running subcommand: exit status 1
(14:16:02) INFO: Elapsed time: 704,839s, Critical Path: 70,45s
(14:16:02) INFO: 612 processes: 612 local.
(14:16:02) FAILED: Build did NOT complete successfully

@christian-roggia christian-roggia changed the title Windows issue (0.18.0 and 0.17.1): missing $GOPATH Windows issue: missing $GOPATH when pure="on" is set Mar 14, 2019
@jayconrod jayconrod added bug cgo windows Affects Windows hosts or targets labels Mar 14, 2019
@GauntletWizard
Copy link

This doesn't appear to be purely a Windows issue; I'm getting a similar error on a linux host:

SUBCOMMAND: # @io_bazel_rules_go//:stdlib [action 'GoStdlib external/io_bazel_rules_go/linux_amd64_pure_stripped/stdlib%/pkg']
(cd /root/.cache/bazel/_bazel_root/59780dcb742d55c0fe9af6a012f9b672/execroot/__main__ && \
  exec env - \
    CC=/usr/bin/gcc \
    CGO_CFLAGS='-U_FORTIFY_SOURCE -fstack-protector -Wunused-but-set-parameter -Wno-free-nonheap-object -fno-omit-frame-pointer -fno-canonical-system-headers -Wno-builtin-macro-redefined -D__DATE__="redacted" -D__TIMESTAMP__="redacted" -D__TIME__="redacted"' \
    CGO_ENABLED=0 \
    CGO_LDFLAGS='-fuse-ld=gold -Wl,-no-as-needed -Wl,-z,relro,-z,now -B/usr/bin -pass-exit-codes -lstdc++ -lm' \
    GOARCH=amd64 \
    GOOS=linux \
    GOROOT=external/go_sdk \
    GOROOT_FINAL=GOROOT \
    PATH=/usr/bin:/bin \
  bazel-out/host/bin/external/go_sdk/builder stdlib -sdk external/go_sdk -installsuffix linux_amd64 -out bazel-out/k8-fastbuild/bin/external/io_bazel_rules_go/linux_amd64_pure_stripped/stdlib%)
ERROR: /root/.cache/bazel/_bazel_root/59780dcb742d55c0fe9af6a012f9b672/external/io_bazel_rules_go/BUILD.bazel:8:1: GoStdlib external/io_bazel_rules_go/linux_amd64_pure_stripped/stdlib%/pkg failed (Exit 1)
missing $GOPATH
stdlib: error running subcommand: exit status 1

Switching to an earlier go sdk with go_register_toolchains(go_version="1.10.8") allows building. It appears that the go_sdk/builder compile command changed between 1.10 and 1.11 to require setting a GOPATH.

@jayconrod
Copy link
Contributor

@GauntletWizard I can't reproduce this in any configuration. Could you give me more information? Ideally fill out the issue template. It looks like you're running inside a Docker container, but I have no idea what's in your environment or what version you're using. If you could give me enough info to reproduce this on a "hello world" binary in a clean workspace, that would be very helpful.

Could you try rules_go at master and see if the issue has been fixed already?

Could you try setting GOPATH to a temporary directory explicitly in go_tool_binary, as GOROOT was set in #2008? My guess is that's what would need to be fixed, but I don't want to make changes in there without being able to verify the fix.

@GauntletWizard
Copy link

I've isolated my issue down to bazel build --spawn_strategy=standalone ... or bazel build --spawn_strategy=local ... - My docker image was setting these by default in .bazelrc . It was running Bazel 0.24.0 in a minimalist Ubuntu 16.04 container under OSX's docker for desktop VM.

I'm uncertain why 1.10 worked in this setup. After a successful build with sandboxed strategy, I no longer have the error, so it's not affecting the build targets themselves.

@jayconrod
Copy link
Contributor

@GauntletWizard Sorry, I can't reproduce this and can't make progress without more information. I'm going to close this, but feel free to reopen with a complete, minimal set of files and list of commands to run.

I tried running the ubuntu:16.04 docker image on macOS. I installed, Bazel, git, unzip, build-essential, and I built a "hello world" binary with pure = "on" using --spawn_strategy=standalone. Still works okay though.

@amkartashov
Copy link

@jayconrod
Copy link
Contributor

@gorilych Thanks for putting together that example. That was very helpful.

It looks like this was fixed by part of #2079. We need to explicitly set GO111MODULE=off. When we build the standard library, cmd/go sees the go.mod file in the main workspace and enables modules.

This seems to be a very narrow issue. It should not come up when using sandboxing or remote execution. I'm not sure how this image is constructed, but it doesn't look like Bazel is using sandboxing for this action.

In any case, the fix for this will be cherry-picked into the next release, which should be in a couple weeks.

jayconrod pushed a commit that referenced this issue Jul 8, 2019
This is a partial cherry-pick of #2090 for release branches only.

Fixes #1987
jayconrod pushed a commit that referenced this issue Jul 8, 2019
This is a partial cherry-pick of #2090 for release branches only.

Fixes #1987
jayconrod pushed a commit that referenced this issue Jul 8, 2019
This is a partial cherry-pick of #2090 for release branches only.

Fixes #1987
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug cgo windows Affects Windows hosts or targets
Projects
None yet
Development

No branches or pull requests

4 participants