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/compile: confusing internal error when importing different packages with same name from different paths #25635

Open
griesemer opened this issue May 29, 2018 · 0 comments
Labels
compiler/runtime Issues related to the Go compiler and/or runtime. NeedsFix The path to resolution is known, but the work has not been done.
Milestone

Comments

@griesemer
Copy link
Contributor

griesemer commented May 29, 2018

This is a follow-up on #25568: It is possible to get an internal compiler error when invoking the compiler with plausible but incorrect -I arguments leading to selection of different but identically named packages ("io" in this case). To reproduce:

  1. cd $GOROOT/test
  2. go tool compile fixedbugs/bug345.dir/io.go
  3. go tool compile -I . fixedbugs/bug345.dir/main.go
    =>
fixedbugs/bug345.dir/main.go:10:2: internal compiler error: conflicting package heights 4 and 0 for path "io"

The issue here is an incorrect argument for -I. The following invocation:

go tool compile -I $HOME/test/fixedbugs/bug345.dir fixedbugs/bug345.dir/main.go

works as expected.

The internal error is confusing. We should be able to provide a better error message.

@griesemer griesemer added the NeedsFix The path to resolution is known, but the work has not been done. label May 29, 2018
@griesemer griesemer added this to the Go1.12 milestone May 29, 2018
@odeke-em odeke-em self-assigned this Oct 18, 2018
@griesemer griesemer modified the milestones: Go1.12, Go1.13 Nov 28, 2018
@andybons andybons modified the milestones: Go1.13, Go1.14 Jul 8, 2019
@rsc rsc modified the milestones: Go1.14, Backlog Oct 9, 2019
@gopherbot gopherbot added the compiler/runtime Issues related to the Go compiler and/or runtime. label Jul 13, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
compiler/runtime Issues related to the Go compiler and/or runtime. NeedsFix The path to resolution is known, but the work has not been done.
Projects
Status: Triage Backlog
Development

No branches or pull requests

5 participants