app-builder-lib 27.0.0-alpha.7 → 27.0.0-alpha.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/asar/asarUtil.js +21 -11
- package/dist/asar/asarUtil.js.map +1 -1
- package/dist/codeSign/mac/macCodeSign.d.ts.map +1 -1
- package/dist/codeSign/mac/macCodeSign.js +6 -4
- package/dist/codeSign/mac/macCodeSign.js.map +1 -1
- package/dist/codeSign/signResult.d.ts +26 -0
- package/dist/codeSign/signResult.d.ts.map +1 -0
- package/dist/codeSign/signResult.js +12 -0
- package/dist/codeSign/signResult.js.map +1 -0
- package/dist/codeSign/win/signManager.d.ts +2 -1
- package/dist/codeSign/win/signManager.d.ts.map +1 -1
- package/dist/codeSign/win/signManager.js.map +1 -1
- package/dist/codeSign/win/signtoolBaseSignManager.d.ts +2 -1
- package/dist/codeSign/win/signtoolBaseSignManager.d.ts.map +1 -1
- package/dist/codeSign/win/signtoolBaseSignManager.js +3 -3
- package/dist/codeSign/win/signtoolBaseSignManager.js.map +1 -1
- package/dist/codeSign/win/windowsCodeSign.d.ts +2 -1
- package/dist/codeSign/win/windowsCodeSign.d.ts.map +1 -1
- package/dist/codeSign/win/windowsCodeSign.js +16 -7
- package/dist/codeSign/win/windowsCodeSign.js.map +1 -1
- package/dist/codeSign/win/windowsSignAzureManager.d.ts +2 -1
- package/dist/codeSign/win/windowsSignAzureManager.d.ts.map +1 -1
- package/dist/codeSign/win/windowsSignAzureManager.js +2 -2
- package/dist/codeSign/win/windowsSignAzureManager.js.map +1 -1
- package/dist/configuration.d.ts +45 -4
- package/dist/configuration.d.ts.map +1 -1
- package/dist/configuration.js.map +1 -1
- package/dist/core.d.ts +5 -0
- package/dist/core.d.ts.map +1 -1
- package/dist/core.js.map +1 -1
- package/dist/electron/ElectronFramework.d.ts +2 -1
- package/dist/electron/ElectronFramework.d.ts.map +1 -1
- package/dist/electron/ElectronFramework.js +14 -7
- package/dist/electron/ElectronFramework.js.map +1 -1
- package/dist/electron/mac/electronMac.js +2 -6
- package/dist/electron/mac/electronMac.js.map +1 -1
- package/dist/fileMatcher.d.ts.map +1 -1
- package/dist/fileMatcher.js +1 -0
- package/dist/fileMatcher.js.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +14 -1
- package/dist/index.js.map +1 -1
- package/dist/indexInternal.d.ts +9 -2
- package/dist/indexInternal.d.ts.map +1 -1
- package/dist/indexInternal.js +8 -2
- package/dist/indexInternal.js.map +1 -1
- package/dist/linuxPackager.d.ts.map +1 -1
- package/dist/linuxPackager.js +19 -1
- package/dist/linuxPackager.js.map +1 -1
- package/dist/macPackager.d.ts +16 -8
- package/dist/macPackager.d.ts.map +1 -1
- package/dist/macPackager.js +78 -30
- package/dist/macPackager.js.map +1 -1
- package/dist/node-module-collector/index.d.ts.map +1 -1
- package/dist/node-module-collector/index.js +47 -16
- package/dist/node-module-collector/index.js.map +1 -1
- package/dist/node-module-collector/moduleManager.d.ts.map +1 -1
- package/dist/node-module-collector/moduleManager.js +16 -8
- package/dist/node-module-collector/moduleManager.js.map +1 -1
- package/dist/node-module-collector/nodeModulesCollector.d.ts +7 -2
- package/dist/node-module-collector/nodeModulesCollector.d.ts.map +1 -1
- package/dist/node-module-collector/nodeModulesCollector.js +13 -17
- package/dist/node-module-collector/nodeModulesCollector.js.map +1 -1
- package/dist/node-module-collector/pnpmNodeModulesCollector.d.ts +44 -4
- package/dist/node-module-collector/pnpmNodeModulesCollector.d.ts.map +1 -1
- package/dist/node-module-collector/pnpmNodeModulesCollector.js +130 -34
- package/dist/node-module-collector/pnpmNodeModulesCollector.js.map +1 -1
- package/dist/options/PlatformSpecificBuildOptions.d.ts +31 -2
- package/dist/options/PlatformSpecificBuildOptions.d.ts.map +1 -1
- package/dist/options/PlatformSpecificBuildOptions.js.map +1 -1
- package/dist/options/SquirrelWindowsOptions.d.ts +0 -5
- package/dist/options/SquirrelWindowsOptions.d.ts.map +1 -1
- package/dist/options/SquirrelWindowsOptions.js.map +1 -1
- package/dist/options/linuxOptions.d.ts +8 -2
- package/dist/options/linuxOptions.d.ts.map +1 -1
- package/dist/options/linuxOptions.js.map +1 -1
- package/dist/options/macOptions.d.ts +12 -7
- package/dist/options/macOptions.d.ts.map +1 -1
- package/dist/options/macOptions.js.map +1 -1
- package/dist/options/pkgOptions.d.ts +1 -1
- package/dist/options/pkgOptions.js.map +1 -1
- package/dist/options/winOptions.d.ts +3 -3
- package/dist/options/winOptions.js.map +1 -1
- package/dist/packager.d.ts +2 -0
- package/dist/packager.d.ts.map +1 -1
- package/dist/packager.js +52 -2
- package/dist/packager.js.map +1 -1
- package/dist/packagerApi.d.ts +1 -1
- package/dist/packagerApi.d.ts.map +1 -1
- package/dist/packagerApi.js.map +1 -1
- package/dist/platformPackager.d.ts +15 -2
- package/dist/platformPackager.d.ts.map +1 -1
- package/dist/platformPackager.js +31 -5
- package/dist/platformPackager.js.map +1 -1
- package/dist/publish/PublishManager.d.ts.map +1 -1
- package/dist/publish/PublishManager.js +126 -7
- package/dist/publish/PublishManager.js.map +1 -1
- package/dist/publish/updateInfoBuilder.d.ts.map +1 -1
- package/dist/publish/updateInfoBuilder.js +61 -6
- package/dist/publish/updateInfoBuilder.js.map +1 -1
- package/dist/targets/ArchiveTarget.js +1 -1
- package/dist/targets/ArchiveTarget.js.map +1 -1
- package/dist/targets/archive.d.ts +12 -0
- package/dist/targets/archive.d.ts.map +1 -1
- package/dist/targets/archive.js +44 -1
- package/dist/targets/archive.js.map +1 -1
- package/dist/targets/differentialUpdateInfoBuilder.d.ts +2 -1
- package/dist/targets/differentialUpdateInfoBuilder.d.ts.map +1 -1
- package/dist/targets/differentialUpdateInfoBuilder.js +2 -2
- package/dist/targets/differentialUpdateInfoBuilder.js.map +1 -1
- package/dist/targets/linux/FlatpakTarget.d.ts.map +1 -1
- package/dist/targets/linux/FlatpakTarget.js +5 -1
- package/dist/targets/linux/FlatpakTarget.js.map +1 -1
- package/dist/targets/linux/FpmTarget.d.ts +7 -0
- package/dist/targets/linux/FpmTarget.d.ts.map +1 -1
- package/dist/targets/linux/FpmTarget.js +45 -4
- package/dist/targets/linux/FpmTarget.js.map +1 -1
- package/dist/targets/linux/LinuxTargetHelper.d.ts +1 -0
- package/dist/targets/linux/LinuxTargetHelper.d.ts.map +1 -1
- package/dist/targets/linux/LinuxTargetHelper.js +17 -1
- package/dist/targets/linux/LinuxTargetHelper.js.map +1 -1
- package/dist/targets/linux/snap/core24.js +3 -3
- package/dist/targets/linux/snap/core24.js.map +1 -1
- package/dist/targets/linux/snap/coreLegacy.js +1 -1
- package/dist/targets/linux/snap/coreLegacy.js.map +1 -1
- package/dist/targets/mac/MacTargetHelper.d.ts +75 -7
- package/dist/targets/mac/MacTargetHelper.d.ts.map +1 -1
- package/dist/targets/mac/MacTargetHelper.js +296 -38
- package/dist/targets/mac/MacTargetHelper.js.map +1 -1
- package/dist/targets/mac/pkg.d.ts +16 -0
- package/dist/targets/mac/pkg.d.ts.map +1 -1
- package/dist/targets/mac/pkg.js +27 -1
- package/dist/targets/mac/pkg.js.map +1 -1
- package/dist/targets/win/MsiTarget.d.ts.map +1 -1
- package/dist/targets/win/MsiTarget.js +6 -3
- package/dist/targets/win/MsiTarget.js.map +1 -1
- package/dist/targets/win/nsis/Defines.d.ts +2 -0
- package/dist/targets/win/nsis/Defines.d.ts.map +1 -1
- package/dist/targets/win/nsis/Defines.js.map +1 -1
- package/dist/targets/win/nsis/NsisTarget.d.ts +18 -0
- package/dist/targets/win/nsis/NsisTarget.d.ts.map +1 -1
- package/dist/targets/win/nsis/NsisTarget.js +79 -19
- package/dist/targets/win/nsis/NsisTarget.js.map +1 -1
- package/dist/targets/win/nsis/WebInstallerTarget.d.ts.map +1 -1
- package/dist/targets/win/nsis/WebInstallerTarget.js +19 -12
- package/dist/targets/win/nsis/WebInstallerTarget.js.map +1 -1
- package/dist/targets/win/nsis/nsisOptions.d.ts +29 -4
- package/dist/targets/win/nsis/nsisOptions.d.ts.map +1 -1
- package/dist/targets/win/nsis/nsisOptions.js.map +1 -1
- package/dist/toolsets/7zip.d.ts +32 -0
- package/dist/toolsets/7zip.d.ts.map +1 -1
- package/dist/toolsets/7zip.js +39 -13
- package/dist/toolsets/7zip.js.map +1 -1
- package/dist/toolsets/linuxToolsMac.d.ts.map +1 -1
- package/dist/toolsets/linuxToolsMac.js +15 -5
- package/dist/toolsets/linuxToolsMac.js.map +1 -1
- package/dist/toolsets/wine.d.ts.map +1 -1
- package/dist/toolsets/wine.js +17 -12
- package/dist/toolsets/wine.js.map +1 -1
- package/dist/util/NodeModuleCopyHelper.js +12 -4
- package/dist/util/NodeModuleCopyHelper.js.map +1 -1
- package/dist/util/appFileCopier.d.ts +5 -0
- package/dist/util/appFileCopier.d.ts.map +1 -1
- package/dist/util/appFileCopier.js +39 -1
- package/dist/util/appFileCopier.js.map +1 -1
- package/dist/util/config/config.d.ts.map +1 -1
- package/dist/util/config/config.js +4 -0
- package/dist/util/config/config.js.map +1 -1
- package/dist/util/config/legacyConfigGuard.d.ts +7 -0
- package/dist/util/config/legacyConfigGuard.d.ts.map +1 -0
- package/dist/util/config/legacyConfigGuard.js +187 -0
- package/dist/util/config/legacyConfigGuard.js.map +1 -0
- package/dist/util/config/legacyOptions.d.ts +73 -0
- package/dist/util/config/legacyOptions.d.ts.map +1 -0
- package/dist/util/config/legacyOptions.js +369 -0
- package/dist/util/config/legacyOptions.js.map +1 -0
- package/dist/util/config/schemaValidator.d.ts.map +1 -1
- package/dist/util/config/schemaValidator.js +16 -0
- package/dist/util/config/schemaValidator.js.map +1 -1
- package/dist/util/electronGet.d.ts +11 -4
- package/dist/util/electronGet.d.ts.map +1 -1
- package/dist/util/electronGet.js +63 -3
- package/dist/util/electronGet.js.map +1 -1
- package/dist/util/flags.d.ts +5 -0
- package/dist/util/flags.d.ts.map +1 -1
- package/dist/util/flags.js +124 -1
- package/dist/util/flags.js.map +1 -1
- package/dist/util/installOrRebuild.d.ts +6 -0
- package/dist/util/installOrRebuild.d.ts.map +1 -1
- package/dist/util/installOrRebuild.js +47 -0
- package/dist/util/installOrRebuild.js.map +1 -1
- package/dist/util/packageMetadata.js +11 -0
- package/dist/util/packageMetadata.js.map +1 -1
- package/dist/util/repositoryInfo.js +6 -3
- package/dist/util/repositoryInfo.js.map +1 -1
- package/dist/util/resolve.js +1 -1
- package/dist/util/resolve.js.map +1 -1
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/dist/version.js.map +1 -1
- package/dist/winPackager.d.ts +4 -3
- package/dist/winPackager.d.ts.map +1 -1
- package/dist/winPackager.js +22 -16
- package/dist/winPackager.js.map +1 -1
- package/package.json +12 -12
- package/scheme.json +396 -49
- package/templates/entitlements.mac.adhoc.plist +15 -0
- package/templates/entitlements.mac.plist +9 -6
- package/templates/nsis/common.nsh +2 -2
- package/templates/nsis/include/allowOnlyOneInstallerInstance.nsh +68 -4
- package/templates/nsis/include/extractAppPackage.nsh +1 -1
- package/templates/nsis/include/installUtil.nsh +2 -2
- package/templates/nsis/include/installer.nsh +2 -31
- package/templates/nsis/include/webPackage.nsh +33 -23
- package/templates/nsis/installer.nsi +1 -1
- package/templates/nsis/multiUserUi.nsh +1 -1
package/dist/util/electronGet.js
CHANGED
|
@@ -233,6 +233,47 @@ function initializeProxyOnce() {
|
|
|
233
233
|
export function reinitializeProxy() {
|
|
234
234
|
get.initializeProxy();
|
|
235
235
|
}
|
|
236
|
+
/**
|
|
237
|
+
* Error codes considered transient for artifact downloads. Plain node socket errors carry the code
|
|
238
|
+
* directly on `error.code`; undici (the fetch implementation used by @electron/get v5) wraps them in
|
|
239
|
+
* a `TypeError: fetch failed` whose code lives on `error.cause.code` — including undici's own
|
|
240
|
+
* `UND_ERR_*` codes for connection resets and connect timeouts.
|
|
241
|
+
*/
|
|
242
|
+
const TRANSIENT_DOWNLOAD_ERROR_CODES = new Set([
|
|
243
|
+
"ENOTFOUND",
|
|
244
|
+
"ETIMEDOUT",
|
|
245
|
+
"ECONNRESET",
|
|
246
|
+
"ECONNREFUSED",
|
|
247
|
+
"EAI_AGAIN",
|
|
248
|
+
"EPIPE",
|
|
249
|
+
"ENOENT",
|
|
250
|
+
"UND_ERR_SOCKET",
|
|
251
|
+
"UND_ERR_CONNECT_TIMEOUT",
|
|
252
|
+
]);
|
|
253
|
+
/**
|
|
254
|
+
* Decides whether a failed @electron/get download should be retried. Handles all three error shapes
|
|
255
|
+
* seen in practice (exported for tests):
|
|
256
|
+
* - builder-util-runtime's `HttpError` — retry on 5xx.
|
|
257
|
+
* - @electron/get v5's `HTTPError` (`FetchDownloader`) — a plain `Error` subclass with the fetch
|
|
258
|
+
* `Response` on `.response` and NO `.code`; retry on 5xx and 429. Matched by class and by
|
|
259
|
+
* `name === "HTTPError"` as a fallback in case multiple @electron/get copies are loaded.
|
|
260
|
+
* - transient network errors — code on `error.code`, or on `error.cause.code` for undici's
|
|
261
|
+
* `TypeError: fetch failed` wrapper.
|
|
262
|
+
*/
|
|
263
|
+
export function shouldRetryDownloadError(e) {
|
|
264
|
+
if (e == null) {
|
|
265
|
+
return false;
|
|
266
|
+
}
|
|
267
|
+
if (e instanceof HttpError) {
|
|
268
|
+
return e.isServerError();
|
|
269
|
+
}
|
|
270
|
+
if (e instanceof get.HTTPError || e.name === "HTTPError") {
|
|
271
|
+
const status = e.response?.status;
|
|
272
|
+
return typeof status === "number" && (status >= 500 || status === 429);
|
|
273
|
+
}
|
|
274
|
+
const code = typeof e.code === "string" ? e.code : typeof e.cause?.code === "string" ? e.cause.code : undefined;
|
|
275
|
+
return code != null && TRANSIENT_DOWNLOAD_ERROR_CODES.has(code);
|
|
276
|
+
}
|
|
236
277
|
async function downloadArtifactToFile(config, label) {
|
|
237
278
|
// Serialize concurrent downloads of the same artifact across vitest workers to prevent @electron/get's
|
|
238
279
|
// non-atomic putFileInCache (remove + move) from racing with a concurrent reader.
|
|
@@ -298,7 +339,7 @@ async function downloadArtifactToFile(config, label) {
|
|
|
298
339
|
retries: 3,
|
|
299
340
|
interval: 2000,
|
|
300
341
|
backoff: 2000,
|
|
301
|
-
shouldRetry:
|
|
342
|
+
shouldRetry: shouldRetryDownloadError,
|
|
302
343
|
});
|
|
303
344
|
}
|
|
304
345
|
catch (err) {
|
|
@@ -498,7 +539,7 @@ const CUSTOM_DIR_ENV_VARS = [
|
|
|
498
539
|
* Resolves the final download URL for a builder binary, honouring:
|
|
499
540
|
* ELECTRON_BUILDER_BINARIES_DOWNLOAD_OVERRIDE_URL – fully replaces the URL directory
|
|
500
541
|
* ELECTRON_BUILDER_BINARIES_CUSTOM_DIR (and npm_ variants) – replaces releaseName in the path
|
|
501
|
-
* overrideUrl (caller-supplied) – used as-is when no env var is set
|
|
542
|
+
* overrideUrl (caller-supplied) – the complete file URL, used as-is when no env var is set
|
|
502
543
|
*
|
|
503
544
|
* Exported for unit testing; not part of the public API.
|
|
504
545
|
* @internal
|
|
@@ -509,7 +550,9 @@ export function resolveBuilderBinaryUrl(releaseName, filenameWithExt, baseUrl, o
|
|
|
509
550
|
return `${envOverrideUrl}/${filenameWithExt}`;
|
|
510
551
|
}
|
|
511
552
|
if (overrideUrl != null) {
|
|
512
|
-
|
|
553
|
+
// The caller-supplied override (ToolsetCustom.url) points directly at the file — appending
|
|
554
|
+
// filenameWithExt would double the last path segment (e.g. …/bundle.7z/bundle.7z, issue #10084).
|
|
555
|
+
return overrideUrl;
|
|
513
556
|
}
|
|
514
557
|
const customDirEntry = CUSTOM_DIR_ENV_VARS.map(name => ({ name, value: process.env[name] })).find(e => e.value != null);
|
|
515
558
|
if (customDirEntry != null) {
|
|
@@ -521,8 +564,25 @@ export function resolveBuilderBinaryUrl(releaseName, filenameWithExt, baseUrl, o
|
|
|
521
564
|
* Downloads a generic artifact (.tar.gz or .zip) from a GitHub release.
|
|
522
565
|
* Used for electron-builder-binaries tools (appimage, etc.).
|
|
523
566
|
*/
|
|
567
|
+
/** Toolsets already announced this process, so a multi-target build logs each one once. */
|
|
568
|
+
const announcedToolsets = new Set();
|
|
569
|
+
/**
|
|
570
|
+
* Every `toolsets.*` property now defaults to "latest", which resolves to a newer bundle than v26
|
|
571
|
+
* pinned (NSIS 3.0.4.1 -> 3.12, winCodeSign 2.6.0 -> 1.3.0, Wine 4.0.1 -> 11.0, AppImage FUSE2 ->
|
|
572
|
+
* static FUSE3). Nothing recorded which version was used: `downloadBuilderToolset` logged only at
|
|
573
|
+
* debug level, and on a warm cache it printed nothing at all — so a regression introduced by a new
|
|
574
|
+
* bundle had no trace in the build log tying it to the toolset.
|
|
575
|
+
*/
|
|
576
|
+
function announceToolsetVersion(releaseName) {
|
|
577
|
+
if (announcedToolsets.has(releaseName)) {
|
|
578
|
+
return;
|
|
579
|
+
}
|
|
580
|
+
announcedToolsets.add(releaseName);
|
|
581
|
+
log.info({ toolset: releaseName }, "using toolset");
|
|
582
|
+
}
|
|
524
583
|
export async function downloadBuilderToolset(options) {
|
|
525
584
|
const { releaseName, filenameWithExt, checksums, githubOrgRepo = "electron-userland/electron-builder-binaries", overrideUrl } = options;
|
|
585
|
+
announceToolsetVersion(releaseName);
|
|
526
586
|
if (/[/\\]|^\.\./.test(filenameWithExt) || filenameWithExt.includes("..")) {
|
|
527
587
|
throw new Error(`downloadBuilderToolset: unsafe filenameWithExt "${filenameWithExt}" — must be a plain filename with no path separators or traversal sequences`);
|
|
528
588
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"electronGet.js","sourceRoot":"","sources":["../../src/util/electronGet.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,GAAG,MAAM,eAAe,CAAA;AACpC,OAAO,EAEL,yBAAyB,GAM1B,MAAM,eAAe,CAAA;AACtB,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,GAAG,EAAE,OAAO,EAAE,mBAAmB,EAAE,eAAe,EAAE,iBAAiB,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,cAAc,CAAA;AAC5I,OAAO,EAAE,SAAS,EAAE,QAAQ,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xD,MAAM,SAAS,GAAG,OAAO,CAAC,GAAG,CAAC,yCAAyC,CAAC,KAAK,MAAM,CAAA;IACnF,KAAK,MAAM,MAAM,IAAI;QACnB,6CAA6C;QAC7C,6CAA6C;QAC7C,qDAAqD;QACrD,kCAAkC;KACnC,EAAE,CAAC;QACF,MAAM,GAAG,GAAG,mBAAmB,CAAC,MAAM,EAAE,SAAS,CAAC,CAAA;QAClD,IAAI,GAAG,EAAE,CAAC;YACR,OAAO,GAAG,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,GAAG,GAAG,CAAA;QAC5C,CAAC;IACH,CAAC;IACD,OAAO,sBAAsB,aAAa,qBAAqB,CAAA;AACjE,CAAC","sourcesContent":["import * as get from \"@electron/get\"\nimport {\n ElectronArtifactDetails,\n ElectronDownloadCacheMode,\n ElectronDownloadRequest,\n ElectronDownloadRequestOptions,\n ElectronPlatformArtifactDetails,\n FetchDownloaderOptions,\n MirrorOptions,\n} from \"@electron/get\"\nimport { exec, exists, log, PADDING, parseValidEnvVarUrl, sanitizeDirPath, to7zaOutputSwitch, ensureDir, moveDirAtomic } from \"builder-util\"\nimport { HttpError, MemoLazy, retry, sleep } from \"builder-util-runtime\"\nimport * as crypto from \"crypto\"\nimport type { ProgressBar } from \"electron-publish\"\nimport { MultiProgress } from \"electron-publish\"\nimport { createReadStream, createWriteStream } from \"fs\"\nimport * as fs from \"fs/promises\"\nimport * as os from \"os\"\nimport * as path from \"path\"\nimport * as lockfile from \"proper-lockfile\"\nimport { pipeline } from \"stream/promises\"\nimport * as tar from \"tar\"\nimport * as unzipper from \"unzipper\"\nimport { getPath7za } from \"../toolsets/7zip.js\"\nimport { CacheState, cleanupCacheDirectory, computeCacheMetadata, readCacheStateFile, validateCacheDirectory, writeCacheState } from \"./cacheState.js\"\n\nexport interface ElectronGetOptions extends Omit<\n ElectronPlatformArtifactDetails,\n | \"platform\"\n | \"arch\"\n | \"version\"\n | \"artifactName\"\n | \"artifactSuffix\"\n | \"customFilename\"\n | \"tempDirectory\"\n | \"downloader\"\n | \"cacheMode\"\n | \"cacheRoot\"\n | \"downloadOptions\"\n | \"isGeneric\"\n | \"mirrorOptions\"\n> {\n mirrorOptions?: Omit<MirrorOptions, \"customDir\" | \"customFilename\" | \"customVersion\">\n}\n\nexport type ArtifactDownloadOptions = {\n options?: ElectronGetOptions | null\n artifactName: string\n platformName: string\n arch: string\n version: string\n cacheDir?: string\n}\n\nexport function hashUrlSafe(input: string, length = 6): string {\n let hash = 5381\n for (let i = 0; i < input.length; i++) {\n hash = ((hash << 5) + hash) ^ input.charCodeAt(i)\n }\n hash >>>= 0\n const out = hash.toString(36)\n return out.length >= length ? out.slice(0, length) : out.padStart(length, \"0\")\n}\n\n// MemoLazy (not Lazy): keyed on ELECTRON_BUILDER_CACHE so the resolved cache dir is recomputed if the\n// override env var changes, while staying memoized when it doesn't (the production case). The creator\n// also ensures the resolved dir exists — that side effect lives here, at the point of use, so\n// getCacheDirectoryInternal stays a pure path resolver.\nexport const cacheDirectoryOverrideAllowed = new MemoLazy<string | undefined, string>(\n () => process.env.ELECTRON_BUILDER_CACHE?.trim(),\n async () => {\n const dir = await getCacheDirectoryInternal({ isAvoidSystemOnWindows: true, allowEnvVarOverride: true })\n await ensureDir(dir)\n return dir\n }\n)\n// Exposed for testing; not intended for public use. Pure path resolution (no I/O) — use the memoized\n// const's above when you need the directory to exist on disk. Kept async for a stable Promise-returning\n// contract across all call sites.\n// eslint-disable-next-line @typescript-eslint/require-await\nexport async function getCacheDirectoryInternal(options: { isAvoidSystemOnWindows?: boolean; allowEnvVarOverride: boolean }): Promise<string> {\n const { isAvoidSystemOnWindows = true, allowEnvVarOverride } = options\n const env = process.env.ELECTRON_BUILDER_CACHE?.trim()\n if (allowEnvVarOverride && env && path.parse(env).root) {\n return sanitizeDirPath(env)\n }\n\n const appName = \"electron-builder\"\n const platform = os.platform()\n const homeDir = os.homedir()\n\n if (platform === \"darwin\") {\n return path.join(homeDir, \"Library\", \"Caches\", appName)\n }\n if (platform === \"win32\") {\n const localAppData = process.env.LOCALAPPDATA?.trim()\n const username = process.env.USERNAME?.trim()?.toLowerCase()\n // https://github.com/electron-userland/electron-builder/issues/1164\n const isSystemUser = isAvoidSystemOnWindows && (localAppData?.toLowerCase()?.includes(\"\\\\windows\\\\system32\\\\\") || username === \"system\")\n if (!localAppData || isSystemUser) {\n return path.join(os.tmpdir(), `${appName}-cache`)\n }\n return path.join(localAppData, appName, \"Cache\")\n }\n\n const xdgCache = process.env.XDG_CACHE_HOME\n return xdgCache && path.parse(xdgCache).root ? path.join(xdgCache, appName) : path.join(homeDir, \".cache\", appName)\n}\n\nfunction resolveCacheMode(): ElectronDownloadCacheMode {\n const varName = \"ELECTRON_DOWNLOAD_CACHE_MODE\"\n const cacheOverride = process.env[varName]?.trim()\n if (cacheOverride && Number(cacheOverride) in ElectronDownloadCacheMode) {\n const mode = Number(cacheOverride) as ElectronDownloadCacheMode\n log.debug({ mode }, `cache mode overridden via env var ${varName}`)\n return mode\n }\n return ElectronDownloadCacheMode.ReadWrite\n}\n\n/**\n * Returns true when `destPath` is safely contained within `dir` (direct child or deeper).\n * On Windows the filesystem is case-insensitive so the comparison is normalised to lowercase.\n * @internal exported for unit testing\n */\nexport function isSafeExtractPath(destPath: string, dir: string): boolean {\n const normalizedDest = path.resolve(destPath)\n const normalizedDir = path.resolve(dir)\n if (process.platform === \"win32\") {\n const d = normalizedDest.toLowerCase()\n const b = normalizedDir.toLowerCase()\n return d.startsWith(b + path.sep) || d === b\n }\n return normalizedDest.startsWith(normalizedDir + path.sep) || normalizedDest === normalizedDir\n}\n\nasync function extractZipStreaming(file: string, dir: string): Promise<void> {\n // Pass 1: read central directory once to collect Unix modes (one seek to EOF)\n const zipDir = await unzipper.Open.file(file)\n const entryModes = new Map<string, number>()\n for (const entry of zipDir.files) {\n const mode = (entry.externalFileAttributes >> 16) & 0xffff\n if (mode > 0) {\n entryModes.set(entry.path, mode)\n }\n }\n const isSymlink = (mode: number) => (mode & 0o170000) === 0o120000\n\n // Pass 2: stream from byte 0 — no per-entry seeks, no Docker hang.\n // Destroy the read stream in a finally block so the file handle is always released,\n // including when the loop exits early due to a thrown error.\n const readStream = createReadStream(file)\n try {\n const entries = readStream.pipe(unzipper.Parse({ forceStream: true }))\n for await (const entry of entries as AsyncIterable<unzipper.Entry>) {\n const destPath = path.resolve(dir, entry.path)\n if (!isSafeExtractPath(destPath, dir)) {\n throw new Error(`Path traversal blocked: ${entry.path}`)\n }\n const mode = entryModes.get(entry.path) ?? 0\n if (mode > 0 && isSymlink(mode)) {\n const target = (await entry.buffer()).toString()\n if (path.isAbsolute(target)) {\n throw new Error(`Absolute symlink target blocked: ${target}`)\n }\n const resolvedTarget = path.resolve(path.dirname(destPath), target)\n if (!isSafeExtractPath(resolvedTarget, dir)) {\n throw new Error(`Symlink target escapes extraction dir: ${target}`)\n }\n await fs.mkdir(path.dirname(destPath), { recursive: true })\n await fs.symlink(target, destPath)\n } else if (entry.type === \"Directory\") {\n await fs.mkdir(destPath, { recursive: true })\n entry.autodrain()\n } else {\n await fs.mkdir(path.dirname(destPath), { recursive: true })\n await pipeline(entry, createWriteStream(destPath))\n if (mode > 0) {\n await fs.chmod(destPath, mode & 0o7777)\n }\n }\n }\n } finally {\n readStream.destroy()\n }\n}\n\nexport async function extractArchive(archive: string, dir: string) {\n const file = sanitizeDirPath(archive)\n\n const tmpDir = `${dir}.tmp`\n await fs.mkdir(tmpDir, { recursive: true })\n\n const release = await lockfile.lock(tmpDir, {\n // 100 retries (not 15) so concurrent callers wait out a slow first extraction instead of failing\n // with ELOCKED; the update heartbeat keeps an in-progress holder's lock fresh against `stale`.\n retries: { retries: 100, minTimeout: 1000, maxTimeout: 5000 },\n stale: 120000, // Increased from 60s to allow long-running extractions\n })\n\n try {\n // rm + mkdir happen AFTER acquiring the lock so no concurrent caller can clear our tmpDir mid-extraction\n await fs.rm(tmpDir, { recursive: true, force: true })\n await fs.mkdir(tmpDir, { recursive: true })\n\n // Guard against the transient window in @electron/get's non-atomic putFileInCache (remove → move).\n // A concurrent worker may have deleted and not yet replaced the source archive; wait briefly for it.\n for (let i = 0; !(await exists(file)); i++) {\n if (i >= 4) {\n throw Object.assign(new Error(`Source archive not found after retries: ${file}`), { code: \"ENOENT\", path: file })\n }\n log.warn({ file, attempt: i + 1 }, \"source archive transiently missing, retrying\")\n await sleep(300 * (i + 1))\n }\n\n if (file.endsWith(\".tar.gz\") || file.endsWith(\".tgz\")) {\n await tar.extract({ file, cwd: tmpDir, strip: 1 })\n } else if (file.endsWith(\".tar.xz\") || file.endsWith(\".txz\") || file.endsWith(\".tar.7z\")) {\n // Compressed tarballs node-tar cannot decompress itself (xz, 7z): use 7za to strip the outer\n // compression layer into a .tar, then extract that tar.\n // Note: the .tar.7z check MUST stay ahead of the plain .7z branch below, otherwise only the outer\n // 7z layer is removed and the inner tar is left behind as-is (see https://github.com/electron-userland/electron-builder/issues/10002).\n const cmd7za = await getPath7za()\n const decompressOutDir = `${tmpDir}.decompress`\n await fs.rm(decompressOutDir, { recursive: true, force: true })\n await fs.mkdir(decompressOutDir, { recursive: true })\n try {\n await exec(cmd7za, [\"x\", \"-bd\", file, to7zaOutputSwitch(sanitizeDirPath(decompressOutDir)), \"-y\"])\n const innerTar = (await fs.readdir(decompressOutDir)).find(f => f.endsWith(\".tar\"))\n if (innerTar == null) {\n throw new Error(`decompression of ${path.basename(file)} produced no .tar archive`)\n }\n await tar.extract({ file: path.join(decompressOutDir, innerTar), cwd: tmpDir, strip: 1 })\n } finally {\n await fs.rm(decompressOutDir, { recursive: true, force: true })\n }\n } else if (file.endsWith(\".zip\")) {\n await extractZipStreaming(file, tmpDir)\n } else if (file.endsWith(\".7z\")) {\n const cmd7za = await getPath7za()\n try {\n await exec(cmd7za, [\"x\", \"-bd\", file, to7zaOutputSwitch(sanitizeDirPath(tmpDir)), \"-y\"])\n } catch (e: any) {\n // Check if extraction actually failed or just had benign warnings\n const files = await fs.readdir(tmpDir)\n if (files.length === 0) {\n log.warn({ file: log.filePath(file), tmpDir: log.filePath(tmpDir), error: e.message }, \"7z extraction produced no output\")\n throw new Error(`7z extraction failed for ${file}: ${e.message}`)\n }\n // If files were extracted despite the error, log and continue\n log.warn({ error: e.message, filesExtracted: files.length }, \"7z reported error but extracted files\")\n }\n } else {\n throw new Error(`Unsupported archive format: ${path.basename(file)}`)\n }\n\n // Verify extraction produced files\n const extractedFiles = await fs.readdir(tmpDir)\n if (extractedFiles.length === 0) {\n throw new Error(`Extraction of ${path.basename(file)} produced no files`)\n }\n\n await fs.rm(dir, { recursive: true, force: true })\n await moveDirAtomic(tmpDir, dir)\n } finally {\n await release().catch(err => log.warn({ err }, \"failed to release lockfile\"))\n }\n}\n\nlet proxyInitialized = false\nfunction initializeProxyOnce(): void {\n if (!proxyInitialized) {\n reinitializeProxy()\n proxyInitialized = true\n }\n}\n\n/**\n * Forces undici's global proxy dispatcher to re-read the current HTTP(S)_PROXY / NO_PROXY env vars,\n * bypassing the once-guard in initializeProxyOnce(). Exported for integration testing only.\n */\nexport function reinitializeProxy(): void {\n get.initializeProxy()\n}\n\nasync function downloadArtifactToFile(config: ElectronArtifactDetails, label: string): Promise<string> {\n // Serialize concurrent downloads of the same artifact across vitest workers to prevent @electron/get's\n // non-atomic putFileInCache (remove + move) from racing with a concurrent reader.\n const key = {\n p: (config as ElectronPlatformArtifactDetails).platform,\n a: (config as ElectronPlatformArtifactDetails).arch,\n v: config.version,\n n: config.artifactName,\n g: config.isGeneric,\n }\n\n const artifactLockKey = crypto.createHash(\"sha256\").update(JSON.stringify(key)).digest(\"hex\").slice(0, 20)\n const artifactLockPath = path.join(os.tmpdir(), `eb-dl-${artifactLockKey}.lock`)\n // This lock is taken even for cache hits (the cache-hit check lives inside @electron/get), so under\n // heavy concurrency many builds serialize here. 30 retries (~137s of backoff) is too few — waiters\n // were exhausting it and failing with ELOCKED while the holder fetched a large artifact. 100 retries\n // matches the other toolset locks; stale (10min) + proper-lockfile's update heartbeat keep a live\n // downloader's lock fresh so the longer wait never falsely steals an in-progress download.\n const releaseArtifactLock = await lockfile.lock(artifactLockPath, {\n retries: { retries: 100, minTimeout: 500, maxTimeout: 5000 },\n stale: 600_000,\n realpath: false,\n })\n let lastLoggedMilestone = -1\n const state: { bar: ProgressBar | undefined } = { bar: undefined }\n\n // @electron/get v5 downloads via fetch, whose proxy support comes from undici's global dispatcher.\n // initializeProxy() wires that up from HTTP(S)_PROXY/NO_PROXY env vars (replaces the got proxy agent).\n initializeProxyOnce()\n\n const downloadOptions: FetchDownloaderOptions = {\n signal: AbortSignal.timeout(10 * 60 * 1000), // prevent indefinite hang on stalled connections\n ...config.downloadOptions,\n getProgressCallback: info => {\n // @electron/get passes downloadOptions (including this callback) to its internal\n // SHASUMS256.txt validation download. That file is tiny (<1 MB) and fires at 100%\n // immediately, producing a spurious bar even when the artifact itself is cached.\n // Skip progress display for any download whose total size is known and small.\n if (info.total && info.total < 1_000_000) {\n return Promise.resolve()\n }\n if (!state.bar && process.stdout.isTTY) {\n log.info({ label }, \"downloading\")\n state.bar = new MultiProgress().createBar(`${\" \".repeat(PADDING + 2)}[:bar] :percent | ${label}`, { total: 100 })\n }\n const pct = info.percent != null ? Math.floor(info.percent * 100) : 0\n if (state.bar) {\n state.bar.update(pct)\n } else {\n // log every 25% milestone for non-TTY environments (e.g. CI logs) to provide some visibility into download progress without overwhelming logs with too many updates\n const percentCompleted = info.transferred && info.total ? Math.floor((info.transferred / info.total) * 100) : Math.floor(pct / 25) * 25\n if (percentCompleted > lastLoggedMilestone && percentCompleted > 0) {\n lastLoggedMilestone = percentCompleted\n log.info({ label, progress: `${percentCompleted}%` }, percentCompleted !== 100 ? \"downloading\" : \"downloaded\")\n }\n }\n return Promise.resolve()\n },\n }\n\n const configWithProgress = { ...config, downloadOptions }\n try {\n let filePath: string\n try {\n filePath = await retry(() => get.downloadArtifact(configWithProgress), {\n retries: 3,\n interval: 2000,\n backoff: 2000,\n shouldRetry: (e: any) =>\n e instanceof HttpError ? e.isServerError() : typeof e?.code === \"string\" && [\"ENOTFOUND\", \"ETIMEDOUT\", \"ECONNRESET\", \"EPIPE\", \"ENOENT\"].includes(e.code),\n })\n } catch (err) {\n if (typeof (err as any)?.message === \"string\" && (err as any).message.includes(\"dest already exists\")) {\n filePath = await get.downloadArtifact(configWithProgress)\n } else {\n throw err\n }\n }\n if (!(await exists(filePath))) {\n log.warn({ filePath, label }, \"cached artifact missing from disk; retrying with cache write\")\n filePath = await get.downloadArtifact({ ...configWithProgress, cacheMode: ElectronDownloadCacheMode.WriteOnly })\n }\n if (!state.bar && lastLoggedMilestone === -1) {\n log.info({ label }, \"using cached artifact\")\n }\n return filePath\n } finally {\n state.bar?.update(100)\n state.bar?.terminate()\n await releaseArtifactLock().catch(err => log.warn({ err }, \"failed to release artifact download lock\"))\n }\n}\n\n/**\n * Checks electron-builder's own archive cache for a previously downloaded archive.\n * Validates the SHA-256 checksum when one is known. Returns the cached path on hit,\n * null on miss or checksum mismatch (mismatch also deletes the stale file).\n *\n * Air-gapped seeding contract: placing the archive at\n * `<cacheDir>/<releaseName>/<archive>` (e.g. `$ELECTRON_BUILDER_CACHE/appimage@1.0.3/appimage-tools-runtime-20251108.tar.gz`)\n * is sufficient for a fully offline toolset resolution — the checksum here is computed locally\n * against the value hardcoded in the toolset module, and extraction happens locally too. No\n * `.state` file needs to be seeded. See https://www.electron.build/tutorials/offline-air-gapped-builds.\n */\nasync function resolveFromArchiveCache(archiveCachePath: string, label: string, expectedSha256: string | undefined): Promise<string | null> {\n if (!(await exists(archiveCachePath))) {\n return null\n }\n if (expectedSha256) {\n const hash = await new Promise<string>((resolve, reject) => {\n const h = crypto.createHash(\"sha256\")\n const s = createReadStream(archiveCachePath)\n s.on(\"error\", reject)\n s.on(\"data\", (chunk: Buffer | string) => h.update(chunk))\n s.on(\"end\", () => resolve(h.digest(\"hex\")))\n })\n if (hash !== expectedSha256) {\n log.warn({ file: label, archiveCachePath }, \"cached archive checksum mismatch — removing and re-downloading\")\n await fs.rm(archiveCachePath).catch(() => {})\n return null\n }\n }\n log.debug({ file: label, archiveCachePath }, \"using cached archive — skipping download\")\n return archiveCachePath\n}\n\n/**\n * Copies a freshly downloaded archive into electron-builder's own archive cache so that\n * future builds (including offline environments) can skip the network request entirely.\n */\nasync function persistToArchiveCache(sourcePath: string, archiveCachePath: string): Promise<void> {\n try {\n await fs.mkdir(path.dirname(archiveCachePath), { recursive: true })\n await fs.copyFile(sourcePath, archiveCachePath)\n } catch (err) {\n log.warn({ err, archiveCachePath }, \"failed to persist archive to cache — will re-download next time\")\n }\n}\n\n/**\n * Core download + extract engine. Handles lockfile, cache-hit short-circuit,\n * progress bar, extraction (.zip or .tar.gz), and completion marker.\n * Both public download functions delegate here after building their respective configs.\n */\nasync function downloadAndExtract(config: ElectronArtifactDetails, extractDir: string, label: string, archiveCachePath?: string): Promise<string> {\n // Create only the PARENT dir (e.g. <cache>/fpm@2.2.1), never extractDir itself, before locking.\n // The parent is stable — cleanup only ever removes extractDir and its .state/.tmp/.lock siblings —\n // so extractDir's whole lifecycle (mkdir, rm, re-mkdir) stays inside the lock. ensureDir absorbs\n // the concurrent-recursive-mkdir ENOENT/EEXIST race while peers populate the cold cache tree.\n await ensureDir(path.dirname(extractDir))\n\n // Pre-lock fast path: read-only short-circuit for a definitively complete and valid cache.\n // Safe unlocked — the cache-state helpers return null/false for a missing or half-written dir,\n // so a racing read only ever falls through to take the lock. Do NOT mutate the dir here.\n const stateData = await readCacheStateFile(extractDir)\n if (stateData?.state === CacheState.complete) {\n const isValid = await validateCacheDirectory(extractDir, stateData.fileCount)\n if (isValid) {\n log.debug({ file: label, path: extractDir }, \"using cached artifact - cache valid\")\n return extractDir\n }\n }\n\n // Be patient: when many targets/builds contend on the same toolset cache concurrently, all but the\n // first wait here while the winner downloads+extracts (a large bundle can take >1min). 15 retries\n // (~67s) is too few and waiters fail with ELOCKED before the winner finishes; 100 matches the\n // patience of withToolsetLock. proper-lockfile's update heartbeat keeps a live holder's lock fresh,\n // so increasing waiter retries never falsely steals an in-progress extraction.\n const release = await lockfile.lock(extractDir, {\n // realpath:false so proper-lockfile creates <extractDir>.lock in the (already-created) parent\n // WITHOUT calling fs.realpath(extractDir) first — which would throw ENOENT now that extractDir\n // is created lazily inside the lock. This filesystem lock serializes peers both across worker\n // processes AND within a single process (a second lock() for the same path retries until the\n // first releases), so no in-process promise cache is needed — and one wouldn't help across the\n // separate test worker processes anyway.\n realpath: false,\n retries: { retries: 100, minTimeout: 1000, maxTimeout: 5000 },\n stale: 120000,\n })\n let downloadedFile: string | null = null\n try {\n // Re-check after acquiring lock: another worker may have completed while we waited.\n const stateDataAfterLock = await readCacheStateFile(extractDir)\n if (stateDataAfterLock?.state === CacheState.complete) {\n const isValid = await validateCacheDirectory(extractDir, stateDataAfterLock.fileCount)\n if (isValid) {\n log.debug({ file: label, path: extractDir }, \"using cached artifact - skipping download/extract\")\n return extractDir\n }\n log.warn({ extractDir }, \"Cache marked complete but files invalid, clearing\")\n } else if (stateDataAfterLock?.state === CacheState.corrupted) {\n log.warn({ extractDir }, \"Corrupted cache detected, cleaning up and re-extracting\")\n }\n\n // Cleanup inside the lock — skip lock files since we currently hold them\n await cleanupCacheDirectory(extractDir, { skipLockFiles: true })\n await ensureDir(extractDir)\n\n // Check electron-builder's own archive cache before touching @electron/get.\n // The cache lives alongside the extract dir: <cacheDir>/<releaseName>/<filename>.\n // This lets repeated builds (or offline environments) skip the download entirely once\n // the archive has been fetched at least once.\n if (archiveCachePath) {\n downloadedFile = await resolveFromArchiveCache(archiveCachePath, label, (config as any).checksums?.[label])\n }\n\n if (!downloadedFile) {\n log.debug({ file: label }, \"downloading\")\n downloadedFile = await downloadArtifactToFile(config, label)\n if (!downloadedFile) {\n throw new Error(`Failed to download artifact: ${label}`)\n }\n // Persist the downloaded archive so future builds (and offline environments) can\n // skip the network request entirely.\n if (archiveCachePath) {\n await persistToArchiveCache(downloadedFile, archiveCachePath)\n }\n }\n\n await writeCacheState(extractDir, CacheState.downloaded)\n\n // Mark extracting so stale-lock detection can recover a crashed mid-extraction process\n await writeCacheState(extractDir, CacheState.extracting)\n\n // Extract while holding the lock to prevent concurrent interference\n await extractArchive(downloadedFile, extractDir)\n\n // Compute metadata with a full recursive walk now that tmpDir has been renamed to extractDir\n const { fileCount, extractedSize } = await computeCacheMetadata(extractDir)\n\n // Write complete state with metadata BEFORE releasing the lock; throwOnError=true so a\n // failed write (disk full, permissions) propagates instead of silently producing a no-op cache\n await writeCacheState(extractDir, CacheState.complete, { fileCount, extractedSize }, true)\n } finally {\n await release().catch(err => log.warn({ err }, \"failed to release lockfile\"))\n }\n return extractDir\n}\n\n// ─── Public API ───────────────────────────────────────────────────────────────\n\n/**\n * Copies a remote artifact to a specific output path on disk.\n * Unlike downloadBuilderToolset, this does not extract archives — it copies the raw file.\n * Used for certificate imports where the caller needs the file at a known path.\n */\nexport async function download(url: string, output: string, checksum?: string | null): Promise<void> {\n const filenameWithExt = path.basename(new URL(url).pathname)\n if (checksum == null) {\n log.warn({ url }, \"downloading without an integrity checksum — the download is not verified against a known-good hash\")\n }\n const downloadedFile = await downloadArtifactToFile(\n {\n version: \"9.9.9\",\n artifactName: filenameWithExt,\n cacheRoot: path.resolve(await cacheDirectoryOverrideAllowed.value, \"downloads\"),\n cacheMode: resolveCacheMode(),\n ...(checksum != null ? { checksums: { [filenameWithExt]: checksum } } : { unsafelyDisableChecksums: true }),\n mirrorOptions: { resolveAssetURL: async () => Promise.resolve(url) },\n isGeneric: true,\n },\n filenameWithExt\n )\n await fs.copyFile(downloadedFile, output)\n}\n\nfunction validateBinaryCustomDir(envVarName: string, value: string): string {\n if (value.includes(\"://\") || value.includes(\"..\") || value.startsWith(\"/\")) {\n throw new Error(\n `${envVarName} must be a safe relative path component (e.g. \"v1.0.0-custom\"). ` + `Values containing \"://\", \"..\", or a leading \"/\" are not allowed. Got: \"${value}\"`\n )\n }\n return value\n}\n\nconst CUSTOM_DIR_ENV_VARS = [\n \"NPM_CONFIG_ELECTRON_BUILDER_BINARIES_CUSTOM_DIR\",\n \"npm_config_electron_builder_binaries_custom_dir\",\n \"npm_package_config_electron_builder_binaries_custom_dir\",\n \"ELECTRON_BUILDER_BINARIES_CUSTOM_DIR\",\n] as const\n\n/**\n * Resolves the final download URL for a builder binary, honouring:\n * ELECTRON_BUILDER_BINARIES_DOWNLOAD_OVERRIDE_URL – fully replaces the URL directory\n * ELECTRON_BUILDER_BINARIES_CUSTOM_DIR (and npm_ variants) – replaces releaseName in the path\n * overrideUrl (caller-supplied) – used as-is when no env var is set\n *\n * Exported for unit testing; not part of the public API.\n * @internal\n */\nexport function resolveBuilderBinaryUrl(releaseName: string, filenameWithExt: string, baseUrl: string, overrideUrl?: string): string {\n const envOverrideUrl = parseValidEnvVarUrl(\"ELECTRON_BUILDER_BINARIES_DOWNLOAD_OVERRIDE_URL\")\n if (envOverrideUrl != null) {\n return `${envOverrideUrl}/${filenameWithExt}`\n }\n if (overrideUrl != null) {\n return `${overrideUrl}/${filenameWithExt}`\n }\n const customDirEntry = CUSTOM_DIR_ENV_VARS.map(name => ({ name, value: process.env[name] })).find(e => e.value != null)\n if (customDirEntry != null) {\n return `${baseUrl}${validateBinaryCustomDir(customDirEntry.name, customDirEntry.value!)}/${filenameWithExt}`\n }\n return `${baseUrl}${releaseName}/${filenameWithExt}`\n}\n\n/**\n * Downloads a generic artifact (.tar.gz or .zip) from a GitHub release.\n * Used for electron-builder-binaries tools (appimage, etc.).\n */\nexport async function downloadBuilderToolset(options: {\n releaseName: string\n filenameWithExt: string\n checksums?: Record<string, string>\n githubOrgRepo?: string\n overrideUrl?: string\n}): Promise<string> {\n const { releaseName, filenameWithExt, checksums, githubOrgRepo = \"electron-userland/electron-builder-binaries\", overrideUrl } = options\n\n if (/[/\\\\]|^\\.\\./.test(filenameWithExt) || filenameWithExt.includes(\"..\")) {\n throw new Error(`downloadBuilderToolset: unsafe filenameWithExt \"${filenameWithExt}\" — must be a plain filename with no path separators or traversal sequences`)\n }\n\n const baseUrl = getBinariesMirrorUrl(githubOrgRepo)\n const fullUrl = resolveBuilderBinaryUrl(releaseName, filenameWithExt, baseUrl, overrideUrl)\n const suffix = hashUrlSafe(fullUrl, 5)\n // tar.7z is listed before 7z so the full extension is stripped. Deliberate side effect: this changes the\n // extract-dir name for .tar.7z toolsets (e.g. the snap template) from \"<name>.tar-<hash>\" to \"<name>-<hash>\",\n // which busts caches poisoned by the broken .tar.7z extraction in 26.15.0-26.15.6 (issue #10002).\n const folderName = `${filenameWithExt.replace(/\\.(tar\\.gz|tgz|tar\\.xz|txz|tar\\.7z|zip|7z)$/, \"\")}-${suffix}`\n // releaseName is library input; enforce cache-dir containment (rejects traversal, clears taint into shell extraction)\n const cacheDir = await cacheDirectoryOverrideAllowed.value\n const extractDir = sanitizeDirPath(path.join(cacheDir, releaseName, folderName), cacheDir)\n\n // Use resolveAssetURL so @electron/get's ELECTRON_MIRROR env var check cannot override\n // the builder-binaries URL we've already resolved (see getArtifactRemoteURL in @electron/get).\n const mirrorOptions: MirrorOptions = {\n resolveAssetURL: async () => Promise.resolve(fullUrl),\n }\n\n // Predictable archive cache: <cacheDir>/<releaseName>/<filename>, next to the extract dir.\n // downloadAndExtract checks here before touching @electron/get and persists the archive here\n // after every successful download, so subsequent builds never need a network round-trip.\n const archiveCachePath = sanitizeDirPath(path.join(cacheDir, releaseName, filenameWithExt), cacheDir)\n\n const config: ElectronDownloadRequest & ElectronDownloadRequestOptions & { isGeneric: true } = {\n version: \"9.9.9\", // must be >1.3.2 to bypass @electron/get validation shortcut\n artifactName: filenameWithExt,\n cacheRoot: path.resolve(await cacheDirectoryOverrideAllowed.value, \"downloads\"),\n cacheMode: resolveCacheMode(),\n ...(checksums != null ? { checksums } : { unsafelyDisableChecksums: true }),\n mirrorOptions,\n isGeneric: true,\n }\n return downloadAndExtract(config, extractDir, filenameWithExt, archiveCachePath)\n}\n\n/**\n * Mirrors @electron/get's default cache root (`env-paths(\"electron\", { suffix: \"\" }).cache`).\n * @electron/get does not export it and its package `exports` map blocks deep imports, so the\n * (deliberately tiny) platform switch is replicated here. Must stay in sync with the\n * `cacheRoot` default documented in @electron/get's `ElectronDownloadRequestOptions`.\n * @internal exported for unit testing\n */\nexport function defaultElectronGetCacheRoot(): string {\n const name = \"electron\"\n const homeDir = os.homedir()\n switch (os.platform()) {\n case \"darwin\":\n return path.join(homeDir, \"Library\", \"Caches\", name)\n case \"win32\":\n return path.join(process.env.LOCALAPPDATA || path.join(homeDir, \"AppData\", \"Local\"), name, \"Cache\")\n default:\n return path.join(process.env.XDG_CACHE_HOME || path.join(homeDir, \".cache\"), name)\n }\n}\n\n/**\n * Parses the upstream `SHASUMS256.txt` format into the `Record<filename, sha256-hex>` shape that\n * @electron/get accepts as inline `checksums`. Each line is `<sha256-hex> *<filename>` (binary\n * mode) or `<sha256-hex> <filename>` (text mode); malformed lines are ignored.\n * @internal exported for unit testing\n */\nexport function parseChecksumFile(content: string): Record<string, string> {\n const checksums: Record<string, string> = {}\n for (const rawLine of content.split(\"\\n\")) {\n const match = /^([a-fA-F0-9]{64})\\s+\\*?(.+)$/.exec(rawLine.trim())\n if (match != null) {\n checksums[match[2]] = match[1].toLowerCase()\n }\n }\n return checksums\n}\n\n/**\n * Looks for a locally seeded SHASUMS256 file at the root of the @electron/get cache and returns\n * its contents as inline `checksums`, or null when nothing usable is seeded.\n *\n * Why: without inline `checksums`, @electron/get re-downloads `SHASUMS256.txt` with a hardcoded\n * `cacheMode: Bypass` on EVERY build — even when the artifact itself is a cache hit — so a fully\n * seeded cache still requires network access and air-gapped builds fail (#10039). Cache-seeding\n * tools (e.g. flatpak-node-generator) already place `SHASUMS256.txt-<version>` flat at the cache\n * root; feeding it back as inline `checksums` keeps checksum validation enabled while making it\n * fully offline. A plain `SHASUMS256.txt` at the cache root is accepted as a manual-seeding\n * fallback. A candidate file is only used when it actually contains an entry for the requested\n * artifact, so a stale file for another version can never break an online build.\n * See https://www.electron.build/tutorials/offline-air-gapped-builds for the seeding contract.\n * @internal exported for unit testing\n */\nexport async function resolveSeededChecksums(cacheRoot: string, version: string, artifactFileName: string): Promise<Record<string, string> | null> {\n const candidates = [path.join(cacheRoot, `SHASUMS256.txt-${version}`), path.join(cacheRoot, \"SHASUMS256.txt\")]\n for (const candidate of candidates) {\n if (!(await exists(candidate))) {\n continue\n }\n let content: string\n try {\n content = await fs.readFile(candidate, \"utf-8\")\n } catch (err: any) {\n log.warn({ file: log.filePath(candidate), err: err.message }, \"failed to read seeded SHASUMS file — ignoring it\")\n continue\n }\n const checksums = parseChecksumFile(content)\n if (checksums[artifactFileName] == null) {\n log.warn({ file: log.filePath(candidate), artifactFileName }, \"seeded SHASUMS file has no entry for the requested artifact — ignoring it\")\n continue\n }\n log.debug({ file: log.filePath(candidate), artifactFileName }, \"using locally seeded SHASUMS256 checksums — checksum validation can run offline\")\n return checksums\n }\n return null\n}\n\n/**\n * Assembles the `@electron/get` artifact config (`ElectronPlatformArtifactDetails`) from\n * `ArtifactDownloadOptions`: spreads the caller's options and pins `cacheRoot`/`platform`/`arch`/\n * `version`/`artifactName` and the resolved cache mode, warning when checksum verification is\n * disabled. When the caller provides no `checksums` (user-provided `electronGet.checksums` always\n * wins) and verification is not disabled, a locally seeded `SHASUMS256.txt-<version>` at the cache\n * root is picked up as inline `checksums` so validation works offline (see resolveSeededChecksums).\n * Callers pass the result to `downloadArtifactToFile` / `downloadAndExtract`.\n * @internal exported for unit testing\n */\nexport async function buildElectronArtifactConfig(artifactOptions: ArtifactDownloadOptions): Promise<ElectronPlatformArtifactDetails> {\n const { options, arch, version, platformName: platform, artifactName, cacheDir: cacheRoot } = artifactOptions\n\n if (options?.unsafelyDisableChecksums) {\n log.warn(\n { artifactName },\n \"electronGet.unsafelyDisableChecksums is enabled — downloaded artifacts will NOT be verified; a compromised mirror can serve malicious binaries undetected\"\n )\n }\n\n const artifactConfig: ElectronPlatformArtifactDetails = { ...options, cacheRoot, platform, arch, version, artifactName, cacheMode: resolveCacheMode() }\n if (artifactConfig.checksums == null && !artifactConfig.unsafelyDisableChecksums) {\n // Matches @electron/get's getArtifactFileName for non-generic artifacts; `artifactSuffix` and\n // `customFilename` cannot diverge here — both are excluded from ElectronGetOptions.\n const artifactFileName = `${artifactName}-v${version}-${platform}-${arch}.zip`\n const seededChecksums = await resolveSeededChecksums(cacheRoot ?? defaultElectronGetCacheRoot(), version, artifactFileName)\n if (seededChecksums != null) {\n artifactConfig.checksums = seededChecksums\n }\n }\n return artifactConfig\n}\n\n/**\n * Downloads the electron artifact zip via @electron/get (with caching) and returns the zip file path.\n * Use when you need to extract the zip yourself (e.g. directly to appOutDir to preserve empty dirs and symlinks).\n */\nexport async function downloadElectronArtifactZip(options: ArtifactDownloadOptions): Promise<string> {\n const config = await buildElectronArtifactConfig(options)\n return downloadArtifactToFile(config, config.artifactName)\n}\n\n/**\n * Downloads an electron platform artifact (e.g. ffmpeg) via `@electron/get` and extracts it into a\n * content-addressed cache directory (keyed on a hash of the resolved artifact config), returning the\n * extraction path.\n */\nexport async function downloadElectronArtifact(options: ArtifactDownloadOptions): Promise<string> {\n const { arch, version, platformName: platform, artifactName } = options\n const artifactConfig = await buildElectronArtifactConfig(options)\n\n const suffix = hashUrlSafe(JSON.stringify(artifactConfig), 5)\n const folderName = `${artifactName}-v${version}-${platform}-${arch}-${suffix}`\n const extractDir = path.join(await cacheDirectoryOverrideAllowed.value, `${artifactName}-v${version}`, folderName)\n\n return downloadAndExtract(artifactConfig, extractDir, artifactName)\n}\n\n/**\n * Get the binaries mirror URL from environment variables.\n * Supports various npm config formats and falls back to GitHub.\n */\nexport function getBinariesMirrorUrl(githubOrgRepo: string): string {\n const allowHttp = process.env[\"ELECTRON_BUILDER_DANGEROUSLY_ALLOW_HTTP\"] === \"true\"\n for (const envVar of [\n \"NPM_CONFIG_ELECTRON_BUILDER_BINARIES_MIRROR\",\n \"npm_config_electron_builder_binaries_mirror\",\n \"npm_package_config_electron_builder_binaries_mirror\",\n \"ELECTRON_BUILDER_BINARIES_MIRROR\",\n ]) {\n const url = parseValidEnvVarUrl(envVar, allowHttp)\n if (url) {\n return url.endsWith(\"/\") ? url : `${url}/`\n }\n }\n return `https://github.com/${githubOrgRepo}/releases/download/`\n}\n"]}
|
|
1
|
+
{"version":3,"file":"electronGet.js","sourceRoot":"","sources":["../../src/util/electronGet.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,GAAG,MAAM,eAAe,CAAA;AACpC,OAAO,EAEL,yBAAyB,GAM1B,MAAM,eAAe,CAAA;AACtB,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,GAAG,EAAE,OAAO,EAAE,mBAAmB,EAAE,eAAe,EAAE,iBAAiB,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,cAAc,CAAA;AAC5I,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,sBAAsB,CAAA;AACxE,OAAO,KAAK,MAAM,MAAM,QAAQ,CAAA;AAEhC,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAA;AAChD,OAAO,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,MAAM,IAAI,CAAA;AACxD,OAAO,KAAK,EAAE,MAAM,aAAa,CAAA;AACjC,OAAO,KAAK,EAAE,MAAM,IAAI,CAAA;AACxB,OAAO,KAAK,IAAI,MAAM,MAAM,CAAA;AAC5B,OAAO,KAAK,QAAQ,MAAM,iBAAiB,CAAA;AAC3C,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAA;AAC1C,OAAO,KAAK,GAAG,MAAM,KAAK,CAAA;AAC1B,OAAO,KAAK,QAAQ,MAAM,UAAU,CAAA;AACpC,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAA;AAChD,OAAO,EAAE,UAAU,EAAE,qBAAqB,EAAE,oBAAoB,EAAE,kBAAkB,EAAE,sBAAsB,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAA;AA8BtJ,MAAM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AAG,WAAW,CAAC,IAAI,CAAC,SAAS,CAAC,cAAc,CAAC,EAAE,CAAC,CAAC,CAAA;IAC7D,MAAM,UAAU,GAAG,GAAG,YAAY,KAAK,OAAO,IAAI,QAAQ,IAAI,IAAI,IAAI,MAAM,EAAE,CAAA;IAC9E,MAAM,UAAU,GAAG,IAAI,CAAC,IAAI,CAAC,MAAM,6BAA6B,CAAC,KAAK,EAAE,GAAG,YAAY,KAAK,OAAO,EAAE,EAAE,UAAU,CAAC,CAAA;IAElH,OAAO,kBAAkB,CAAC,cAAc,EAAE,UAAU,EAAE,YAAY,CAAC,CAAA;AACrE,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,oBAAoB,CAAC,aAAqB;IACxD,MAAM,SAAS,GAAG,OAAO,CAAC,GAAG,CAAC,yCAAyC,CAAC,KAAK,MAAM,CAAA;IACnF,KAAK,MAAM,MAAM,IAAI;QACnB,6CAA6C;QAC7C,6CAA6C;QAC7C,qDAAqD;QACrD,kCAAkC;KACnC,EAAE,CAAC;QACF,MAAM,GAAG,GAAG,mBAAmB,CAAC,MAAM,EAAE,SAAS,CAAC,CAAA;QAClD,IAAI,GAAG,EAAE,CAAC;YACR,OAAO,GAAG,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,GAAG,GAAG,CAAA;QAC5C,CAAC;IACH,CAAC;IACD,OAAO,sBAAsB,aAAa,qBAAqB,CAAA;AACjE,CAAC","sourcesContent":["import * as get from \"@electron/get\"\nimport {\n ElectronArtifactDetails,\n ElectronDownloadCacheMode,\n ElectronDownloadRequest,\n ElectronDownloadRequestOptions,\n ElectronPlatformArtifactDetails,\n FetchDownloaderOptions,\n MirrorOptions,\n} from \"@electron/get\"\nimport { exec, exists, log, PADDING, parseValidEnvVarUrl, sanitizeDirPath, to7zaOutputSwitch, ensureDir, moveDirAtomic } from \"builder-util\"\nimport { HttpError, MemoLazy, retry, sleep } from \"builder-util-runtime\"\nimport * as crypto from \"crypto\"\nimport type { ProgressBar } from \"electron-publish\"\nimport { MultiProgress } from \"electron-publish\"\nimport { createReadStream, createWriteStream } from \"fs\"\nimport * as fs from \"fs/promises\"\nimport * as os from \"os\"\nimport * as path from \"path\"\nimport * as lockfile from \"proper-lockfile\"\nimport { pipeline } from \"stream/promises\"\nimport * as tar from \"tar\"\nimport * as unzipper from \"unzipper\"\nimport { getPath7za } from \"../toolsets/7zip.js\"\nimport { CacheState, cleanupCacheDirectory, computeCacheMetadata, readCacheStateFile, validateCacheDirectory, writeCacheState } from \"./cacheState.js\"\n\nexport interface ElectronGetOptions extends Omit<\n ElectronPlatformArtifactDetails,\n | \"platform\"\n | \"arch\"\n | \"version\"\n | \"artifactName\"\n | \"artifactSuffix\"\n | \"customFilename\"\n | \"tempDirectory\"\n | \"downloader\"\n | \"cacheMode\"\n | \"cacheRoot\"\n | \"downloadOptions\"\n | \"isGeneric\"\n | \"mirrorOptions\"\n> {\n mirrorOptions?: Omit<MirrorOptions, \"customDir\" | \"customFilename\" | \"customVersion\">\n}\n\nexport type ArtifactDownloadOptions = {\n options?: ElectronGetOptions | null\n artifactName: string\n platformName: string\n arch: string\n version: string\n cacheDir?: string\n}\n\nexport function hashUrlSafe(input: string, length = 6): string {\n let hash = 5381\n for (let i = 0; i < input.length; i++) {\n hash = ((hash << 5) + hash) ^ input.charCodeAt(i)\n }\n hash >>>= 0\n const out = hash.toString(36)\n return out.length >= length ? out.slice(0, length) : out.padStart(length, \"0\")\n}\n\n// MemoLazy (not Lazy): keyed on ELECTRON_BUILDER_CACHE so the resolved cache dir is recomputed if the\n// override env var changes, while staying memoized when it doesn't (the production case). The creator\n// also ensures the resolved dir exists — that side effect lives here, at the point of use, so\n// getCacheDirectoryInternal stays a pure path resolver.\nexport const cacheDirectoryOverrideAllowed = new MemoLazy<string | undefined, string>(\n () => process.env.ELECTRON_BUILDER_CACHE?.trim(),\n async () => {\n const dir = await getCacheDirectoryInternal({ isAvoidSystemOnWindows: true, allowEnvVarOverride: true })\n await ensureDir(dir)\n return dir\n }\n)\n// Exposed for testing; not intended for public use. Pure path resolution (no I/O) — use the memoized\n// const's above when you need the directory to exist on disk. Kept async for a stable Promise-returning\n// contract across all call sites.\n// eslint-disable-next-line @typescript-eslint/require-await\nexport async function getCacheDirectoryInternal(options: { isAvoidSystemOnWindows?: boolean; allowEnvVarOverride: boolean }): Promise<string> {\n const { isAvoidSystemOnWindows = true, allowEnvVarOverride } = options\n const env = process.env.ELECTRON_BUILDER_CACHE?.trim()\n if (allowEnvVarOverride && env && path.parse(env).root) {\n return sanitizeDirPath(env)\n }\n\n const appName = \"electron-builder\"\n const platform = os.platform()\n const homeDir = os.homedir()\n\n if (platform === \"darwin\") {\n return path.join(homeDir, \"Library\", \"Caches\", appName)\n }\n if (platform === \"win32\") {\n const localAppData = process.env.LOCALAPPDATA?.trim()\n const username = process.env.USERNAME?.trim()?.toLowerCase()\n // https://github.com/electron-userland/electron-builder/issues/1164\n const isSystemUser = isAvoidSystemOnWindows && (localAppData?.toLowerCase()?.includes(\"\\\\windows\\\\system32\\\\\") || username === \"system\")\n if (!localAppData || isSystemUser) {\n return path.join(os.tmpdir(), `${appName}-cache`)\n }\n return path.join(localAppData, appName, \"Cache\")\n }\n\n const xdgCache = process.env.XDG_CACHE_HOME\n return xdgCache && path.parse(xdgCache).root ? path.join(xdgCache, appName) : path.join(homeDir, \".cache\", appName)\n}\n\nfunction resolveCacheMode(): ElectronDownloadCacheMode {\n const varName = \"ELECTRON_DOWNLOAD_CACHE_MODE\"\n const cacheOverride = process.env[varName]?.trim()\n if (cacheOverride && Number(cacheOverride) in ElectronDownloadCacheMode) {\n const mode = Number(cacheOverride) as ElectronDownloadCacheMode\n log.debug({ mode }, `cache mode overridden via env var ${varName}`)\n return mode\n }\n return ElectronDownloadCacheMode.ReadWrite\n}\n\n/**\n * Returns true when `destPath` is safely contained within `dir` (direct child or deeper).\n * On Windows the filesystem is case-insensitive so the comparison is normalised to lowercase.\n * @internal exported for unit testing\n */\nexport function isSafeExtractPath(destPath: string, dir: string): boolean {\n const normalizedDest = path.resolve(destPath)\n const normalizedDir = path.resolve(dir)\n if (process.platform === \"win32\") {\n const d = normalizedDest.toLowerCase()\n const b = normalizedDir.toLowerCase()\n return d.startsWith(b + path.sep) || d === b\n }\n return normalizedDest.startsWith(normalizedDir + path.sep) || normalizedDest === normalizedDir\n}\n\nasync function extractZipStreaming(file: string, dir: string): Promise<void> {\n // Pass 1: read central directory once to collect Unix modes (one seek to EOF)\n const zipDir = await unzipper.Open.file(file)\n const entryModes = new Map<string, number>()\n for (const entry of zipDir.files) {\n const mode = (entry.externalFileAttributes >> 16) & 0xffff\n if (mode > 0) {\n entryModes.set(entry.path, mode)\n }\n }\n const isSymlink = (mode: number) => (mode & 0o170000) === 0o120000\n\n // Pass 2: stream from byte 0 — no per-entry seeks, no Docker hang.\n // Destroy the read stream in a finally block so the file handle is always released,\n // including when the loop exits early due to a thrown error.\n const readStream = createReadStream(file)\n try {\n const entries = readStream.pipe(unzipper.Parse({ forceStream: true }))\n for await (const entry of entries as AsyncIterable<unzipper.Entry>) {\n const destPath = path.resolve(dir, entry.path)\n if (!isSafeExtractPath(destPath, dir)) {\n throw new Error(`Path traversal blocked: ${entry.path}`)\n }\n const mode = entryModes.get(entry.path) ?? 0\n if (mode > 0 && isSymlink(mode)) {\n const target = (await entry.buffer()).toString()\n if (path.isAbsolute(target)) {\n throw new Error(`Absolute symlink target blocked: ${target}`)\n }\n const resolvedTarget = path.resolve(path.dirname(destPath), target)\n if (!isSafeExtractPath(resolvedTarget, dir)) {\n throw new Error(`Symlink target escapes extraction dir: ${target}`)\n }\n await fs.mkdir(path.dirname(destPath), { recursive: true })\n await fs.symlink(target, destPath)\n } else if (entry.type === \"Directory\") {\n await fs.mkdir(destPath, { recursive: true })\n entry.autodrain()\n } else {\n await fs.mkdir(path.dirname(destPath), { recursive: true })\n await pipeline(entry, createWriteStream(destPath))\n if (mode > 0) {\n await fs.chmod(destPath, mode & 0o7777)\n }\n }\n }\n } finally {\n readStream.destroy()\n }\n}\n\nexport async function extractArchive(archive: string, dir: string) {\n const file = sanitizeDirPath(archive)\n\n const tmpDir = `${dir}.tmp`\n await fs.mkdir(tmpDir, { recursive: true })\n\n const release = await lockfile.lock(tmpDir, {\n // 100 retries (not 15) so concurrent callers wait out a slow first extraction instead of failing\n // with ELOCKED; the update heartbeat keeps an in-progress holder's lock fresh against `stale`.\n retries: { retries: 100, minTimeout: 1000, maxTimeout: 5000 },\n stale: 120000, // Increased from 60s to allow long-running extractions\n })\n\n try {\n // rm + mkdir happen AFTER acquiring the lock so no concurrent caller can clear our tmpDir mid-extraction\n await fs.rm(tmpDir, { recursive: true, force: true })\n await fs.mkdir(tmpDir, { recursive: true })\n\n // Guard against the transient window in @electron/get's non-atomic putFileInCache (remove → move).\n // A concurrent worker may have deleted and not yet replaced the source archive; wait briefly for it.\n for (let i = 0; !(await exists(file)); i++) {\n if (i >= 4) {\n throw Object.assign(new Error(`Source archive not found after retries: ${file}`), { code: \"ENOENT\", path: file })\n }\n log.warn({ file, attempt: i + 1 }, \"source archive transiently missing, retrying\")\n await sleep(300 * (i + 1))\n }\n\n if (file.endsWith(\".tar.gz\") || file.endsWith(\".tgz\")) {\n await tar.extract({ file, cwd: tmpDir, strip: 1 })\n } else if (file.endsWith(\".tar.xz\") || file.endsWith(\".txz\") || file.endsWith(\".tar.7z\")) {\n // Compressed tarballs node-tar cannot decompress itself (xz, 7z): use 7za to strip the outer\n // compression layer into a .tar, then extract that tar.\n // Note: the .tar.7z check MUST stay ahead of the plain .7z branch below, otherwise only the outer\n // 7z layer is removed and the inner tar is left behind as-is (see https://github.com/electron-userland/electron-builder/issues/10002).\n const cmd7za = await getPath7za()\n const decompressOutDir = `${tmpDir}.decompress`\n await fs.rm(decompressOutDir, { recursive: true, force: true })\n await fs.mkdir(decompressOutDir, { recursive: true })\n try {\n await exec(cmd7za, [\"x\", \"-bd\", file, to7zaOutputSwitch(sanitizeDirPath(decompressOutDir)), \"-y\"])\n const innerTar = (await fs.readdir(decompressOutDir)).find(f => f.endsWith(\".tar\"))\n if (innerTar == null) {\n throw new Error(`decompression of ${path.basename(file)} produced no .tar archive`)\n }\n await tar.extract({ file: path.join(decompressOutDir, innerTar), cwd: tmpDir, strip: 1 })\n } finally {\n await fs.rm(decompressOutDir, { recursive: true, force: true })\n }\n } else if (file.endsWith(\".zip\")) {\n await extractZipStreaming(file, tmpDir)\n } else if (file.endsWith(\".7z\")) {\n const cmd7za = await getPath7za()\n try {\n await exec(cmd7za, [\"x\", \"-bd\", file, to7zaOutputSwitch(sanitizeDirPath(tmpDir)), \"-y\"])\n } catch (e: any) {\n // Check if extraction actually failed or just had benign warnings\n const files = await fs.readdir(tmpDir)\n if (files.length === 0) {\n log.warn({ file: log.filePath(file), tmpDir: log.filePath(tmpDir), error: e.message }, \"7z extraction produced no output\")\n throw new Error(`7z extraction failed for ${file}: ${e.message}`)\n }\n // If files were extracted despite the error, log and continue\n log.warn({ error: e.message, filesExtracted: files.length }, \"7z reported error but extracted files\")\n }\n } else {\n throw new Error(`Unsupported archive format: ${path.basename(file)}`)\n }\n\n // Verify extraction produced files\n const extractedFiles = await fs.readdir(tmpDir)\n if (extractedFiles.length === 0) {\n throw new Error(`Extraction of ${path.basename(file)} produced no files`)\n }\n\n await fs.rm(dir, { recursive: true, force: true })\n await moveDirAtomic(tmpDir, dir)\n } finally {\n await release().catch(err => log.warn({ err }, \"failed to release lockfile\"))\n }\n}\n\nlet proxyInitialized = false\nfunction initializeProxyOnce(): void {\n if (!proxyInitialized) {\n reinitializeProxy()\n proxyInitialized = true\n }\n}\n\n/**\n * Forces undici's global proxy dispatcher to re-read the current HTTP(S)_PROXY / NO_PROXY env vars,\n * bypassing the once-guard in initializeProxyOnce(). Exported for integration testing only.\n */\nexport function reinitializeProxy(): void {\n get.initializeProxy()\n}\n\n/**\n * Error codes considered transient for artifact downloads. Plain node socket errors carry the code\n * directly on `error.code`; undici (the fetch implementation used by @electron/get v5) wraps them in\n * a `TypeError: fetch failed` whose code lives on `error.cause.code` — including undici's own\n * `UND_ERR_*` codes for connection resets and connect timeouts.\n */\nconst TRANSIENT_DOWNLOAD_ERROR_CODES = new Set([\n \"ENOTFOUND\",\n \"ETIMEDOUT\",\n \"ECONNRESET\",\n \"ECONNREFUSED\",\n \"EAI_AGAIN\",\n \"EPIPE\",\n \"ENOENT\",\n \"UND_ERR_SOCKET\",\n \"UND_ERR_CONNECT_TIMEOUT\",\n])\n\n/**\n * Decides whether a failed @electron/get download should be retried. Handles all three error shapes\n * seen in practice (exported for tests):\n * - builder-util-runtime's `HttpError` — retry on 5xx.\n * - @electron/get v5's `HTTPError` (`FetchDownloader`) — a plain `Error` subclass with the fetch\n * `Response` on `.response` and NO `.code`; retry on 5xx and 429. Matched by class and by\n * `name === \"HTTPError\"` as a fallback in case multiple @electron/get copies are loaded.\n * - transient network errors — code on `error.code`, or on `error.cause.code` for undici's\n * `TypeError: fetch failed` wrapper.\n */\nexport function shouldRetryDownloadError(e: any): boolean {\n if (e == null) {\n return false\n }\n if (e instanceof HttpError) {\n return e.isServerError()\n }\n if (e instanceof get.HTTPError || e.name === \"HTTPError\") {\n const status = e.response?.status\n return typeof status === \"number\" && (status >= 500 || status === 429)\n }\n const code = typeof e.code === \"string\" ? e.code : typeof e.cause?.code === \"string\" ? e.cause.code : undefined\n return code != null && TRANSIENT_DOWNLOAD_ERROR_CODES.has(code)\n}\n\nasync function downloadArtifactToFile(config: ElectronArtifactDetails, label: string): Promise<string> {\n // Serialize concurrent downloads of the same artifact across vitest workers to prevent @electron/get's\n // non-atomic putFileInCache (remove + move) from racing with a concurrent reader.\n const key = {\n p: (config as ElectronPlatformArtifactDetails).platform,\n a: (config as ElectronPlatformArtifactDetails).arch,\n v: config.version,\n n: config.artifactName,\n g: config.isGeneric,\n }\n\n const artifactLockKey = crypto.createHash(\"sha256\").update(JSON.stringify(key)).digest(\"hex\").slice(0, 20)\n const artifactLockPath = path.join(os.tmpdir(), `eb-dl-${artifactLockKey}.lock`)\n // This lock is taken even for cache hits (the cache-hit check lives inside @electron/get), so under\n // heavy concurrency many builds serialize here. 30 retries (~137s of backoff) is too few — waiters\n // were exhausting it and failing with ELOCKED while the holder fetched a large artifact. 100 retries\n // matches the other toolset locks; stale (10min) + proper-lockfile's update heartbeat keep a live\n // downloader's lock fresh so the longer wait never falsely steals an in-progress download.\n const releaseArtifactLock = await lockfile.lock(artifactLockPath, {\n retries: { retries: 100, minTimeout: 500, maxTimeout: 5000 },\n stale: 600_000,\n realpath: false,\n })\n let lastLoggedMilestone = -1\n const state: { bar: ProgressBar | undefined } = { bar: undefined }\n\n // @electron/get v5 downloads via fetch, whose proxy support comes from undici's global dispatcher.\n // initializeProxy() wires that up from HTTP(S)_PROXY/NO_PROXY env vars (replaces the got proxy agent).\n initializeProxyOnce()\n\n const downloadOptions: FetchDownloaderOptions = {\n signal: AbortSignal.timeout(10 * 60 * 1000), // prevent indefinite hang on stalled connections\n ...config.downloadOptions,\n getProgressCallback: info => {\n // @electron/get passes downloadOptions (including this callback) to its internal\n // SHASUMS256.txt validation download. That file is tiny (<1 MB) and fires at 100%\n // immediately, producing a spurious bar even when the artifact itself is cached.\n // Skip progress display for any download whose total size is known and small.\n if (info.total && info.total < 1_000_000) {\n return Promise.resolve()\n }\n if (!state.bar && process.stdout.isTTY) {\n log.info({ label }, \"downloading\")\n state.bar = new MultiProgress().createBar(`${\" \".repeat(PADDING + 2)}[:bar] :percent | ${label}`, { total: 100 })\n }\n const pct = info.percent != null ? Math.floor(info.percent * 100) : 0\n if (state.bar) {\n state.bar.update(pct)\n } else {\n // log every 25% milestone for non-TTY environments (e.g. CI logs) to provide some visibility into download progress without overwhelming logs with too many updates\n const percentCompleted = info.transferred && info.total ? Math.floor((info.transferred / info.total) * 100) : Math.floor(pct / 25) * 25\n if (percentCompleted > lastLoggedMilestone && percentCompleted > 0) {\n lastLoggedMilestone = percentCompleted\n log.info({ label, progress: `${percentCompleted}%` }, percentCompleted !== 100 ? \"downloading\" : \"downloaded\")\n }\n }\n return Promise.resolve()\n },\n }\n\n const configWithProgress = { ...config, downloadOptions }\n try {\n let filePath: string\n try {\n filePath = await retry(() => get.downloadArtifact(configWithProgress), {\n retries: 3,\n interval: 2000,\n backoff: 2000,\n shouldRetry: shouldRetryDownloadError,\n })\n } catch (err) {\n if (typeof (err as any)?.message === \"string\" && (err as any).message.includes(\"dest already exists\")) {\n filePath = await get.downloadArtifact(configWithProgress)\n } else {\n throw err\n }\n }\n if (!(await exists(filePath))) {\n log.warn({ filePath, label }, \"cached artifact missing from disk; retrying with cache write\")\n filePath = await get.downloadArtifact({ ...configWithProgress, cacheMode: ElectronDownloadCacheMode.WriteOnly })\n }\n if (!state.bar && lastLoggedMilestone === -1) {\n log.info({ label }, \"using cached artifact\")\n }\n return filePath\n } finally {\n state.bar?.update(100)\n state.bar?.terminate()\n await releaseArtifactLock().catch(err => log.warn({ err }, \"failed to release artifact download lock\"))\n }\n}\n\n/**\n * Checks electron-builder's own archive cache for a previously downloaded archive.\n * Validates the SHA-256 checksum when one is known. Returns the cached path on hit,\n * null on miss or checksum mismatch (mismatch also deletes the stale file).\n *\n * Air-gapped seeding contract: placing the archive at\n * `<cacheDir>/<releaseName>/<archive>` (e.g. `$ELECTRON_BUILDER_CACHE/appimage@1.0.3/appimage-tools-runtime-20251108.tar.gz`)\n * is sufficient for a fully offline toolset resolution — the checksum here is computed locally\n * against the value hardcoded in the toolset module, and extraction happens locally too. No\n * `.state` file needs to be seeded. See https://www.electron.build/tutorials/offline-air-gapped-builds.\n */\nasync function resolveFromArchiveCache(archiveCachePath: string, label: string, expectedSha256: string | undefined): Promise<string | null> {\n if (!(await exists(archiveCachePath))) {\n return null\n }\n if (expectedSha256) {\n const hash = await new Promise<string>((resolve, reject) => {\n const h = crypto.createHash(\"sha256\")\n const s = createReadStream(archiveCachePath)\n s.on(\"error\", reject)\n s.on(\"data\", (chunk: Buffer | string) => h.update(chunk))\n s.on(\"end\", () => resolve(h.digest(\"hex\")))\n })\n if (hash !== expectedSha256) {\n log.warn({ file: label, archiveCachePath }, \"cached archive checksum mismatch — removing and re-downloading\")\n await fs.rm(archiveCachePath).catch(() => {})\n return null\n }\n }\n log.debug({ file: label, archiveCachePath }, \"using cached archive — skipping download\")\n return archiveCachePath\n}\n\n/**\n * Copies a freshly downloaded archive into electron-builder's own archive cache so that\n * future builds (including offline environments) can skip the network request entirely.\n */\nasync function persistToArchiveCache(sourcePath: string, archiveCachePath: string): Promise<void> {\n try {\n await fs.mkdir(path.dirname(archiveCachePath), { recursive: true })\n await fs.copyFile(sourcePath, archiveCachePath)\n } catch (err) {\n log.warn({ err, archiveCachePath }, \"failed to persist archive to cache — will re-download next time\")\n }\n}\n\n/**\n * Core download + extract engine. Handles lockfile, cache-hit short-circuit,\n * progress bar, extraction (.zip or .tar.gz), and completion marker.\n * Both public download functions delegate here after building their respective configs.\n */\nasync function downloadAndExtract(config: ElectronArtifactDetails, extractDir: string, label: string, archiveCachePath?: string): Promise<string> {\n // Create only the PARENT dir (e.g. <cache>/fpm@2.2.1), never extractDir itself, before locking.\n // The parent is stable — cleanup only ever removes extractDir and its .state/.tmp/.lock siblings —\n // so extractDir's whole lifecycle (mkdir, rm, re-mkdir) stays inside the lock. ensureDir absorbs\n // the concurrent-recursive-mkdir ENOENT/EEXIST race while peers populate the cold cache tree.\n await ensureDir(path.dirname(extractDir))\n\n // Pre-lock fast path: read-only short-circuit for a definitively complete and valid cache.\n // Safe unlocked — the cache-state helpers return null/false for a missing or half-written dir,\n // so a racing read only ever falls through to take the lock. Do NOT mutate the dir here.\n const stateData = await readCacheStateFile(extractDir)\n if (stateData?.state === CacheState.complete) {\n const isValid = await validateCacheDirectory(extractDir, stateData.fileCount)\n if (isValid) {\n log.debug({ file: label, path: extractDir }, \"using cached artifact - cache valid\")\n return extractDir\n }\n }\n\n // Be patient: when many targets/builds contend on the same toolset cache concurrently, all but the\n // first wait here while the winner downloads+extracts (a large bundle can take >1min). 15 retries\n // (~67s) is too few and waiters fail with ELOCKED before the winner finishes; 100 matches the\n // patience of withToolsetLock. proper-lockfile's update heartbeat keeps a live holder's lock fresh,\n // so increasing waiter retries never falsely steals an in-progress extraction.\n const release = await lockfile.lock(extractDir, {\n // realpath:false so proper-lockfile creates <extractDir>.lock in the (already-created) parent\n // WITHOUT calling fs.realpath(extractDir) first — which would throw ENOENT now that extractDir\n // is created lazily inside the lock. This filesystem lock serializes peers both across worker\n // processes AND within a single process (a second lock() for the same path retries until the\n // first releases), so no in-process promise cache is needed — and one wouldn't help across the\n // separate test worker processes anyway.\n realpath: false,\n retries: { retries: 100, minTimeout: 1000, maxTimeout: 5000 },\n stale: 120000,\n })\n let downloadedFile: string | null = null\n try {\n // Re-check after acquiring lock: another worker may have completed while we waited.\n const stateDataAfterLock = await readCacheStateFile(extractDir)\n if (stateDataAfterLock?.state === CacheState.complete) {\n const isValid = await validateCacheDirectory(extractDir, stateDataAfterLock.fileCount)\n if (isValid) {\n log.debug({ file: label, path: extractDir }, \"using cached artifact - skipping download/extract\")\n return extractDir\n }\n log.warn({ extractDir }, \"Cache marked complete but files invalid, clearing\")\n } else if (stateDataAfterLock?.state === CacheState.corrupted) {\n log.warn({ extractDir }, \"Corrupted cache detected, cleaning up and re-extracting\")\n }\n\n // Cleanup inside the lock — skip lock files since we currently hold them\n await cleanupCacheDirectory(extractDir, { skipLockFiles: true })\n await ensureDir(extractDir)\n\n // Check electron-builder's own archive cache before touching @electron/get.\n // The cache lives alongside the extract dir: <cacheDir>/<releaseName>/<filename>.\n // This lets repeated builds (or offline environments) skip the download entirely once\n // the archive has been fetched at least once.\n if (archiveCachePath) {\n downloadedFile = await resolveFromArchiveCache(archiveCachePath, label, (config as any).checksums?.[label])\n }\n\n if (!downloadedFile) {\n log.debug({ file: label }, \"downloading\")\n downloadedFile = await downloadArtifactToFile(config, label)\n if (!downloadedFile) {\n throw new Error(`Failed to download artifact: ${label}`)\n }\n // Persist the downloaded archive so future builds (and offline environments) can\n // skip the network request entirely.\n if (archiveCachePath) {\n await persistToArchiveCache(downloadedFile, archiveCachePath)\n }\n }\n\n await writeCacheState(extractDir, CacheState.downloaded)\n\n // Mark extracting so stale-lock detection can recover a crashed mid-extraction process\n await writeCacheState(extractDir, CacheState.extracting)\n\n // Extract while holding the lock to prevent concurrent interference\n await extractArchive(downloadedFile, extractDir)\n\n // Compute metadata with a full recursive walk now that tmpDir has been renamed to extractDir\n const { fileCount, extractedSize } = await computeCacheMetadata(extractDir)\n\n // Write complete state with metadata BEFORE releasing the lock; throwOnError=true so a\n // failed write (disk full, permissions) propagates instead of silently producing a no-op cache\n await writeCacheState(extractDir, CacheState.complete, { fileCount, extractedSize }, true)\n } finally {\n await release().catch(err => log.warn({ err }, \"failed to release lockfile\"))\n }\n return extractDir\n}\n\n// ─── Public API ───────────────────────────────────────────────────────────────\n\n/**\n * Copies a remote artifact to a specific output path on disk.\n * Unlike downloadBuilderToolset, this does not extract archives — it copies the raw file.\n * Used for certificate imports where the caller needs the file at a known path.\n */\nexport async function download(url: string, output: string, checksum?: string | null): Promise<void> {\n const filenameWithExt = path.basename(new URL(url).pathname)\n if (checksum == null) {\n log.warn({ url }, \"downloading without an integrity checksum — the download is not verified against a known-good hash\")\n }\n const downloadedFile = await downloadArtifactToFile(\n {\n version: \"9.9.9\",\n artifactName: filenameWithExt,\n cacheRoot: path.resolve(await cacheDirectoryOverrideAllowed.value, \"downloads\"),\n cacheMode: resolveCacheMode(),\n ...(checksum != null ? { checksums: { [filenameWithExt]: checksum } } : { unsafelyDisableChecksums: true }),\n mirrorOptions: { resolveAssetURL: async () => Promise.resolve(url) },\n isGeneric: true,\n },\n filenameWithExt\n )\n await fs.copyFile(downloadedFile, output)\n}\n\nfunction validateBinaryCustomDir(envVarName: string, value: string): string {\n if (value.includes(\"://\") || value.includes(\"..\") || value.startsWith(\"/\")) {\n throw new Error(\n `${envVarName} must be a safe relative path component (e.g. \"v1.0.0-custom\"). ` + `Values containing \"://\", \"..\", or a leading \"/\" are not allowed. Got: \"${value}\"`\n )\n }\n return value\n}\n\nconst CUSTOM_DIR_ENV_VARS = [\n \"NPM_CONFIG_ELECTRON_BUILDER_BINARIES_CUSTOM_DIR\",\n \"npm_config_electron_builder_binaries_custom_dir\",\n \"npm_package_config_electron_builder_binaries_custom_dir\",\n \"ELECTRON_BUILDER_BINARIES_CUSTOM_DIR\",\n] as const\n\n/**\n * Resolves the final download URL for a builder binary, honouring:\n * ELECTRON_BUILDER_BINARIES_DOWNLOAD_OVERRIDE_URL – fully replaces the URL directory\n * ELECTRON_BUILDER_BINARIES_CUSTOM_DIR (and npm_ variants) – replaces releaseName in the path\n * overrideUrl (caller-supplied) – the complete file URL, used as-is when no env var is set\n *\n * Exported for unit testing; not part of the public API.\n * @internal\n */\nexport function resolveBuilderBinaryUrl(releaseName: string, filenameWithExt: string, baseUrl: string, overrideUrl?: string): string {\n const envOverrideUrl = parseValidEnvVarUrl(\"ELECTRON_BUILDER_BINARIES_DOWNLOAD_OVERRIDE_URL\")\n if (envOverrideUrl != null) {\n return `${envOverrideUrl}/${filenameWithExt}`\n }\n if (overrideUrl != null) {\n // The caller-supplied override (ToolsetCustom.url) points directly at the file — appending\n // filenameWithExt would double the last path segment (e.g. …/bundle.7z/bundle.7z, issue #10084).\n return overrideUrl\n }\n const customDirEntry = CUSTOM_DIR_ENV_VARS.map(name => ({ name, value: process.env[name] })).find(e => e.value != null)\n if (customDirEntry != null) {\n return `${baseUrl}${validateBinaryCustomDir(customDirEntry.name, customDirEntry.value!)}/${filenameWithExt}`\n }\n return `${baseUrl}${releaseName}/${filenameWithExt}`\n}\n\n/**\n * Downloads a generic artifact (.tar.gz or .zip) from a GitHub release.\n * Used for electron-builder-binaries tools (appimage, etc.).\n */\n/** Toolsets already announced this process, so a multi-target build logs each one once. */\nconst announcedToolsets = new Set<string>()\n\n/**\n * Every `toolsets.*` property now defaults to \"latest\", which resolves to a newer bundle than v26\n * pinned (NSIS 3.0.4.1 -> 3.12, winCodeSign 2.6.0 -> 1.3.0, Wine 4.0.1 -> 11.0, AppImage FUSE2 ->\n * static FUSE3). Nothing recorded which version was used: `downloadBuilderToolset` logged only at\n * debug level, and on a warm cache it printed nothing at all — so a regression introduced by a new\n * bundle had no trace in the build log tying it to the toolset.\n */\nfunction announceToolsetVersion(releaseName: string): void {\n if (announcedToolsets.has(releaseName)) {\n return\n }\n announcedToolsets.add(releaseName)\n log.info({ toolset: releaseName }, \"using toolset\")\n}\n\nexport async function downloadBuilderToolset(options: {\n releaseName: string\n filenameWithExt: string\n checksums?: Record<string, string>\n githubOrgRepo?: string\n overrideUrl?: string\n}): Promise<string> {\n const { releaseName, filenameWithExt, checksums, githubOrgRepo = \"electron-userland/electron-builder-binaries\", overrideUrl } = options\n announceToolsetVersion(releaseName)\n\n if (/[/\\\\]|^\\.\\./.test(filenameWithExt) || filenameWithExt.includes(\"..\")) {\n throw new Error(`downloadBuilderToolset: unsafe filenameWithExt \"${filenameWithExt}\" — must be a plain filename with no path separators or traversal sequences`)\n }\n\n const baseUrl = getBinariesMirrorUrl(githubOrgRepo)\n const fullUrl = resolveBuilderBinaryUrl(releaseName, filenameWithExt, baseUrl, overrideUrl)\n const suffix = hashUrlSafe(fullUrl, 5)\n // tar.7z is listed before 7z so the full extension is stripped. Deliberate side effect: this changes the\n // extract-dir name for .tar.7z toolsets (e.g. the snap template) from \"<name>.tar-<hash>\" to \"<name>-<hash>\",\n // which busts caches poisoned by the broken .tar.7z extraction in 26.15.0-26.15.6 (issue #10002).\n const folderName = `${filenameWithExt.replace(/\\.(tar\\.gz|tgz|tar\\.xz|txz|tar\\.7z|zip|7z)$/, \"\")}-${suffix}`\n // releaseName is library input; enforce cache-dir containment (rejects traversal, clears taint into shell extraction)\n const cacheDir = await cacheDirectoryOverrideAllowed.value\n const extractDir = sanitizeDirPath(path.join(cacheDir, releaseName, folderName), cacheDir)\n\n // Use resolveAssetURL so @electron/get's ELECTRON_MIRROR env var check cannot override\n // the builder-binaries URL we've already resolved (see getArtifactRemoteURL in @electron/get).\n const mirrorOptions: MirrorOptions = {\n resolveAssetURL: async () => Promise.resolve(fullUrl),\n }\n\n // Predictable archive cache: <cacheDir>/<releaseName>/<filename>, next to the extract dir.\n // downloadAndExtract checks here before touching @electron/get and persists the archive here\n // after every successful download, so subsequent builds never need a network round-trip.\n const archiveCachePath = sanitizeDirPath(path.join(cacheDir, releaseName, filenameWithExt), cacheDir)\n\n const config: ElectronDownloadRequest & ElectronDownloadRequestOptions & { isGeneric: true } = {\n version: \"9.9.9\", // must be >1.3.2 to bypass @electron/get validation shortcut\n artifactName: filenameWithExt,\n cacheRoot: path.resolve(await cacheDirectoryOverrideAllowed.value, \"downloads\"),\n cacheMode: resolveCacheMode(),\n ...(checksums != null ? { checksums } : { unsafelyDisableChecksums: true }),\n mirrorOptions,\n isGeneric: true,\n }\n return downloadAndExtract(config, extractDir, filenameWithExt, archiveCachePath)\n}\n\n/**\n * Mirrors @electron/get's default cache root (`env-paths(\"electron\", { suffix: \"\" }).cache`).\n * @electron/get does not export it and its package `exports` map blocks deep imports, so the\n * (deliberately tiny) platform switch is replicated here. Must stay in sync with the\n * `cacheRoot` default documented in @electron/get's `ElectronDownloadRequestOptions`.\n * @internal exported for unit testing\n */\nexport function defaultElectronGetCacheRoot(): string {\n const name = \"electron\"\n const homeDir = os.homedir()\n switch (os.platform()) {\n case \"darwin\":\n return path.join(homeDir, \"Library\", \"Caches\", name)\n case \"win32\":\n return path.join(process.env.LOCALAPPDATA || path.join(homeDir, \"AppData\", \"Local\"), name, \"Cache\")\n default:\n return path.join(process.env.XDG_CACHE_HOME || path.join(homeDir, \".cache\"), name)\n }\n}\n\n/**\n * Parses the upstream `SHASUMS256.txt` format into the `Record<filename, sha256-hex>` shape that\n * @electron/get accepts as inline `checksums`. Each line is `<sha256-hex> *<filename>` (binary\n * mode) or `<sha256-hex> <filename>` (text mode); malformed lines are ignored.\n * @internal exported for unit testing\n */\nexport function parseChecksumFile(content: string): Record<string, string> {\n const checksums: Record<string, string> = {}\n for (const rawLine of content.split(\"\\n\")) {\n const match = /^([a-fA-F0-9]{64})\\s+\\*?(.+)$/.exec(rawLine.trim())\n if (match != null) {\n checksums[match[2]] = match[1].toLowerCase()\n }\n }\n return checksums\n}\n\n/**\n * Looks for a locally seeded SHASUMS256 file at the root of the @electron/get cache and returns\n * its contents as inline `checksums`, or null when nothing usable is seeded.\n *\n * Why: without inline `checksums`, @electron/get re-downloads `SHASUMS256.txt` with a hardcoded\n * `cacheMode: Bypass` on EVERY build — even when the artifact itself is a cache hit — so a fully\n * seeded cache still requires network access and air-gapped builds fail (#10039). Cache-seeding\n * tools (e.g. flatpak-node-generator) already place `SHASUMS256.txt-<version>` flat at the cache\n * root; feeding it back as inline `checksums` keeps checksum validation enabled while making it\n * fully offline. A plain `SHASUMS256.txt` at the cache root is accepted as a manual-seeding\n * fallback. A candidate file is only used when it actually contains an entry for the requested\n * artifact, so a stale file for another version can never break an online build.\n * See https://www.electron.build/tutorials/offline-air-gapped-builds for the seeding contract.\n * @internal exported for unit testing\n */\nexport async function resolveSeededChecksums(cacheRoot: string, version: string, artifactFileName: string): Promise<Record<string, string> | null> {\n const candidates = [path.join(cacheRoot, `SHASUMS256.txt-${version}`), path.join(cacheRoot, \"SHASUMS256.txt\")]\n for (const candidate of candidates) {\n if (!(await exists(candidate))) {\n continue\n }\n let content: string\n try {\n content = await fs.readFile(candidate, \"utf-8\")\n } catch (err: any) {\n log.warn({ file: log.filePath(candidate), err: err.message }, \"failed to read seeded SHASUMS file — ignoring it\")\n continue\n }\n const checksums = parseChecksumFile(content)\n if (checksums[artifactFileName] == null) {\n log.warn({ file: log.filePath(candidate), artifactFileName }, \"seeded SHASUMS file has no entry for the requested artifact — ignoring it\")\n continue\n }\n log.debug({ file: log.filePath(candidate), artifactFileName }, \"using locally seeded SHASUMS256 checksums — checksum validation can run offline\")\n return checksums\n }\n return null\n}\n\n/**\n * Assembles the `@electron/get` artifact config (`ElectronPlatformArtifactDetails`) from\n * `ArtifactDownloadOptions`: spreads the caller's options and pins `cacheRoot`/`platform`/`arch`/\n * `version`/`artifactName` and the resolved cache mode, warning when checksum verification is\n * disabled. When the caller provides no `checksums` (user-provided `electronGet.checksums` always\n * wins) and verification is not disabled, a locally seeded `SHASUMS256.txt-<version>` at the cache\n * root is picked up as inline `checksums` so validation works offline (see resolveSeededChecksums).\n * Callers pass the result to `downloadArtifactToFile` / `downloadAndExtract`.\n * @internal exported for unit testing\n */\nexport async function buildElectronArtifactConfig(artifactOptions: ArtifactDownloadOptions): Promise<ElectronPlatformArtifactDetails> {\n const { options, arch, version, platformName: platform, artifactName, cacheDir: cacheRoot } = artifactOptions\n\n if (options?.unsafelyDisableChecksums) {\n log.warn(\n { artifactName },\n \"electronGet.unsafelyDisableChecksums is enabled — downloaded artifacts will NOT be verified; a compromised mirror can serve malicious binaries undetected\"\n )\n }\n\n const artifactConfig: ElectronPlatformArtifactDetails = { ...options, cacheRoot, platform, arch, version, artifactName, cacheMode: resolveCacheMode() }\n if (artifactConfig.checksums == null && !artifactConfig.unsafelyDisableChecksums) {\n // Matches @electron/get's getArtifactFileName for non-generic artifacts; `artifactSuffix` and\n // `customFilename` cannot diverge here — both are excluded from ElectronGetOptions.\n const artifactFileName = `${artifactName}-v${version}-${platform}-${arch}.zip`\n const seededChecksums = await resolveSeededChecksums(cacheRoot ?? defaultElectronGetCacheRoot(), version, artifactFileName)\n if (seededChecksums != null) {\n artifactConfig.checksums = seededChecksums\n }\n }\n return artifactConfig\n}\n\n/**\n * Downloads the electron artifact zip via @electron/get (with caching) and returns the zip file path.\n * Use when you need to extract the zip yourself (e.g. directly to appOutDir to preserve empty dirs and symlinks).\n */\nexport async function downloadElectronArtifactZip(options: ArtifactDownloadOptions): Promise<string> {\n const config = await buildElectronArtifactConfig(options)\n return downloadArtifactToFile(config, config.artifactName)\n}\n\n/**\n * Downloads an electron platform artifact (e.g. ffmpeg) via `@electron/get` and extracts it into a\n * content-addressed cache directory (keyed on a hash of the resolved artifact config), returning the\n * extraction path.\n */\nexport async function downloadElectronArtifact(options: ArtifactDownloadOptions): Promise<string> {\n const { arch, version, platformName: platform, artifactName } = options\n const artifactConfig = await buildElectronArtifactConfig(options)\n\n const suffix = hashUrlSafe(JSON.stringify(artifactConfig), 5)\n const folderName = `${artifactName}-v${version}-${platform}-${arch}-${suffix}`\n const extractDir = path.join(await cacheDirectoryOverrideAllowed.value, `${artifactName}-v${version}`, folderName)\n\n return downloadAndExtract(artifactConfig, extractDir, artifactName)\n}\n\n/**\n * Get the binaries mirror URL from environment variables.\n * Supports various npm config formats and falls back to GitHub.\n */\nexport function getBinariesMirrorUrl(githubOrgRepo: string): string {\n const allowHttp = process.env[\"ELECTRON_BUILDER_DANGEROUSLY_ALLOW_HTTP\"] === \"true\"\n for (const envVar of [\n \"NPM_CONFIG_ELECTRON_BUILDER_BINARIES_MIRROR\",\n \"npm_config_electron_builder_binaries_mirror\",\n \"npm_package_config_electron_builder_binaries_mirror\",\n \"ELECTRON_BUILDER_BINARIES_MIRROR\",\n ]) {\n const url = parseValidEnvVarUrl(envVar, allowHttp)\n if (url) {\n return url.endsWith(\"/\") ? url : `${url}/`\n }\n }\n return `https://github.com/${githubOrgRepo}/releases/download/`\n}\n"]}
|
package/dist/util/flags.d.ts
CHANGED
|
@@ -8,4 +8,9 @@ export declare function isNpmNoBinLinks(): boolean;
|
|
|
8
8
|
export declare function isTravis(): boolean;
|
|
9
9
|
export declare function isFpmDebug(): boolean;
|
|
10
10
|
export declare function isSnapDestructiveMode(): boolean;
|
|
11
|
+
/**
|
|
12
|
+
* Throws when a removed environment variable is set. Called once per process from `Packager.build()`
|
|
13
|
+
* so it runs for every entrypoint (CLI, programmatic `build()`, and a directly constructed Packager).
|
|
14
|
+
*/
|
|
15
|
+
export declare function assertNoRemovedEnvVars(): void;
|
|
11
16
|
//# sourceMappingURL=flags.d.ts.map
|
package/dist/util/flags.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"flags.d.ts","sourceRoot":"","sources":["../../src/util/flags.ts"],"names":[],"mappings":"AAIA,wBAAgB,+BAA+B,YAE9C;AAED,wBAAgB,mBAAmB,YAElC;AAID,wBAAgB,mBAAmB,YAElC;AAED,wBAAgB,2BAA2B,YAE1C;AAED,wBAAgB,oBAAoB,YAEnC;AAID,wBAAgB,uBAAuB,YAEtC;AAID,wBAAgB,eAAe,YAE9B;AAID,wBAAgB,QAAQ,YAEvB;AAID,wBAAgB,UAAU,YAEzB;AAED,wBAAgB,qBAAqB,YAEpC"}
|
|
1
|
+
{"version":3,"file":"flags.d.ts","sourceRoot":"","sources":["../../src/util/flags.ts"],"names":[],"mappings":"AAIA,wBAAgB,+BAA+B,YAE9C;AAED,wBAAgB,mBAAmB,YAElC;AAID,wBAAgB,mBAAmB,YAElC;AAED,wBAAgB,2BAA2B,YAE1C;AAED,wBAAgB,oBAAoB,YAEnC;AAID,wBAAgB,uBAAuB,YAEtC;AAID,wBAAgB,eAAe,YAE9B;AAID,wBAAgB,QAAQ,YAEvB;AAID,wBAAgB,UAAU,YAEzB;AAED,wBAAgB,qBAAqB,YAEpC;AAyHD;;;GAGG;AACH,wBAAgB,sBAAsB,IAAI,IAAI,CAS7C"}
|
package/dist/util/flags.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { isEnvTrue } from "builder-util";
|
|
1
|
+
import { InvalidConfigurationError, isEnvTrue } from "builder-util";
|
|
2
2
|
// ─── Code signing ─────────────────────────────────────────────────────────────
|
|
3
3
|
export function isAutoDiscoveryCodeSignIdentity() {
|
|
4
4
|
return process.env.CSC_IDENTITY_AUTO_DISCOVERY !== "false";
|
|
@@ -35,4 +35,127 @@ export function isFpmDebug() {
|
|
|
35
35
|
export function isSnapDestructiveMode() {
|
|
36
36
|
return isEnvTrue(process.env.SNAP_DESTRUCTIVE_MODE);
|
|
37
37
|
}
|
|
38
|
+
/**
|
|
39
|
+
* Environment variables that v26 honored and v27 ignores.
|
|
40
|
+
*
|
|
41
|
+
* These are the most silent of all the v27 breaking changes: unlike a removed config key, nothing
|
|
42
|
+
* validates `process.env`, so a CI image exporting `USE_SYSTEM_WINE` or `ELECTRON_BUILDER_NSIS_DIR`
|
|
43
|
+
* silently switches toolchain with a green build. `CI_BUILD_TAG` is worse still — combined with the
|
|
44
|
+
* removal of implicit publishing, a tagged release simply stops uploading.
|
|
45
|
+
*
|
|
46
|
+
* Toolsets are now configured through the `toolsets` build option, which accepts an `https://` URL
|
|
47
|
+
* (downloaded and cached) or a `file://` path (used as-is).
|
|
48
|
+
*/
|
|
49
|
+
const REMOVED_ENV_VARS = {
|
|
50
|
+
APPIMAGE_TOOLS_PATH: {
|
|
51
|
+
controlled: "the AppImage build tools (mksquashfs, runtime)",
|
|
52
|
+
replacement: 'toolsets.appimage: { url: "file:///path/to/appimage-tools-dir" }',
|
|
53
|
+
},
|
|
54
|
+
LINUX_TOOLS_MAC_PATH: {
|
|
55
|
+
controlled: "the linux-tools-mac bundle (ar, lzip, gtar) used when building Linux targets on macOS",
|
|
56
|
+
replacement: 'toolsets.linuxToolsMac: { url: "file:///path/to/linux-tools-mac-dir" }',
|
|
57
|
+
},
|
|
58
|
+
CUSTOM_FPM_PATH: {
|
|
59
|
+
controlled: "the FPM executable",
|
|
60
|
+
replacement: 'toolsets.fpm: { url: "file:///path/to/fpm-dir" }',
|
|
61
|
+
},
|
|
62
|
+
USE_SYSTEM_FPM: {
|
|
63
|
+
controlled: "forcing the host-installed fpm instead of the bundled one",
|
|
64
|
+
replacement: 'toolsets.fpm: { url: "file:///path/to/fpm-dir" }',
|
|
65
|
+
},
|
|
66
|
+
ELECTRON_BUILDER_NSIS_DIR: {
|
|
67
|
+
controlled: "the NSIS compiler bundle directory",
|
|
68
|
+
replacement: 'toolsets.nsis: { url: "file:///path/to/nsis-bundle-dir" }',
|
|
69
|
+
},
|
|
70
|
+
ELECTRON_BUILDER_NSIS_RESOURCES_DIR: {
|
|
71
|
+
controlled: "the NSIS resources/plugins directory",
|
|
72
|
+
replacement: 'toolsets.nsis: { url: "file:///path/to/nsis-bundle-dir" } (the v27 nsis bundle carries compiler and resources together)',
|
|
73
|
+
},
|
|
74
|
+
ELECTRON_BUILDER_WINE_TOOLSET_DIR: {
|
|
75
|
+
controlled: "the Wine bundle directory",
|
|
76
|
+
replacement: 'toolsets.wine: { url: "file:///path/to/wine-dir" }',
|
|
77
|
+
},
|
|
78
|
+
USE_SYSTEM_WINE: {
|
|
79
|
+
controlled: "forcing the host-installed Wine instead of the downloaded bundle",
|
|
80
|
+
replacement: 'toolsets.wine: "system" (the host `wine` on PATH is already the default on macOS and Linux, so you can simply drop this variable)',
|
|
81
|
+
},
|
|
82
|
+
USE_SYSTEM_SIGNCODE: {
|
|
83
|
+
controlled: "forcing the host signtool/signcode instead of the bundled winCodeSign toolset",
|
|
84
|
+
replacement: 'win.sign (e.g. { "win": { "sign": { "type": "signtool", … } } }) together with toolsets.winCodeSign: { url: "file:///path/to/bundle-dir" }',
|
|
85
|
+
},
|
|
86
|
+
USE_SYSTEM_OSSLSIGNCODE: {
|
|
87
|
+
controlled: "forcing the host osslsigncode instead of the bundled one",
|
|
88
|
+
replacement: 'win.sign together with toolsets.winCodeSign: { url: "file:///path/to/bundle-dir" }',
|
|
89
|
+
},
|
|
90
|
+
SIGNTOOL_PATH: {
|
|
91
|
+
controlled: "the path to signtool.exe",
|
|
92
|
+
replacement: 'toolsets.winCodeSign: { url: "file:///path/to/bundle-dir" }',
|
|
93
|
+
},
|
|
94
|
+
ELECTRON_BUILDER_7ZIP_PATH: {
|
|
95
|
+
controlled: "the 7-Zip executable",
|
|
96
|
+
replacement: 'toolsets.sevenZip: { url: "file:///path/to/dir" } (a custom sevenZip bundle must be a .tar.gz, .zip, or bare file:// directory)',
|
|
97
|
+
},
|
|
98
|
+
ELECTRON_BUILDER_ICONS_TOOLSET_DIR: {
|
|
99
|
+
controlled: "the icons toolset bundle directory",
|
|
100
|
+
replacement: 'toolsets.icons: { url: "file:///path/to/icons-bundle-dir" }',
|
|
101
|
+
},
|
|
102
|
+
CI_BUILD_TAG: {
|
|
103
|
+
controlled: "the release tag used by the publisher",
|
|
104
|
+
replacement: "the CI_COMMIT_TAG environment variable (the standard GitLab CI variable)",
|
|
105
|
+
},
|
|
106
|
+
ALLOW_ELECTRON_BUILDER_AS_PRODUCTION_DEPENDENCY: {
|
|
107
|
+
controlled: "bundling electron-builder itself when it was listed under production dependencies",
|
|
108
|
+
replacement: 'the ignoredProductionDependencies build option — drop "electron-builder" from the list to ship it inside your app',
|
|
109
|
+
},
|
|
110
|
+
};
|
|
111
|
+
/** Emitted once per process; a build can invoke the packager more than once. */
|
|
112
|
+
let removedEnvVarsChecked = false;
|
|
113
|
+
/**
|
|
114
|
+
* Fails the build when a removed environment variable is set, naming the `toolsets` (or other)
|
|
115
|
+
* replacement. Without this the variable is simply ignored and the build silently uses a different
|
|
116
|
+
* toolchain than the one CI asked for.
|
|
117
|
+
*
|
|
118
|
+
* @internal exported for tests
|
|
119
|
+
*/
|
|
120
|
+
export function checkRemovedEnvVars(env = process.env) {
|
|
121
|
+
const found = Object.keys(REMOVED_ENV_VARS)
|
|
122
|
+
.filter(name => env[name] != null && env[name] !== "")
|
|
123
|
+
.sort();
|
|
124
|
+
if (found.length === 0) {
|
|
125
|
+
return null;
|
|
126
|
+
}
|
|
127
|
+
const header = found.length === 1
|
|
128
|
+
? `The environment variable ${found[0]} was removed in electron-builder v27 and is now ignored:`
|
|
129
|
+
: `${found.length} environment variables set here were removed in electron-builder v27 and are now ignored:`;
|
|
130
|
+
const entries = found.map(name => {
|
|
131
|
+
const { controlled, replacement } = REMOVED_ENV_VARS[name];
|
|
132
|
+
return `• ${name} controlled ${controlled}.\n Use ${replacement} instead.`;
|
|
133
|
+
});
|
|
134
|
+
return [
|
|
135
|
+
header,
|
|
136
|
+
"",
|
|
137
|
+
...entries,
|
|
138
|
+
"",
|
|
139
|
+
"Unset the variable once you have moved the setting into your configuration.",
|
|
140
|
+
"https://www.electron.build/docs/migration/v27-breaking-changes#toolset-env-var-overrides-removed",
|
|
141
|
+
].join("\n");
|
|
142
|
+
}
|
|
143
|
+
/**
|
|
144
|
+
* Throws when a removed environment variable is set. Called once per process from `Packager.build()`
|
|
145
|
+
* so it runs for every entrypoint (CLI, programmatic `build()`, and a directly constructed Packager).
|
|
146
|
+
*/
|
|
147
|
+
export function assertNoRemovedEnvVars() {
|
|
148
|
+
if (removedEnvVarsChecked) {
|
|
149
|
+
return;
|
|
150
|
+
}
|
|
151
|
+
removedEnvVarsChecked = true;
|
|
152
|
+
const message = checkRemovedEnvVars();
|
|
153
|
+
if (message != null) {
|
|
154
|
+
throw new InvalidConfigurationError(message);
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
/** @internal exported for tests — lets a test re-arm the once-per-process guard. */
|
|
158
|
+
export function resetRemovedEnvVarsCheck() {
|
|
159
|
+
removedEnvVarsChecked = false;
|
|
160
|
+
}
|
|
38
161
|
//# sourceMappingURL=flags.js.map
|
package/dist/util/flags.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"flags.js","sourceRoot":"","sources":["../../src/util/flags.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAA;AAExC,iFAAiF;AAEjF,MAAM,UAAU,+BAA+B;IAC7C,OAAO,OAAO,CAAC,GAAG,CAAC,2BAA2B,KAAK,OAAO,CAAA;AAC5D,CAAC;AAED,MAAM,UAAU,mBAAmB;IACjC,OAAO,SAAS,CAAC,OAAO,CAAC,GAAG,CAAC,oBAAoB,CAAC,CAAA;AACpD,CAAC;AAED,iFAAiF;AAEjF,MAAM,UAAU,mBAAmB;IACjC,OAAO,CAAC,SAAS,CAAC,OAAO,CAAC,GAAG,CAAC,oCAAoC,CAAC,CAAA;AACrE,CAAC;AAED,MAAM,UAAU,2BAA2B;IACzC,OAAO,SAAS,CAAC,OAAO,CAAC,GAAG,CAAC,2CAA2C,CAAC,CAAA;AAC3E,CAAC;AAED,MAAM,UAAU,oBAAoB;IAClC,OAAO,SAAS,CAAC,OAAO,CAAC,GAAG,CAAC,wBAAwB,CAAC,CAAA;AACxD,CAAC;AAED,iFAAiF;AAEjF,MAAM,UAAU,uBAAuB;IACrC,OAAO,SAAS,CAAC,OAAO,CAAC,GAAG,CAAC,wBAAwB,CAAC,CAAA;AACxD,CAAC;AAED,gFAAgF;AAEhF,MAAM,UAAU,eAAe;IAC7B,OAAO,SAAS,CAAC,OAAO,CAAC,GAAG,CAAC,gBAAgB,CAAC,CAAA;AAChD,CAAC;AAED,iFAAiF;AAEjF,MAAM,UAAU,QAAQ;IACtB,OAAO,SAAS,CAAC,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,CAAA;AACtC,CAAC;AAED,iFAAiF;AAEjF,MAAM,UAAU,UAAU;IACxB,OAAO,SAAS,CAAC,OAAO,CAAC,GAAG,CAAC,SAAS,CAAC,CAAA;AACzC,CAAC;AAED,MAAM,UAAU,qBAAqB;IACnC,OAAO,SAAS,CAAC,OAAO,CAAC,GAAG,CAAC,qBAAqB,CAAC,CAAA;AACrD,CAAC","sourcesContent":["import { isEnvTrue } from \"builder-util\"\n\n// ─── Code signing ─────────────────────────────────────────────────────────────\n\nexport function isAutoDiscoveryCodeSignIdentity() {\n return process.env.CSC_IDENTITY_AUTO_DISCOVERY !== \"false\"\n}\n\nexport function isCscForPullRequest() {\n return isEnvTrue(process.env.CSC_FOR_PULL_REQUEST)\n}\n\n// ─── Build behaviour ──────────────────────────────────────────────────────────\n\nexport function isBuildCacheEnabled() {\n return !isEnvTrue(process.env.ELECTRON_BUILDER_DISABLE_BUILD_CACHE)\n}\n\nexport function isRemoveStageDirEvenIfDebug() {\n return isEnvTrue(process.env.ELECTRON_BUILDER_REMOVE_STAGE_EVEN_IF_DEBUG)\n}\n\nexport function isOfflineModeEnabled() {\n return isEnvTrue(process.env.ELECTRON_BUILDER_OFFLINE)\n}\n\n// ─── Publishing ───────────────────────────────────────────────────────────────\n\nexport function isPublishForPullRequest() {\n return isEnvTrue(process.env.PUBLISH_FOR_PULL_REQUEST)\n}\n\n// ─── Package metadata / dependencies ─────────────────────────────────────────\n\nexport function isNpmNoBinLinks() {\n return isEnvTrue(process.env.NPM_NO_BIN_LINKS)\n}\n\n// ─── CI environment detection ─────────────────────────────────────────────────\n\nexport function isTravis() {\n return isEnvTrue(process.env.TRAVIS)\n}\n\n// ─── Platform toolset overrides ───────────────────────────────────────────────\n\nexport function isFpmDebug() {\n return isEnvTrue(process.env.FPM_DEBUG)\n}\n\nexport function isSnapDestructiveMode() {\n return isEnvTrue(process.env.SNAP_DESTRUCTIVE_MODE)\n}\n"]}
|
|
1
|
+
{"version":3,"file":"flags.js","sourceRoot":"","sources":["../../src/util/flags.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,yBAAyB,EAAE,SAAS,EAAE,MAAM,cAAc,CAAA;AAEnE,iFAAiF;AAEjF,MAAM,UAAU,+BAA+B;IAC7C,OAAO,OAAO,CAAC,GAAG,CAAC,2BAA2B,KAAK,OAAO,CAAA;AAC5D,CAAC;AAED,MAAM,UAAU,mBAAmB;IACjC,OAAO,SAAS,CAAC,OAAO,CAAC,GAAG,CAAC,oBAAoB,CAAC,CAAA;AACpD,CAAC;AAED,iFAAiF;AAEjF,MAAM,UAAU,mBAAmB;IACjC,OAAO,CAAC,SAAS,CAAC,OAAO,CAAC,GAAG,CAAC,oCAAoC,CAAC,CAAA;AACrE,CAAC;AAED,MAAM,UAAU,2BAA2B;IACzC,OAAO,SAAS,CAAC,OAAO,CAAC,GAAG,CAAC,2CAA2C,CAAC,CAAA;AAC3E,CAAC;AAED,MAAM,UAAU,oBAAoB;IAClC,OAAO,SAAS,CAAC,OAAO,CAAC,GAAG,CAAC,wBAAwB,CAAC,CAAA;AACxD,CAAC;AAED,iFAAiF;AAEjF,MAAM,UAAU,uBAAuB;IACrC,OAAO,SAAS,CAAC,OAAO,CAAC,GAAG,CAAC,wBAAwB,CAA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AAO,KAAK,IAAI,eAAe,UAAU,YAAY,WAAW,WAAW,CAAA;IAC7E,CAAC,CAAC,CAAA;IACF,OAAO;QACL,MAAM;QACN,EAAE;QACF,GAAG,OAAO;QACV,EAAE;QACF,6EAA6E;QAC7E,kGAAkG;KACnG,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;AACd,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,sBAAsB;IACpC,IAAI,qBAAqB,EAAE,CAAC;QAC1B,OAAM;IACR,CAAC;IACD,qBAAqB,GAAG,IAAI,CAAA;IAC5B,MAAM,OAAO,GAAG,mBAAmB,EAAE,CAAA;IACrC,IAAI,OAAO,IAAI,IAAI,EAAE,CAAC;QACpB,MAAM,IAAI,yBAAyB,CAAC,OAAO,CAAC,CAAA;IAC9C,CAAC;AACH,CAAC;AAED,oFAAoF;AACpF,MAAM,UAAU,wBAAwB;IACtC,qBAAqB,GAAG,KAAK,CAAA;AAC/B,CAAC","sourcesContent":["import { InvalidConfigurationError, isEnvTrue } from \"builder-util\"\n\n// ─── Code signing ─────────────────────────────────────────────────────────────\n\nexport function isAutoDiscoveryCodeSignIdentity() {\n return process.env.CSC_IDENTITY_AUTO_DISCOVERY !== \"false\"\n}\n\nexport function isCscForPullRequest() {\n return isEnvTrue(process.env.CSC_FOR_PULL_REQUEST)\n}\n\n// ─── Build behaviour ──────────────────────────────────────────────────────────\n\nexport function isBuildCacheEnabled() {\n return !isEnvTrue(process.env.ELECTRON_BUILDER_DISABLE_BUILD_CACHE)\n}\n\nexport function isRemoveStageDirEvenIfDebug() {\n return isEnvTrue(process.env.ELECTRON_BUILDER_REMOVE_STAGE_EVEN_IF_DEBUG)\n}\n\nexport function isOfflineModeEnabled() {\n return isEnvTrue(process.env.ELECTRON_BUILDER_OFFLINE)\n}\n\n// ─── Publishing ───────────────────────────────────────────────────────────────\n\nexport function isPublishForPullRequest() {\n return isEnvTrue(process.env.PUBLISH_FOR_PULL_REQUEST)\n}\n\n// ─── Package metadata / dependencies ─────────────────────────────────────────\n\nexport function isNpmNoBinLinks() {\n return isEnvTrue(process.env.NPM_NO_BIN_LINKS)\n}\n\n// ─── CI environment detection ─────────────────────────────────────────────────\n\nexport function isTravis() {\n return isEnvTrue(process.env.TRAVIS)\n}\n\n// ─── Platform toolset overrides ───────────────────────────────────────────────\n\nexport function isFpmDebug() {\n return isEnvTrue(process.env.FPM_DEBUG)\n}\n\nexport function isSnapDestructiveMode() {\n return isEnvTrue(process.env.SNAP_DESTRUCTIVE_MODE)\n}\n\n// ─── Removed environment variables (v26 → v27) ───────────────────────────────\n\ninterface RemovedEnvVar {\n /** How to achieve the same thing in v27. */\n readonly replacement: string\n /** What the variable used to control, so the user can tell whether they still need it. */\n readonly controlled: string\n}\n\n/**\n * Environment variables that v26 honored and v27 ignores.\n *\n * These are the most silent of all the v27 breaking changes: unlike a removed config key, nothing\n * validates `process.env`, so a CI image exporting `USE_SYSTEM_WINE` or `ELECTRON_BUILDER_NSIS_DIR`\n * silently switches toolchain with a green build. `CI_BUILD_TAG` is worse still — combined with the\n * removal of implicit publishing, a tagged release simply stops uploading.\n *\n * Toolsets are now configured through the `toolsets` build option, which accepts an `https://` URL\n * (downloaded and cached) or a `file://` path (used as-is).\n */\nconst REMOVED_ENV_VARS: Record<string, RemovedEnvVar> = {\n APPIMAGE_TOOLS_PATH: {\n controlled: \"the AppImage build tools (mksquashfs, runtime)\",\n replacement: 'toolsets.appimage: { url: \"file:///path/to/appimage-tools-dir\" }',\n },\n LINUX_TOOLS_MAC_PATH: {\n controlled: \"the linux-tools-mac bundle (ar, lzip, gtar) used when building Linux targets on macOS\",\n replacement: 'toolsets.linuxToolsMac: { url: \"file:///path/to/linux-tools-mac-dir\" }',\n },\n CUSTOM_FPM_PATH: {\n controlled: \"the FPM executable\",\n replacement: 'toolsets.fpm: { url: \"file:///path/to/fpm-dir\" }',\n },\n USE_SYSTEM_FPM: {\n controlled: \"forcing the host-installed fpm instead of the bundled one\",\n replacement: 'toolsets.fpm: { url: \"file:///path/to/fpm-dir\" }',\n },\n ELECTRON_BUILDER_NSIS_DIR: {\n controlled: \"the NSIS compiler bundle directory\",\n replacement: 'toolsets.nsis: { url: \"file:///path/to/nsis-bundle-dir\" }',\n },\n ELECTRON_BUILDER_NSIS_RESOURCES_DIR: {\n controlled: \"the NSIS resources/plugins directory\",\n replacement: 'toolsets.nsis: { url: \"file:///path/to/nsis-bundle-dir\" } (the v27 nsis bundle carries compiler and resources together)',\n },\n ELECTRON_BUILDER_WINE_TOOLSET_DIR: {\n controlled: \"the Wine bundle directory\",\n replacement: 'toolsets.wine: { url: \"file:///path/to/wine-dir\" }',\n },\n USE_SYSTEM_WINE: {\n controlled: \"forcing the host-installed Wine instead of the downloaded bundle\",\n replacement: 'toolsets.wine: \"system\" (the host `wine` on PATH is already the default on macOS and Linux, so you can simply drop this variable)',\n },\n USE_SYSTEM_SIGNCODE: {\n controlled: \"forcing the host signtool/signcode instead of the bundled winCodeSign toolset\",\n replacement: 'win.sign (e.g. { \"win\": { \"sign\": { \"type\": \"signtool\", … } } }) together with toolsets.winCodeSign: { url: \"file:///path/to/bundle-dir\" }',\n },\n USE_SYSTEM_OSSLSIGNCODE: {\n controlled: \"forcing the host osslsigncode instead of the bundled one\",\n replacement: 'win.sign together with toolsets.winCodeSign: { url: \"file:///path/to/bundle-dir\" }',\n },\n SIGNTOOL_PATH: {\n controlled: \"the path to signtool.exe\",\n replacement: 'toolsets.winCodeSign: { url: \"file:///path/to/bundle-dir\" }',\n },\n ELECTRON_BUILDER_7ZIP_PATH: {\n controlled: \"the 7-Zip executable\",\n replacement: 'toolsets.sevenZip: { url: \"file:///path/to/dir\" } (a custom sevenZip bundle must be a .tar.gz, .zip, or bare file:// directory)',\n },\n ELECTRON_BUILDER_ICONS_TOOLSET_DIR: {\n controlled: \"the icons toolset bundle directory\",\n replacement: 'toolsets.icons: { url: \"file:///path/to/icons-bundle-dir\" }',\n },\n CI_BUILD_TAG: {\n controlled: \"the release tag used by the publisher\",\n replacement: \"the CI_COMMIT_TAG environment variable (the standard GitLab CI variable)\",\n },\n ALLOW_ELECTRON_BUILDER_AS_PRODUCTION_DEPENDENCY: {\n controlled: \"bundling electron-builder itself when it was listed under production dependencies\",\n replacement: 'the ignoredProductionDependencies build option — drop \"electron-builder\" from the list to ship it inside your app',\n },\n}\n\n/** Emitted once per process; a build can invoke the packager more than once. */\nlet removedEnvVarsChecked = false\n\n/**\n * Fails the build when a removed environment variable is set, naming the `toolsets` (or other)\n * replacement. Without this the variable is simply ignored and the build silently uses a different\n * toolchain than the one CI asked for.\n *\n * @internal exported for tests\n */\nexport function checkRemovedEnvVars(env: NodeJS.ProcessEnv = process.env): string | null {\n const found = Object.keys(REMOVED_ENV_VARS)\n .filter(name => env[name] != null && env[name] !== \"\")\n .sort()\n if (found.length === 0) {\n return null\n }\n\n const header =\n found.length === 1\n ? `The environment variable ${found[0]} was removed in electron-builder v27 and is now ignored:`\n : `${found.length} environment variables set here were removed in electron-builder v27 and are now ignored:`\n const entries = found.map(name => {\n const { controlled, replacement } = REMOVED_ENV_VARS[name]\n return `• ${name} controlled ${controlled}.\\n Use ${replacement} instead.`\n })\n return [\n header,\n \"\",\n ...entries,\n \"\",\n \"Unset the variable once you have moved the setting into your configuration.\",\n \"https://www.electron.build/docs/migration/v27-breaking-changes#toolset-env-var-overrides-removed\",\n ].join(\"\\n\")\n}\n\n/**\n * Throws when a removed environment variable is set. Called once per process from `Packager.build()`\n * so it runs for every entrypoint (CLI, programmatic `build()`, and a directly constructed Packager).\n */\nexport function assertNoRemovedEnvVars(): void {\n if (removedEnvVarsChecked) {\n return\n }\n removedEnvVarsChecked = true\n const message = checkRemovedEnvVars()\n if (message != null) {\n throw new InvalidConfigurationError(message)\n }\n}\n\n/** @internal exported for tests — lets a test re-arm the once-per-process guard. */\nexport function resetRemovedEnvVarsCheck(): void {\n removedEnvVarsChecked = false\n}\n"]}
|