Skip to content

Commit 7236472

Browse files
committed
close #3974: add support for netbsd on arm64
1 parent 3ae3525 commit 7236472

File tree

5 files changed

+50
-5
lines changed

5 files changed

+50
-5
lines changed

CHANGELOG.md

+6
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,12 @@
6464

6565
This can sometimes expose additional minification opportunities.
6666

67+
* Experimental support for esbuild on NetBSD ([#3974](https://github.com/evanw/esbuild/pull/3974))
68+
69+
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).
70+
71+
⚠️ 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. ⚠️
72+
6773
## 0.24.0
6874

6975
**_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.

Makefile

+18-5
Original file line numberDiff line numberDiff line change
@@ -303,6 +303,7 @@ platform-all:
303303
platform-linux-riscv64 \
304304
platform-linux-s390x \
305305
platform-linux-x64 \
306+
platform-netbsd-arm64 \
306307
platform-netbsd-x64 \
307308
platform-neutral \
308309
platform-openbsd-arm64 \
@@ -361,6 +362,9 @@ platform-freebsd-x64:
361362
platform-freebsd-arm64:
362363
@$(MAKE) --no-print-directory GOOS=freebsd GOARCH=arm64 NPMDIR=npm/@esbuild/freebsd-arm64 platform-unixlike
363364

365+
platform-netbsd-arm64:
366+
@$(MAKE) --no-print-directory GOOS=netbsd GOARCH=amd64 NPMDIR=npm/@esbuild/netbsd-arm64 platform-unixlike
367+
364368
platform-netbsd-x64:
365369
@$(MAKE) --no-print-directory GOOS=netbsd GOARCH=amd64 NPMDIR=npm/@esbuild/netbsd-x64 platform-unixlike
366370

@@ -442,22 +446,26 @@ publish-all: check-go-version
442446

443447
@echo Enter one-time password:
444448
@read OTP && OTP="$$OTP" $(MAKE) --no-print-directory -j4 \
445-
publish-freebsd-x64 \
446449
publish-freebsd-arm64 \
450+
publish-freebsd-x64 \
447451
publish-openbsd-arm64 \
448-
publish-openbsd-x64 \
452+
publish-openbsd-x64
453+
454+
@echo Enter one-time password:
455+
@read OTP && OTP="$$OTP" $(MAKE) --no-print-directory -j4 \
456+
publish-darwin-arm64 \
457+
publish-darwin-x64 \
458+
publish-netbsd-arm64 \
449459
publish-netbsd-x64
450460

451461
@echo Enter one-time password:
452462
@read OTP && OTP="$$OTP" $(MAKE) --no-print-directory -j4 \
453463
publish-android-x64 \
454464
publish-android-arm \
455-
publish-android-arm64 \
456-
publish-darwin-x64
465+
publish-android-arm64
457466

458467
@echo Enter one-time password:
459468
@read OTP && OTP="$$OTP" $(MAKE) --no-print-directory -j4 \
460-
publish-darwin-arm64 \
461469
publish-linux-x64 \
462470
publish-linux-ia32 \
463471
publish-linux-arm
@@ -522,6 +530,9 @@ publish-freebsd-x64: platform-freebsd-x64
522530
publish-freebsd-arm64: platform-freebsd-arm64
523531
test -n "$(OTP)" && cd npm/@esbuild/freebsd-arm64 && npm publish --otp="$(OTP)"
524532

533+
publish-netbsd-arm64: platform-netbsd-arm64
534+
test -n "$(OTP)" && cd npm/@esbuild/netbsd-arm64 && npm publish --otp="$(OTP)"
535+
525536
publish-netbsd-x64: platform-netbsd-x64
526537
test -n "$(OTP)" && cd npm/@esbuild/netbsd-x64 && npm publish --otp="$(OTP)"
527538

@@ -619,6 +630,7 @@ validate-builds:
619630
@$(MAKE) --no-print-directory TARGET=platform-linux-riscv64 SCOPE=@esbuild/ PACKAGE=linux-riscv64 SUBPATH=bin/esbuild validate-build
620631
@$(MAKE) --no-print-directory TARGET=platform-linux-s390x SCOPE=@esbuild/ PACKAGE=linux-s390x SUBPATH=bin/esbuild validate-build
621632
@$(MAKE) --no-print-directory TARGET=platform-linux-x64 SCOPE=@esbuild/ PACKAGE=linux-x64 SUBPATH=bin/esbuild validate-build
633+
@$(MAKE) --no-print-directory TARGET=platform-netbsd-arm64 SCOPE=@esbuild/ PACKAGE=netbsd-arm64 SUBPATH=bin/esbuild validate-build
622634
@$(MAKE) --no-print-directory TARGET=platform-netbsd-x64 SCOPE=@esbuild/ PACKAGE=netbsd-x64 SUBPATH=bin/esbuild validate-build
623635
@$(MAKE) --no-print-directory TARGET=platform-openbsd-arm64 SCOPE=@esbuild/ PACKAGE=openbsd-arm64 SUBPATH=bin/esbuild validate-build
624636
@$(MAKE) --no-print-directory TARGET=platform-openbsd-x64 SCOPE=@esbuild/ PACKAGE=openbsd-x64 SUBPATH=bin/esbuild validate-build
@@ -655,6 +667,7 @@ clean:
655667
rm -rf npm/@esbuild/linux-riscv64/bin
656668
rm -rf npm/@esbuild/linux-s390x/bin
657669
rm -rf npm/@esbuild/linux-x64/bin
670+
rm -rf npm/@esbuild/netbsd-arm64/bin
658671
rm -rf npm/@esbuild/netbsd-x64/bin
659672
rm -rf npm/@esbuild/openbsd-arm64/bin
660673
rm -rf npm/@esbuild/openbsd-x64/bin

lib/npm/node-platform.ts

+1
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ export const knownUnixlikePackages: Record<string, string> = {
4141
'linux s390x BE': '@esbuild/linux-s390x',
4242
'linux x64 LE': '@esbuild/linux-x64',
4343
'linux loong64 LE': '@esbuild/linux-loong64',
44+
'netbsd arm64 LE': '@esbuild/netbsd-arm64',
4445
'netbsd x64 LE': '@esbuild/netbsd-x64',
4546
'openbsd arm64 LE': '@esbuild/openbsd-arm64',
4647
'openbsd x64 LE': '@esbuild/openbsd-x64',

npm/@esbuild/netbsd-arm64/README.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# esbuild
2+
3+
This is the NetBSD ARM 64-bit binary for esbuild, a JavaScript bundler and minifier. See https://github.com/evanw/esbuild for details.
4+
5+
⚠️ 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. ⚠️
+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
{
2+
"name": "@esbuild/netbsd-arm64",
3+
"version": "0.24.0",
4+
"description": "The NetBSD ARM 64-bit binary for esbuild, a JavaScript bundler.",
5+
"repository": {
6+
"type": "git",
7+
"url": "git+https://github.com/evanw/esbuild.git"
8+
},
9+
"license": "MIT",
10+
"preferUnplugged": true,
11+
"engines": {
12+
"node": ">=18"
13+
},
14+
"os": [
15+
"netbsd"
16+
],
17+
"cpu": [
18+
"arm64"
19+
]
20+
}

0 commit comments

Comments
 (0)