Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
build: Try to get and use working directory, when possible.
Previously, in build.Import, the srcDir argument to importWithSrcDir call was always empty string. Ideally, the Import method should have a srcDir parameter and pass it onwards. Then the caller (gopherjs tool, for example) can provide the working directory, if available. However, this is an exported method and changing its signature at this time is hard. Settle for an intermediate solution of try to figure out working directory inside Import, but continue to use empty string on failure (such as if in GOARCH=js mode, e.g., inside browser). This will be used by the gopherjs tool in the next commit to be able to resolve relative import paths, such as "." or "./foo/bar". The future plan is to bring all the "supported" code into gopherjs repo for convenience, mark the build API as unstable and make breaking API changes to bring it up to speed. Helps #302.
- Loading branch information