jmhodges / bazel_gomock

Code to create Go mocks for bazel targets using mockgen
MIT License
58 stars 30 forks source link

Fails with rules_go 0.18.3 (go 1.12) #14

Closed Globegitter closed 5 years ago

Globegitter commented 5 years ago

I am seeing:

(14:16:19) ERROR: /home/markus/Projects/github.com/ecosia/core/heimdall/client-go/BUILD.bazel:17:1: error executing shell command: '/bin/bash -c 
           source <($PWD/external/go_sdk/bin/go env) &&
           export PATH=$GOROOT/bin:$PWD/external/go_sdk/bin:$PATH &&
           export GOPATH=$(pwd)/bazel-out/k8-fastbuild/bin...' failed (Exit 1) bash failed: error executing command 
  (cd /home/markus/.cache/bazel/_bazel_markus/c83dd5dc66625baf386a59b750f50a10/sandbox/linux-sandbox/1/execroot/__main__ && \
  exec env - \
  /bin/bash -c '
           source <($PWD/external/go_sdk/bin/go env) &&
           export PATH=$GOROOT/bin:$PWD/external/go_sdk/bin:$PATH &&
           export GOPATH=$(pwd)/bazel-out/k8-fastbuild/bin/heimdall/client-go/mock_client_gomock_gopath &&
           $(pwd)/bazel-out/host/bin/external/com_github_golang_mock/mockgen/linux_amd64_stripped/mockgen -package client -destination $(pwd)/bazel-out/k8-fastbuild/bin/heimdall/client-go/mock_client_test.go github.com/ecosia/core/ext/proto/heimdall HeimdallClient
        ')
Execution platform: @bazel_tools//platforms:host_platform

Use --sandbox_debug to see verbose messages from the sandbox: bash failed: error executing command 
  (cd /home/markus/.cache/bazel/_bazel_markus/c83dd5dc66625baf386a59b750f50a10/sandbox/linux-sandbox/1/execroot/__main__ && \
  exec env - \
  /bin/bash -c '
           source <($PWD/external/go_sdk/bin/go env) &&
           export PATH=$GOROOT/bin:$PWD/external/go_sdk/bin:$PATH &&
           export GOPATH=$(pwd)/bazel-out/k8-fastbuild/bin/heimdall/client-go/mock_client_gomock_gopath &&
           $(pwd)/bazel-out/host/bin/external/com_github_golang_mock/mockgen/linux_amd64_stripped/mockgen -package client -destination $(pwd)/bazel-out/k8-fastbuild/bin/heimdall/client-go/mock_client_test.go github.com/ecosia/core/ext/proto/heimdall HeimdallClient
        ')
Execution platform: @bazel_tools//platforms:host_platform

Use --sandbox_debug to see verbose messages from the sandbox
build cache is required, but could not be located: GOCACHE is not defined and neither $XDG_CACHE_HOME nor $HOME are defined
build cache is required, but could not be located: GOCACHE is not defined and neither $XDG_CACHE_HOME nor $HOME are defined
build cache is required, but could not be located: GOCACHE is not defined and neither $XDG_CACHE_HOME nor $HOME are defined

I assume the error is probably similarly to https://github.com/bazelbuild/bazel-gazelle/issues/461 - I will take a look at fixing this.

jmhodges commented 5 years ago

This got fixed in #15 but we forgot to drop a "Fixes #15" in the commit.