From 112a033823044a4f9c8964e8740493adce78f81a Mon Sep 17 00:00:00 2001 From: Evan Wallace Date: Sun, 11 Sep 2022 07:33:24 +0800 Subject: [PATCH] turn 64bit android package into a simple shim --- .gitignore | 4 ---- Makefile | 5 +---- npm/esbuild-android-64/bin/esbuild | 2 ++ npm/esbuild-android-64/package.json | 3 +++ scripts/esbuild.js | 12 ------------ 5 files changed, 6 insertions(+), 20 deletions(-) create mode 100755 npm/esbuild-android-64/bin/esbuild diff --git a/.gitignore b/.gitignore index 6dfbdf47e5f..f743e21a483 100644 --- a/.gitignore +++ b/.gitignore @@ -6,10 +6,6 @@ /deno/ /esbuild /github/ -/npm/esbuild-android-64/esbuild.wasm -/npm/esbuild-android-64/exit0.js -/npm/esbuild-android-64/wasm_exec_node.js -/npm/esbuild-android-64/wasm_exec.js /npm/esbuild-wasm/browser.js /npm/esbuild-wasm/esbuild.wasm /npm/esbuild-wasm/esm/ diff --git a/Makefile b/Makefile index 40785402dd6..f094a3e2002 100644 --- a/Makefile +++ b/Makefile @@ -299,7 +299,7 @@ platform-unixlike: version-go node scripts/esbuild.js "$(NPMDIR)/package.json" --version CGO_ENABLED=0 GOOS="$(GOOS)" GOARCH="$(GOARCH)" go build $(GO_FLAGS) -o "$(NPMDIR)/bin/esbuild" ./cmd/esbuild -platform-android: platform-wasm +platform-android: node scripts/esbuild.js npm/esbuild-android-64/package.json --version platform-android-arm: @@ -533,7 +533,6 @@ validate-build: # This checks that the published binaries are bitwise-identical to the locally-build binaries validate-builds: git fetch --all --tags && git checkout "v$(ESBUILD_VERSION)" - @$(MAKE) --no-print-directory TARGET=platform-android PACKAGE=esbuild-android-64 SUBPATH=esbuild.wasm validate-build @$(MAKE) --no-print-directory TARGET=platform-android-arm64 PACKAGE=esbuild-android-arm64 SUBPATH=bin/esbuild validate-build @$(MAKE) --no-print-directory TARGET=platform-darwin PACKAGE=esbuild-darwin-64 SUBPATH=bin/esbuild validate-build @$(MAKE) --no-print-directory TARGET=platform-darwin-arm64 PACKAGE=esbuild-darwin-arm64 SUBPATH=bin/esbuild validate-build @@ -564,8 +563,6 @@ clean: rm -f npm/esbuild-windows-arm64/esbuild.exe rm -f npm/esbuild/install.js rm -rf npm/@esbuild/linux-loong64/bin - rm -rf npm/esbuild-android-64/bin - rm -rf npm/esbuild-android-64/esbuild.wasm npm/esbuild-android-64/wasm_exec.js npm/esbuild-android-64/wasm_exec_node.js npm/esbuild-android-64/exit0.js rm -rf npm/esbuild-android-arm64/bin rm -rf npm/esbuild-darwin-64/bin rm -rf npm/esbuild-darwin-arm64/bin diff --git a/npm/esbuild-android-64/bin/esbuild b/npm/esbuild-android-64/bin/esbuild new file mode 100755 index 00000000000..5e1c875667e --- /dev/null +++ b/npm/esbuild-android-64/bin/esbuild @@ -0,0 +1,2 @@ +#!/usr/bin/env node +require('esbuild-wasm/bin/esbuild') diff --git a/npm/esbuild-android-64/package.json b/npm/esbuild-android-64/package.json index 7a6074e8d60..d71c9826b5d 100644 --- a/npm/esbuild-android-64/package.json +++ b/npm/esbuild-android-64/package.json @@ -8,6 +8,9 @@ "engines": { "node": ">=12" }, + "dependencies": { + "esbuild-wasm": "0.15.7" + }, "os": [ "android" ], diff --git a/scripts/esbuild.js b/scripts/esbuild.js index f53e252bbb9..2bdd863b188 100644 --- a/scripts/esbuild.js +++ b/scripts/esbuild.js @@ -208,18 +208,6 @@ module.exports = ${JSON.stringify(exit0Map, null, 2)}; // Join with the asynchronous WebAssembly build await goBuildPromise; - - // Also copy this into the WebAssembly shim directories - for (const dir of [ - path.join(repoDir, 'npm', 'esbuild-android-64'), - ]) { - fs.mkdirSync(path.join(dir, 'bin'), { recursive: true }) - fs.writeFileSync(path.join(dir, 'wasm_exec.js'), wasm_exec_js); - fs.writeFileSync(path.join(dir, 'wasm_exec_node.js'), wasm_exec_node_js); - fs.writeFileSync(path.join(dir, 'exit0.js'), exit0Code); - fs.copyFileSync(path.join(npmWasmDir, 'bin', 'esbuild'), path.join(dir, 'bin', 'esbuild')); - fs.copyFileSync(path.join(npmWasmDir, 'esbuild.wasm'), path.join(dir, 'esbuild.wasm')); - } } const buildDenoLib = (esbuildPath) => {