Skip to content
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

add support for GOARCH=wasm (include GOOS=wasip1) #168

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

amadigan
Copy link

@amadigan amadigan commented May 1, 2024

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant