evanw / esbuild

An extremely fast bundler for the web
https://esbuild.github.io/
MIT License
38.25k stars 1.16k forks source link

OpenBSD arm64 support #3665

Closed ikmckenz closed 5 months ago

ikmckenz commented 9 months ago

I'd love an arm64 version for OpenBSD, looks like there is an arm64 version for FreeBSD so hopefully the effort is minimal?

evanw commented 9 months ago

Can you verify that esbuild builds and runs on that configuration? For example: installing Go, downloading this repo, and running go test ./internal/... to verify that basic tests pass?

ikmckenz commented 9 months ago

Looks good to me! It builds and the tests seem to pass. Full output of the Go tests:

openbsd-dev$ go test ./internal/...
?       github.com/evanw/esbuild/internal/api_helpers   [no test files]
?       github.com/evanw/esbuild/internal/ast   [no test files]
?       github.com/evanw/esbuild/internal/bundler   [no test files]
?       github.com/evanw/esbuild/internal/cache [no test files]
?       github.com/evanw/esbuild/internal/cli_helpers   [no test files]
?       github.com/evanw/esbuild/internal/config    [no test files]
?       github.com/evanw/esbuild/internal/css_ast   [no test files]
ok      github.com/evanw/esbuild/internal/bundler_tests 11.750s
ok      github.com/evanw/esbuild/internal/compat    0.075s
ok      github.com/evanw/esbuild/internal/css_lexer 0.080s
ok      github.com/evanw/esbuild/internal/css_parser    0.638s
ok      github.com/evanw/esbuild/internal/css_printer   0.156s
?       github.com/evanw/esbuild/internal/graph [no test files]
ok      github.com/evanw/esbuild/internal/fs    0.088s
ok      github.com/evanw/esbuild/internal/helpers   0.288s
ok      github.com/evanw/esbuild/internal/js_ast    0.080s
ok      github.com/evanw/esbuild/internal/js_lexer  0.201s
?       github.com/evanw/esbuild/internal/linker    [no test files]
?       github.com/evanw/esbuild/internal/renamer   [no test files]
ok      github.com/evanw/esbuild/internal/js_parser 6.315s
ok      github.com/evanw/esbuild/internal/js_printer    0.769s
ok      github.com/evanw/esbuild/internal/logger    0.075s
?       github.com/evanw/esbuild/internal/runtime   [no test files]
?       github.com/evanw/esbuild/internal/sourcemap [no test files]
?       github.com/evanw/esbuild/internal/test  [no test files]
?       github.com/evanw/esbuild/internal/xxhash    [no test files]
ok      github.com/evanw/esbuild/internal/resolver  0.072s

And this is on OpenBSD on an Arm MacBook:

openbsd-dev$ uname -a
OpenBSD openbsd-dev.my.domain 7.4 GENERIC.MP#2273 arm64
evanw commented 9 months ago

That's great, thanks!

ikmckenz commented 9 months ago

Currently testing the cross build in this branch: https://github.com/ikmckenz/esbuild/tree/openbsd-arm64, but ran into a weird issue with Go. I think there may be an issue with go cross building to OpenBSD arm64, as even hello world fails to run correctly. Issue filed with Go here: https://github.com/golang/go/issues/66040

ikmckenz commented 9 months ago

Issue was the Go cross compiler not working correctly for OpenBSD on the latest (M2+) apple silicon chips, but when tested against an M1 it was always working without issue. The M2+ issue has also been resolved upstream in go. To that end I've opened a pull request for my branch here: #3674

ikmckenz commented 6 months ago

Hey @evanw , is there anything else I can do to support this?

ikmckenz commented 5 months ago

Thank you! :)