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

fulltest failed #196

Closed
dannypsnl opened this issue Jul 20, 2021 · 7 comments
Closed

fulltest failed #196

dannypsnl opened this issue Jul 20, 2021 · 7 comments

Comments

@dannypsnl
Copy link
Member

@mewmew could you take a look? Changes destroyed test

ir/enum/tools.go:6:2: import "golang.org/x/tools/cmd/stringer" is a program, not an importable package
ir/types/tools.go:6:2: import "golang.org/x/tools/cmd/stringer" is a program, not an importable package
@mewmew
Copy link
Member

mewmew commented Jul 20, 2021

Asked upstream for help on what the current best practice is for handling tools dependencies: golang/go#25922 (comment)

@mewmew
Copy link
Member

mewmew commented Jul 21, 2021

Upstream answer from @jayconrod.

@mewmew In this case, don't run go vet with -tags tools. The tools.go file is not meant to be part of a buildable package, so vet won't provide useful feedback on it. Without -tags tools, everything except go mod tidy will ignore tools.go.

@dannypsnl, we should update our CI test scripts to not include the tools Go build tag for the go vet command. Could you look into how to do this?

Cheers,
Robin

@dannypsnl
Copy link
Member Author

dannypsnl commented Jul 21, 2021

But we didn't run go vet command, the failed command was go install ./...

@mewmew
Copy link
Member

mewmew commented Jul 21, 2021

@dannypsnl, can you re-produce this issue locally?

When i run go install -v ./... I get no error locally (on the llvm12 branch).

$ go install -v ./... ; echo $?
0

Edit: It seems from https://github.com/llir/llvm/actions/runs/1045240441 that go test produces the error.
screenshot_2021-07-21_09:51:28

Since Go version 1.10, go vet is automatically run during go test. From https://golang.org/doc/go1.10

This release ..., runs vet automatically during tests, ...

@mewmew
Copy link
Member

mewmew commented Jul 21, 2021

Ahh, I think I know what the issue is. We updated the Go build tags to the format supported by Go 1.17 (i.e. using //go:build tags instead of //+build tags). Older versions of Go does not recognize the new Go build tag format.

So for the time being, we should use both it seems. Then when Go version 1.18 (or 1.19) is released, we can remove the use of //+build and only keep //go:build.

From df0eb03#diff-22d8b7bad6c36a7bfe9e86a29b00c1b5006662b532a29a1f99de16b4eef9473a

-//+build tools
+//go:build tools

@mewmew
Copy link
Member

mewmew commented Jul 21, 2021

Note, the build passes (on rev 11e88e3) using Go version 1.17.

u@x1 ~/l/p/g/l/llvm (llvm12)> go test ./...
?   	github.com/llir/llvm	[no test files]
ok  	github.com/llir/llvm/asm	20.987s
?   	github.com/llir/llvm/asm/enum	[no test files]
?   	github.com/llir/llvm/cmd/l-tm	[no test files]
ok  	github.com/llir/llvm/internal/enc	0.002s
?   	github.com/llir/llvm/internal/gep	[no test files]
ok  	github.com/llir/llvm/internal/natsort	0.020s
?   	github.com/llir/llvm/internal/osutil	[no test files]
ok  	github.com/llir/llvm/ir	0.173s
ok  	github.com/llir/llvm/ir/constant	0.927s
?   	github.com/llir/llvm/ir/enum	[no test files]
ok  	github.com/llir/llvm/ir/metadata	0.176s
ok  	github.com/llir/llvm/ir/types	0.005s
?   	github.com/llir/llvm/ir/value	[no test files]

mewmew added a commit to llir/testdata that referenced this issue Jul 21, 2021
mewmew added a commit that referenced this issue Jul 21, 2021
@mewmew
Copy link
Member

mewmew commented Jul 21, 2021

Fixed in ee6f05b.

@mewmew mewmew closed this as completed Jul 21, 2021
mewmew added a commit that referenced this issue Jul 22, 2021
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

No branches or pull requests

2 participants