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

internal/fs: fails to build on Plan 9 #3289

Closed
dmitshur opened this issue Aug 5, 2023 · 2 comments
Closed

internal/fs: fails to build on Plan 9 #3289

dmitshur opened this issue Aug 5, 2023 · 2 comments

Comments

@dmitshur
Copy link

dmitshur commented Aug 5, 2023

Hello,

I happened to notice that the github.com/evanw/esbuild/internal/fs package has a compilation error when targeting the Plan 9 operating system, which has three Go ports:

$ go tool dist list | grep plan9        
plan9/386
plan9/amd64
plan9/arm

The build error can be reproduced on another platform via cross-compilation, for example:

$ GOOS=plan9 GOARCH=amd64 go build ./...
# github.com/evanw/esbuild/internal/fs
internal/fs/fs_real.go:384:35: undefined: syscall.Errno
$ echo $?
1

syscall documentation says:

On most systems, that error has type syscall.Errno.

But isn't the case on Plan 9.

I don't use Plan 9 myself, but I noticed this when checking that another project at minimum compiles on all Go ports, and that project has esbuild as a dependency. That project doesn't necessarily need to work on Plan 9 and can add "!plan9" build constraints to indicate that, so this isn't causing a serious problem for it.

I'm reporting it here in case you find this information useful. Thanks.

@dmitshur
Copy link
Author

dmitshur commented Aug 5, 2023

I can think of at least 3 general approaches that can be used. Perhaps there are even better ones.

If supporting Plan 9 is completely out of scope of esbuild, you can leave the build error in the ./internal/fs package on Plan 9 as is and close this issue as not planned, that is completely reasonable.

Or you can use build constraints to fix at least the build errors and make ./internal/fs compile. Of course, it might not be very useful to fix a build error without testing that it actually works, so it should probably return a "not implemented" error unless you're interested and willing to implement and support a Plan 9-specific implementation. (See a diff illustrating this direction. Happy to send it as a PR if you like.)

Another approach might be to add a !plan9 build constraint to ./cmd/esbuild and all other packages that aren't supported on that OS. That would essentially "hide" the packages when using GOOS=plan9, to clearly indicate they cannot be used on said OS. A downside is that many .go files would need build constraints. (See a diff illustrating this direction.)

@evanw evanw closed this as completed in f752b5f Aug 6, 2023
@dmitshur
Copy link
Author

dmitshur commented Aug 6, 2023

Thanks!

gopherbot pushed a commit to golang/website that referenced this issue Aug 7, 2023
Current esbuild version fails to build on Plan 9.
Pull in a newer version where that's been fixed.

Updates evanw/esbuild#3289.
For golang/go#61698.

Change-Id: Ie12bf81df57d22306857b6f51bb426cfa2a47cec
Cq-Include-Trybots: luci.golang.try:x_website-gotip-linux-amd64-misccompile
Reviewed-on: https://go-review.googlesource.com/c/website/+/516256
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Auto-Submit: Dmitri Shuralyov <dmitshur@golang.org>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Run-TryBot: Dmitri Shuralyov <dmitshur@golang.org>
Reviewed-by: Heschi Kreinick <heschi@google.com>
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

No branches or pull requests

1 participant