-
Notifications
You must be signed in to change notification settings - Fork 3.8k
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
buildutil: fix disallowed_imports_test to propagate deps via embed #93477
Merged
craig
merged 1 commit into
cockroachdb:master
from
ajwerner:ajwerner/fix-disallowed_imports_test
Dec 15, 2022
Merged
buildutil: fix disallowed_imports_test to propagate deps via embed #93477
craig
merged 1 commit into
cockroachdb:master
from
ajwerner:ajwerner/fix-disallowed_imports_test
Dec 15, 2022
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ajwerner
force-pushed
the
ajwerner/fix-disallowed_imports_test
branch
from
December 13, 2022 06:25
6b85fb7
to
14e5bfe
Compare
rickystewart
approved these changes
Dec 13, 2022
TFTR! bors r+ |
Build failed (retrying...): |
bors r- Check failing tests. |
Canceled. |
Before this change we wouldn't track the dependencies inherited via embedded targets. This does add some cruft because some embedded targets are not `go_library` targets but rather are things like `go_proto_library` so we have to check whether the targets have certain attributes. The aspect docs make it seem like this is normal. Before this change, the following would not fail, now it will: ``` --- a/pkg/cmd/cockroach/BUILD.bazel +++ b/pkg/cmd/cockroach/BUILD.bazel @@ -1,5 +1,6 @@ load("//build/bazelutil/unused_checker:unused.bzl", "get_x_data") load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library") +load("//pkg/testutils/buildutil:buildutil.bzl", "disallowed_imports_test") go_library( name = "cockroach_lib", @@ -20,4 +21,11 @@ go_binary( visibility = ["//visibility:public"], ) +disallowed_imports_test( + "cockroach", + disallowed_list = [ + "//pkg/sql/randgen:randgen", + ], +) + ``` ``` ERROR: //pkg/cmd/cockroach:cockroach imports //pkg/sql/randgen:randgen check: bazel query 'somepath(//pkg/cmd/cockroach:cockroach, //pkg/sql/randgen:randgen)' ``` Epic: none Release note: None
ajwerner
force-pushed
the
ajwerner/fix-disallowed_imports_test
branch
from
December 14, 2022 21:52
14e5bfe
to
127733c
Compare
bors r+ |
This PR was included in a batch that was canceled, it will be automatically retried |
Build succeeded: |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Before this change we wouldn't track the dependencies inherited via embedded targets. This does add some cruft because some embedded targets are not
go_library
targets but rather are things likego_proto_library
so we have to check whether the targets have certain attributes. The aspect docs make it seem like this is normal.Before this change, the following would not fail, now it will:
Epic: none
Release note: None