-
-
Notifications
You must be signed in to change notification settings - Fork 670
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
Remove patching for WORKSPACE file #2355
Conversation
Bazel will always override the external repository's WORKSPACE file by `workspace_file`, `workspace_file_content` or an created file with "workspace(name =`<name in repo rule>`)"
This will fix bazelbuild/bazel#10681 for rules_go |
Thank you, Yun! To clarify, this means that the problematic part of the patch was simply ignored until now (Bazel would patch the WORKSPACE file as requested and then replace it with a completely new one), so you can just remove it. Bazel@HEAD contains a bugfix for this behavior, so that patches now get applied after replacing the WORKSPACE file - which means that if the patch was not valid, it will now fail. |
Seems fine. I think this was necessary at some point, but not anymore. What goes into the replacement WORKSPACE file? |
@jayconrod The default WORKSPACE (if neither
where {name} is the name attribute of the This is implemented here: https://github.com/bazelbuild/bazel/blob/master/tools/build_defs/repo/utils.bzl#L55 |
Hi, could we have a patch release with this commit included. See bazelbuild/rules_k8s#517 (comment) |
Bazel will always override the external repository's WORKSPACE file by `workspace_file`, `workspace_file_content` or an created file with "workspace(name =`<name in repo rule>`)"
Bazel will always override the external repository's WORKSPACE file by `workspace_file`, `workspace_file_content` or an created file with "workspace(name =`<name in repo rule>`)"
@nlopezgi Just tagged releases |
thanks! |
Normally, Gazelle detects the repository name by reading the WORKSPACE file and looking for a workspace rule. In go_googleapis, the proper workspace name is com_google_googleapis. Before bazel-contrib/rules_go#2355, we patched the WORKSPACE file before running Gazelle so the repository name would be set to go_googleapis. Unfortunately, in newer versions of Bazel, WORKSPACE is overwritten, so the patch doesn't apply. This change just adds a hack to set the repository name to go_googleapis if com_google_googleapis is detected. Updates bazel-contrib/rules_go#2387
Normally, Gazelle detects the repository name by reading the WORKSPACE file and looking for a workspace rule. In go_googleapis, the proper workspace name is com_google_googleapis. Before bazel-contrib/rules_go#2355, we patched the WORKSPACE file before running Gazelle so the repository name would be set to go_googleapis. Unfortunately, in newer versions of Bazel, WORKSPACE is overwritten, so the patch doesn't apply. This change just adds a hack to set the repository name to go_googleapis if com_google_googleapis is detected. Updates bazel-contrib/rules_go#2387
Bazel will always override the external repository's WORKSPACE file by
workspace_file
,workspace_file_content
or a created file with "workspace(name =<name in repo rule>
)"