-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
build: marking extensions as extension-only visible by default #12337
Conversation
cc @yanavlasov for import (where I think we can just define envoy_cc_extension_library to envoy_cc_library and ignore the dependency issue) |
Signed-off-by: Alyssa Wilk <alyssar@chromium.org>
This only does half of it - |
Ok I take it back - I ended up defining extra_visibility so there will need to be some bzl tweaks. |
Signed-off-by: Alyssa Wilk <alyssar@chromium.org>
It feels like this PR basically consists of tagging every filter in the integration tests. Still, I think it'll help future proof, like we should have moved the redirect integration test into extensions when we started adding pluggable retry predicates. So everything is included everywhere but hopefully it won't be going forward? |
This is likely breaking many downstream builds. We have bunch of extension point that defined in extensions, for example: |
Signed-off-by: Alyssa Wilk <alyssar@chromium.org>
Unfortunately, one can't do //visibility:public -//source:__subpackages How about this: I'll split the rules into their own build file, and add instructions on how folks can override on their imports? |
Yeah, wondering whether visibility can be |
@@ -1,16 +1,18 @@ | |||
load( | |||
"//bazel:envoy_build_system.bzl", | |||
"envoy_cc_library", | |||
"envoy_cc_extension_library", | |||
"envoy_package", | |||
) | |||
|
|||
licenses(["notice"]) # Apache 2 | |||
|
|||
envoy_package() |
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.
We can define a envoy_extension_package
with stricter default_visibility
, use that instead of envoy_package
in extensions. That limit visibility beyond cc_library.
Signed-off-by: Alyssa Wilk <alyssar@chromium.org>
Signed-off-by: Alyssa Wilk <alyssar@chromium.org>
Signed-off-by: Alyssa Wilk <alyssar@chromium.org>
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.
LGTM, one TODO to add.
BUILD
Outdated
# These two definitions exist to help reduce Envoy upstream core code depending on extensions. | ||
# To avoid visibility problems, one can replace the package lists below with "//visibility:public" | ||
# | ||
# TODO(#9953) //test/config_test:__pkg__ should probably be split up and removed. | ||
# TODO(#9953) the config fuzz tests should be moved somewhere local and //test/config_test and //test/server removed. | ||
package_group( | ||
name = "extension_config", | ||
packages = [ | ||
"//source/exe", | ||
"//source/extensions/...", | ||
"//test/config_test", | ||
"//test/extensions/...", | ||
"//test/server", | ||
"//test/server/config_validation", | ||
], | ||
) | ||
|
||
package_group( | ||
name = "extension_library", | ||
packages = [ | ||
"//source/extensions/...", | ||
"//test/extensions/...", | ||
], | ||
) |
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.
Can we add a TODO here to make this override more easier? I think potentially we can embed part of this in source/extensions/extensions_build_config.bzl
(something like additional_visibility
), that's where the overrides happen for downstream builds normally.
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.
Gah, that's a fair point.
I hate to make folks overwrite the build file, then move their workarounds when I do the TODO. Let me see if I can get something working tonight.
Signed-off-by: Alyssa Wilk <alyssar@chromium.org>
Signed-off-by: Alyssa Wilk <alyssar@chromium.org>
BUILD
Outdated
@@ -1,3 +1,8 @@ | |||
load( | |||
"//source/extensions:extensions_build_config.bzl", |
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.
"//source/extensions:extensions_build_config.bzl", | |
"@envoy_build_config//:extensions_build_config.bzl", |
Is the real overridden path :)
@@ -6,7 +11,7 @@ exports_files([ | |||
]) | |||
|
|||
# These two definitions exist to help reduce Envoy upstream core code depending on extensions. | |||
# To avoid visibility problems, one can replace the package lists below with "//visibility:public" | |||
# To avoid visibility problems, one can extend ADDITIONAL_VISIBILITY in source/extensions/extensions_build_config.bzl |
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.
re: how to override is documented in https://github.com/envoyproxy/envoy/tree/master/bazel#disabling-extensions, can you update there too?
By default, Envoy extensions are set up to only be visible to code within the | ||
[//source/extensions](../source/extensions/), or the Envoy server target. To adjust this, | ||
add any additional targets you need to `ADDITIONAL_VISIBILITY` in | ||
[extensions_build_config.bzl](../source/extensions/extensions_build_config.bzl). |
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.
To inject this file should be done like what https://github.com/envoyproxy/envoy/blob/master/bazel/README.md#disabling-extensions describes, add a link?
…proxy#12337) Risk Level: medium (of build breakage) Testing: n/a Docs Changes: n/a Release Notes: n/a Part of envoyproxy#9953 Signed-off-by: Alyssa Wilk <alyssar@chromium.org>
…proxy#12337) Risk Level: medium (of build breakage) Testing: n/a Docs Changes: n/a Release Notes: n/a Part of envoyproxy#9953 Signed-off-by: Alyssa Wilk <alyssar@chromium.org> Signed-off-by: chaoqinli <chaoqinli@google.com>
Commit Message: Revert buffer filter visibility back to public Additional Description: After bringing in #12337, we are unable to build the router check tool as we build it with the buffer filter extension, which is no longer visible to the target we use. This change reverts the visibility change for the buffer filter back to public. Risk Level: Low Testing: N/A Docs Changes: N/A Release Notes: N/A Part of #12444 Signed-off-by: Lisa Lu <lisalu@lyft.com>
Risk Level: medium (of build breakage)
Testing: n/a
Docs Changes: n/a
Release Notes: n/a
Part of #9953