From a9104236ae107e2d284f6ce9ff0a8c8c50e599d5 Mon Sep 17 00:00:00 2001 From: Jelle Licht Date: Fri, 21 Apr 2023 23:09:04 +0200 Subject: [PATCH 1/3] add more node releases to crosswalk --- lib/util/abi_crosswalk.json | 296 ++++++++++++++++++++++++++++++++++++ 1 file changed, 296 insertions(+) diff --git a/lib/util/abi_crosswalk.json b/lib/util/abi_crosswalk.json index 7f5297276..9b6c52afb 100644 --- a/lib/util/abi_crosswalk.json +++ b/lib/util/abi_crosswalk.json @@ -2435,6 +2435,54 @@ "node_abi": 83, "v8": "8.4" }, + "14.18.2": { + "node_abi": 83, + "v8": "8.4" + }, + "14.18.3": { + "node_abi": 83, + "v8": "8.4" + }, + "14.19.0": { + "node_abi": 83, + "v8": "8.4" + }, + "14.19.1": { + "node_abi": 83, + "v8": "8.4" + }, + "14.19.2": { + "node_abi": 83, + "v8": "8.4" + }, + "14.19.3": { + "node_abi": 83, + "v8": "8.4" + }, + "14.20.0": { + "node_abi": 83, + "v8": "8.4" + }, + "14.20.1": { + "node_abi": 83, + "v8": "8.4" + }, + "14.21.0": { + "node_abi": 83, + "v8": "8.4" + }, + "14.21.1": { + "node_abi": 83, + "v8": "8.4" + }, + "14.21.2": { + "node_abi": 83, + "v8": "8.4" + }, + "14.21.3": { + "node_abi": 83, + "v8": "8.4" + }, "15.0.0": { "node_abi": 88, "v8": "8.6" @@ -2587,6 +2635,66 @@ "node_abi": 93, "v8": "9.4" }, + "16.13.1": { + "node_abi": 93, + "v8": "9.4" + }, + "16.13.2": { + "node_abi": 93, + "v8": "9.4" + }, + "16.14.0": { + "node_abi": 93, + "v8": "9.4" + }, + "16.14.1": { + "node_abi": 93, + "v8": "9.4" + }, + "16.14.2": { + "node_abi": 93, + "v8": "9.4" + }, + "16.15.0": { + "node_abi": 93, + "v8": "9.4" + }, + "16.15.1": { + "node_abi": 93, + "v8": "9.4" + }, + "16.16.0": { + "node_abi": 93, + "v8": "9.4" + }, + "16.17.0": { + "node_abi": 93, + "v8": "9.4" + }, + "16.17.1": { + "node_abi": 93, + "v8": "9.4" + }, + "16.18.0": { + "node_abi": 93, + "v8": "9.4" + }, + "16.18.1": { + "node_abi": 93, + "v8": "9.4" + }, + "16.19.0": { + "node_abi": 93, + "v8": "9.4" + }, + "16.19.1": { + "node_abi": 93, + "v8": "9.4" + }, + "16.20.0": { + "node_abi": 93, + "v8": "9.4" + }, "17.0.0": { "node_abi": 102, "v8": "9.5" @@ -2598,5 +2706,193 @@ "17.1.0": { "node_abi": 102, "v8": "9.5" + }, + "17.2.0": { + "node_abi": 102, + "v8": "9.6" + }, + "17.3.0": { + "node_abi": 102, + "v8": "9.6" + }, + "17.3.1": { + "node_abi": 102, + "v8": "9.6" + }, + "17.4.0": { + "node_abi": 102, + "v8": "9.6" + }, + "17.5.0": { + "node_abi": 102, + "v8": "9.6" + }, + "17.6.0": { + "node_abi": 102, + "v8": "9.6" + }, + "17.7.0": { + "node_abi": 102, + "v8": "9.6" + }, + "17.7.1": { + "node_abi": 102, + "v8": "9.6" + }, + "17.7.2": { + "node_abi": 102, + "v8": "9.6" + }, + "17.8.0": { + "node_abi": 102, + "v8": "9.6" + }, + "17.9.0": { + "node_abi": 102, + "v8": "9.6" + }, + "17.9.1": { + "node_abi": 102, + "v8": "9.6" + }, + "18.0.0": { + "node_abi": 108, + "v8": "10.1" + }, + "18.1.0": { + "node_abi": 108, + "v8": "10.1" + }, + "18.2.0": { + "node_abi": 108, + "v8": "10.1" + }, + "18.3.0": { + "node_abi": 108, + "v8": "10.2" + }, + "18.4.0": { + "node_abi": 108, + "v8": "10.2" + }, + "18.5.0": { + "node_abi": 108, + "v8": "10.2" + }, + "18.6.0": { + "node_abi": 108, + "v8": "10.2" + }, + "18.7.0": { + "node_abi": 108, + "v8": "10.2" + }, + "18.8.0": { + "node_abi": 108, + "v8": "10.2" + }, + "18.9.0": { + "node_abi": 108, + "v8": "10.2" + }, + "18.9.1": { + "node_abi": 108, + "v8": "10.2" + }, + "18.10.0": { + "node_abi": 108, + "v8": "10.2" + }, + "18.11.0": { + "node_abi": 108, + "v8": "10.2" + }, + "18.12.0": { + "node_abi": 108, + "v8": "10.2" + }, + "18.12.1": { + "node_abi": 108, + "v8": "10.2" + }, + "18.13.0": { + "node_abi": 108, + "v8": "10.2" + }, + "18.14.0": { + "node_abi": 108, + "v8": "10.2" + }, + "18.14.1": { + "node_abi": 108, + "v8": "10.2" + }, + "18.14.2": { + "node_abi": 108, + "v8": "10.2" + }, + "18.15.0": { + "node_abi": 108, + "v8": "10.2" + }, + "18.16.0": { + "node_abi": 108, + "v8": "10.2" + }, + "19.0.0": { + "node_abi": 111, + "v8": "10.7" + }, + "19.0.1": { + "node_abi": 111, + "v8": "10.7" + }, + "19.1.0": { + "node_abi": 111, + "v8": "10.7" + }, + "19.2.0": { + "node_abi": 111, + "v8": "10.8" + }, + "19.3.0": { + "node_abi": 111, + "v8": "10.8" + }, + "19.4.0": { + "node_abi": 111, + "v8": "10.8" + }, + "19.5.0": { + "node_abi": 111, + "v8": "10.8" + }, + "19.6.0": { + "node_abi": 111, + "v8": "10.8" + }, + "19.6.1": { + "node_abi": 111, + "v8": "10.8" + }, + "19.7.0": { + "node_abi": 111, + "v8": "10.8" + }, + "19.8.0": { + "node_abi": 111, + "v8": "10.8" + }, + "19.8.1": { + "node_abi": 111, + "v8": "10.8" + }, + "19.9.0": { + "node_abi": 111, + "v8": "10.8" + }, + "20.0.0": { + "node_abi": 115, + "v8": "11.3" } } \ No newline at end of file From c2b2f2641a0ebba48f20fc2285cca2e6cbe083e3 Mon Sep 17 00:00:00 2001 From: Jelle Licht Date: Sat, 22 Apr 2023 15:19:24 +0200 Subject: [PATCH 2/3] use python2 for tests with old node --- .travis.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.travis.yml b/.travis.yml index dc2e21398..4a34f30b8 100644 --- a/.travis.yml +++ b/.travis.yml @@ -59,6 +59,7 @@ matrix: sources: [ 'ubuntu-toolchain-r-test' ] packages: ['xvfb','libasound2','libx11-6','libglib2.0-0','libgtk2.0-0','libatk1.0-0','libgdk-pixbuf2.0-0','libcairo2','libfreetype6','libfontconfig1','libxcomposite1','libasound2','libxdamage1','libxext6','libxfixes3','libnss3','libnspr4','libgconf-2-4','libexpat1','libdbus-1-3','libudev1'] script: + - pyenv global 2.7 # test node-webkit usage - ./scripts/test-node-webkit.sh From fb5d9e2b6e72165856dea4096f30bc2b8d7e710e Mon Sep 17 00:00:00 2001 From: Jelle Licht Date: Fri, 21 Apr 2023 23:28:56 +0200 Subject: [PATCH 3/3] add rudimentary noproxy support --- lib/install.js | 41 ++++++++++++++++++++++++++++++++++++++++- lib/node-pre-gyp.js | 1 + 2 files changed, 41 insertions(+), 1 deletion(-) diff --git a/lib/install.js b/lib/install.js index 617dd8663..1784114eb 100644 --- a/lib/install.js +++ b/lib/install.js @@ -14,6 +14,7 @@ const makeDir = require('make-dir'); // for fetching binaries const fetch = require('node-fetch'); const tar = require('tar'); +const url = require('url'); let npgVersion = 'unknown'; try { @@ -24,6 +25,34 @@ try { // do nothing } +function should_proxy(uri, noProxyList) { + const { hostname, port } = url.parse(uri); + + /* TODO: Default ports as defined by the protocol should still + match, they currently will not if the noProxyList entry + explicitly specifies the default port. */ + + // eslint-disable-next-line eqeqeq + const portMatch = (entry) => entry.port === undefined || entry.port == port; + + for (let i = 0; i < noProxyList && noProxyList.length; i++) { + const entry = noProxyList[i]; + if (!portMatch(entry)) { + continue; + } + // TODO: Deal with 'partial wildcards': *.foo.com + if (entry.hostSuffix === '*') { + return false; + } + const rightSideMatch = hostname.indexOf(entry.hostSuffix, hostname.length, entry.hostSuffix.length); + if (rightSideMatch > -1) { + return false; + } + } + + return true; +} + function place_binary(uri, targetDir, opts, callback) { log.http('GET', uri); @@ -54,8 +83,18 @@ function place_binary(uri, targetDir, opts, callback) { process.env.http_proxy || process.env.HTTP_PROXY || process.env.npm_config_proxy; + const noProxy = opts.noproxy || + process.env.no_proxy || + process.env.NO_PROXY || + process.env.npm_config_noproxy; + // TODO: IPv6 address + port support. + const noProxyList = noProxy && noProxy.split(',').map((e) => { + const [hostSuffix, port] = e.split(':'); + return { hostSuffix, port }; + }); + let agent; - if (proxyUrl) { + if (proxyUrl && should_proxy(sanitized, noProxyList)) { const ProxyAgent = require('https-proxy-agent'); agent = new ProxyAgent(proxyUrl); log.http('download', 'proxy agent configured using: "%s"', proxyUrl); diff --git a/lib/node-pre-gyp.js b/lib/node-pre-gyp.js index dc18e749e..df16f0789 100644 --- a/lib/node-pre-gyp.js +++ b/lib/node-pre-gyp.js @@ -113,6 +113,7 @@ proto.configDefs = { debug: Boolean, // 'build' directory: String, // bin proxy: String, // 'install' + noproxy: String, // 'install' loglevel: String // everywhere };