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

importcfg parser does not support "importmap" directives #17

Closed
mvdan opened this issue Nov 8, 2020 · 0 comments
Closed

importcfg parser does not support "importmap" directives #17

mvdan opened this issue Nov 8, 2020 · 0 comments

Comments

@mvdan
Copy link
Contributor

mvdan commented Nov 8, 2020

For example:

# import config
importmap golang.org/x/net/dns/dnsmessage=vendor/golang.org/x/net/dns/dnsmessage
packagefile context=$WORK/tmp/go-build068570326/b003/_pkg_.a
packagefile errors=$WORK/tmp/go-build068570326/b004/_pkg_.a
packagefile vendor/golang.org/x/net/dns/dnsmessage=$WORK/tmp/go-build068570326/b020/_pkg_.a
packagefile internal/bytealg=$WORK/tmp/go-build068570326/b009/_pkg_.a
packagefile internal/nettrace=$WORK/tmp/go-build068570326/b021/_pkg_.a
packagefile internal/poll=$WORK/tmp/go-build068570326/b022/_pkg_.a
packagefile internal/singleflight=$WORK/tmp/go-build068570326/b025/_pkg_.a
packagefile io=$WORK/tmp/go-build068570326/b024/_pkg_.a
packagefile math/rand=$WORK/tmp/go-build068570326/b026/_pkg_.a
packagefile os=$WORK/tmp/go-build068570326/b029/_pkg_.a
packagefile runtime=$WORK/tmp/go-build068570326/b008/_pkg_.a
packagefile sort=$WORK/tmp/go-build068570326/b032/_pkg_.a
packagefile sync=$WORK/tmp/go-build068570326/b014/_pkg_.a
packagefile sync/atomic=$WORK/tmp/go-build068570326/b016/_pkg_.a
packagefile syscall=$WORK/tmp/go-build068570326/b018/_pkg_.a
packagefile time=$WORK/tmp/go-build068570326/b017/_pkg_.a
packagefile runtime/cgo=$WORK/tmp/go-build068570326/b033/_pkg_.a

This is akin to the ImportMap field of go list -json. It essentially tells you that the package in question imports golang.org/x/net/dns/dnsmessage, but the actual package being imported there is vendor/golang.org/x/net/dns/dnsmessage, so you should look for packagefile vendor/golang.org/x/net/dns/dnsmessage=....

This happens in burrowers/garble#146, for example.

capnspacehook added a commit that referenced this issue Nov 8, 2020
Also change Parse to take in a function instead of a map to give the caller additional flexibility.

Fixes #13 and #17.
lu4p pushed a commit to burrowers/garble that referenced this issue Nov 8, 2020
We also update the "original types importer" to support ImportMap.

The test now gets further along, no longer getting stuck on "path not
found in listed packages". Instead, we get stuck on:

	error parsing importcfg: <...>/importcfg:2: unknown directive "importmap"

This bug has been filed at Binject/debug#17.
Until it's fixed, we can't really proceed on #146, so the net import in
the test file (which triggers this case) is commented out for now.

Updates #146.
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