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

cmd/go: error from 'go mod vendor' missing import stack for unmatched 'go:embed' pattern #49534

Open
thanm opened this issue Nov 11, 2021 · 4 comments

Comments

@thanm
Copy link
Contributor

@thanm thanm commented Nov 11, 2021

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

$ go version
go version devel go1.18-73a4bbb0df Thu Nov 11 17:18:13 2021 +0000 linux/amd64

Does this issue reproduce with the latest release?

I tried 1.17 and it seems to have the same problem.

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

amd64/linux

What did you do?

For this program:

https://play.golang.org/p/eXki7fZlkkc

if you download it and run "go mod vendor"

What did you expect to see?

Successful "go" cmd.

What did you see instead?

Got:

go mod vendor
go: downloading github.com/go-delve/delve v1.7.2
go: downloading golang.org/x/arch v0.0.0-20190927153633-4e8777c89be4
go: downloading github.com/sirupsen/logrus v1.6.0
go: downloading github.com/aquasecurity/libbpfgo v0.1.2-0.20210708203834-4928d36fafac
go: downloading golang.org/x/sys v0.0.0-20210514084401-e8d321eab015
go: downloading github.com/konsorten/go-windows-terminal-sequences v1.0.3
go mod vendor: pattern trace_probe/trace.o: no matching files found

Note the last error ("no matching files found"). Exit status is 1.

@seankhliao
Copy link
Contributor

@seankhliao seankhliao commented Nov 11, 2021

the file doesn't exist: https://github.com/go-delve/delve/tree/v1.7.2/pkg/proc/internal/ebpf/trace_probe

Note: delve appears to have switched ebpf libraries last week which should resolve the issue? go-delve/delve#2771

Loading

@bcmills
Copy link
Member

@bcmills bcmills commented Nov 12, 2021

We should still have a clearer diagnostic in this case, though: no matching files found doesn't explain why we were trying to match that pattern in the first place.

(I'm guessing maybe it's from a //go:embed directive, but in that case we really ought to display the import stack up to the file containing the unmatched directive.)

Loading

@bcmills
Copy link
Member

@bcmills bcmills commented Nov 12, 2021

Loading

@bcmills bcmills changed the title cmd/go: strange error from 'go mod vendor' for program importing delve pkgs cmd/go: error from 'go mod vendor' missing import stack for unmatched 'go:embed' pattern Nov 12, 2021
@thanm
Copy link
Contributor Author

@thanm thanm commented Nov 12, 2021

OK, that makes more sense now. Especially given that Delve has a top-level makefile ( as opposed to being pure "go build").
Agree that a stack trace or more info would be nice.

Loading

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
3 participants