avancement planning

This commit is contained in:
2026-05-26 11:58:39 +02:00
parent 619a2b240a
commit 150b97cd2e
4892 changed files with 99214 additions and 429382 deletions
+2 -2
View File
@@ -163,7 +163,7 @@ async function build (gyp, argv) {
if (!isNaN(j) && j > 0) {
argv.push('/m:' + j)
} else if (jobs.toUpperCase() === 'MAX') {
argv.push('/m:' + require('os').cpus().length)
argv.push('/m:' + require('os').availableParallelism())
}
}
} else {
@@ -178,7 +178,7 @@ async function build (gyp, argv) {
argv.push(j)
} else if (jobs.toUpperCase() === 'MAX') {
argv.push('--jobs')
argv.push(require('os').cpus().length)
argv.push(require('os').availableParallelism())
}
}
}
+55 -8
View File
@@ -1,4 +1,5 @@
const fetch = require('make-fetch-happen')
const { Readable } = require('stream')
const { EnvHttpProxyAgent } = require('undici')
const { promises: fs } = require('graceful-fs')
const log = require('./log')
@@ -10,19 +11,65 @@ async function download (gyp, url) {
'User-Agent': `node-gyp v${gyp.version} (node ${process.version})`,
Connection: 'keep-alive'
},
proxy: gyp.opts.proxy,
noProxy: gyp.opts.noproxy
dispatcher: await createDispatcher(gyp)
}
const cafile = gyp.opts.cafile
if (cafile) {
requestOpts.ca = await readCAFile(cafile)
let res
try {
res = await fetch(url, requestOpts)
} catch (err) {
// Built-in fetch wraps low-level errors in "TypeError: fetch failed" with
// the underlying error on .cause. Callers inspect .code (e.g. ENOTFOUND).
if (err.cause) {
throw err.cause
}
throw err
}
const res = await fetch(url, requestOpts)
log.http(res.status, res.url)
return res
const body = res.body ? Readable.fromWeb(res.body) : Readable.from([])
return {
status: res.status,
url: res.url,
body,
text: async () => {
let data = ''
body.setEncoding('utf8')
for await (const chunk of body) {
data += chunk
}
return data
}
}
}
async function createDispatcher (gyp) {
const env = process.env
const hasProxyEnv = env.http_proxy || env.HTTP_PROXY || env.https_proxy || env.HTTPS_PROXY
if (!gyp.opts.proxy && !gyp.opts.cafile && !hasProxyEnv) {
return undefined
}
const opts = {}
if (gyp.opts.cafile) {
const ca = await readCAFile(gyp.opts.cafile)
// EnvHttpProxyAgent forwards opts to both its internal Agent (direct) and
// ProxyAgent (proxied). Agent reads TLS config from `connect`; ProxyAgent
// reads it from `requestTls` (origin) / `proxyTls` (proxy). Set all three
// so the custom CA is applied regardless of which path a request takes.
opts.connect = { ca }
opts.requestTls = { ca }
opts.proxyTls = { ca }
}
if (gyp.opts.proxy) {
opts.httpProxy = gyp.opts.proxy
opts.httpsProxy = gyp.opts.proxy
}
if (gyp.opts.noproxy) {
opts.noProxy = gyp.opts.noproxy
}
return new EnvHttpProxyAgent(opts)
}
async function readCAFile (filename) {
+2 -8
View File
@@ -86,14 +86,10 @@ class PythonFinder {
{
before: () => {
if (!this.configPython) {
this.addLog(
'Python is not set from command line or npm configuration')
this.addLog('--python was not set on the command line')
return SKIP
}
this.addLog('checking Python explicitly set from command line or ' +
'npm configuration')
this.addLog('- "--python=" or "npm config get python" is ' +
`"${this.configPython}"`)
this.addLog(`--python=${this.configPython} was set on the command line`)
},
check: () => this.checkCommand(this.configPython)
},
@@ -295,8 +291,6 @@ class PythonFinder {
`- Use the switch --python="${pathExample}"`,
' (accepted by both node-gyp and npm)',
'- Set the environment variable PYTHON',
'- Set the npm configuration variable python:',
` npm config set python "${pathExample}"`,
'For more information consult the documentation at:',
'https://github.com/nodejs/node-gyp#installation',
'**********************************************************'
+12 -6
View File
@@ -30,7 +30,7 @@ class VisualStudioFinder {
this.configVersionYear = null
this.configPath = null
if (this.configMsvsVersion) {
this.addLog('msvs_version was set from command line or npm config')
this.addLog(`--msvs_version=${this.configMsvsVersion} was set on the command line`)
if (this.configMsvsVersion.match(/^\d{4}$/)) {
this.configVersionYear = parseInt(this.configMsvsVersion, 10)
this.addLog(
@@ -41,7 +41,7 @@ class VisualStudioFinder {
`- looking for Visual Studio installed in "${this.configPath}"`)
}
} else {
this.addLog('msvs_version not set from command line or npm config')
this.addLog('--msvs_version was not set on the command line')
}
if (process.env.VCINSTALLDIR) {
@@ -119,7 +119,7 @@ class VisualStudioFinder {
}
async findVisualStudio2019OrNewerFromSpecifiedLocation () {
return this.findVSFromSpecifiedLocation([2019, 2022])
return this.findVSFromSpecifiedLocation([2019, 2022, 2026])
}
async findVisualStudio2017FromSpecifiedLocation () {
@@ -162,7 +162,7 @@ class VisualStudioFinder {
}
async findVisualStudio2019OrNewerUsingSetupModule () {
return this.findNewVSUsingSetupModule([2019, 2022])
return this.findNewVSUsingSetupModule([2019, 2022, 2026])
}
async findVisualStudio2017UsingSetupModule () {
@@ -223,7 +223,7 @@ class VisualStudioFinder {
// Invoke the PowerShell script to get information about Visual Studio 2019
// or newer installations
async findVisualStudio2019OrNewer () {
return this.findNewVS([2019, 2022])
return this.findNewVS([2019, 2022, 2026])
}
// Invoke the PowerShell script to get information about Visual Studio 2017
@@ -247,7 +247,7 @@ class VisualStudioFinder {
'Unrestricted',
'-NoProfile',
'-Command',
'&{Add-Type -Path \'' + csFile + '\';' + '[VisualStudioConfiguration.Main]::PrintJson()}'
'&{Add-Type -IgnoreWarnings -Path \'' + csFile + '\';' + '[VisualStudioConfiguration.Main]::PrintJson()}'
]
this.log.silly('Running', ps, psArgs)
@@ -389,6 +389,10 @@ class VisualStudioFinder {
ret.versionYear = 2022
return ret
}
if (ret.versionMajor === 18) {
ret.versionYear = 2026
return ret
}
this.log.silly('- unsupported version:', ret.versionMajor)
return {}
}
@@ -456,6 +460,8 @@ class VisualStudioFinder {
return 'v142'
} else if (versionYear === 2022) {
return 'v143'
} else if (versionYear === 2026) {
return 'v145'
}
this.log.silly('- invalid versionYear:', versionYear)
return null
+1 -1
View File
@@ -198,7 +198,7 @@ async function install (gyp, argv) {
}
// download the tarball and extract!
// Ommited on Windows if only new node.lib is required
// Omitted on Windows if only new node.lib is required
// there can be file errors from tar if parallel installs
// are happening (not uncommon with multiple native modules) so
+17 -19
View File
@@ -1,9 +1,6 @@
/* eslint-disable n/no-deprecated-api */
'use strict'
const semver = require('semver')
const url = require('url')
const path = require('path')
const log = require('./log')
@@ -74,11 +71,11 @@ function processRelease (argv, gyp, defaultVersion, defaultRelease) {
} else {
distBaseUrl = 'https://nodejs.org/dist'
}
distBaseUrl += '/v' + version + '/'
distBaseUrl = new URL(distBaseUrl + '/v' + version + '/')
// new style, based on process.release so we have a lot of the data we need
if (defaultRelease && defaultRelease.headersUrl && !overrideDistUrl) {
baseUrl = url.resolve(defaultRelease.headersUrl, './')
baseUrl = new URL('./', defaultRelease.headersUrl)
libUrl32 = resolveLibUrl(name, defaultRelease.libUrl || baseUrl || distBaseUrl, 'x86', versionSemver.major)
libUrl64 = resolveLibUrl(name, defaultRelease.libUrl || baseUrl || distBaseUrl, 'x64', versionSemver.major)
libUrlArm64 = resolveLibUrl(name, defaultRelease.libUrl || baseUrl || distBaseUrl, 'arm64', versionSemver.major)
@@ -96,28 +93,28 @@ function processRelease (argv, gyp, defaultVersion, defaultRelease) {
// have a *-headers.tar.gz file in its dist location, even some frankenstein
// custom version
canGetHeaders = semver.satisfies(versionSemver, headersTarballRange)
tarballUrl = url.resolve(baseUrl, name + '-v' + version + (canGetHeaders ? '-headers' : '') + '.tar.gz')
tarballUrl = new URL(name + '-v' + version + (canGetHeaders ? '-headers' : '') + '.tar.gz', baseUrl).href
}
return {
version,
semver: versionSemver,
name,
baseUrl,
baseUrl: baseUrl.href,
tarballUrl,
shasumsUrl: url.resolve(baseUrl, 'SHASUMS256.txt'),
shasumsUrl: new URL('SHASUMS256.txt', baseUrl).href,
versionDir: (name !== 'node' ? name + '-' : '') + version,
ia32: {
libUrl: libUrl32,
libPath: normalizePath(path.relative(url.parse(baseUrl).path, url.parse(libUrl32).path))
libUrl: libUrl32.href,
libPath: normalizePath(path.relative(baseUrl.pathname, libUrl32.pathname))
},
x64: {
libUrl: libUrl64,
libPath: normalizePath(path.relative(url.parse(baseUrl).path, url.parse(libUrl64).path))
libUrl: libUrl64.href,
libPath: normalizePath(path.relative(baseUrl.pathname, libUrl64.pathname))
},
arm64: {
libUrl: libUrlArm64,
libPath: normalizePath(path.relative(url.parse(baseUrl).path, url.parse(libUrlArm64).path))
libUrl: libUrlArm64.href,
libPath: normalizePath(path.relative(baseUrl.pathname, libUrlArm64.pathname))
}
}
}
@@ -127,20 +124,21 @@ function normalizePath (p) {
}
function resolveLibUrl (name, defaultUrl, arch, versionMajor) {
const base = url.resolve(defaultUrl, './')
const hasLibUrl = bitsre.test(defaultUrl) || (versionMajor === 3 && bitsreV3.test(defaultUrl))
if (!defaultUrl.pathname) defaultUrl = new URL(defaultUrl)
const base = new URL('./', defaultUrl)
const hasLibUrl = bitsre.test(defaultUrl.pathname) || (versionMajor === 3 && bitsreV3.test(defaultUrl.pathname))
if (!hasLibUrl) {
// let's assume it's a baseUrl then
if (versionMajor >= 1) {
return url.resolve(base, 'win-' + arch + '/' + name + '.lib')
return new URL('win-' + arch + '/' + name + '.lib', base)
}
// prior to io.js@1.0.0 32-bit node.lib lives in /, 64-bit lives in /x64/
return url.resolve(base, (arch === 'x86' ? '' : arch + '/') + name + '.lib')
return new URL((arch === 'x86' ? '' : arch + '/') + name + '.lib', base)
}
// else we have a proper url to a .lib, just make sure it's the right arch
return defaultUrl.replace(versionMajor === 3 ? bitsreV3 : bitsre, '/win-' + arch + '/')
return new URL(defaultUrl.pathname.replace(versionMajor === 3 ? bitsreV3 : bitsre, '/win-' + arch + '/'), defaultUrl)
}
module.exports = processRelease