From 008972b3d3a16e9f201fddc4526b65fa1c5f84e9 Mon Sep 17 00:00:00 2001 From: Pagan Gazzard Date: Fri, 24 Dec 2021 16:01:30 +0000 Subject: [PATCH] Update pkg Change-type: patch --- automation/build-bin.ts | 5 ++ npm-shrinkwrap.json | 60 ++++++++++++------- package.json | 2 +- patches/all/pkg+4.4.9.dev.patch | 37 ------------ patches/all/pkg+4.5.1.dev.patch | 38 ++++++++++++ .../pkg/expected-warnings-darwin.txt | 16 ----- .../test-data/pkg/expected-warnings-linux.txt | 8 --- .../test-data/pkg/expected-warnings-win32.txt | 8 --- 8 files changed, 83 insertions(+), 91 deletions(-) delete mode 100644 patches/all/pkg+4.4.9.dev.patch create mode 100644 patches/all/pkg+4.5.1.dev.patch diff --git a/automation/build-bin.ts b/automation/build-bin.ts index 5b31474a..96bf2f9c 100644 --- a/automation/build-bin.ts +++ b/automation/build-bin.ts @@ -96,6 +96,7 @@ async function diffPkgOutput(pkgOut: string) { '> pkg@', '> Fetching base Node.js binaries', ' fetched-', + 'prebuild-install WARN install No prebuilt binaries found', ]; const modulesRE = process.platform === 'win32' @@ -322,6 +323,10 @@ async function signFilesForNotarization() { if (!item.stats.isFile()) { return; } + if (path.basename(item.path).endsWith('.node.bak')) { + console.log('Removing pkg .node.bak file', item.path); + fs.unlinkSync(item.path); + } if ( path.basename(item.path).endsWith('.zip') && path.dirname(item.path).includes('test') diff --git a/npm-shrinkwrap.json b/npm-shrinkwrap.json index f89f413a..e0789254 100644 --- a/npm-shrinkwrap.json +++ b/npm-shrinkwrap.json @@ -1093,15 +1093,15 @@ } }, "@babel/parser": { - "version": "7.11.3", - "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.11.3.tgz", - "integrity": "sha512-REo8xv7+sDxkKvoxEywIdsNFiZLybwdI7hcT5uEPyQrSMB4YQ973BfC9OOrD/81MaIjh6UxdulIQXkjmiH3PcA==", + "version": "7.13.12", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.13.12.tgz", + "integrity": "sha512-4T7Pb244rxH24yR116LAuJ+adxXXnHhZaLJjegJVKSdoNCe4x1eDBaud5YIcQFcqzsaD5BHvJw5BQ0AZapdCRw==", "dev": true }, "@babel/runtime": { - "version": "7.11.2", - "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.11.2.tgz", - "integrity": "sha512-TeWkU52so0mPtDcaCTxNBI/IHiz0pZgr8VEFqXFtZWpYD08ZB6FaSwVAS8MKRQAP3bYKiVjwysOJgMFY28o6Tw==", + "version": "7.13.10", + "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.13.10.tgz", + "integrity": "sha512-4QPkjJq6Ns3V/RgpEahRk+AGfL0eO6RHHtTWoNNr5mO49G6B5+X6d6THgWEAvTrznU5xYpbAlVKRYcsCgh/Akw==", "dev": true, "requires": { "regenerator-runtime": "^0.13.4" @@ -6225,12 +6225,6 @@ "yargs": "^16.1.0" }, "dependencies": { - "@babel/parser": { - "version": "7.16.4", - "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.16.4.tgz", - "integrity": "sha512-6V0qdPUaiVHH3RtZeLIsc+6pDhbYzHR8ogA8w+f+Wc77DuXto19g2QUwveINoS34Uw+W8/hQDGJCx+i4n7xcng==", - "dev": true - }, "arrify": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/arrify/-/arrify-2.0.1.tgz", @@ -14134,13 +14128,13 @@ } }, "pkg": { - "version": "4.4.9", - "resolved": "https://registry.npmjs.org/pkg/-/pkg-4.4.9.tgz", - "integrity": "sha512-FK4GqHtcCY2PPPVaKViU0NyRzpo6gCS7tPKN5b7AkElqjAOCH1bsRKgohEnxThr6DWfTGByGqba2YHGR/BqbmA==", + "version": "4.5.1", + "resolved": "https://registry.npmjs.org/pkg/-/pkg-4.5.1.tgz", + "integrity": "sha512-UXKL88jGQ+FD4//PyrFeRcqurVQ3BVIfUNaEU9cXY24EJz08JyBj85qrGh0CFGvyzNb1jpwHOnns5Sw0M5H92Q==", "dev": true, "requires": { - "@babel/parser": "^7.9.4", - "@babel/runtime": "^7.9.2", + "@babel/parser": "7.13.12", + "@babel/runtime": "7.13.10", "chalk": "^3.0.0", "escodegen": "^1.14.1", "fs-extra": "^8.1.0", @@ -14148,7 +14142,8 @@ "into-stream": "^5.1.1", "minimist": "^1.2.5", "multistream": "^2.1.1", - "pkg-fetch": "^2.6.9", + "pkg-fetch": "2.6.9", + "prebuild-install": "6.0.1", "progress": "^2.0.3", "resolve": "^1.15.1", "stream-meter": "^1.0.4" @@ -14174,6 +14169,29 @@ "graceful-fs": "^4.1.6" } }, + "prebuild-install": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/prebuild-install/-/prebuild-install-6.0.1.tgz", + "integrity": "sha512-7GOJrLuow8yeiyv75rmvZyeMGzl8mdEX5gY69d6a6bHWmiPevwqFw+tQavhK0EYMaSg3/KD24cWqeQv1EWsqDQ==", + "dev": true, + "requires": { + "detect-libc": "^1.0.3", + "expand-template": "^2.0.3", + "github-from-package": "0.0.0", + "minimist": "^1.2.3", + "mkdirp-classic": "^0.5.3", + "napi-build-utils": "^1.0.1", + "node-abi": "^2.7.0", + "noop-logger": "^0.1.1", + "npmlog": "^4.0.1", + "pump": "^3.0.0", + "rc": "^1.2.7", + "simple-get": "^3.0.3", + "tar-fs": "^2.0.0", + "tunnel-agent": "^0.6.0", + "which-pm-runs": "^1.0.0" + } + }, "universalify": { "version": "0.1.2", "resolved": "https://registry.npmjs.org/universalify/-/universalify-0.1.2.tgz", @@ -15299,9 +15317,9 @@ } }, "regenerator-runtime": { - "version": "0.13.7", - "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.13.7.tgz", - "integrity": "sha512-a54FxoJDIr27pgf7IgeQGxmqUNYrcV338lf/6gH456HZ/PhX+5BcwHXG9ajESmwe6WRO0tAzRUrRmNONWgkrew==", + "version": "0.13.9", + "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.13.9.tgz", + "integrity": "sha512-p3VT+cOEgxFsRRA9X4lkI1E+k2/CtnKtU4gcxyaCUreilL/vqI6CdZ3wxVUx3UOUg+gnUOQQcRI7BmSI656MYA==", "dev": true }, "regex-not": { diff --git a/package.json b/package.json index f4fd80c0..a659438b 100644 --- a/package.json +++ b/package.json @@ -184,7 +184,7 @@ "mock-require": "^3.0.3", "nock": "^13.2.1", "parse-link-header": "^1.0.1", - "pkg": "^4.4.9", + "pkg": "^4.5.1", "publish-release": "^1.6.1", "rewire": "^5.0.0", "simple-git": "^2.48.0", diff --git a/patches/all/pkg+4.4.9.dev.patch b/patches/all/pkg+4.4.9.dev.patch deleted file mode 100644 index 5db5e8ec..00000000 --- a/patches/all/pkg+4.4.9.dev.patch +++ /dev/null @@ -1,37 +0,0 @@ -diff --git a/node_modules/pkg/lib-es5/packer.js b/node_modules/pkg/lib-es5/packer.js -index 7295bb6..76805a3 100644 ---- a/node_modules/pkg/lib-es5/packer.js -+++ b/node_modules/pkg/lib-es5/packer.js -@@ -128,6 +128,7 @@ function _default({ - const newStat = Object.assign({}, value); - newStat.isFileValue = value.isFile(); - newStat.isDirectoryValue = value.isDirectory(); -+ newStat.isSocketValue = value.isSocket(); - const buffer = Buffer.from(JSON.stringify(newStat)); - stripes.push({ - snap, -diff --git a/node_modules/pkg/prelude/bootstrap.js b/node_modules/pkg/prelude/bootstrap.js -index 0d19f1d..db69015 100644 ---- a/node_modules/pkg/prelude/bootstrap.js -+++ b/node_modules/pkg/prelude/bootstrap.js -@@ -925,8 +925,10 @@ function payloadFileSync (pointer) { - - var isFileValue = s.isFileValue; - var isDirectoryValue = s.isDirectoryValue; -+ var isSocketValue = s.isSocketValue; - delete s.isFileValue; - delete s.isDirectoryValue; -+ delete s.isSocketValue; - - s.isFile = function () { - return isFileValue; -@@ -934,6 +936,9 @@ function payloadFileSync (pointer) { - s.isDirectory = function () { - return isDirectoryValue; - }; -+ s.isSocket = function () { -+ return isSocketValue; -+ }; - s.isSymbolicLink = function () { - return false; - }; diff --git a/patches/all/pkg+4.5.1.dev.patch b/patches/all/pkg+4.5.1.dev.patch new file mode 100644 index 00000000..8712c9cb --- /dev/null +++ b/patches/all/pkg+4.5.1.dev.patch @@ -0,0 +1,38 @@ +diff --git a/node_modules/pkg/prelude/bootstrap.js b/node_modules/pkg/prelude/bootstrap.js +index b87902f..58cb7bc 100644 +--- a/node_modules/pkg/prelude/bootstrap.js ++++ b/node_modules/pkg/prelude/bootstrap.js +@@ -1220,19 +1220,20 @@ function payloadFileSync(pointer) { + // promises //////////////////////////////////////////////////////// + // /////////////////////////////////////////////////////////////// + +- if (fs.promises !== undefined) { +- var util = require('util'); +- fs.promises.open = util.promisify(fs.open); +- fs.promises.read = util.promisify(fs.read); +- fs.promises.write = util.promisify(fs.write); +- fs.promises.readFile = util.promisify(fs.readFile); +- fs.promises.readdir = util.promisify(fs.readdir); +- fs.promises.realpath = util.promisify(fs.realpath); +- fs.promises.stat = util.promisify(fs.stat); +- fs.promises.lstat = util.promisify(fs.lstat); +- fs.promises.fstat = util.promisify(fs.fstat); +- fs.promises.access = util.promisify(fs.access); +- } ++ // Disable fs.promises patching as eg `fs.promises.open` returns an object not a number like a promisified `fs.open` returns ++ // if (fs.promises !== undefined) { ++ // var util = require('util'); ++ // fs.promises.open = util.promisify(fs.open); ++ // fs.promises.read = util.promisify(fs.read); ++ // fs.promises.write = util.promisify(fs.write); ++ // fs.promises.readFile = util.promisify(fs.readFile); ++ // fs.promises.readdir = util.promisify(fs.readdir); ++ // fs.promises.realpath = util.promisify(fs.realpath); ++ // fs.promises.stat = util.promisify(fs.stat); ++ // fs.promises.lstat = util.promisify(fs.lstat); ++ // fs.promises.fstat = util.promisify(fs.fstat); ++ // fs.promises.access = util.promisify(fs.access); ++ // } + + // /////////////////////////////////////////////////////////////// + // INTERNAL ////////////////////////////////////////////////////// diff --git a/tests/test-data/pkg/expected-warnings-darwin.txt b/tests/test-data/pkg/expected-warnings-darwin.txt index d0d81b15..5506c51b 100644 --- a/tests/test-data/pkg/expected-warnings-darwin.txt +++ b/tests/test-data/pkg/expected-warnings-darwin.txt @@ -24,10 +24,6 @@ The file must be distributed with executable as %2. %1: node_modules/open/xdg-open %2: path-to-executable/xdg-open -> Warning Cannot include addon %1 into executable. - The addon must be distributed with executable as %2. - %1: node_modules/@ronomon/direct-io/binding.node - %2: path-to-executable/binding.node > Warning Cannot include file %1 into executable. The file must be distributed with executable as %2. %1: node_modules/etcher-sdk/node_modules/drivelist/build/Release/drivelist.node @@ -100,18 +96,6 @@ The file must be distributed with executable as %2. %1: node_modules/drivelist/scripts/win32.bat %2: path-to-executable/drivelist/win32.bat -> Warning Cannot include addon %1 into executable. - The addon must be distributed with executable as %2. - %1: node_modules/fsevents/fsevents.node - %2: path-to-executable/fsevents.node -> Warning Cannot include addon %1 into executable. - The addon must be distributed with executable as %2. - %1: node_modules/fsevents/fsevents.node - %2: path-to-executable/fsevents.node -> Warning Cannot include addon %1 into executable. - The addon must be distributed with executable as %2. - %1: node_modules/xxhash/build/Release/hash.node - %2: path-to-executable/hash.node > Warning Cannot include file %1 into executable. The file must be distributed with executable as %2. %1: node_modules/opn/xdg-open diff --git a/tests/test-data/pkg/expected-warnings-linux.txt b/tests/test-data/pkg/expected-warnings-linux.txt index 2f81d776..5506c51b 100644 --- a/tests/test-data/pkg/expected-warnings-linux.txt +++ b/tests/test-data/pkg/expected-warnings-linux.txt @@ -24,10 +24,6 @@ The file must be distributed with executable as %2. %1: node_modules/open/xdg-open %2: path-to-executable/xdg-open -> Warning Cannot include addon %1 into executable. - The addon must be distributed with executable as %2. - %1: node_modules/@ronomon/direct-io/binding.node - %2: path-to-executable/binding.node > Warning Cannot include file %1 into executable. The file must be distributed with executable as %2. %1: node_modules/etcher-sdk/node_modules/drivelist/build/Release/drivelist.node @@ -100,10 +96,6 @@ The file must be distributed with executable as %2. %1: node_modules/drivelist/scripts/win32.bat %2: path-to-executable/drivelist/win32.bat -> Warning Cannot include addon %1 into executable. - The addon must be distributed with executable as %2. - %1: node_modules/xxhash/build/Release/hash.node - %2: path-to-executable/hash.node > Warning Cannot include file %1 into executable. The file must be distributed with executable as %2. %1: node_modules/opn/xdg-open diff --git a/tests/test-data/pkg/expected-warnings-win32.txt b/tests/test-data/pkg/expected-warnings-win32.txt index 66c7fc51..5d788d41 100644 --- a/tests/test-data/pkg/expected-warnings-win32.txt +++ b/tests/test-data/pkg/expected-warnings-win32.txt @@ -24,10 +24,6 @@ The file must be distributed with executable as %2. %1: node_modules\open\xdg-open %2: path-to-executable/xdg-open -> Warning Cannot include addon %1 into executable. - The addon must be distributed with executable as %2. - %1: node_modules\@ronomon\direct-io\binding.node - %2: path-to-executable/binding.node > Warning Cannot include file %1 into executable. The file must be distributed with executable as %2. %1: node_modules\etcher-sdk\node_modules\drivelist\build\Release\drivelist.node @@ -100,10 +96,6 @@ The file must be distributed with executable as %2. %1: node_modules\drivelist\scripts\win32.bat %2: path-to-executable/drivelist/win32.bat -> Warning Cannot include addon %1 into executable. - The addon must be distributed with executable as %2. - %1: node_modules\xxhash\build\Release\hash.node - %2: path-to-executable/hash.node > Warning Cannot include file %1 into executable. The file must be distributed with executable as %2. %1: node_modules\opn\xdg-open