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

nogo fails using WORKSPACE.bazel after upgrade to 0.45.0 #3828

Closed
DolceTriade opened this issue Jan 12, 2024 · 3 comments · Fixed by #3832
Closed

nogo fails using WORKSPACE.bazel after upgrade to 0.45.0 #3828

DolceTriade opened this issue Jan 12, 2024 · 3 comments · Fixed by #3832

Comments

@DolceTriade
Copy link
Contributor

What version of rules_go are you using?

0.45.0

What version of gazelle are you using?

0.35.0

What version of Bazel are you using?

bazel version
Build label: 7.0.0- (@non-git)
Build target: @@//src/main/java/com/google/devtools/build/lib/bazel:BazelServer
Build time: Tue Jan 1 00:00:00 1980 (315532800)
Build timestamp: 315532800
Build timestamp as int: 315532800

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

ya

What operating system and processor architecture are you using?

Linux amd64

What did you do?

Upgrade rules_go to 0.45.0 from 0.44.2.

Upon upgrading, nogo fails on things that are wrong and returns garbage output like:

Use --sandbox_debug to see verbose messages from the sandbox and retain the sandbox build root for debugging
compilepkg: nogo: errors found by nogo during build-time code analysis:
bazel-out/k8-fastbuild/bin/path/to/file/1437484352.go:1:1: at least one file in a package should have a package comment (ST1000)

Note that only the file path was replaced, not the file name. Bazel literally returns a random number here. Downgrading to 0.44.2 makes the issue go away.

What did you expect to see?

no nogo failures

What did you see instead?

gibberish nogo failures

@fmeum
Copy link
Member

fmeum commented Jan 12, 2024

@DolceTriade Do you have a reproducer? Our tests for nogo don't catch this.
@sluongng @emmaxy Any ideas?

@DolceTriade
Copy link
Contributor Author

I can't reproduce it in a minimal set up. I'll try some more and see if its something I can reproduce outside of our repository...

DolceTriade added a commit to DolceTriade/monorepo that referenced this issue Jan 13, 2024
@DolceTriade
Copy link
Contributor Author

nvm, I repro'd it.

https://github.com/DolceTriade/monorepo/tree/minimal

INFO: Invocation ID: 8954761e-7090-4656-ae1e-a13279895b82
INFO: Analyzed 2 targets (0 packages loaded, 0 targets configured).
ERROR: /home/hmodi/monorepo/repro/subdir/mod/BUILD.bazel:10:8: GoCompilePkg repro/subdir/mod/mod_test_test.external.a failed: (Exit 1): builder failed: error executing GoCompilePkg command (from target //repro/subdir/mod:mod_test) bazel-out/k8-opt-exec-ST-13d3ddad9198/bin/external/go_sdk/builder_reset/builder compilepkg -sdk external/go_sdk -installsuffix linux_amd64 -src repro/subdir/mod/mod.go -src repro/subdir/mod/mod_test.go ... (remaining 26 arguments skipped)

Use --sandbox_debug to see verbose messages from the sandbox and retain the sandbox build root for debugging
compilepkg: nogo: errors found by nogo during build-time code analysis:
bazel-out/k8-fastbuild/bin/repro/subdir/mod/2404402859.go:1:1: at least one file in a package should have a package comment (ST1000)
Use --verbose_failures to see the command lines of failed build steps.
INFO: Elapsed time: 0.143s, Critical Path: 0.04s
INFO: 2 processes: 2 internal.
ERROR: Build did NOT complete successfully

The file in that module:

// Package mod does a bunch of stuff.
package mod

func Important() {
}

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.

2 participants