From 723647263fcd0e4095e25a569e1d0a38f382768a Mon Sep 17 00:00:00 2001 From: Evan Wallace Date: Thu, 19 Dec 2024 19:08:03 -0500 Subject: [PATCH] close #3974: add support for netbsd on arm64 --- CHANGELOG.md | 6 ++++++ Makefile | 23 ++++++++++++++++++----- lib/npm/node-platform.ts | 1 + npm/@esbuild/netbsd-arm64/README.md | 5 +++++ npm/@esbuild/netbsd-arm64/package.json | 20 ++++++++++++++++++++ 5 files changed, 50 insertions(+), 5 deletions(-) create mode 100644 npm/@esbuild/netbsd-arm64/README.md create mode 100644 npm/@esbuild/netbsd-arm64/package.json diff --git a/CHANGELOG.md b/CHANGELOG.md index 81474fbf1bc..5d1e527dd89 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -64,6 +64,12 @@ This can sometimes expose additional minification opportunities. +* Experimental support for esbuild on NetBSD ([#3974](https://github.com/evanw/esbuild/pull/3974)) + + With this release, esbuild now has a published binary executable for [NetBSD](https://www.netbsd.org/) in the [`@esbuild/netbsd-arm64`](https://www.npmjs.com/package/@esbuild/netbsd-arm64) npm package, and esbuild's installer has been modified to attempt to use it when on NetBSD. Hopefully this makes installing esbuild via npm work on NetBSD. This change was contributed by [@bsiegert](https://github.com/bsiegert). + + ⚠️ Note: NetBSD is not one of [Node's supported platforms](https://nodejs.org/api/process.html#process_process_platform), so installing esbuild may or may not work on NetBSD depending on how Node has been patched. This is not a problem with esbuild. ⚠️ + ## 0.24.0 **_This release deliberately contains backwards-incompatible changes._** To avoid automatically picking up releases like this, you should either be pinning the exact version of `esbuild` in your `package.json` file (recommended) or be using a version range syntax that only accepts patch upgrades such as `^0.23.0` or `~0.23.0`. See npm's documentation about [semver](https://docs.npmjs.com/cli/v6/using-npm/semver/) for more information. diff --git a/Makefile b/Makefile index f2f8d212a58..967e1d4bb83 100644 --- a/Makefile +++ b/Makefile @@ -303,6 +303,7 @@ platform-all: platform-linux-riscv64 \ platform-linux-s390x \ platform-linux-x64 \ + platform-netbsd-arm64 \ platform-netbsd-x64 \ platform-neutral \ platform-openbsd-arm64 \ @@ -361,6 +362,9 @@ platform-freebsd-x64: platform-freebsd-arm64: @$(MAKE) --no-print-directory GOOS=freebsd GOARCH=arm64 NPMDIR=npm/@esbuild/freebsd-arm64 platform-unixlike +platform-netbsd-arm64: + @$(MAKE) --no-print-directory GOOS=netbsd GOARCH=amd64 NPMDIR=npm/@esbuild/netbsd-arm64 platform-unixlike + platform-netbsd-x64: @$(MAKE) --no-print-directory GOOS=netbsd GOARCH=amd64 NPMDIR=npm/@esbuild/netbsd-x64 platform-unixlike @@ -442,22 +446,26 @@ publish-all: check-go-version @echo Enter one-time password: @read OTP && OTP="$$OTP" $(MAKE) --no-print-directory -j4 \ - publish-freebsd-x64 \ publish-freebsd-arm64 \ + publish-freebsd-x64 \ publish-openbsd-arm64 \ - publish-openbsd-x64 \ + publish-openbsd-x64 + + @echo Enter one-time password: + @read OTP && OTP="$$OTP" $(MAKE) --no-print-directory -j4 \ + publish-darwin-arm64 \ + publish-darwin-x64 \ + publish-netbsd-arm64 \ publish-netbsd-x64 @echo Enter one-time password: @read OTP && OTP="$$OTP" $(MAKE) --no-print-directory -j4 \ publish-android-x64 \ publish-android-arm \ - publish-android-arm64 \ - publish-darwin-x64 + publish-android-arm64 @echo Enter one-time password: @read OTP && OTP="$$OTP" $(MAKE) --no-print-directory -j4 \ - publish-darwin-arm64 \ publish-linux-x64 \ publish-linux-ia32 \ publish-linux-arm @@ -522,6 +530,9 @@ publish-freebsd-x64: platform-freebsd-x64 publish-freebsd-arm64: platform-freebsd-arm64 test -n "$(OTP)" && cd npm/@esbuild/freebsd-arm64 && npm publish --otp="$(OTP)" +publish-netbsd-arm64: platform-netbsd-arm64 + test -n "$(OTP)" && cd npm/@esbuild/netbsd-arm64 && npm publish --otp="$(OTP)" + publish-netbsd-x64: platform-netbsd-x64 test -n "$(OTP)" && cd npm/@esbuild/netbsd-x64 && npm publish --otp="$(OTP)" @@ -619,6 +630,7 @@ validate-builds: @$(MAKE) --no-print-directory TARGET=platform-linux-riscv64 SCOPE=@esbuild/ PACKAGE=linux-riscv64 SUBPATH=bin/esbuild validate-build @$(MAKE) --no-print-directory TARGET=platform-linux-s390x SCOPE=@esbuild/ PACKAGE=linux-s390x SUBPATH=bin/esbuild validate-build @$(MAKE) --no-print-directory TARGET=platform-linux-x64 SCOPE=@esbuild/ PACKAGE=linux-x64 SUBPATH=bin/esbuild validate-build + @$(MAKE) --no-print-directory TARGET=platform-netbsd-arm64 SCOPE=@esbuild/ PACKAGE=netbsd-arm64 SUBPATH=bin/esbuild validate-build @$(MAKE) --no-print-directory TARGET=platform-netbsd-x64 SCOPE=@esbuild/ PACKAGE=netbsd-x64 SUBPATH=bin/esbuild validate-build @$(MAKE) --no-print-directory TARGET=platform-openbsd-arm64 SCOPE=@esbuild/ PACKAGE=openbsd-arm64 SUBPATH=bin/esbuild validate-build @$(MAKE) --no-print-directory TARGET=platform-openbsd-x64 SCOPE=@esbuild/ PACKAGE=openbsd-x64 SUBPATH=bin/esbuild validate-build @@ -655,6 +667,7 @@ clean: rm -rf npm/@esbuild/linux-riscv64/bin rm -rf npm/@esbuild/linux-s390x/bin rm -rf npm/@esbuild/linux-x64/bin + rm -rf npm/@esbuild/netbsd-arm64/bin rm -rf npm/@esbuild/netbsd-x64/bin rm -rf npm/@esbuild/openbsd-arm64/bin rm -rf npm/@esbuild/openbsd-x64/bin diff --git a/lib/npm/node-platform.ts b/lib/npm/node-platform.ts index bda3b0948cc..559c5409712 100644 --- a/lib/npm/node-platform.ts +++ b/lib/npm/node-platform.ts @@ -41,6 +41,7 @@ export const knownUnixlikePackages: Record = { 'linux s390x BE': '@esbuild/linux-s390x', 'linux x64 LE': '@esbuild/linux-x64', 'linux loong64 LE': '@esbuild/linux-loong64', + 'netbsd arm64 LE': '@esbuild/netbsd-arm64', 'netbsd x64 LE': '@esbuild/netbsd-x64', 'openbsd arm64 LE': '@esbuild/openbsd-arm64', 'openbsd x64 LE': '@esbuild/openbsd-x64', diff --git a/npm/@esbuild/netbsd-arm64/README.md b/npm/@esbuild/netbsd-arm64/README.md new file mode 100644 index 00000000000..ddbd635a15c --- /dev/null +++ b/npm/@esbuild/netbsd-arm64/README.md @@ -0,0 +1,5 @@ +# esbuild + +This is the NetBSD ARM 64-bit binary for esbuild, a JavaScript bundler and minifier. See https://github.com/evanw/esbuild for details. + +⚠️ Note: NetBSD is not one of [Node's supported platforms](https://nodejs.org/api/process.html#process_process_platform), so installing esbuild may or may not work on NetBSD depending on how Node has been patched. This is not a problem with esbuild. ⚠️ diff --git a/npm/@esbuild/netbsd-arm64/package.json b/npm/@esbuild/netbsd-arm64/package.json new file mode 100644 index 00000000000..6bc06dab67e --- /dev/null +++ b/npm/@esbuild/netbsd-arm64/package.json @@ -0,0 +1,20 @@ +{ + "name": "@esbuild/netbsd-arm64", + "version": "0.24.0", + "description": "The NetBSD ARM 64-bit binary for esbuild, a JavaScript bundler.", + "repository": { + "type": "git", + "url": "git+https://github.com/evanw/esbuild.git" + }, + "license": "MIT", + "preferUnplugged": true, + "engines": { + "node": ">=18" + }, + "os": [ + "netbsd" + ], + "cpu": [ + "arm64" + ] +}