-
-
Notifications
You must be signed in to change notification settings - Fork 668
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
window: race condition when declare multiple go_library in the same directory #3144
Comments
Some findings from #3145: The issue is indeed happening exclusively to Window due to lack of sandboxing support. This is caused exclusively due to having multiple
According to https://github.com/bazelbuild/rules_go/blob/fee2095e0a8219c93206be0b5adecfce6f32eac0/go/private/rules/test.bzl#L454-L486, However, because we have multiple The current workaround is to mark these
Not sure what the correct fix for this situation would be 🤔 |
Is it necessary to delete the |
I tried commenting out the defer deletion and the file stayed, however each compilation kept on writing into the file which then create an invalid go file with multiple
Let me try this temp file approach
|
hmm it seems like using I will try this next
|
This seems to work
|
Turns out we can just define |
I figured for the case where |
What version of rules_go are you using?
Latest
What version of gazelle are you using?
Irrelevant
What version of Bazel are you using?
Latest
Does this issue reproduce with the latest releases of all the above?
yes
What operating system and processor architecture are you using?
rules_go Window CI
Any other potentially useful information about your toolchain?
Via our CI setup
What did you do?
Setup is described in #3138 (comment)
where we have something like this in the same BUILD file
What did you expect to see?
Window CI to successfully passed
What did you see instead?
Window CI reporting this error
Most likely caused by this block https://github.com/bazelbuild/rules_go/blob/a2677c2c0af38a851bf381e013c45a27642892ac/go/tools/builders/compilepkg.go#L187-L204
Here the
outpath
value of each go_library target is the samebazel-out\x64_windows-fastbuild\bin\go\analyzer\staticcheck
thus a compilation of one go_library was deleting the same_empty.go
file of another compilation. This is most likely caused by Window lack of sandboxing support for these action to run in parallel bazelbuild/bazel#5136The text was updated successfully, but these errors were encountered: