termenv compiles where GOOS=js, but fails with GOOS=wasip1 (https://go.dev/blog/wasi). This patch treats wasip1 as js, which for these purposes should be correct.
I was able to run the tests on wasip1 by installing wazero and setting WASMRUNTIME=wazero. The tests failed, when I first ran them, but it looks like the tests make assumptions that would fail for all of the _other targets. This patch also "fixes" the tests (it skips one I wasn't sure how to rewrite for this platform).
A project I'm working on imports this library as a transitive dependency, without this termenv does not build on GOOS=wasip1.
I decided to target wasm rather than js and wasip1 because more GOOS values will probably be added for wasm in the future, but it seems unlikely that wasm will end up running full operating systems tag like 'unix' would apply to.
termenv compiles where
GOOS=js
, but fails withGOOS=wasip1
(https://go.dev/blog/wasi). This patch treats wasip1 as js, which for these purposes should be correct.I was able to run the tests on wasip1 by installing wazero and setting
WASMRUNTIME=wazero
. The tests failed, when I first ran them, but it looks like the tests make assumptions that would fail for all of the_other
targets. This patch also "fixes" the tests (it skips one I wasn't sure how to rewrite for this platform).A project I'm working on imports this library as a transitive dependency, without this termenv does not build on GOOS=wasip1.
I decided to target wasm rather than js and wasip1 because more GOOS values will probably be added for wasm in the future, but it seems unlikely that wasm will end up running full operating systems tag like 'unix' would apply to.