-
Notifications
You must be signed in to change notification settings - Fork 0
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
package in GOPATH shadows module #27
Comments
Thanks very much for the repro @antong. Here is a copy-paste repro script for reference:
gives:
I suspect this is somewhat related to #24... but in a strange way. I'll investigate. Thanks again |
Per discussions with @marwan-at-work, a temporary fix for this (and @antong points this out above) is to set your |
e.g.
|
build: fix GOPATH shadow bug Fixes #27
build: fix GOPATH shadow bug Fixes #27
build: fix GOPATH shadow bug Fixes #27
build: fix GOPATH shadow bug Fixes #27
build: fix GOPATH shadow bug Fixes #27
build: fix GOPATH shadow bug Fixes #27
This is a necessarily large PR to offer almost complete Go modules support for GopherJS. * We now use github.com/rogpeppe/go-internal to be able to write testscript tests * A suite of testscript tests have been added to cover the major GopherJS commands operating in both GOPATH mode and module mode. Includes a test to ensure that the bug raised in #27 is now properly fixed. * The GopherJS tool and build packages have been heavily refactored in places to support Go modules. GopherJS support for Go modules follows the same patterns as the go tool. * We fix the build cache to be a function of the augmented packages as opposed (incorrectly) to the unaugmented package files. This has a slight cost because of the way the augmentation code is currently written (this could be refactored in a later PR) because every file is unconditionally parsed. Main and test packages are not cached (again, we could change this in a later PR). Because it would just work. * We fix the tests/run.go wrapper around the fixedbugs tests in the Go distribution to not perform a chdir into GOROOT; this does not work with modules. * We tidy up .circleci/config.yml to split commands into their separate run sections where it makes sense to. * We add genmodstubbs.go to automatically populate the stubs we need in testdata/mod for the loading of github.com/gopherjs/gopherjs/{js,nosync}. * For a more current commentary on the Go module support in GopherJS see https://github.com/myitcv/gopherjs/wiki/Changes-in-module-aware-GopherJS Fixes #27
This is a necessarily large PR to offer almost complete Go modules support for GopherJS. * We now use github.com/rogpeppe/go-internal to be able to write testscript tests * A suite of testscript tests have been added to cover the major GopherJS commands operating in both GOPATH mode and module mode. Includes a test to ensure that the bug raised in #27 is now properly fixed. * The GopherJS tool and build packages have been heavily refactored in places to support Go modules. GopherJS support for Go modules follows the same patterns as the go tool. * We fix the build cache to be a function of the augmented packages as opposed (incorrectly) to the unaugmented package files. This has a slight cost because of the way the augmentation code is currently written (this could be refactored in a later PR) because every file is unconditionally parsed. Main and test packages are not cached (again, we could change this in a later PR). Because it would just work. * We fix the tests/run.go wrapper around the fixedbugs tests in the Go distribution to not perform a chdir into GOROOT; this does not work with modules. * We tidy up .circleci/config.yml to split commands into their separate run sections where it makes sense to. * We add genmodstubbs.go to automatically populate the stubs we need in testdata/mod for the loading of github.com/gopherjs/gopherjs/{js,nosync}. * For a more current commentary on the Go module support in GopherJS see https://github.com/myitcv/gopherjs/wiki/Changes-in-module-aware-GopherJS Fixes #27
This is a necessarily large PR to offer almost complete Go modules support for GopherJS. * We now use github.com/rogpeppe/go-internal to be able to write testscript tests * A suite of testscript tests have been added to cover the major GopherJS commands operating in both GOPATH mode and module mode. Includes a test to ensure that the bug raised in #27 is now properly fixed. * The GopherJS tool and build packages have been heavily refactored in places to support Go modules. GopherJS support for Go modules follows the same patterns as the go tool. * We fix the build cache to be a function of the augmented packages as opposed (incorrectly) to the unaugmented package files. This has a slight cost because of the way the augmentation code is currently written (this could be refactored in a later PR) because every file is unconditionally parsed. Main and test packages are not cached (again, we could change this in a later PR). Because it would just work. * We fix the tests/run.go wrapper around the fixedbugs tests in the Go distribution to not perform a chdir into GOROOT; this does not work with modules. * We tidy up .circleci/config.yml to split commands into their separate run sections where it makes sense to. * We add genmodstubbs.go to automatically populate the stubs we need in testdata/mod for the loading of github.com/gopherjs/gopherjs/{js,nosync}. * For a more current commentary on the Go module support in GopherJS see https://github.com/myitcv/gopherjs/wiki/Changes-in-module-aware-GopherJS Fixes #27
This is a necessarily large PR to offer almost complete Go modules support for GopherJS. * We now use github.com/rogpeppe/go-internal to be able to write testscript tests * A suite of testscript tests have been added to cover the major GopherJS commands operating in both GOPATH mode and module mode. Includes a test to ensure that the bug raised in #27 is now properly fixed. * The GopherJS tool and build packages have been heavily refactored in places to support Go modules. GopherJS support for Go modules follows the same patterns as the go tool. * We fix the build cache to be a function of the augmented packages as opposed (incorrectly) to the unaugmented package files. This has a slight cost because of the way the augmentation code is currently written (this could be refactored in a later PR) because every file is unconditionally parsed. Main and test packages are not cached (again, we could change this in a later PR). Because it would just work. * We fix the tests/run.go wrapper around the fixedbugs tests in the Go distribution to not perform a chdir into GOROOT; this does not work with modules. * We tidy up .circleci/config.yml to split commands into their separate run sections where it makes sense to. * We add genmodstubbs.go to automatically populate the stubs we need in testdata/mod for the loading of github.com/gopherjs/gopherjs/{js,nosync}. * For a more current commentary on the Go module support in GopherJS see https://github.com/myitcv/gopherjs/wiki/Changes-in-module-aware-GopherJS Fixes #24 Fixes #27
This is a necessarily large PR to offer almost complete Go modules support for GopherJS. * We now use github.com/rogpeppe/go-internal to be able to write testscript tests * A suite of testscript tests have been added to cover the major GopherJS commands operating in both GOPATH mode and module mode. Includes a test to ensure that the bug raised in #27 is now properly fixed. * The GopherJS tool and build packages have been heavily refactored in places to support Go modules. GopherJS support for Go modules follows the same patterns as the go tool. * We fix the build cache to be a function of the augmented packages as opposed (incorrectly) to the unaugmented package files. This has a slight cost because of the way the augmentation code is currently written (this could be refactored in a later PR) because every file is unconditionally parsed. Main and test packages are not cached (again, we could change this in a later PR). Because it would just work. * We fix the tests/run.go wrapper around the fixedbugs tests in the Go distribution to not perform a chdir into GOROOT; this does not work with modules. * We tidy up .circleci/config.yml to split commands into their separate run sections where it makes sense to. * We add genmodstubbs.go to automatically populate the stubs we need in testdata/mod for the loading of github.com/gopherjs/gopherjs/{js,nosync}. * For a more current commentary on the Go module support in GopherJS see https://github.com/myitcv/gopherjs/wiki/Changes-in-module-aware-GopherJS Fixes #24 Fixes #27
On the go1.11 branch, packages within the module are shadowed by packages happening to be in GOPATH as well. This does not happen for regular Go, only GopherJS.
Consider the following layout, with GOPATH set to "/.../topdir/gopath".
With Go:
With gopherjs on branch go1.11 I get "Hello from GOPATH!". If I remove the version checked out in GOPATH, I get the expected "Hello from module foo!".
The text was updated successfully, but these errors were encountered: