-
Notifications
You must be signed in to change notification settings - Fork 17.9k
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
x/tools/go/loader: when loading >1 initial package in ImportBinary mode, some dependencies are loaded twice #9955
Comments
@alandonovan @griesemer Not sure if this is go/loader or go/types. Seems to be confused and thinks there are (at least) two debug/gosym packages. |
I can reproduce it although I'm not certain what the cause is yet. You almost certainly want this: |
When two or more packages are specified on the command line, and !SourceImports is indicated (i.e. load dependencies from gc export data), and the transitive closure of one initial package A (e.g. cmd/pprof) includes another initial package B (e.g. debug/gosym), then B is created twice: once when loading it from binary to satisfy A, and again from source for B. This isn't going to be a simple fix and the design is already so complex, and this case wasn't even the intended use, that I'm not certain it's worth fixing. We could just restrict to a single import when using !SourceImports. (The only tool I know of that ever wants to load gc export data is llgo, and it doesn't load multiple packages at once.) |
This should be closed now. It was fixed in golang/tools@9c57c19, but the commit message mistakenly said |
Oops, thanks. |
FYI, @alandonovan, if you update to the latest version of git-codereview, it'll fix issue references for you when you save the commit message. |
On 17 April 2015 at 15:46, Josh Bleecher Snyder notifications@github.com
Ah, that explains it. Thanks. |
This is breaking a code cleanup tool I am building.
The text was updated successfully, but these errors were encountered: