Skip to content

x/vuln: fix handling of build tags for govulncheck #59607

@rminnich

Description

@rminnich

What version of Go are you using (go version)?

go version go1.20.3 darwin/arm64

Does this issue reproduce at the latest version of golang.org/x/vuln?

yes

What operating system and processor architecture are you using (go env)?

darwin
arm64

What did you do?

in github.com/u-root/u-root

rminnich-macbookpro2:u-root rminnich$ GOOS=linux govulncheck ./...
govulncheck is an experimental tool. Share feedback at https://go.dev/s/govulncheck-feedback.

Using go1.20.3 and [email protected] with
vulnerability data from https://vuln.go.dev (last modified 2023-04-13 00:03:55 +0000 UTC).
Packages contain errors:
/Users/rminnich/go/src/github.com/u-root/u-root/pkg/strace/socket.go:74:12: undefined: archWidth
/Users/rminnich/go/src/github.com/u-root/u-root/pkg/strace/syscall_linux.go:312:14: undefined: syscalls
/Users/rminnich/go/src/github.com/u-root/u-root/pkg/strace/syscall_linux.go:321:14: undefined: syscalls
/Users/rminnich/go/src/github.com/u-root/u-root/pkg/strace/syscalls.go:212:20: undefined: syscalls
/Users/rminnich/go/src/github.com/u-root/u-root/pkg/strace/syscalls.go:223:11: undefined: syscalls
/Users/rminnich/go/src/github.com/u-root/u-root/pkg/strace/tracer.go:258:12: t.Syscall.FillArgs undefined (type *SyscallEvent has no field or method FillArgs)
/Users/rminnich/go/src/github.com/u-root/u-root/pkg/strace/tracer.go:265:13: t.Syscall.FillRet undefined (type *SyscallEvent has no field or method FillRet)
/Users/rminnich/go/src/github.com/u-root/u-root/pkg/strace/tracer.go:435:28: undefined: signals
/Users/rminnich/go/src/github.com/u-root/u-root/pkg/strace/tracer.go:436:33: undefined: signals

but

rminnich-macbookpro2:u-root rminnich$ GOOS=linux govulncheck pkg/strace/...
govulncheck is an experimental tool. Share feedback at https://go.dev/s/govulncheck-feedback.

Using go1.20.3 and [email protected] with
vulnerability data from https://vuln.go.dev (last modified 2023-04-13 00:03:55 +0000 UTC).

Scanning your code and 0 packages across 0 dependent modules for known vulnerabilities...
No vulnerabilities found.

Why does it find errors on the same code in the one case and not see them in others.

Also:
govulncheck ./...

Gets a huge number of errors, almost as though constraints are not properly applied?

Metadata

Metadata

Assignees

Labels

FrozenDueToAgeNeedsInvestigationSomeone must examine and confirm this is a valid issue and not a duplicate of an existing one.vulncheck or vulndbIssues for the x/vuln or x/vulndb repo

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions