-
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/internal/gcimporter: position filename inconsistency for os/signal/internal/pty #44339
Comments
/cc @griesemer as well as per dev.golang.org/owners |
Change-Id: Ifb3f1b03a8e0b58465e088cdda3e0357ce648124 Reviewed-on: https://go-review.googlesource.com/c/tools/+/293249 Trust: Matthew Dempsky <mdempsky@google.com> Reviewed-by: Ian Lance Taylor <iant@golang.org>
Change https://golang.org/cl/293249 mentions this issue: |
I can reproduce the failure on Linux. All you need to do is (from within the x/tools checkout):
|
I think it's go/loader that's being inconsistent here. It uses /tmp/fake-goroot-prefixed paths for all of the declared objects, except for in os/signal/internal/pty. |
The internal path is a red herring. It's actually that os/signal/internal/pty is the only package to have exported declarations in a file that uses import "C". When the file is rewritten by cgo, cgo is invoked from the source directory and uses the actual path in |
That probably points to a |
Change https://golang.org/cl/293250 mentions this issue: |
* txtar: minor fix in unit test input 4b197900 * internal/lsp: 'go get' packages instead of modules 9eb35354 * go/internal/cgo: set pkgdir with -srcdir instead of CWD 67e49ef2 * go/analysis/unitchecker: tell the user how to list the flags and analyzers 19ff21fb * internal/lsp/command: rename package generate to gen d5b83329 * go/internal/gcimporter: reference golang/go#44339 in TODO 4534fc34 * go/internal/gcimporter: fix tests on darwin 35839b70 * go/internal/gcimporter: add "bundled" export data formats a1db63cc * go/internal/gcimporter: fix reexporting compiler data b79f76fe * go/internal/gcimporter: refactor IExportData tests 7fde01ff * go/internal/gcimporter: simplify IExportData API 6055ccf0 * internal/lsp: refactor go command error handling 1e7abacf * internal/lsp: fix nil pointer in hover when (types.Object).Pkg() is nil ffc20750 * internal/lsp: handle nil pointer with import shortcut = link fca89925 * internal/typesinternal: sync error codes with go1.16 5848b84f * go/analysis/passes: add sigchanyzer Analyzer 3a5a0519 * godoc/vfs: add io/fs adapter 123adc86
* txtar: minor fix in unit test input 4b197900 * internal/lsp: 'go get' packages instead of modules 9eb35354 * go/internal/cgo: set pkgdir with -srcdir instead of CWD 67e49ef2 * go/analysis/unitchecker: tell the user how to list the flags and analyzers 19ff21fb * internal/lsp/command: rename package generate to gen d5b83329 * go/internal/gcimporter: reference golang/go#44339 in TODO 4534fc34 * go/internal/gcimporter: fix tests on darwin 35839b70 * go/internal/gcimporter: add "bundled" export data formats a1db63cc * go/internal/gcimporter: fix reexporting compiler data b79f76fe * go/internal/gcimporter: refactor IExportData tests 7fde01ff * go/internal/gcimporter: simplify IExportData API 6055ccf0 * internal/lsp: refactor go command error handling 1e7abacf * internal/lsp: fix nil pointer in hover when (types.Object).Pkg() is nil ffc20750 * internal/lsp: handle nil pointer with import shortcut = link fca89925 * internal/typesinternal: sync error codes with go1.16 5848b84f * go/analysis/passes: add sigchanyzer Analyzer 3a5a0519 * godoc/vfs: add io/fs adapter 123adc86
* internal/lsp/source: filter out comparable from completion results f3748ed8 * go/analysis/passes/buildtag: update check for //go:build f47cb783 * go/loader: fix race 06713c25 * internal/regtest: fix regtests for the dev.typeparams Go branch 1f00549a * txtar: minor fix in unit test input 4b197900 * internal/lsp: 'go get' packages instead of modules 9eb35354 * go/internal/cgo: set pkgdir with -srcdir instead of CWD 67e49ef2 * go/analysis/unitchecker: tell the user how to list the flags and analyzers 19ff21fb * internal/lsp/command: rename package generate to gen d5b83329 * go/internal/gcimporter: reference golang/go#44339 in TODO 4534fc34 * go/internal/gcimporter: fix tests on darwin 35839b70 * go/internal/gcimporter: add "bundled" export data formats a1db63cc * go/internal/gcimporter: fix reexporting compiler data b79f76fe * go/internal/gcimporter: refactor IExportData tests 7fde01ff * go/internal/gcimporter: simplify IExportData API 6055ccf0 * internal/lsp: refactor go command error handling 1e7abacf * internal/lsp: fix nil pointer in hover when (types.Object).Pkg() is nil ffc20750 * internal/lsp: handle nil pointer with import shortcut = link fca89925 * internal/typesinternal: sync error codes with go1.16 5848b84f * go/analysis/passes: add sigchanyzer Analyzer 3a5a0519 * godoc/vfs: add io/fs adapter 123adc86
Also includes some fixes for our CI build to work around golang.org/issue/40067 * internal/lsp/source: filter out comparable from completion results f3748ed8 * go/analysis/passes/buildtag: update check for //go:build f47cb783 * go/loader: fix race 06713c25 * internal/regtest: fix regtests for the dev.typeparams Go branch 1f00549a * txtar: minor fix in unit test input 4b197900 * internal/lsp: 'go get' packages instead of modules 9eb35354 * go/internal/cgo: set pkgdir with -srcdir instead of CWD 67e49ef2 * go/analysis/unitchecker: tell the user how to list the flags and analyzers 19ff21fb * internal/lsp/command: rename package generate to gen d5b83329 * go/internal/gcimporter: reference golang/go#44339 in TODO 4534fc34 * go/internal/gcimporter: fix tests on darwin 35839b70 * go/internal/gcimporter: add "bundled" export data formats a1db63cc * go/internal/gcimporter: fix reexporting compiler data b79f76fe * go/internal/gcimporter: refactor IExportData tests 7fde01ff * go/internal/gcimporter: simplify IExportData API 6055ccf0 * internal/lsp: refactor go command error handling 1e7abacf * internal/lsp: fix nil pointer in hover when (types.Object).Pkg() is nil ffc20750 * internal/lsp: handle nil pointer with import shortcut = link fca89925 * internal/typesinternal: sync error codes with go1.16 5848b84f * go/analysis/passes: add sigchanyzer Analyzer 3a5a0519 * godoc/vfs: add io/fs adapter 123adc86
Also includes some fixes for our CI build to work around golang.org/issue/40067 * internal/lsp/source: filter out comparable from completion results f3748ed8 * go/analysis/passes/buildtag: update check for //go:build f47cb783 * go/loader: fix race 06713c25 * internal/regtest: fix regtests for the dev.typeparams Go branch 1f00549a * txtar: minor fix in unit test input 4b197900 * internal/lsp: 'go get' packages instead of modules 9eb35354 * go/internal/cgo: set pkgdir with -srcdir instead of CWD 67e49ef2 * go/analysis/unitchecker: tell the user how to list the flags and analyzers 19ff21fb * internal/lsp/command: rename package generate to gen d5b83329 * go/internal/gcimporter: reference golang/go#44339 in TODO 4534fc34 * go/internal/gcimporter: fix tests on darwin 35839b70 * go/internal/gcimporter: add "bundled" export data formats a1db63cc * go/internal/gcimporter: fix reexporting compiler data b79f76fe * go/internal/gcimporter: refactor IExportData tests 7fde01ff * go/internal/gcimporter: simplify IExportData API 6055ccf0 * internal/lsp: refactor go command error handling 1e7abacf * internal/lsp: fix nil pointer in hover when (types.Object).Pkg() is nil ffc20750 * internal/lsp: handle nil pointer with import shortcut = link fca89925 * internal/typesinternal: sync error codes with go1.16 5848b84f * go/analysis/passes: add sigchanyzer Analyzer 3a5a0519 * godoc/vfs: add io/fs adapter 123adc86
Also includes some fixes for our CI build to work around golang.org/issue/40067 * internal/lsp/source: filter out comparable from completion results f3748ed8 * go/analysis/passes/buildtag: update check for //go:build f47cb783 * go/loader: fix race 06713c25 * internal/regtest: fix regtests for the dev.typeparams Go branch 1f00549a * txtar: minor fix in unit test input 4b197900 * internal/lsp: 'go get' packages instead of modules 9eb35354 * go/internal/cgo: set pkgdir with -srcdir instead of CWD 67e49ef2 * go/analysis/unitchecker: tell the user how to list the flags and analyzers 19ff21fb * internal/lsp/command: rename package generate to gen d5b83329 * go/internal/gcimporter: reference golang/go#44339 in TODO 4534fc34 * go/internal/gcimporter: fix tests on darwin 35839b70 * go/internal/gcimporter: add "bundled" export data formats a1db63cc * go/internal/gcimporter: fix reexporting compiler data b79f76fe * go/internal/gcimporter: refactor IExportData tests 7fde01ff * go/internal/gcimporter: simplify IExportData API 6055ccf0 * internal/lsp: refactor go command error handling 1e7abacf * internal/lsp: fix nil pointer in hover when (types.Object).Pkg() is nil ffc20750 * internal/lsp: handle nil pointer with import shortcut = link fca89925 * internal/typesinternal: sync error codes with go1.16 5848b84f * go/analysis/passes: add sigchanyzer Analyzer 3a5a0519 * godoc/vfs: add io/fs adapter 123adc86
Change https://golang.org/cl/295049 mentions this issue: |
…h.0.6 0e232fa gopls: add scheme to CodeDescription.href 2363391 all: go fmt ./... b369640 all: fmt tests with new gofmt f6e0443 go/analysis: add unusedwrite pass bdaa8bf go/gcexportdata: warn that {Read,Write}Bundle are experimental f4301d9 internal/imports: update stdlib index for 1.16 f3748ed internal/lsp/source: filter out comparable from completion results f47cb78 go/analysis/passes/buildtag: update check for //go:build 06713c2 go/loader: fix race 1f00549 internal/regtest: fix regtests for the dev.typeparams Go branch 4b19790 txtar: minor fix in unit test input 9eb3535 internal/lsp: 'go get' packages instead of modules 67e49ef go/internal/cgo: set pkgdir with -srcdir instead of CWD 19ff21f go/analysis/unitchecker: tell the user how to list the flags and analyzers d5b8332 internal/lsp/command: rename package generate to gen 4534fc3 go/internal/gcimporter: reference golang/go#44339 in TODO 35839b7 go/internal/gcimporter: fix tests on darwin a1db63c go/internal/gcimporter: add "bundled" export data formats b79f76f go/internal/gcimporter: fix reexporting compiler data 7fde01f go/internal/gcimporter: refactor IExportData tests 6055ccf go/internal/gcimporter: simplify IExportData API 1e7abac internal/lsp: refactor go command error handling ffc2075 internal/lsp: fix nil pointer in hover when (types.Object).Pkg() is nil fca8992 internal/lsp: handle nil pointer with import shortcut = link 5848b84 internal/typesinternal: sync error codes with go1.16 3a5a051 go/analysis/passes: add sigchanyzer Analyzer Change-Id: I1d4a41669e2f8e8115fb5d62cc25a62f7c755ba2
In CL 292351, I added a test to compare cmd/compile's export data output against gcimporter.IExportData. Because cmd/compile generates paths prefixed with "$GOROOT" whereas go/loader generates them with the actual build.Context.GOROOT value, I included code to expand $GOROOT.
However, this turned out to break on the macOS machines, because for package os/signal/internal/pty (and only that package!) go/loader was using "/var/folders/..." but cmd/compile's expanded path became "/private/var/folders/...". The former is a symlink to the latter, so I submitted CL 292910 to workaround this special case.
But the toothrot builder is still unhappy (https://build.golang.org/?repo=golang.org%2fx%2ftools), now because of "/private/tmp" vs "/tmp" (and again, only for os/signal/internal/pty): https://build.golang.org/log/d0edf17481286f622c2764cf38ab1831375ccb94
I don't think the "/private" vs no-"/private" discrepancy is a big deal. They're semantically equivalent paths. But it's bizarre that os/signal/internal/pty is the only package affected by this.
One suspicion: I think os/signal/internal/pty is the only "internal" package that uses cgo?
/cc @findleyr @stamblerre
The text was updated successfully, but these errors were encountered: