Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
build: almost complete module support (#33)
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
- Loading branch information