-
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
dev: spurious diffs appear when hoisting generated code into tree #72232
Labels
A-build-system
C-bug
Code not up to spec/doc, specs & docs deemed correct. Solution expected to change code/behavior.
T-dev-inf
Comments
irfansharif
added
C-bug
Code not up to spec/doc, specs & docs deemed correct. Solution expected to change code/behavior.
A-build-system
T-dev-inf
labels
Oct 29, 2021
rickystewart
added a commit
to rickystewart/cockroach
that referenced
this issue
Dec 22, 2021
Before this change, `dev build --hoist-generated-code` would introduce a lot of spurious, benign diffs in generated code. I've validated that you can `dev build --hoist-generated code` without introducing any diffs with this change applied. The code we're deleting from tree here is: * *ALL* `.pb.go` and `.pb.gw.go` files; * and an ad-hoc selection of generated files that cannot be hoisted into the worktree by `dev` without introducing diffs (see cockroachdb#72232). My first attempt at solving this problem was by deleting "all" generated code from tree but I quickly found that this was intractable: the large majority of these generated files don't have bespoke support in the `Makefile`, so deleting them from tree and running `make build` just causes the build to fail. Instead, the approach here is more targeted: I delete only the generated files that have diffs when hoisted by `dev`, and add support in the `Makefile` for those specific generated files. The remaining checked-in generated files aren't hurting anyone, and can be deleted from tree wholesale after `make` is dead. NB: This change can require running `make generate` (or, in certain more constrained scenarios, `make protobuf`) to make some builds/tests work. Closes cockroachdb#72232. Release note: None
rickystewart
added a commit
to rickystewart/cockroach
that referenced
this issue
Dec 22, 2021
Before this change, `dev build --hoist-generated-code` would introduce a lot of spurious, benign diffs in generated code. I've validated that you can `dev build --hoist-generated code` without introducing any diffs with this change applied. The code we're deleting from tree here is: * *ALL* `.pb.go` and `.pb.gw.go` files; * and an ad-hoc selection of generated files that cannot be hoisted into the worktree by `dev` without introducing diffs (see cockroachdb#72232). My first attempt at solving this problem was by deleting "all" generated code from tree but I quickly found that this was intractable: the large majority of these generated files don't have bespoke support in the `Makefile`, so deleting them from tree and running `make build` just causes the build to fail. Instead, the approach here is more targeted: I delete only the generated files that have diffs when hoisted by `dev`, and add support in the `Makefile` for those specific generated files. The remaining checked-in generated files aren't hurting anyone, and can be deleted from tree wholesale after `make` is dead. NB: This change can require running `make generate` (or, in certain more constrained scenarios, `make protobuf`) to make some builds/tests work. Closes cockroachdb#72232. Release note: None
craig bot
pushed a commit
that referenced
this issue
Dec 23, 2021
72675: *: delete a bunch of generated go code from tree r=irfansharif a=rickystewart Before this change, `dev build --hoist-generated-code` would introduce a lot of spurious, benign diffs in generated code. I've validated that you can `dev build --hoist-generated code` without introducing any diffs with this change applied. The code we're deleting from tree here is: * *ALL* `.pb.go` and `.pb.gw.go` files; * and an ad-hoc selection of generated files that cannot be hoisted into the worktree by `dev` without introducing diffs (see #72232). My first attempt at solving this problem was by deleting "all" generated code from tree but I quickly found that this was intractable: the large majority of these generated files don't have bespoke support in the `Makefile`, so deleting them from tree and running `make build` just causes the build to fail. Instead, the approach here is more targeted: I delete only the generated files that have diffs when hoisted by `dev`, and add support in the `Makefile` for those specific generated files. The remaining checked-in generated files aren't hurting anyone, and can be deleted from tree wholesale after `make` is dead. NB: This change can require running `make generate` (or, in certain more constrained scenarios, `make protobuf`) to make some builds/tests work. Closes #72232. Release note: None 74210: sql: deprecate GRANT privilege r=jackcwu a=jackcwu Resolves #73065 Release note (sql change): We will be deprecating the GRANT privilege in 22.1 before eventually removing it in 22.2 in favor of grant options. To promote backwards compatibility for users with code still using GRANT, we will give grant options on every privilege a user has when they are granted GRANT and remove all their grant options when GRANT is revoked, in addition to the existing grant option behavior. Co-authored-by: Ricky Stewart <[email protected]> Co-authored-by: Jack Wu <[email protected]>
gustasva
pushed a commit
to gustasva/cockroach
that referenced
this issue
Jan 4, 2022
Before this change, `dev build --hoist-generated-code` would introduce a lot of spurious, benign diffs in generated code. I've validated that you can `dev build --hoist-generated code` without introducing any diffs with this change applied. The code we're deleting from tree here is: * *ALL* `.pb.go` and `.pb.gw.go` files; * and an ad-hoc selection of generated files that cannot be hoisted into the worktree by `dev` without introducing diffs (see cockroachdb#72232). My first attempt at solving this problem was by deleting "all" generated code from tree but I quickly found that this was intractable: the large majority of these generated files don't have bespoke support in the `Makefile`, so deleting them from tree and running `make build` just causes the build to fail. Instead, the approach here is more targeted: I delete only the generated files that have diffs when hoisted by `dev`, and add support in the `Makefile` for those specific generated files. The remaining checked-in generated files aren't hurting anyone, and can be deleted from tree wholesale after `make` is dead. NB: This change can require running `make generate` (or, in certain more constrained scenarios, `make protobuf`) to make some builds/tests work. Closes cockroachdb#72232. Release note: None
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
A-build-system
C-bug
Code not up to spec/doc, specs & docs deemed correct. Solution expected to change code/behavior.
T-dev-inf
Describe the problem
The checked in generated code (protos and various stringer files) are generated using
make
. When generating using bazel/dev (introduced in #68663), you can observe spurious diffs.The diffs (at the time of writing) are of three sorts:
And new (go ignored) files:
Expected behavior
For there to be no extraneous diffs. For protos the extra empty line is something
gofmt
gets rid of, so feels to me we should getdev
/bazel
to apply it when hoisting out of the sandbox. For the stringer files, we could either ignore them in the source tree or use a customstringer
binary inbazel
to strip out the sandbox path? Not sure about the .pb.gw.go files.Epic CRDB-8036
The text was updated successfully, but these errors were encountered: