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

log/term: fix build on GOOS=js GOARCH=wasm #993

Merged
merged 1 commit into from
Jul 10, 2020
Merged

log/term: fix build on GOOS=js GOARCH=wasm #993

merged 1 commit into from
Jul 10, 2020

Conversation

mvdan
Copy link
Contributor

@mvdan mvdan commented Jul 9, 2020

Before this fix, the build would fail, as IsTerminal isn't defined on
that platform:

$ GOOS=js GOARCH=wasm go build
# github.com/go-kit/kit/log/term
./term.go:14:6: undefined: IsTerminal

The reason is pretty simple; js/wasm doesn't have syscalls, and thus it
doesn't have an "is a terminal" syscall.

Grouping it with appengine to always assume that the output is not a
terminal is good enough for now, as it at least makes the package build.

No change is needed in any other file, because none of the other
IsTerminal +build lines include js/wasm in any way.

Before this fix, the build would fail, as IsTerminal isn't defined on
that platform:

	$ GOOS=js GOARCH=wasm go build
	# github.com/go-kit/kit/log/term
	./term.go:14:6: undefined: IsTerminal

The reason is pretty simple; js/wasm doesn't have syscalls, and thus it
doesn't have an "is a terminal" syscall.

Grouping it with appengine to always assume that the output is not a
terminal is good enough for now, as it at least makes the package build.

No change is needed in any other file, because none of the other
IsTerminal +build lines include js/wasm in any way.
@mvdan
Copy link
Contributor Author

mvdan commented Jul 9, 2020

I realise that go-kit probably doesn't support js/wasm explicitly right now, but I have a dependency that indirectly ends up depending on your log packages, for better or worse. And there really isn't a reason why a log package should require an "is a terminal" syscall to work.

@peterbourgon
Copy link
Member

Fine by me!

@peterbourgon peterbourgon merged commit 02c7c01 into go-kit:master Jul 10, 2020
@sagikazarmark sagikazarmark added this to the v0.11.0 milestone Jun 19, 2021
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.

3 participants