From f7380b15e6a986e9723c3a23d9e512b931d86f13 Mon Sep 17 00:00:00 2001 From: Amin Yahyaabadi Date: Sat, 26 Nov 2022 23:25:34 -0800 Subject: [PATCH 1/4] fix: fix the spawning errors in node-gyp-build --- .github/workflows/CI.yml | 2 +- package.json | 4 ++-- pnpm-lock.yaml | 14 +++++++------- tsconfig.json | 7 +------ 4 files changed, 11 insertions(+), 16 deletions(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index a20fa3f9..4234029d 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -113,7 +113,7 @@ jobs: - name: Install Dependencies and Build if: ${{ !matrix.docker }} - run: pnpm install + run: pnpm install --verbose - name: Prebuild if: ${{ !matrix.docker }} diff --git a/package.json b/package.json index 732a6b51..47d73610 100644 --- a/package.json +++ b/package.json @@ -17,7 +17,7 @@ "url": "https://github.com/zeromq/zeromq.js.git" }, "dependencies": { - "@aminya/node-gyp-build": "4.5.0-aminya.1", + "@aminya/node-gyp-build": "4.5.0-aminya.3", "node-addon-api": "^5.0.0", "shelljs": "^0.8.5", "shx": "^0.3.4" @@ -69,7 +69,7 @@ "tsconfig.json" ], "scripts": { - "install": "(shx test -f ./script/build.js || run-s build.js) && node-gyp-build", + "install": "(shx test -f ./script/build.js || run-s build.js) && echo 'running node-gyp-build:' && node-gyp-build", "clean": "shx rm -rf ./build ./lib/ ./prebuilds ./script/*.js ./script/*.js.map ./script/*.d.ts ./script/*.tsbuildinfo", "clean.temp": "shx rm -rf ./tmp && shx mkdir -p ./tmp && shx touch ./tmp/.gitkeep", "build.library": "tsc -p ./src/tsconfig.json && downlevel-dts ./lib ./lib/ts3.7 --to=3.7", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 3f19e16c..86219b18 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -1,7 +1,7 @@ lockfileVersion: 5.4 specifiers: - '@aminya/node-gyp-build': 4.5.0-aminya.1 + '@aminya/node-gyp-build': 4.5.0-aminya.3 '@gnd/typedoc': ^0.15.0-0 '@types/chai': ^4.3.4 '@types/fs-extra': ^9.0.13 @@ -35,7 +35,7 @@ specifiers: which: ^3.0.0 dependencies: - '@aminya/node-gyp-build': 4.5.0-aminya.1 + '@aminya/node-gyp-build': 4.5.0-aminya.3 node-addon-api: 5.0.0 shelljs: 0.8.5 shx: 0.3.4 @@ -77,8 +77,8 @@ packages: engines: {node: '>=6'} dev: true - /@aminya/node-gyp-build/4.5.0-aminya.1: - resolution: {integrity: sha512-MqivQnE5pd5SSebBCH3QnWSGLPWeKtjPUqb1EXWlBDo8gr1JVLJbvjXelr3cPLo7ye3efuYkbiWn+Ehc7ItwMw==} + /@aminya/node-gyp-build/4.5.0-aminya.3: + resolution: {integrity: sha512-YTjowxkNMQIsJ7vs+CTbOeb5oKczHJrI9sMJhjQJXfpT82Hf1Wnk9e7B4JX1mZ2NZkOlMuLb1476fOcnpMORGw==} hasBin: true dev: false @@ -1648,7 +1648,7 @@ packages: dependencies: semver: 7.3.8 shelljs: 0.8.5 - typescript: 5.0.0-dev.20221127 + typescript: 5.0.0-dev.20221128 dev: true /duplexer3/0.1.5: @@ -4583,8 +4583,8 @@ packages: hasBin: true dev: true - /typescript/5.0.0-dev.20221127: - resolution: {integrity: sha512-BiiOmTz96U8xt8azvXiHbSKCA+XAY2Ke5p+hpvGHWk2NSrOguWMzK5vwqdNQ7J6jH76yBwbQkEqqvafY8rH9BQ==} + /typescript/5.0.0-dev.20221128: + resolution: {integrity: sha512-cNV/osEHGNKTyjj/Ivi8s8x7MPkh0Kd/t53QjyXfM3jO3cC2jhL6kor57ziWqvyfl6paWjdNUVO/jxGsQOyfug==} engines: {node: '>=4.2.0'} hasBin: true dev: true diff --git a/tsconfig.json b/tsconfig.json index dc1d2cdf..f8508ec8 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -23,10 +23,5 @@ "ES2020", "dom" ] - }, - "include": [ - "src", - "script", - "examples" - ] + } } From b9bb25a72ed1df0cd785f476e40fd124a16a179c Mon Sep 17 00:00:00 2001 From: Amin Yahyaabadi Date: Sun, 27 Nov 2022 23:40:27 -0800 Subject: [PATCH 2/4] fix: add build-from-source to node-gyp-build --- .npmrc | 1 + package.json | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.npmrc b/.npmrc index d8ede7ab..83a8ac89 100644 --- a/.npmrc +++ b/.npmrc @@ -3,3 +3,4 @@ package-lock=false lockfile=true prefer-frozen-lockfile=false strict-peer-dependencies=false +build-from-source=true diff --git a/package.json b/package.json index 47d73610..bf23aade 100644 --- a/package.json +++ b/package.json @@ -69,7 +69,7 @@ "tsconfig.json" ], "scripts": { - "install": "(shx test -f ./script/build.js || run-s build.js) && echo 'running node-gyp-build:' && node-gyp-build", + "install": "(shx test -f ./script/build.js || run-s build.js) && node-gyp-build", "clean": "shx rm -rf ./build ./lib/ ./prebuilds ./script/*.js ./script/*.js.map ./script/*.d.ts ./script/*.tsbuildinfo", "clean.temp": "shx rm -rf ./tmp && shx mkdir -p ./tmp && shx touch ./tmp/.gitkeep", "build.library": "tsc -p ./src/tsconfig.json && downlevel-dts ./lib ./lib/ts3.7 --to=3.7", From 8f4984d10bea62f8c5d2c6c4b747b0cab6d37351 Mon Sep 17 00:00:00 2001 From: Amin Yahyaabadi Date: Sun, 27 Nov 2022 23:47:49 -0800 Subject: [PATCH 3/4] fix: add logging for the build-test execution in node-gyp-build --- package.json | 2 +- pnpm-lock.yaml | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index bf23aade..74ad2425 100644 --- a/package.json +++ b/package.json @@ -17,7 +17,7 @@ "url": "https://github.com/zeromq/zeromq.js.git" }, "dependencies": { - "@aminya/node-gyp-build": "4.5.0-aminya.3", + "@aminya/node-gyp-build": "4.5.0-aminya.4", "node-addon-api": "^5.0.0", "shelljs": "^0.8.5", "shx": "^0.3.4" diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 86219b18..c97a8435 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -1,7 +1,7 @@ lockfileVersion: 5.4 specifiers: - '@aminya/node-gyp-build': 4.5.0-aminya.3 + '@aminya/node-gyp-build': 4.5.0-aminya.4 '@gnd/typedoc': ^0.15.0-0 '@types/chai': ^4.3.4 '@types/fs-extra': ^9.0.13 @@ -35,7 +35,7 @@ specifiers: which: ^3.0.0 dependencies: - '@aminya/node-gyp-build': 4.5.0-aminya.3 + '@aminya/node-gyp-build': 4.5.0-aminya.4 node-addon-api: 5.0.0 shelljs: 0.8.5 shx: 0.3.4 @@ -77,8 +77,8 @@ packages: engines: {node: '>=6'} dev: true - /@aminya/node-gyp-build/4.5.0-aminya.3: - resolution: {integrity: sha512-YTjowxkNMQIsJ7vs+CTbOeb5oKczHJrI9sMJhjQJXfpT82Hf1Wnk9e7B4JX1mZ2NZkOlMuLb1476fOcnpMORGw==} + /@aminya/node-gyp-build/4.5.0-aminya.4: + resolution: {integrity: sha512-2c2+BqZOxfTz/m+1MNWncMyMgil2WOg8cHhKPf1qUo1t9ohOWOgSeb7TVVD4fnTxIcAcpWdmXBpFkjPRyBVS9g==} hasBin: true dev: false From 9759f35abe999b082bda9b72233b3a564684b107 Mon Sep 17 00:00:00 2001 From: Amin Yahyaabadi Date: Sun, 27 Nov 2022 23:53:48 -0800 Subject: [PATCH 4/4] fix: set npm_config_build_from_source for production --- package.json | 6 +++--- pnpm-lock.yaml | 10 ++-------- 2 files changed, 5 insertions(+), 11 deletions(-) diff --git a/package.json b/package.json index 74ad2425..93141063 100644 --- a/package.json +++ b/package.json @@ -20,7 +20,8 @@ "@aminya/node-gyp-build": "4.5.0-aminya.4", "node-addon-api": "^5.0.0", "shelljs": "^0.8.5", - "shx": "^0.3.4" + "shx": "^0.3.4", + "cross-env": "^7.0.3" }, "devDependencies": { "@gnd/typedoc": "^0.15.0-0", @@ -34,7 +35,6 @@ "@types/which": "^2.0.1", "benchmark": "^2.1.4", "chai": "^4.3.7", - "cross-env": "^7.0.3", "deasync": "^0.1.28", "downlevel-dts": "^0.11.0", "eslint-config-atomic": "^1.18.1", @@ -69,7 +69,7 @@ "tsconfig.json" ], "scripts": { - "install": "(shx test -f ./script/build.js || run-s build.js) && node-gyp-build", + "install": "(shx test -f ./script/build.js || run-s build.js) && cross-env npm_config_build_from_source=true node-gyp-build", "clean": "shx rm -rf ./build ./lib/ ./prebuilds ./script/*.js ./script/*.js.map ./script/*.d.ts ./script/*.tsbuildinfo", "clean.temp": "shx rm -rf ./tmp && shx mkdir -p ./tmp && shx touch ./tmp/.gitkeep", "build.library": "tsc -p ./src/tsconfig.json && downlevel-dts ./lib ./lib/ts3.7 --to=3.7", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index c97a8435..155b4f71 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -36,6 +36,7 @@ specifiers: dependencies: '@aminya/node-gyp-build': 4.5.0-aminya.4 + cross-env: 7.0.3 node-addon-api: 5.0.0 shelljs: 0.8.5 shx: 0.3.4 @@ -52,7 +53,6 @@ devDependencies: '@types/which': 2.0.1 benchmark: 2.1.4 chai: 4.3.7 - cross-env: 7.0.3 deasync: 0.1.28 downlevel-dts: 0.11.0 eslint-config-atomic: 1.18.1 @@ -1398,7 +1398,7 @@ packages: hasBin: true dependencies: cross-spawn: 7.0.3 - dev: true + dev: false /cross-spawn/5.1.0: resolution: {integrity: sha512-pTgQJ5KC0d2hcY8eyL1IzlBPYjTkyH72XRZPnLyKus2mBfNjQs3klqbJU2VILqZryAZUt9JOb3h/mWMy23/f5A==} @@ -1415,7 +1415,6 @@ packages: path-key: 3.1.1 shebang-command: 2.0.0 which: 2.0.2 - dev: true /crypto-random-string/1.0.0: resolution: {integrity: sha512-GsVpkFPlycH7/fRR7Dhcmnoii54gV1nz7y4CWyeFS14N+JVBBhY+r8amRHE4BwSYal7BPTDp8isvAlCxyFt3Hg==} @@ -3018,7 +3017,6 @@ packages: /isexe/2.0.0: resolution: {integrity: sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==} - dev: true /jquery/3.6.1: resolution: {integrity: sha512-opJeO4nCucVnsjiXOE+/PcCgYw9Gwpvs/a6B1LL/lQhwWwpbVEVYDZ1FokFr8PRc7ghYlrFPuyHuiiDNTQxmcw==} @@ -3761,7 +3759,6 @@ packages: /path-key/3.1.1: resolution: {integrity: sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==} engines: {node: '>=8'} - dev: true /path-parse/1.0.7: resolution: {integrity: sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==} @@ -4153,7 +4150,6 @@ packages: engines: {node: '>=8'} dependencies: shebang-regex: 3.0.0 - dev: true /shebang-regex/1.0.0: resolution: {integrity: sha512-wpoSFAxys6b2a2wHZ1XpDSgD7N9iVjg29Ph9uV/uaP9Ex/KXlkTZTeddxDPSYQpgvzKLGJke2UU0AzoGCjNIvQ==} @@ -4163,7 +4159,6 @@ packages: /shebang-regex/3.0.0: resolution: {integrity: sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==} engines: {node: '>=8'} - dev: true /shell-quote/1.7.4: resolution: {integrity: sha512-8o/QEhSSRb1a5i7TFR0iM4G16Z0vYB2OQVs4G3aAFXjn3T6yEx8AZxy1PgDF7I00LZHYA3WxaSYIf5e5sAX8Rw==} @@ -4763,7 +4758,6 @@ packages: hasBin: true dependencies: isexe: 2.0.0 - dev: true /which/3.0.0: resolution: {integrity: sha512-nla//68K9NU6yRiwDY/Q8aU6siKlSs64aEC7+IV56QoAuyQT2ovsJcgGYGyqMOmI/CGN1BOR6mM5EN0FBO+zyQ==}