-
Notifications
You must be signed in to change notification settings - Fork 18k
cmd/go: tidy and vendor do not record dependencies of '// +build ignore' go:generate sources #38061
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
Comments
Does go throw an error? Is there a specific import that should be added but isn't? |
You are using the word “correctly”, but it isn't at all obvious to me that the observed behavior is “incorrect”. Can you describe what you expected to see and what you did see in terms of the actual dependencies used? |
//go:generate
one-offs.//go:generate
one-offs as expected
https://github.com/angelofdeauth/xnotify/blob/4263fb794911e4bf6e6350ff262b593ae07843b6/pkg/box/generator.go is a script that is run at build time using Without this line: https://github.com/angelofdeauth/xnotify/blob/4263fb794911e4bf6e6350ff262b593ae07843b6/pkg/box/hack.go#L11 , |
I just realized, it's actually the |
If you don't want the file to be ignored, use a build constraint other than ( |
Or, I suppose, if you want the dependency to be resolved dynamically instead of a specific version, set |
//go:generate
one-offs as expected
Duplicate of #29598 |
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
Yes
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
Create a package with dependencies built from
go:generate
tagsAttempt to use
go mod vendor
andgo mod tidy
https://github.com/angelofdeauth/xnotify/
under
pkg/box
:generate.go script called using preprocessor tags in box.go
Since generate.go is not using
package box
,go mod tidy
andgo mod vendor
do not correctly resolve its imports.What did you expect to see?
go mod vendor
andgo mod tidy
correctly resolve imports of build-time dependencies.What did you see instead?
imports are not correctly resolved, added to go.mod or vendor/modules.txt, or downloaded to the vendor folder.
The text was updated successfully, but these errors were encountered: