bazel-contrib / bazel-contrib/rules_go

Running tests with race condition enabled returns TreeArtifact error

Open
#2,879 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Go
Stars
1.5k
Forks
760
Avg merge
1d 11h
Merged PRs (30d)
12

Description

### What version of rules_go are you using?
```
http_archive(
name = "io_bazel_rules_go",
sha256 = "e0015762cdeb5a2a9c48f96fb079c6a98e001d44ec23ad4fa2ca27208c5be4fb",
urls = [
"https://mirror.bazel.build/github.com/bazelbuild/rules_go/releases/download/v0.24.14/rules_go-v0.24.14.tar.gz",
"https://github.com/bazelbuild/rules_go/releases/download/v0.24.14/rules_go-v0.24.14.tar.gz",
],
)
```

### What version of gazelle are you using?
```
http_archive(
name = "bazel_gazelle",
urls = [
"https://storage.googleapis.com/bazel-mirror/github.com/bazelbuild/bazel-gazelle/releases/download/v0.20.0/bazel-gazelle-v0.20.0.tar.gz",
"https://github.com/bazelbuild/bazel-gazelle/releases/download/v0.20.0/bazel-gazelle-v0.20.0.tar.gz",
],
sha256 = "d8c45ee70ec39a57e7a05e5027c32b1576cc7f16d9dd37135b0eddde45cf1b10",
)
```

### What version of Bazel are you using?
```
Build label: 4.0.0
Build target: bazel-out/k8-opt/bin/src/main/java/com/google/devtools/build/lib/bazel/BazelServer_deploy.jar
Build time: Thu Jan 21 07:33:24 2021 (1611214404)
Build timestamp: 1611214404
Build timestamp as int: 1611214404
```

### Does this issue reproduce with the latest releases of all the above?
I tried with `v0.27.0` of `rules_go` and same thing occurs.

### What operating system and processor architecture are you using?
```
Linux 1378dd253e33 5.10.25-linuxkit #1 SMP Tue Mar 23 09:27:39 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux
```

### Any other potentially useful information about your toolchain?
I am running Bazel inside a docker container. I don't know if this can be related to that error.

### What did you do?
Tried to run tests with race condition feature enabled:
```
bazel test --features=race //...
```

### What did you expect to see?
Tests should run with race condition enabled.

### What did you see instead?
Following error occurs if I enable race condition (with `--features=race`):
```
ERROR: /workspace/.bazel/external/io_bazel_rules_go/BUILD.bazel:43:7: TreeArtifact external/io_bazel_rules_go/stdlib_/pkg was not created
ERROR: /workspace/.bazel/external/io_bazel_rules_go/BUILD.bazel:43:7: TreeArtifact external/io_bazel_rules_go/stdlib_/src was not created
ERROR: /workspace/.bazel/external/io_bazel_rules_go/BUILD.bazel:43:7: GoStdlib external/io_bazel_rules_go/stdlib_/pkg failed: not all outputs were created or valid
```
If I disable, tests run successfully.

Contributor guide

Open the contributing guide

Research direction

Reproduce the failure with `bazel test --features=race //...` in the reported Docker/Linux setup, then inspect the external `io_bazel_rules_go/BUILD.bazel` target at line 43 and the Go standard-library outputs named in the error. Done means tests complete successfully with the race feature enabled, without the TreeArtifact or GoStdlib output errors.

Written by the indexing model from the issue text.

Assessment

Tech stack
docker, go
Domain
build-system, testing
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.