Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
build: Don't use cgo for "os/user", "crypto/x509".
This changes fixes GopherJS ability to build os/user package. In turn, this change also fixes crypto/x509 and net/http on darwin. The goal is to ensure that os/user builds without errors, because it may end up being imported by some stdlib packages (e.g., crypto/x509 on darwin in Go 1.9). This is accomplished by disabling cgo for these standard library packages. Normally, GopherJS build context enables cgo for the purpose of catching when a user package uses cgo and reporting that: CgoEnabled: true, // detect `import "C"` to throw proper error ... if len(pkg.CgoFiles) > 0 { return nil, &ImportCError{path} } But we don't want to use cgo for standard library packages. They have support for building without cgo by using !cgo build constraints, which we want to activate. Setting bctxt.CgoEnabled to false achieves that. Add to CI a test of os/user package for gopherjs, as well as ensure net/http builds successfully. We can't run its tests because there are too many and they require the HTTP server, but only client is implemented in GopherJS. Fixes #664.
- Loading branch information