Skip to content

build: use static config_impl_test to generate corpus#6725

Merged
htuch merged 2 commits intoenvoyproxy:masterfrom
lizan:static_generator
May 6, 2019
Merged

build: use static config_impl_test to generate corpus#6725
htuch merged 2 commits intoenvoyproxy:masterfrom
lizan:static_generator

Conversation

@lizan
Copy link
Copy Markdown
Member

@lizan lizan commented Apr 26, 2019

Signed-off-by: Lizan Zhou lizan@tetrate.io

Description:
As we use srcs to specify the tools to avoid host/target confusion, the src need to be static otherwise dynamic libraries cannot be loaded after #6704 in strict sandbox.

Risk Level: Low
Testing: test only
Docs Changes: N/A
Release Notes: N/A

Signed-off-by: Lizan Zhou <lizan@tetrate.io>
@lizan lizan requested a review from htuch April 26, 2019 20:04
Signed-off-by: Lizan Zhou <lizan@tetrate.io>
Copy link
Copy Markdown
Member

@htuch htuch left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, just one quick comment.
/wait-any

],
)

# envoy_cc_test_binary is generating mostly static binary regardless of config
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this always going to be true? Is there a way to make this more robust?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, envoy_cc_test_binary employs envoy_cc_binary which is always linkstatic=1.

@stale
Copy link
Copy Markdown

stale bot commented May 3, 2019

This pull request has been automatically marked as stale because it has not had activity in the last 7 days. It will be closed in 7 days if no further activity occurs. Please feel free to give a status update now, ping for review, or re-open when it's ready. Thank you for your contributions!

@stale stale bot added stale stalebot believes this issue/PR has not been touched recently and removed stale stalebot believes this issue/PR has not been touched recently labels May 3, 2019
@htuch htuch merged commit e4d3981 into envoyproxy:master May 6, 2019
lizan pushed a commit that referenced this pull request May 13, 2019
#6871)

Description: The build target `//test/common/router:config_impl_test_static` was relying upon the `_lib` target that is created by the `envoy_cc_test` in envoy_build_system.bzl. This target should not be relied upon since it is an implementation detail of the Envoy build system rather than a public build target that we want to allow dependencies upon.

This PR restricts the visibility of these synthetic targets to only the code coverage tools and renames them to end with `_lib_INTERNAL_ONLY` instead. See #6725 for where we started using these synthetic targets in our `BUILD` files.

This PR also hides the `envoy_cc_test_infrastructure_library` build macro by renaming it to `_envoy_cc_test_infrastructure_library` as per https://docs.bazel.build/versions/master/build-ref.html#load. This macro was not being used outside of envoy_build_system.bzl.

Note this does not break coverage builds since coverage pulls in the synthetic targets via the `coverage_test_lib` tag, see [generated_coverage_BUILD.txt](https://github.com/envoyproxy/envoy/files/3163463/generated_coverage_BUILD.txt) for the generated coverage `BUILD` file.

Risk Level: Low
Testing: Ran `bazel test //test/common/...`. and ran `test/run_envoy_bazel_coverage.sh`. 
Docs Changes: N/A
Release Notes: N/A

Signed-off-by: Frank Fort <ffort@google.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants