-
-
Notifications
You must be signed in to change notification settings - Fork 702
Only emit patch file if nogo has fixes #4269
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
Conversation
0761444
to
ab9d525
Compare
@sluongng Could you test this? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok it was hard to find the right regex, so let's document it somewhere. But this is working for me
--remote_download_regex='.*_nogo_patch.*'
oA semi related problem I found was that in some cases, the same nogo.patch would be generated twice:
?master ~/work/buildbuddy/buildbuddy> find -L bazel-out -name 'nogo.patch' | cat
bazel-out/platform_linux_x86_64-fastbuild/bin/enterprise/tools/rbesxs/rbesxs_nogo_patch/nogo.patch
bazel-out/platform_linux_x86_64-fastbuild/bin/enterprise/tools/rbesxs/rbesxs_lib_nogo_patch/nogo.patch
bazel-out/platform_linux_x86_64-fastbuild/bin/enterprise/server/remote_execution/snaploader/snaploader_nogo_patch/nogo.patch
bazel-out/platform_linux_x86_64-fastbuild/bin/enterprise/server/vmexec/vmexec_nogo_patch/nogo.patch
bazel-out/platform_linux_x86_64-fastbuild/bin/cli/remotebazel/remotebazel_nogo_patch/nogo.patch
bazel-out/platform_linux_x86_64-fastbuild/bin/cli/remotebazel/remotebazel_test.internal_nogo_patch/nogo.patch
bazel-out/platform_linux_x86_64-fastbuild-ST-d45aeea7532a/bin/enterprise/server/vmexec/vmexec_nogo_patch/nogo.patch
bazel-out/platform_linux_x86_64-fastbuild-ST-9e98d01b8f6c/bin/enterprise/server/remote_execution/snaploader/snaploader_nogo_patch/nogo.patch
?master ~/work/buildbuddy/buildbuddy> cat bazel-out/platform_linux_x86_64-fastbuild/bin/enterprise/tools/rbesxs/rbesxs_nogo_patch/nogo.patch
--- a/enterprise/tools/rbesxs/rbesxs.go
+++ b/enterprise/tools/rbesxs/rbesxs.go
@@ -126,7 +126,7 @@
if *iterations < 0 {
log.Fatal("--iterations cannot be < 0")
}
- if !(*environment == "dev" || *environment == "prod") {
+ if (*environment != "dev" && *environment != "prod") {
log.Fatal("--environment must be 'dev' or 'prod'")
}
if *target == "" {
?master ~/work/buildbuddy/buildbuddy> cat bazel-out/platform_linux_x86_64-fastbuild/bin/enterprise/tools/rbesxs/rbesxs_lib_nogo_patch/nogo.patch
--- a/enterprise/tools/rbesxs/rbesxs.go
+++ b/enterprise/tools/rbesxs/rbesxs.go
@@ -126,7 +126,7 @@
if *iterations < 0 {
log.Fatal("--iterations cannot be < 0")
}
- if !(*environment == "dev" || *environment == "prod") {
+ if (*environment != "dev" && *environment != "prod") {
log.Fatal("--environment must be 'dev' or 'prod'")
}
if *target == "" {
I think this happens if the go_library is also directly used for go_binary or go_test. In such case, one nogo action will be generated for each of the target
It seems like find -L bazel-out -name 'nogo.patch' -print0 |\
xargs -0 -I{} sh -c 'patch -p1 -N --reject-file /dev/null < {}' works nicely, though can be a bit annoying to remember. |
Does
We have two different compilation actions, the one for the library and the one for the internal test that embeds the library (i.e., recompiles its sources). It's probably not common for that to result in different nogo violations, but it's also not obvious that it can't. |
ab9d525
to
56d5732
Compare
bazelbuild/bazel#25976 will make this approach work better by avoiding the eager creation of directories. |
0115909
to
7139ae9
Compare
This makes it easier to download all relevant patches with `--remote_download_regex` without creating a bunch of empty patch files. # Conflicts: # go/private/actions/archive.bzl # go/private/actions/compilepkg.bzl
What type of PR is this?
Feature
What does this PR do? Why is it needed?
This makes it easier to download all relevant patches with
--remote_download_regex
without creating a bunch of empty patch files.Which issues(s) does this PR fix?
Other notes for review