Skip to content
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

On build error, the actual failure is drowned out by a lot of noise related to the build command #3890

Closed
rickystewart opened this issue Mar 15, 2024 · 2 comments · Fixed by #3892

Comments

@rickystewart
Copy link
Contributor

rickystewart commented Mar 15, 2024

What version of rules_go are you using?

0.46

What version of gazelle are you using?

v0.33.0

What version of Bazel are you using?

6.2.1

Does this issue reproduce with the latest releases of all the above?

I haven't tried with the very latest version of Gazelle and Bazel, though I don't see why doing so would fix it.

What operating system and processor architecture are you using?

macOS/arm64

Any other potentially useful information about your toolchain?

No

What did you do?

Run a build of a failing target (i.e., insert a compile error like a line of gibberish into a .go file)

What did you expect to see?

Using v0.43 of rules_go, if I build a failing target, I get a relatively terse failure like the following:

ERROR: /Users/ricky/go/src/github.com/cockroachdb/cockroach/pkg/cmd/dev/BUILD.bazel:40:10: GoCompilePkg pkg/cmd/dev/dev.a failed: (Exit 1): builder failed: error executing command (from target //pkg/cmd/dev:dev) bazel-out/darwin_arm64-opt-exec-2B5CBBC6/bin/external/go_sdk/builder_reset/builder compilepkg -sdk external/go_sdk -installsuffix darwin_arm64 -tags bazel,gss,bazel,gss -src pkg/cmd/dev/acceptance.go ... (remaining 72 arguments skipped)

Use --sandbox_debug to see verbose messages from the sandbox and retain the sandbox build root for debugging
pkg/cmd/dev/build.go:129:2: undefined: sdfdsfsdf
compilepkg: error running subcommand external/go_sdk/pkg/tool/darwin_arm64/compile: exit status 2

The entire message output is quite short, and the actual error (pkg/cmd/dev/build.go:129:2: undefined: sdfdsfsdf) is quite close to the end of the output, making it trivial to spot when you're iterating.

What did you see instead?

Using v0.46, the error message for a similar failure looks like this:

pkg/cmd/dev/build.go:148:2: undefined: asldkfjsf
compilepkg: error running subcommand PATH=external/local_config_cc:/bin:/usr/bin \
SDKROOT=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.2.sdk \
GOEXPERIMENT=nocoverageredesign \
CGO_ENABLED=1 \
XCODE_VERSION_OVERRIDE=15.2.0.15C500b \
GOARCH=arm64 \
DEVELOPER_DIR=/Applications/Xcode.app/Contents/Developer \
GOPATH= \
ZERO_AR_DATE=1 \
GOOS=darwin \
GOROOT=bazel-out/darwin_arm64-fastbuild-ST-b33d65c724e6/bin/external/io_bazel_rules_go/stdlib_ \
APPLE_SDK_VERSION_OVERRIDE=14.2 \
TMPDIR=/var/folders/xl/r959dlf13y968d0d30q1wbr40000gp/T/ \
GOTOOLCHAIN=local \
APPLE_SDK_PLATFORM=MacOSX \
GOROOT_FINAL=GOROOT \
__CF_USER_TEXT_ENCODING=0x1F6:0x0:0x0 \
external/go_sdk/pkg/tool/darwin_arm64/compile -p main -importcfg /private/var/tmp/_bazel_ricky/be70b24e7357091e16c49d70921b7985/sandbox/darwin-sandbox/5355/execroot/com_github_cockroachdb_cockroach/bazel-out/darwin_arm64-fastbuild/bin/pkg/cmd/dev/importcfg138021216 -pack -trimpath=/private/var/tmp/_bazel_ricky/be70b24e7357091e16c49d70921b7985/sandbox/darwin-sandbox/5355/execroot/com_github_cockroachdb_cockroach=>main -o /private/var/tmp/_bazel_ricky/be70b24e7357091e16c49d70921b7985/sandbox/darwin-sandbox/5355/execroot/com_github_cockroachdb_cockroach/bazel-out/darwin_arm64-fastbuild/bin/pkg/cmd/dev/dev.x -linkobj /private/var/tmp/_bazel_ricky/be70b24e7357091e16c49d70921b7985/sandbox/darwin-sandbox/5355/execroot/com_github_cockroachdb_cockroach/bazel-out/darwin_arm64-fastbuild/bin/pkg/cmd/dev/dev.a -- /private/var/tmp/_bazel_ricky/be70b24e7357091e16c49d70921b7985/sandbox/darwin-sandbox/5355/execroot/com_github_cockroachdb_cockroach/pkg/cmd/dev/acceptance.go /private/var/tmp/_bazel_ricky/be70b24e7357091e16c49d70921b7985/sandbox/darwin-sandbox/5355/execroot/com_github_cockroachdb_cockroach/pkg/cmd/dev/bench.go /private/var/tmp/_bazel_ricky/be70b24e7357091e16c49d70921b7985/sandbox/darwin-sandbox/5355/execroot/com_github_cockroachdb_cockroach/pkg/cmd/dev/build.go /private/var/tmp/_bazel_ricky/be70b24e7357091e16c49d70921b7985/sandbox/darwin-sandbox/5355/execroot/com_github_cockroachdb_cockroach/pkg/cmd/dev/builder.go /private/var/tmp/_bazel_ricky/be70b24e7357091e16c49d70921b7985/sandbox/darwin-sandbox/5355/execroot/com_github_cockroachdb_cockroach/pkg/cmd/dev/cache.go /private/var/tmp/_bazel_ricky/be70b24e7357091e16c49d70921b7985/sandbox/darwin-sandbox/5355/execroot/com_github_cockroachdb_cockroach/pkg/cmd/dev/compose.go /private/var/tmp/_bazel_ricky/be70b24e7357091e16c49d70921b7985/sandbox/darwin-sandbox/5355/execroot/com_github_cockroachdb_cockroach/pkg/cmd/dev/dev.go /private/var/tmp/_bazel_ricky/be70b24e7357091e16c49d70921b7985/sandbox/darwin-sandbox/5355/execroot/com_github_cockroachdb_cockroach/pkg/cmd/dev/doctor.go /private/var/tmp/_bazel_ricky/be70b24e7357091e16c49d70921b7985/sandbox/darwin-sandbox/5355/execroot/com_github_cockroachdb_cockroach/pkg/cmd/dev/generate.go /private/var/tmp/_bazel_ricky/be70b24e7357091e16c49d70921b7985/sandbox/darwin-sandbox/5355/execroot/com_github_cockroachdb_cockroach/pkg/cmd/dev/go.go /private/var/tmp/_bazel_ricky/be70b24e7357091e16c49d70921b7985/sandbox/darwin-sandbox/5355/execroot/com_github_cockroachdb_cockroach/pkg/cmd/dev/lint.go /private/var/tmp/_bazel_ricky/be70b24e7357091e16c49d70921b7985/sandbox/darwin-sandbox/5355/execroot/com_github_cockroachdb_cockroach/pkg/cmd/dev/main.go /private/var/tmp/_bazel_ricky/be70b24e7357091e16c49d70921b7985/sandbox/darwin-sandbox/5355/execroot/com_github_cockroachdb_cockroach/pkg/cmd/dev/roachprod_stress.go /private/var/tmp/_bazel_ricky/be70b24e7357091e16c49d70921b7985/sandbox/darwin-sandbox/5355/execroot/com_github_cockroachdb_cockroach/pkg/cmd/dev/test.go /private/var/tmp/_bazel_ricky/be70b24e7357091e16c49d70921b7985/sandbox/darwin-sandbox/5355/execroot/com_github_cockroachdb_cockroach/pkg/cmd/dev/test_binaries.go /private/var/tmp/_bazel_ricky/be70b24e7357091e16c49d70921b7985/sandbox/darwin-sandbox/5355/execroot/com_github_cockroachdb_cockroach/pkg/cmd/dev/testlogic.go /private/var/tmp/_bazel_ricky/be70b24e7357091e16c49d70921b7985/sandbox/darwin-sandbox/5355/execroot/com_github_cockroachdb_cockroach/pkg/cmd/dev/ui.go /private/var/tmp/_bazel_ricky/be70b24e7357091e16c49d70921b7985/sandbox/darwin-sandbox/5355/execroot/com_github_cockroachdb_cockroach/pkg/cmd/dev/util.go: exit status 2

This time, I need to scroll up before I can see the actual error. (Note that this looks more readable in the GitHub output than in the terminal, as a terminal usually does not allow you to scroll right and left and instead wraps the extremely long final line.) This is a relatively small, simple Go package, so consider that it will be far more unreadable for a large production codebase.

If I wanted to see the command-line, I had the option of running the build with -s or --verbose_failures -- I find it dubious that most developers will want to see all this. My hunch is for the large majority of developers, this is irrelevant noise, which makes me think it should not be there in the output. What is actually desired for developers is the compiler error message, which is obscured. Given these command-line options exist and are opt-in (as they should be), my feeling is that #3824 should be reverted. However, if the command is going to be there, it would be much better if the actual compile error (in this case: pkg/cmd/dev/build.go:148:2: undefined: asldkfjsf) were at the bottom, so it is the first thing you see (as in v0.43).

@fmeum
Copy link
Collaborator

fmeum commented Mar 15, 2024

Cc @linzhp I think that this is caused by your recent change.

rickystewart added a commit to rickystewart/cockroach that referenced this issue Mar 15, 2024
... to pull in `0e7e4e31aa49f1afbb402fbb4895f38bc702c88c`.

See bazelbuild/rules_go#3890

This reverts a change in bazelbuild/rules_go#3824 which makes it much
more difficult to see build errors.

Epic: none
Release note: None
craig bot pushed a commit to cockroachdb/cockroach that referenced this issue Mar 15, 2024
120490: ui: show license expiration alert in Db Console r=koorosh a=koorosh

With this change, new alert message is shown in Db Console when license is expired or less than 15 days left before it will expire.
This change doesn't affect clusters that doesn't have any license set.

Release note (ui change): show alert message in Db Console when license is expired or close to expire.

Depends on: #120475

Resolves: #98589

Epic: None

Screens:
1. Less than 15 days before license expires
<img width="1215" alt="Screenshot 2024-03-14 at 13 26 18" src="https://github.com/cockroachdb/cockroach/assets/3106437/54f18792-d16f-43d1-a439-bd04e7a91abd">
2. License expired
<img width="1215" alt="Screenshot 2024-03-14 at 13 25 26" src="https://github.com/cockroachdb/cockroach/assets/3106437/ec9b924a-7800-4cf9-a164-9f4f5b49e91f">
3. License expired today
<img width="1215" alt="Screenshot 2024-03-14 at 13 25 59" src="https://github.com/cockroachdb/cockroach/assets/3106437/38a29b0d-47c3-447a-beb5-d557b58bcfc9">



120505: sql: deflake TestTrackOnlyUserOpenTransactionsAndActiveStatements r=rafiss a=rafiss

This changes the test to block in AfterExecute rather than OnTxnFinish, which should make the active statements assertion less flaky.

It also fixes a testing bug where the SELECT FOR UPDATE was not in a txn.

fixes #120042
fixes #120235
fixes #119829

Release note: None

120547: ccl/cliccl: avoid opening Engine in debug encryption-decrypt r=sumeerbhola a=jbowens

Adapt the `debug encryption-decrypt` command to avoid actually opening the Engine and instead only open the filesystem environment. This allows the command to be used even when missing or corrupt files prevent the Engine from being opened.

Epic: none
Fix #96699.
Release note: none

120562: build: update `rules_go` r=jlinder a=rickystewart

... to pull in `0e7e4e31aa49f1afbb402fbb4895f38bc702c88c`.

See bazelbuild/rules_go#3890

This reverts a change in bazelbuild/rules_go#3824 which makes it much more difficult to see build errors.

Epic: none
Release note: None

Co-authored-by: Andrii Vorobiov <and.vorobiov@gmail.com>
Co-authored-by: Rafi Shamim <rafi@cockroachlabs.com>
Co-authored-by: Jackson Owens <jackson@cockroachlabs.com>
Co-authored-by: Ricky Stewart <ricky@cockroachlabs.com>
@linzhp
Copy link
Contributor

linzhp commented Mar 16, 2024

Yeah, I realized that too. Let's revert it then.

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 a pull request may close this issue.

3 participants