-
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
bazel: tests that depend on buildutil.VerifyNoImports()
fail under remote execution
#74176
Comments
``` --- FAIL: TestNoLinkForbidden (0.01s) build.go:56: cannot find package "github.com/cockroachdb/cockroach/pkg/roachpb" in any of: GOROOT/src/github.com/cockroachdb/cockroach/pkg/roachpb (from $GOROOT) /go/src/github.com/cockroachdb/cockroach/pkg/roachpb (from $GOPATH) ``` This is a workaround for cockroachdb#74176. Release note: None
74266: spanconfig: set stage for migration r=irfansharif a=irfansharif **spanconfig: get rid of ReconciliationDependencies interface** It was hollow, simply embedding the spanconfig.Reconciler interface. In a future commit we end up relying on each pod's span config reconciler outside of just the reconciliation job. This makes the interface even awkwarder than it was. **spanconfig/reconciler: export the checkpoint timestamp** We'll make use of it in a future commit. **kvserver: plumb in a context into (*Store).GetConfReader** We'll use it in a future commit. **clusterversion: improve a version comment** Gets rid of a squiggly line in Goland. --- Set of commits to set the stage for #73876. 74814: Tag test rules that fail with TestNoLinkForbidden r=rickystewart a=ulfjack ``` --- FAIL: TestNoLinkForbidden (0.01s) build.go:56: cannot find package "github.com/cockroachdb/cockroach/pkg/roachpb" in any of: GOROOT/src/github.com/cockroachdb/cockroach/pkg/roachpb (from $GOROOT) /go/src/github.com/cockroachdb/cockroach/pkg/roachpb (from $GOPATH) ``` This is a workaround for #74176. Release note: None Co-authored-by: irfan sharif <irfanmahmoudsharif@gmail.com> Co-authored-by: Ulf Adams <ulf@engflow.com>
I'm not sure this is true, and even if it is true specifying Bazel visibility rules that correspond to what tests using Using
But how to use Also worthy of note is that |
In my opinion, nothing you've described is prohibitively onerous. We can run a one-time query to find which libraries depend on Of course I'm biased and there is disagreement about how much friction this actually is, so we haven't forced anything like this on anyone, but I do think that as the monorepo grows we'll have to make changes in this direction either way. I agree that RE: |
If you're referring to a vet |
I'm not sure I'm following the argument here. In the scenario you're outlining it sounds like this SHOULD break the build because we're violating the invariant that we don't want |
In the scenario I outlined we should have broken the build, but I don't think it would have. |
I feel like I'd address this not with visibility rules, but with
Today this would fail, as
This should be a simple macro to write. |
Ah yes, sorry I was misunderstanding the point about transitive dependencies. Yes, we can build on top of |
I think the output from |
This macro can be used to create a test which disallows one go package from importing another. It uses a thin aspect to accumulate go dependencies while avoiding any cycle due to nogo. There's an example of its use in `execinfrapb`. It also ensures that we generate the tests into the BUILD.bazel file so they are run by CI. Relates heavily to cockroachdb#74176. Release note: None
79299: testutils/buildutil: add disallowed_imports_test bazel macro r=rickystewart a=ajwerner This macro can be used to create a test which disallows one go package from importing another. It uses a thin aspect to accumulate go dependencies while avoiding any cycle due to nogo. There's an example of its use in `execinfrapb`. Relates heavily to #74176. Release note: None Co-authored-by: Andrew Werner <awerner32@gmail.com>
This function no longer exists as of #103059, and we have a suitable replacement in |
The dependency on the
build
package is breaking stuff here. I don't think these tests are doing anything that Bazel's visibility rules couldn't do.Epic CRDB-8308
Jira issue: CRDB-11962
The text was updated successfully, but these errors were encountered: