app-builder-lib 27.0.0-alpha.12 → 27.0.0-alpha.13
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 +1 -1
- package/dist/asar/asarUtil.js.map +1 -1
- package/dist/codeSign/certInfo.d.ts +4 -1
- package/dist/codeSign/certInfo.d.ts.map +1 -1
- package/dist/codeSign/certInfo.js +5 -3
- package/dist/codeSign/certInfo.js.map +1 -1
- package/dist/codeSign/forceCodeSigning.d.ts +22 -0
- package/dist/codeSign/forceCodeSigning.d.ts.map +1 -0
- package/dist/codeSign/forceCodeSigning.js +18 -0
- package/dist/codeSign/forceCodeSigning.js.map +1 -0
- package/dist/codeSign/mac/macCodeSign.d.ts +13 -1
- package/dist/codeSign/mac/macCodeSign.d.ts.map +1 -1
- package/dist/codeSign/mac/macCodeSign.js +29 -2
- package/dist/codeSign/mac/macCodeSign.js.map +1 -1
- package/dist/codeSign/mac/macSignatureVerifier.d.ts +23 -0
- package/dist/codeSign/mac/macSignatureVerifier.d.ts.map +1 -0
- package/dist/codeSign/mac/macSignatureVerifier.js +96 -0
- package/dist/codeSign/mac/macSignatureVerifier.js.map +1 -0
- package/dist/codeSign/win/authenticodeSignature.d.ts +14 -2
- package/dist/codeSign/win/authenticodeSignature.d.ts.map +1 -1
- package/dist/codeSign/win/authenticodeSignature.js +78 -30
- package/dist/codeSign/win/authenticodeSignature.js.map +1 -1
- package/dist/codeSign/win/pkcs11SignManager.d.ts.map +1 -1
- package/dist/codeSign/win/pkcs11SignManager.js +4 -3
- package/dist/codeSign/win/pkcs11SignManager.js.map +1 -1
- package/dist/codeSign/win/publisherName.d.ts +31 -0
- package/dist/codeSign/win/publisherName.d.ts.map +1 -0
- package/dist/codeSign/win/publisherName.js +78 -0
- package/dist/codeSign/win/publisherName.js.map +1 -0
- package/dist/codeSign/win/signtoolBaseSignManager.d.ts +16 -9
- package/dist/codeSign/win/signtoolBaseSignManager.d.ts.map +1 -1
- package/dist/codeSign/win/signtoolBaseSignManager.js +46 -35
- package/dist/codeSign/win/signtoolBaseSignManager.js.map +1 -1
- package/dist/codeSign/win/verifyUpdatePublisher.d.ts.map +1 -1
- package/dist/codeSign/win/verifyUpdatePublisher.js +7 -4
- package/dist/codeSign/win/verifyUpdatePublisher.js.map +1 -1
- package/dist/codeSign/win/windowsSignAzureManager.d.ts +1 -1
- package/dist/codeSign/win/windowsSignAzureManager.d.ts.map +1 -1
- package/dist/codeSign/win/windowsSignAzureManager.js +24 -6
- package/dist/codeSign/win/windowsSignAzureManager.js.map +1 -1
- package/dist/configuration.d.ts +46 -3
- package/dist/configuration.d.ts.map +1 -1
- package/dist/configuration.js.map +1 -1
- package/dist/electron/mac/asarIntegrityDigest.js +2 -2
- package/dist/electron/mac/asarIntegrityDigest.js.map +1 -1
- package/dist/electron/mac/electronMacUtils.d.ts +3 -2
- package/dist/electron/mac/electronMacUtils.d.ts.map +1 -1
- package/dist/electron/mac/electronMacUtils.js +3 -2
- package/dist/electron/mac/electronMacUtils.js.map +1 -1
- package/dist/fileMatcher.d.ts.map +1 -1
- package/dist/fileMatcher.js +4 -2
- package/dist/fileMatcher.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4 -3
- package/dist/index.js.map +1 -1
- package/dist/indexInternal.d.ts +7 -2
- package/dist/indexInternal.d.ts.map +1 -1
- package/dist/indexInternal.js +6 -2
- package/dist/indexInternal.js.map +1 -1
- package/dist/linuxPackager.js +1 -1
- package/dist/linuxPackager.js.map +1 -1
- package/dist/macPackager.d.ts +26 -0
- package/dist/macPackager.d.ts.map +1 -1
- package/dist/macPackager.js +168 -12
- package/dist/macPackager.js.map +1 -1
- package/dist/options/PlatformSpecificBuildOptions.d.ts +15 -12
- package/dist/options/PlatformSpecificBuildOptions.d.ts.map +1 -1
- package/dist/options/PlatformSpecificBuildOptions.js.map +1 -1
- package/dist/options/SquirrelWindowsOptions.d.ts +3 -0
- package/dist/options/SquirrelWindowsOptions.d.ts.map +1 -1
- package/dist/options/SquirrelWindowsOptions.js.map +1 -1
- package/dist/options/macOptions.d.ts +7 -2
- package/dist/options/macOptions.d.ts.map +1 -1
- package/dist/options/macOptions.js.map +1 -1
- package/dist/options/winOptions.d.ts +61 -15
- package/dist/options/winOptions.d.ts.map +1 -1
- package/dist/options/winOptions.js +20 -0
- package/dist/options/winOptions.js.map +1 -1
- package/dist/packager.d.ts +1 -0
- package/dist/packager.d.ts.map +1 -1
- package/dist/packager.js +7 -2
- package/dist/packager.js.map +1 -1
- package/dist/platformPackager.d.ts +14 -5
- package/dist/platformPackager.d.ts.map +1 -1
- package/dist/platformPackager.js +44 -13
- package/dist/platformPackager.js.map +1 -1
- package/dist/publish/PublishManager.d.ts +3 -0
- package/dist/publish/PublishManager.d.ts.map +1 -1
- package/dist/publish/PublishManager.js +50 -16
- package/dist/publish/PublishManager.js.map +1 -1
- package/dist/publish/manifestUploadCheck.d.ts +10 -0
- package/dist/publish/manifestUploadCheck.d.ts.map +1 -0
- package/dist/publish/manifestUploadCheck.js +75 -0
- package/dist/publish/manifestUploadCheck.js.map +1 -0
- package/dist/publish/updateInfoBuilder.d.ts.map +1 -1
- package/dist/publish/updateInfoBuilder.js +51 -17
- package/dist/publish/updateInfoBuilder.js.map +1 -1
- package/dist/publish/updateManifestVerifier.d.ts +22 -0
- package/dist/publish/updateManifestVerifier.d.ts.map +1 -0
- package/dist/publish/updateManifestVerifier.js +65 -0
- package/dist/publish/updateManifestVerifier.js.map +1 -0
- package/dist/targets/ArchiveTarget.d.ts.map +1 -1
- package/dist/targets/ArchiveTarget.js +6 -2
- package/dist/targets/ArchiveTarget.js.map +1 -1
- package/dist/targets/archive.d.ts.map +1 -1
- package/dist/targets/archive.js +3 -3
- package/dist/targets/archive.js.map +1 -1
- package/dist/targets/linux/FlatpakTarget.js +5 -5
- package/dist/targets/linux/FlatpakTarget.js.map +1 -1
- package/dist/targets/linux/FpmTarget.d.ts.map +1 -1
- package/dist/targets/linux/FpmTarget.js +10 -7
- package/dist/targets/linux/FpmTarget.js.map +1 -1
- package/dist/targets/linux/LinuxTargetHelper.js +1 -1
- package/dist/targets/linux/LinuxTargetHelper.js.map +1 -1
- package/dist/targets/linux/appimage/AppImageTarget.d.ts.map +1 -1
- package/dist/targets/linux/appimage/AppImageTarget.js +6 -1
- package/dist/targets/linux/appimage/AppImageTarget.js.map +1 -1
- package/dist/targets/linux/appimage/appImageUtil.js +9 -9
- package/dist/targets/linux/appimage/appImageUtil.js.map +1 -1
- package/dist/targets/linux/flatpakBundle.d.ts.map +1 -1
- package/dist/targets/linux/flatpakBundle.js +25 -20
- package/dist/targets/linux/flatpakBundle.js.map +1 -1
- package/dist/targets/linux/snap/coreLegacy.d.ts.map +1 -1
- package/dist/targets/linux/snap/coreLegacy.js +22 -6
- package/dist/targets/linux/snap/coreLegacy.js.map +1 -1
- package/dist/targets/linux/snap/snapPlugs.d.ts +2 -2
- package/dist/targets/linux/snap/snapPlugs.d.ts.map +1 -1
- package/dist/targets/linux/snap/snapPlugs.js +1 -1
- package/dist/targets/linux/snap/snapPlugs.js.map +1 -1
- package/dist/targets/linux/snap/snapcraftBuilder.d.ts.map +1 -1
- package/dist/targets/linux/snap/snapcraftBuilder.js +19 -17
- package/dist/targets/linux/snap/snapcraftBuilder.js.map +1 -1
- package/dist/targets/mac/MacTargetHelper.d.ts +15 -3
- package/dist/targets/mac/MacTargetHelper.d.ts.map +1 -1
- package/dist/targets/mac/MacTargetHelper.js +96 -13
- package/dist/targets/mac/MacTargetHelper.js.map +1 -1
- package/dist/targets/mac/pkg.d.ts.map +1 -1
- package/dist/targets/mac/pkg.js +7 -5
- package/dist/targets/mac/pkg.js.map +1 -1
- package/dist/targets/win/nsis/NsisTarget.d.ts.map +1 -1
- package/dist/targets/win/nsis/NsisTarget.js +8 -2
- package/dist/targets/win/nsis/NsisTarget.js.map +1 -1
- package/dist/targets/win/nsis/nsisOptions.d.ts +1 -1
- package/dist/targets/win/nsis/nsisOptions.js.map +1 -1
- package/dist/toolsets/nsis.js +1 -1
- package/dist/toolsets/nsis.js.map +1 -1
- package/dist/toolsets/wine.d.ts +3 -0
- package/dist/toolsets/wine.d.ts.map +1 -1
- package/dist/toolsets/wine.js +14 -5
- package/dist/toolsets/wine.js.map +1 -1
- package/dist/util/appFileCopier.d.ts.map +1 -1
- package/dist/util/appFileCopier.js +9 -3
- package/dist/util/appFileCopier.js.map +1 -1
- package/dist/util/buildOutputVerifier.d.ts +40 -0
- package/dist/util/buildOutputVerifier.d.ts.map +1 -0
- package/dist/util/buildOutputVerifier.js +420 -0
- package/dist/util/buildOutputVerifier.js.map +1 -0
- package/dist/util/config/fileOptions.js +2 -2
- package/dist/util/config/fileOptions.js.map +1 -1
- package/dist/util/config/legacyConfigGuard.d.ts.map +1 -1
- package/dist/util/config/legacyConfigGuard.js +2 -2
- package/dist/util/config/legacyConfigGuard.js.map +1 -1
- package/dist/util/config/legacyOptions.d.ts +9 -2
- package/dist/util/config/legacyOptions.d.ts.map +1 -1
- package/dist/util/config/legacyOptions.js +8 -2
- package/dist/util/config/legacyOptions.js.map +1 -1
- package/dist/util/electronGet.d.ts.map +1 -1
- package/dist/util/electronGet.js +3 -1
- package/dist/util/electronGet.js.map +1 -1
- package/dist/util/flags.d.ts.map +1 -1
- package/dist/util/flags.js +3 -9
- package/dist/util/flags.js.map +1 -1
- package/dist/util/mac/macosIconComposer.d.ts.map +1 -1
- package/dist/util/mac/macosIconComposer.js +6 -5
- package/dist/util/mac/macosIconComposer.js.map +1 -1
- package/dist/util/macroExpander.js +1 -1
- package/dist/util/macroExpander.js.map +1 -1
- package/dist/util/nativeBinaryVerifier.d.ts.map +1 -1
- package/dist/util/nativeBinaryVerifier.js +3 -1
- package/dist/util/nativeBinaryVerifier.js.map +1 -1
- package/dist/util/packageMetadata.js +1 -1
- package/dist/util/packageMetadata.js.map +1 -1
- package/dist/util/removedEnvVars.d.ts +2 -0
- package/dist/util/removedEnvVars.d.ts.map +1 -1
- package/dist/util/removedEnvVars.js +15 -1
- package/dist/util/removedEnvVars.js.map +1 -1
- package/dist/util/streamSpawnToFile.d.ts +3 -1
- package/dist/util/streamSpawnToFile.d.ts.map +1 -1
- package/dist/util/streamSpawnToFile.js +6 -2
- package/dist/util/streamSpawnToFile.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/vm/ParallelsVm.d.ts +10 -0
- package/dist/vm/ParallelsVm.d.ts.map +1 -1
- package/dist/vm/ParallelsVm.js +22 -8
- package/dist/vm/ParallelsVm.js.map +1 -1
- package/dist/vm/PwshVm.d.ts +0 -1
- package/dist/vm/PwshVm.d.ts.map +1 -1
- package/dist/vm/PwshVm.js +10 -15
- package/dist/vm/PwshVm.js.map +1 -1
- package/dist/vm/WineVm.d.ts.map +1 -1
- package/dist/vm/WineVm.js +4 -4
- package/dist/vm/WineVm.js.map +1 -1
- package/dist/vm/vm.d.ts +9 -3
- package/dist/vm/vm.d.ts.map +1 -1
- package/dist/vm/vm.js +40 -32
- package/dist/vm/vm.js.map +1 -1
- package/dist/winPackager.d.ts +16 -1
- package/dist/winPackager.d.ts.map +1 -1
- package/dist/winPackager.js +77 -19
- package/dist/winPackager.js.map +1 -1
- package/package.json +9 -9
- package/scheme.json +497 -23
- package/templates/nsis/include/allowOnlyOneInstallerInstance.nsh +14 -9
- package/dist/vm/MonoVm.d.ts +0 -9
- package/dist/vm/MonoVm.d.ts.map +0 -1
- package/dist/vm/MonoVm.js +0 -16
- package/dist/vm/MonoVm.js.map +0 -1
package/dist/toolsets/wine.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { exists, InvalidConfigurationError, sanitizeDirPath } from "builder-util";
|
|
1
|
+
import { Executables, exists, InvalidConfigurationError, sanitizeDirPath } from "builder-util";
|
|
2
2
|
import * as path from "path";
|
|
3
3
|
import { downloadBuilderToolset } from "../util/electronGet.js";
|
|
4
4
|
import { getCustomToolsetPath } from "./custom.js";
|
|
5
5
|
const githubOrgRepo = "electron-userland/electron-builder-binaries";
|
|
6
6
|
// What an unset / null / "latest" config resolves to. Not necessarily a bundle version: the published
|
|
7
|
-
// wine@1.0.1 bundles ship no PE builtins, so the default is the host wine
|
|
7
|
+
// wine@1.0.1 bundles ship no PE builtins, so the default is the host wine (toolsets.executables.wine or its install locations).
|
|
8
8
|
const WINE_LATEST = "system";
|
|
9
9
|
const wineToolsChecksums = {
|
|
10
10
|
"0.0.0": {
|
|
@@ -15,6 +15,9 @@ const wineToolsChecksums = {
|
|
|
15
15
|
"wine-11.0-linux-x86_64.tar.xz": "d8cf95442957b75c07166540142c96d8f7be6a68a572cc656194e7b42e8a0f13",
|
|
16
16
|
},
|
|
17
17
|
};
|
|
18
|
+
/**
|
|
19
|
+
* @param wine `toolsets.wine`: a bundle, or `"system"` (the default) for the host Wine
|
|
20
|
+
*/
|
|
18
21
|
export async function getWineToolset(wine, resourcesDir) {
|
|
19
22
|
if (process.platform === "win32") {
|
|
20
23
|
// oxlint-disable-next-line typescript/no-base-to-string -- pre-existing message; a custom toolset object prints as "[object Object]", changing it is out of scope for the lint migration
|
|
@@ -24,6 +27,12 @@ export async function getWineToolset(wine, resourcesDir) {
|
|
|
24
27
|
// Resolve the "latest"/unset alias up front so every branch below sees a concrete toolset, and an
|
|
25
28
|
// explicitly requested version is never silently swapped for whatever WINE_LATEST points at.
|
|
26
29
|
const toolset = wine == null || wine === "latest" ? WINE_LATEST : wine;
|
|
30
|
+
// on Linux a version string selects no bundle (the host Wine is always used), so only a custom bundle conflicts there; and only a
|
|
31
|
+
// toolsets.executables.wine with a location for this operating system conflicts, not one written for the other hosts of a shared config
|
|
32
|
+
const isBundle = typeof toolset === "object" || (toolset !== "system" && process.platform !== "linux");
|
|
33
|
+
if (isBundle && Executables.isConfigured("wine")) {
|
|
34
|
+
throw new InvalidConfigurationError(`toolsets.wine selects a Wine bundle (${typeof toolset === "object" ? "a custom toolset" : `"${toolset}"`}) and toolsets.executables.wine a host Wine: set only one of them`);
|
|
35
|
+
}
|
|
27
36
|
let toolsetPath;
|
|
28
37
|
let execSubPath;
|
|
29
38
|
if (typeof toolset === "object") {
|
|
@@ -32,10 +41,10 @@ export async function getWineToolset(wine, resourcesDir) {
|
|
|
32
41
|
execSubPath = (await exists(path.join(toolsetPath, "bin", "wine"))) ? "bin/wine" : "bin/wine64";
|
|
33
42
|
}
|
|
34
43
|
else if (toolset === "system" || process.platform === "linux") {
|
|
35
|
-
// Host wine on PATH. Linux ships no portable bundle so it always
|
|
36
|
-
// opt in with `toolsets.wine: "system"` — the replacement for the `USE_SYSTEM_WINE` env var
|
|
44
|
+
// Host wine, by absolute path from toolsets.executables.wine or its default install locations — never looked up on PATH. Linux ships no portable bundle so it always
|
|
45
|
+
// lands here; other platforms opt in with `toolsets.wine: "system"` — the replacement for the `USE_SYSTEM_WINE` env var
|
|
37
46
|
// removed in v27.
|
|
38
|
-
return { execPath: "wine", env: defaultEnv };
|
|
47
|
+
return { execPath: Executables.resolve("wine"), env: defaultEnv };
|
|
39
48
|
}
|
|
40
49
|
else if (toolset === "0.0.0") {
|
|
41
50
|
// Explicit opt-in to the legacy wine-4.0.1-mac bundle (pre-v27).
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"wine.js","sourceRoot":"","sources":["../../src/toolsets/wine.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,yBAAyB,EAAE,eAAe,EAAE,MAAM,cAAc,CAAA;
|
|
1
|
+
{"version":3,"file":"wine.js","sourceRoot":"","sources":["../../src/toolsets/wine.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,EAAE,yBAAyB,EAAE,eAAe,EAAE,MAAM,cAAc,CAAA;AAE9F,OAAO,KAAK,IAAI,MAAM,MAAM,CAAA;AAE5B,OAAO,EAAE,sBAAsB,EAAE,MAAM,wBAAwB,CAAA;AAC/D,OAAO,EAAE,oBAAoB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K,EAAE,OAAO,CAAC,EAAE,CAAC;QACtC,MAAM,SAAS,GAAG,IAAI,CAAC,OAAO,CAAC,iBAAiB,EAAE,MAAM,CAAC,CAAA;QACzD,IAAI,MAAM,MAAM,CAAC,SAAS,CAAC,EAAE,CAAC;YAC5B,WAAW,GAAG,SAAS,CAAA;YACvB,MAAK;QACP,CAAC;IACH,CAAC;IACD,IAAI,WAAW,IAAI,IAAI,EAAE,CAAC;QACxB,MAAM,IAAI,yBAAyB,CAAC,oBAAoB,WAAW,wDAAwD,CAAC,CAAA;IAC9H,CAAC;IAED,OAAO,EAAE,QAAQ,EAAE,UAAU,EAAE,WAAW,EAAE,CAAA;AAC9C,CAAC","sourcesContent":["import { Executables, exists, InvalidConfigurationError, sanitizeDirPath } from \"builder-util\"\nimport { Nullish } from \"builder-util-runtime\"\nimport * as path from \"path\"\nimport { ToolsetConfig } from \"../configuration.js\"\nimport { downloadBuilderToolset } from \"../util/electronGet.js\"\nimport { getCustomToolsetPath } from \"./custom.js\"\n\nconst githubOrgRepo = \"electron-userland/electron-builder-binaries\"\n\n// What an unset / null / \"latest\" config resolves to. Not necessarily a bundle version: the published\n// wine@1.0.1 bundles ship no PE builtins, so the default is the host wine (toolsets.executables.wine or its install locations).\nconst WINE_LATEST = \"system\"\n\nconst wineToolsChecksums: Record<string, Record<string, string>> = {\n \"0.0.0\": {\n \"wine-4.0.1-mac.7z\": \"1baac808a67975b68b9226beea7b64ad0acc3e598a4b45c25bb5d2ae8cac655e\",\n },\n \"1.0.1\": {\n \"wine-11.0-darwin-x86_64.tar.xz\": \"0a4a43867ef225c70ed8d4198aaba24a55cb0e52e5d67b0ac99563e6351a3c61\",\n \"wine-11.0-linux-x86_64.tar.xz\": \"d8cf95442957b75c07166540142c96d8f7be6a68a572cc656194e7b42e8a0f13\",\n },\n}\n\n/**\n * @param wine `toolsets.wine`: a bundle, or `\"system\"` (the default) for the host Wine\n */\nexport async function getWineToolset(wine: ToolsetConfig[\"wine\"] | Nullish, resourcesDir: string): Promise<{ execPath: string; env: Record<string, string> }> {\n if (process.platform === \"win32\") {\n // oxlint-disable-next-line typescript/no-base-to-string -- pre-existing message; a custom toolset object prints as \"[object Object]\", changing it is out of scope for the lint migration\n throw new InvalidConfigurationError(`Wine toolset is not supported on Windows, but got: ${wine}`)\n }\n\n const defaultEnv = { WINEDEBUG: \"-all,err+all\", WINEDLLOVERRIDES: \"winemenubuilder.exe=d\" }\n\n // Resolve the \"latest\"/unset alias up front so every branch below sees a concrete toolset, and an\n // explicitly requested version is never silently swapped for whatever WINE_LATEST points at.\n const toolset = wine == null || wine === \"latest\" ? WINE_LATEST : wine\n // on Linux a version string selects no bundle (the host Wine is always used), so only a custom bundle conflicts there; and only a\n // toolsets.executables.wine with a location for this operating system conflicts, not one written for the other hosts of a shared config\n const isBundle = typeof toolset === \"object\" || (toolset !== \"system\" && process.platform !== \"linux\")\n if (isBundle && Executables.isConfigured(\"wine\")) {\n throw new InvalidConfigurationError(\n `toolsets.wine selects a Wine bundle (${typeof toolset === \"object\" ? \"a custom toolset\" : `\"${toolset}\"`}) and toolsets.executables.wine a host Wine: set only one of them`\n )\n }\n\n let toolsetPath: string\n let execSubPath: string\n\n if (typeof toolset === \"object\") {\n // Custom toolset — honored on every platform (never overridden by the host-wine branch below).\n toolsetPath = await getCustomToolsetPath(toolset, resourcesDir)\n execSubPath = (await exists(path.join(toolsetPath, \"bin\", \"wine\"))) ? \"bin/wine\" : \"bin/wine64\"\n } else if (toolset === \"system\" || process.platform === \"linux\") {\n // Host wine, by absolute path from toolsets.executables.wine or its default install locations — never looked up on PATH. Linux ships no portable bundle so it always\n // lands here; other platforms opt in with `toolsets.wine: \"system\"` — the replacement for the `USE_SYSTEM_WINE` env var\n // removed in v27.\n return { execPath: Executables.resolve(\"wine\"), env: defaultEnv }\n } else if (toolset === \"0.0.0\") {\n // Explicit opt-in to the legacy wine-4.0.1-mac bundle (pre-v27).\n toolsetPath = await downloadBuilderToolset({\n releaseName: \"wine-4.0.1-mac\",\n filenameWithExt: \"wine-4.0.1-mac.7z\",\n checksums: wineToolsChecksums[\"0.0.0\"],\n githubOrgRepo,\n })\n execSubPath = path.join(\"bin\", \"wine64\")\n } else {\n // Explicitly requested bundle version, e.g. \"1.0.1\" → wine@1.0.1 (wine 11; arm64 macOS via Rosetta).\n const file = process.platform === \"darwin\" ? \"wine-11.0-darwin-x86_64.tar.xz\" : \"wine-11.0-linux-x86_64.tar.xz\"\n toolsetPath = await downloadBuilderToolset({\n releaseName: `wine@${toolset}`,\n filenameWithExt: file,\n checksums: wineToolsChecksums[toolset],\n githubOrgRepo,\n })\n execSubPath = (await exists(path.join(toolsetPath, \"bin\", \"wine\"))) ? \"bin/wine\" : \"bin/wine64\"\n }\n\n const { execPath, winePrefix, wineLibPath } = await createWineEnvironment(toolsetPath, execSubPath)\n return {\n execPath,\n env: {\n ...defaultEnv,\n WINEPREFIX: winePrefix,\n DYLD_FALLBACK_LIBRARY_PATH: [wineLibPath, process.env.DYLD_FALLBACK_LIBRARY_PATH].filter(Boolean).join(path.delimiter),\n LD_LIBRARY_PATH: [wineLibPath, process.env.LD_LIBRARY_PATH].filter(Boolean).join(path.delimiter),\n },\n }\n}\n\nasync function createWineEnvironment(toolsetPath: string, execSubPath: string) {\n const sanitizedWinePath = sanitizeDirPath(toolsetPath)\n\n const execPath = path.resolve(sanitizedWinePath, execSubPath)\n const winePrefix = path.resolve(sanitizedWinePath, \"wine-home\")\n\n for (const p of [execPath, winePrefix]) {\n if (!(await exists(p))) {\n throw new InvalidConfigurationError(`Wine toolset at \"${toolsetPath}\" is missing expected path: ${p}`)\n }\n }\n\n // Modern bundles ship a `lib` dir; the legacy wine-4.0.1-mac bundle ships `lib64` instead.\n let wineLibPath: string | null = null\n for (const libDir of [\"lib\", \"lib64\"]) {\n const candidate = path.resolve(sanitizedWinePath, libDir)\n if (await exists(candidate)) {\n wineLibPath = candidate\n break\n }\n }\n if (wineLibPath == null) {\n throw new InvalidConfigurationError(`Wine toolset at \"${toolsetPath}\" is missing expected library directory (lib or lib64)`)\n }\n\n return { execPath, winePrefix, wineLibPath }\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"appFileCopier.d.ts","sourceRoot":"","sources":["../../src/util/appFileCopier.ts"],"names":[],"mappings":"AAAA,OAAO,EAIL,kBAAkB,EAElB,eAAe,EAUhB,MAAM,cAAc,CAAA;AAErB,OAAO,EAAE,KAAK,EAAE,MAAM,IAAI,CAAA;AAO1B,OAAO,EAAE,WAAW,EAA6B,MAAM,mBAAmB,CAAA;AAC1E,OAAO,EAAgC,EAAE,EAAE,MAAM,mCAAmC,CAAA;AACpF,OAAO,EAAyC,aAAa,EAAE,MAAM,2CAA2C,CAAA;AAChH,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAA;AACzC,OAAO,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAA;AAGzD,OAAO,EAAE,cAAc,EAAE,MAAM,mCAAmC,CAAA;
|
|
1
|
+
{"version":3,"file":"appFileCopier.d.ts","sourceRoot":"","sources":["../../src/util/appFileCopier.ts"],"names":[],"mappings":"AAAA,OAAO,EAIL,kBAAkB,EAElB,eAAe,EAUhB,MAAM,cAAc,CAAA;AAErB,OAAO,EAAE,KAAK,EAAE,MAAM,IAAI,CAAA;AAO1B,OAAO,EAAE,WAAW,EAA6B,MAAM,mBAAmB,CAAA;AAC1E,OAAO,EAAgC,EAAE,EAAE,MAAM,mCAAmC,CAAA;AACpF,OAAO,EAAyC,aAAa,EAAE,MAAM,2CAA2C,CAAA;AAChH,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAA;AACzC,OAAO,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAA;AAGzD,OAAO,EAAE,cAAc,EAAE,MAAM,mCAAmC,CAAA;AAMlE,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,eAAe,UAYxE;AAED,MAAM,WAAW,mBAAmB;I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E,GAAG,EAAE,MAAM,KAAK,OAAO,CAAC,oBAAoB,CAAC,CAAA;AA0B7E;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,wBAAgB,gCAAgC,CAC9C,WAAW,EAAE,cAAc,EAAE,EAC7B,YAAY,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,SAAS,EAChD,UAAU,CAAC,EAAE,aAAa,CAAC,YAAY,CAAC,GACvC,OAAO,CAaT;AAED;;;;;;;;;;;GAWG;AACH,wBAAsB,8BAA8B,CAAC,OAAO,EAAE;IAC5D,YAAY,EAAE,EAAE,EAAE,CAAA;IAClB,iBAAiB,EAAE,MAAM,EAAE,CAAA;IAC3B,YAAY,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,SAAS,CAAA;IAChD,GAAG,EAAE,eAAe,CAAA;CACrB,GAAG,OAAO,CAAC,oBAAoB,GAAG,SAAS,CAAC,CAgC5C"}
|
|
@@ -13,6 +13,7 @@ import { AppFileWalker } from "./AppFileWalker.js";
|
|
|
13
13
|
import { NodeModuleCopyHelper } from "./NodeModuleCopyHelper.js";
|
|
14
14
|
import { archToNodeCpu } from "./archCompatibility.js";
|
|
15
15
|
import { assertSourceFileInTrustedRoots } from "./trustedSourceRoots.js";
|
|
16
|
+
import { BUILD_CHANGES_URL } from "./config/legacyOptions.js";
|
|
16
17
|
export function getDestinationPath(file, fileSet) {
|
|
17
18
|
if (file === fileSet.src) {
|
|
18
19
|
return fileSet.destination;
|
|
@@ -320,7 +321,8 @@ export function enforceAllowMissingDependencies(allowMissingDependencies, logSum
|
|
|
320
321
|
}
|
|
321
322
|
throw new InvalidConfigurationError(`The following production dependencies could not be resolved during node-module collection:\n` +
|
|
322
323
|
fatal.map(id => ` - ${id}`).join("\n") +
|
|
323
|
-
`\nInstall the missing dependencies, list names in \`allowMissingDependencies\` to allow specific ones to be missing, or set \`allowMissingDependencies\` to true to only warn (electron-builder <= 26 behavior).`
|
|
324
|
+
`\nInstall the missing dependencies, list names in \`allowMissingDependencies\` to allow specific ones to be missing, or set \`allowMissingDependencies\` to true to only warn (electron-builder <= 26 behavior).` +
|
|
325
|
+
`\nSee ${BUILD_CHANGES_URL}#allowmissingdependencies-now-fails-the-build`);
|
|
324
326
|
}
|
|
325
327
|
/** @internal */
|
|
326
328
|
export async function collectNodeModulesWithLogging(platformPackager, arch) {
|
|
@@ -352,7 +354,11 @@ export async function collectNodeModulesWithLogging(platformPackager, arch) {
|
|
|
352
354
|
pmApproaches,
|
|
353
355
|
searchDirectories,
|
|
354
356
|
dependencies: platformPackager.originalMetadata.dependencies,
|
|
355
|
-
run: (pm, dir) => getCollectorByPackageManager(pm, dir, tempDirManager).getNodeModules({
|
|
357
|
+
run: (pm, dir) => getCollectorByPackageManager(pm, dir, tempDirManager).getNodeModules({
|
|
358
|
+
packageName: platformPackager.nodePackageName,
|
|
359
|
+
archFilter,
|
|
360
|
+
ignoredDependencies,
|
|
361
|
+
}),
|
|
356
362
|
});
|
|
357
363
|
if (!deps?.nodeModules?.length) {
|
|
358
364
|
log.warn({ searchDirectories: searchDirectories.map(it => log.filePath(it)) }, "no node modules returned while searching directories");
|
|
@@ -394,7 +400,7 @@ function warnAboutDeprecatedElectronPackages(nodeModules) {
|
|
|
394
400
|
for (const { name } of bundled) {
|
|
395
401
|
log.warn({ dependency: name, solution: `add "${name}" to ignoredProductionDependencies, or move it to devDependencies` }, `${name} is declared in dependencies and is being packaged into your app (${DEPRECATED_ELECTRON_PACKAGES[name]}). ` +
|
|
396
402
|
"electron-builder <= 26 rejected this outright; v27 removed that guard and does not exclude it by default. " +
|
|
397
|
-
"See https://www.electron.build/docs/migration/v27-
|
|
403
|
+
"See https://www.electron.build/docs/migration/v27-build-changes#electron-prebuilt-electron-rebuild-no-longer-error-and-are-not-excluded");
|
|
398
404
|
}
|
|
399
405
|
}
|
|
400
406
|
//# sourceMappingURL=appFileCopier.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"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kPolicy,\n FileCopier,\n FileTransformer,\n InvalidConfigurationError,\n isEmptyOrSpaces,\n Link,\n log,\n MAX_FILE_REQUESTS,\n rebaseCopiedSymlinkTarget,\n statOrNull,\n walk,\n WriteContainment,\n} from \"builder-util\"\nimport { DEFAULT_IGNORED_PRODUCTION_DEPENDENCIES } from \"../configuration.js\"\nimport { Stats } from \"fs\"\nimport fsExtra from \"fs-extra\"\nimport { readlink } from \"fs/promises\"\nimport * as path from \"path\"\nimport asyncPool from \"tiny-async-pool\"\nimport { isLibOrExe } from \"../asar/unpackDetector.js\"\nimport { Platform } from \"../core.js\"\nimport { FileMatcher, resolveExcludedExtensions } from \"../fileMatcher.js\"\nimport { getCollectorByPackageManager, PM } from \"../node-module-collector/index.js\"\nimport { LogMessageByKey, logMessageLevelByKey, ModuleManager } from \"../node-module-collector/moduleManager.js\"\nimport { Packager } from \"../packager.js\"\nimport { PlatformPackager } from \"../platformPackager.js\"\nimport { AppFileWalker } from \"./AppFileWalker.js\"\nimport { NodeModuleCopyHelper } from \"./NodeModuleCopyHelper.js\"\nimport { NodeModuleInfo } from \"../node-module-collector/types.js\"\nimport { PlatformSpecificBuildOptions } from \"../options/PlatformSpecificBuildOptions.js\"\nimport { archToNodeCpu } from \"./archCompatibility.js\"\nimport { assertSourceFileInTrustedRoots } from \"./trustedSourceRoots.js\"\n\nexport function getDestinationPath(file: string, fileSet: ResolvedFileSet) {\n if (file === fileSet.src) {\n return fileSet.destination\n }\n\n const src = fileSet.src\n const dest = fileSet.destination\n // get node_modules path relative to src and then append to dest\n if (file.startsWith(src + path.sep)) {\n return path.join(dest, path.relative(src, file))\n }\n return dest\n}\n\nexport interface CopyAppFilesOptions {\n /** Every file, directory and symlink is written inside it, checked by its real path: the resources directory of the app. */\n readonly containmentRoot: string\n /** The real paths files may be copied from, see `getTrustedSourceRoots`. Each file is checked when given. */\n readonly trustedSourceRoots?: ReadonlyArray<string> | null\n /** The `fileOptions.allowExternalLinks` build option: allows a file outside the trusted source roots, or a kept symlink that leaves the containment root. */\n readonly externalLinks?: ExternalLinkPolicy | null\n}\n\n/**\n * Copies the files of the app when they are not packed into an asar archive. Like the asar packer, it refuses a file whose real path is\n * outside the trusted source roots, writes only inside the containment root, checked by real path, and recreates a symlink only when it\n * stays inside the containment root.\n */\nexport async function copyAppFiles(fileSet: ResolvedFileSet, packager: Pick<Packager, \"cancellationToken\">, transformer: FileTransformer, options?: CopyAppFilesOptions | null) {\n const metadata = fileSet.metadata\n // search auto unpacked dir\n const taskManager = new AsyncTaskManager(packager.cancellationToken)\n const containment = new WriteContainment(options?.containmentRoot ?? fileSet.destination, \"app file\")\n const trustedSourceRoots = options?.trustedSourceRoots\n\n const fileCopier = new FileCopier(file => {\n return !isLibOrExe(file)\n }, transformer)\n const links: Array<Link & { source: string }> = []\n for (let i = 0, n = fileSet.files.length; i < n; i++) {\n const sourceFile = fileSet.files[i]\n const stat = metadata.get(sourceFile)\n if (stat == null) {\n // dir\n continue\n }\n\n if (trustedSourceRoots != null) {\n await assertSourceFileInTrustedRoots(sourceFile, trustedSourceRoots, options?.externalLinks)\n }\n\n const destinationFile = getDestinationPath(sourceFile, fileSet)\n if (stat.isSymbolicLink()) {\n links.push({ file: destinationFile, link: rebaseCopiedSymlinkTarget(fileSet.src, sourceFile, await readlink(sourceFile)), source: sourceFile })\n continue\n }\n\n // creates the directory once, checked by its real path, and removes a symlink planted at the destination\n await containment.prepareFile(destinationFile)\n\n taskManager.addTask(fileCopier.copy(sourceFile, destinationFile, stat))\n if (taskManager.tasks.length > MAX_FILE_REQUESTS) {\n await taskManager.awaitTasks()\n }\n }\n\n if (taskManager.tasks.length > 0) {\n await taskManager.awaitTasks()\n }\n\n await asyncPool(MAX_FILE_REQUESTS, links, async it => {\n await containment.prepareFile(it.file)\n await fsExtra.ensureSymlink(it.link, it.file)\n })\n // the walker follows a symlink that leaves the app directory and copies what it points to, so a symlink kept as it is has to stay inside\n await assertCopiedSymlinksContained(containment, links, [], \"app file\", options?.externalLinks)\n}\n\n// os path separator is used\nexport interface ResolvedFileSet {\n src: string\n destination: string\n\n files: Array<string>\n metadata: Map<string, Stats>\n transformedFiles?: Map<number, string | Buffer> | null\n}\n\n// used only for ASAR, if no asar, file transformed on the fly\nexport async function transformFiles(transformer: FileTransformer, fileSet: ResolvedFileSet): Promise<void> {\n if (transformer == null) {\n return\n }\n\n let transformedFiles = fileSet.transformedFiles\n if (fileSet.transformedFiles == null) {\n transformedFiles = new Map()\n fileSet.transformedFiles = transformedFiles\n }\n\n const metadata = fileSet.metadata\n const filesPromise = fileSet.files.map(async (it, index) => {\n const fileStat = metadata.get(it)\n if (fileStat == null || !fileStat.isFile()) {\n return\n }\n\n const transformedValue = transformer(it)\n if (transformedValue == null) {\n return\n }\n\n if (typeof transformedValue === \"object\" && \"then\" in transformedValue) {\n return (transformedValue as Promise<any>).then(it => {\n if (it != null) {\n transformedFiles!.set(index, it)\n }\n return\n })\n }\n transformedFiles!.set(index, transformedValue as string | Buffer)\n return\n })\n // `asyncPool` doesn't provide `index` in it's handler, so we `map` first before using it\n await asyncPool(MAX_FILE_REQUESTS, filesPromise, promise => promise)\n}\n\nexport async function computeFileSets(matchers: Array<FileMatcher>, transformer: FileTransformer | null, platformPackager: PlatformPackager<any>): Promise<Array<ResolvedFileSet>> {\n const fileSets: Array<ResolvedFileSet> = []\n\n for (const matcher of matchers) {\n const fileWalker = new AppFileWalker(matcher, platformPackager)\n\n const fromStat = await statOrNull(matcher.from)\n if (fromStat == null) {\n log.debug({ directory: matcher.from, reason: \"doesn't exist\" }, `skipped copying`)\n continue\n }\n\n const files = await walk(matcher.from, fileWalker.filter, fileWalker)\n const metadata = fileWalker.metadata\n fileSets.push(validateFileSet({ src: matcher.from, files, metadata, destination: matcher.to }))\n }\n\n return fileSets\n}\n\nfunction getNodeModuleExcludedExts(platformPackager: PlatformPackager<any>, platformSpecificBuildOptions: PlatformSpecificBuildOptions) {\n // do not exclude *.h files (https://github.com/electron-userland/electron-builder/issues/2852)\n const result = resolveExcludedExtensions(platformPackager.config, platformSpecificBuildOptions).map(it => `.${it}`)\n if (platformPackager.platform !== Platform.WINDOWS) {\n // https://github.com/electron-userland/electron-builder/issues/1738\n result.push(\".dll\")\n result.push(\".exe\")\n }\n return result\n}\n\nfunction validateFileSet(fileSet: ResolvedFileSet): ResolvedFileSet {\n if (fileSet.src == null || fileSet.src.length === 0) {\n throw new Error(\"fileset src is empty\")\n }\n return fileSet\n}\n\n/** @internal */\nexport async function computeNodeModuleFileSets(\n platformPackager: PlatformPackager<any>,\n platformSpecificBuildOptions: PlatformSpecificBuildOptions,\n mainMatcher: FileMatcher,\n arch: Arch,\n applyArchFilter = true\n): Promise<Array<ResolvedFileSet>> {\n const deps = await collectNodeModulesWithLogging(platformPackager, applyArchFilter ? arch : null)\n\n // the options this pack uses for the app files too (e.g. mac → mas → masDev cascaded), not always the platform section's own\n const nodeModuleExcludedExts = getNodeModuleExcludedExts(platformPackager, platformSpecificBuildOptions)\n // serial execution because copyNodeModules is concurrent and so, no need to increase queue/pressure\n const result = new Array<ResolvedFileSet>()\n let index = 0\n const NODE_MODULES = \"node_modules\"\n\n const collectNodeModules = async (dep: NodeModuleInfo, destination: string) => {\n // Ignore excluded dependencies.\n if (dep.excluded) {\n return\n }\n\n const source = dep.dir\n const matcher = new FileMatcher(source, destination, mainMatcher.macroExpander, mainMatcher.patterns)\n const copier = new NodeModuleCopyHelper(matcher, platformPackager)\n const files = await copier.collectNodeModules(dep, nodeModuleExcludedExts, path.relative(mainMatcher.to, destination))\n result[index++] = validateFileSet({ src: source, destination, files, metadata: copier.metadata })\n\n log.debug({ dep: dep.name, from: log.filePath(source), to: log.filePath(destination), filesCount: files.length }, \"identified module\")\n\n if (dep.dependencies) {\n for (const c of dep.dependencies) {\n await collectNodeModules(c, path.join(destination, NODE_MODULES, c.name))\n }\n }\n }\n\n for (const dep of deps) {\n const destination = path.join(mainMatcher.to, NODE_MODULES, dep.name)\n await collectNodeModules(dep, destination)\n }\n return result\n}\n\ntype CollectedNodeModules = { nodeModules: NodeModuleInfo[]; logSummary: ModuleManager[\"logSummary\"] }\n\n/** Runs a single package-manager collector against a single directory. */\ntype CollectorRunner = (pm: PM, dir: string) => Promise<CollectedNodeModules>\n\n// `workspace:`/`file:`/`link:`/`portal:` dependencies are symlinked into place rather than\n// installed as standalone, hoistable packages, so they may legitimately be absent from a\n// collected tree and cannot be used to validate it.\nconst LOCAL_DEPENDENCY_SPEC = /^(?:workspace|file|link|portal):/\n\n// Log-summary buckets in which a collector reports a declared dependency it deliberately or\n// unavoidably left out of the collected tree. A direct dependency recorded in one of these is\n// accounted for even though it is absent from the top level of an otherwise correct collection.\nconst ACCOUNTED_ABSENT_DEPENDENCY_KEYS: ReadonlyArray<LogMessageByKey> = [\n // dropped by the target arch/platform filter (`archFilter`, package.json `cpu`/`os`)\n LogMessageByKey.PKG_INCOMPATIBLE_PLATFORM,\n // not installed / not resolvable on disk — whether that is fatal is decided afterwards by\n // `allowMissingDependencies` (see enforceAllowMissingDependencies), not by collection matching\n LogMessageByKey.PKG_NOT_FOUND,\n LogMessageByKey.PKG_NOT_ON_DISK,\n LogMessageByKey.PKG_OPTIONAL_NOT_INSTALLED,\n LogMessageByKey.PKG_OPTIONAL_PLATFORM_NOT_INSTALLED,\n // excluded via `ignoredProductionDependencies` (such modules normally stay in the tree flagged\n // `excluded`, so this only matters if a collector ever drops them instead)\n LogMessageByKey.PKG_EXCLUDED_IGNORED,\n // a dependency that resolves to the package itself is skipped rather than collected\n LogMessageByKey.PKG_SELF_REF,\n]\n\n/**\n * Determines whether a collected module tree actually describes the package being built.\n *\n * A package-manager `list` invocation can resolve to the wrong project root — most notably when\n * electron-builder is run from a workspace sub-package whose dependencies are hoisted to the\n * workspace root (#9945) — or a collector can resolve the root node to the wrong package (e.g. an\n * app named like one of its own dependencies, #10277). In both cases the collector returns a\n * non-empty but wrong tree. Accepting it would suppress the manual-traversal fallback that resolves\n * the correct modules, so we need to tell a matching collection from a mismatched one.\n *\n * Only the package's declared external (registry-installed, non-`workspace:`/`file:`/`link:`/`portal:`)\n * production `dependencies` are checked; they are always placed at the top level of a correct\n * collection. A collection matches when:\n * - at least one of them is present at the top level, and\n * - every one of them is either present at the top level (including modules flagged `excluded` by\n * `ignoredProductionDependencies`) or reported in the collection's own `logSummary` as\n * legitimately absent: dropped by the arch/platform filter, missing on disk (enforced later by\n * `allowMissingDependencies`), a missing optional/platform-specific package, excluded as ignored,\n * or a self-reference.\n *\n * When the package declares no external production dependencies there is nothing to validate\n * against, so any non-empty collection is accepted.\n */\nexport function collectionMatchesAppDependencies(\n nodeModules: NodeModuleInfo[],\n dependencies: Record<string, string> | undefined,\n logSummary?: ModuleManager[\"logSummary\"]\n): boolean {\n const requiredExternalDeps = Object.entries(dependencies ?? {})\n .filter(([, spec]) => !LOCAL_DEPENDENCY_SPEC.test(spec))\n .map(([name]) => name)\n if (requiredExternalDeps.length === 0) {\n return true\n }\n const collected = new Set(nodeModules.map(it => it.name))\n if (!requiredExternalDeps.some(name => collected.has(name))) {\n return false\n }\n const accountedAbsent = new Set(ACCOUNTED_ABSENT_DEPENDENCY_KEYS.flatMap(key => logSummary?.[key] ?? []).map(dependencyNameFromSummaryId))\n return requiredExternalDeps.every(name => collected.has(name) || accountedAbsent.has(name))\n}\n\n/**\n * Walks the candidate (package-manager, directory) combinations and returns the first collection\n * that both contains modules and matches the package being built (see\n * {@link collectionMatchesAppDependencies}). A non-empty collection that does NOT match — e.g. a\n * workspace-root tree returned for a sub-package — is retained only as a last-resort fallback so a\n * later approach (notably {@link PM.TRAVERSAL}) can supply the correct modules.\n *\n * An approach that throws (e.g. the package manager exited without producing its dependency tree,\n * issue #10208) is logged as a warning and skipped so the remaining approaches still run. If every\n * approach fails to produce a collection and at least one threw, the first error is rethrown rather\n * than silently reporting \"no node modules\".\n */\nexport async function resolveFirstMatchingCollection(options: {\n pmApproaches: PM[]\n searchDirectories: string[]\n dependencies: Record<string, string> | undefined\n run: CollectorRunner\n}): Promise<CollectedNodeModules | undefined> {\n const { pmApproaches, searchDirectories, dependencies, run } = options\n let fallback: CollectedNodeModules | undefined\n let firstError: Error | undefined\n\n for (const pm of pmApproaches) {\n for (const dir of searchDirectories) {\n log.info({ pm, searchDir: dir }, \"searching for node modules\")\n let deps: CollectedNodeModules\n try {\n deps = await run(pm, dir)\n } catch (error: any) {\n log.warn({ pm, searchDir: dir, error: error?.message ?? String(error) }, \"node module collection failed, trying next search directory/approach\")\n firstError ??= error instanceof Error ? error : new Error(String(error))\n continue\n }\n if (deps.nodeModules.length === 0) {\n log.info({ pm, searchDir: dir }, \"no node modules found in collection, trying next search directory\")\n continue\n }\n if (collectionMatchesAppDependencies(deps.nodeModules, dependencies, deps.logSummary)) {\n log.debug({ pm, searchDir: dir, depCount: deps.nodeModules.length }, \"collected node modules\")\n return deps\n }\n log.info({ pm, searchDir: dir }, \"collected node modules do not match the target package, trying next search directory/approach\")\n fallback ??= deps\n }\n }\n if (fallback == null && firstError != null) {\n throw firstError\n }\n return fallback\n}\n\n/** Extracts the package name from a `name@version` log-summary entry, handling `@scope/name@version`. */\nfunction dependencyNameFromSummaryId(id: string): string {\n let at: number\n if (id.startsWith(\"@\")) {\n // Scoped package: the version separator is the first `@` after the scope's `/`\n const slashIndex = id.indexOf(\"/\")\n if (slashIndex === -1) {\n return id\n }\n at = id.indexOf(\"@\", slashIndex + 1)\n } else {\n at = id.indexOf(\"@\")\n }\n return at > 0 ? id.slice(0, at) : id\n}\n\n/**\n * Enforces {@link CommonConfiguration.allowMissingDependencies} against the finished collection\n * summary (issue #10058). Runs only after collection completes, so the error reports the COMPLETE\n * set of missing production dependencies at once instead of failing on the first one.\n *\n * Fail-closed by default: `false`, `null` and omitted all fail the build when a production\n * dependency is missing; `true` restores the historical warn-only behavior. When the option is a\n * `string[]`, only the listed dependency names are allowed to be missing — matched against the\n * package name parsed from the summary's `name@version` entries (scoped names included), with an\n * exact-entry match accepted as well.\n *\n * Only genuinely missing production dependencies (`PKG_NOT_FOUND` / `PKG_NOT_ON_DISK`) are fatal;\n * missing optional dependencies (`PKG_OPTIONAL_NOT_INSTALLED` / `PKG_OPTIONAL_PLATFORM_NOT_INSTALLED`)\n * never fail the build.\n *\n * @internal exported for tests\n */\nexport function enforceAllowMissingDependencies(allowMissingDependencies: boolean | Array<string> | null | undefined, logSummary: ModuleManager[\"logSummary\"] | undefined): void {\n if (allowMissingDependencies === true) {\n return\n }\n const missing = new Set<string>([...(logSummary?.[LogMessageByKey.PKG_NOT_FOUND] ?? []), ...(logSummary?.[LogMessageByKey.PKG_NOT_ON_DISK] ?? [])])\n const allowed = new Set(Array.isArray(allowMissingDependencies) ? allowMissingDependencies : [])\n const fatal = Array.from(missing)\n .filter(id => !allowed.has(dependencyNameFromSummaryId(id)) && !allowed.has(id))\n .sort()\n if (fatal.length === 0) {\n return\n }\n throw new InvalidConfigurationError(\n `The following production dependencies could not be resolved during node-module collection:\\n` +\n fatal.map(id => ` - ${id}`).join(\"\\n\") +\n `\\nInstall the missing dependencies, list names in \\`allowMissingDependencies\\` to allow specific ones to be missing, or set \\`allowMissingDependencies\\` to true to only warn (electron-builder <= 26 behavior).`\n )\n}\n\n/** @internal */\nexport async function collectNodeModulesWithLogging(platformPackager: PlatformPackager<any>, arch: Arch | null) {\n const { tempDirManager, appDir, projectDir } = platformPackager\n\n // Drop packages whose `package.json` `cpu`/`os` is incompatible with the target arch/platform while\n // collecting (e.g. exclude `@esbuild/darwin-arm64` from the x64 slice). See NodeModulesCollector.\n // `null` arch (universal slices) disables the filter so both slices stay symmetric for the merge.\n const archFilter = arch == null ? undefined : { cpu: archToNodeCpu(arch), os: platformPackager.platform.nodeName }\n\n const searchDirectories = Array.from(new Set([appDir, projectDir, await platformPackager.getWorkspaceRoot()])).filter((it): it is string => isEmptyOrSpaces(it) === false)\n const pmApproaches = [await platformPackager.getPackageManager(), PM.TRAVERSAL]\n\n // The default-ignored packages are excluded from the copied `node_modules` — together with any\n // transitive dependency they alone require — because electron-builder already provides them another\n // way (the Electron runtime is embedded separately), so copying them would be redundant. They remain\n // valid production dependencies for tooling such as SBOM generation. See NodeModulesCollector.getNodeModules.\n const configuredIgnored = platformPackager.config.ignoredProductionDependencies\n const ignoredDependencies = configuredIgnored == null ? DEFAULT_IGNORED_PRODUCTION_DEPENDENCIES : configuredIgnored\n\n // An app that declares no production dependencies at all (neither as-installed nor via\n // `extraMetadata`) has nothing to bundle. Without this guard the search would skip the app's\n // empty `node_modules`, climb to the workspace root, and the vacuous match in\n // `collectionMatchesAppDependencies` would accept the entire hoisted workspace tree (#10033).\n const declaredDependencies = Object.keys({ ...platformPackager.originalMetadata.dependencies, ...platformPackager.metadata.dependencies })\n if (declaredDependencies.length === 0) {\n log.info(null, \"app has no production dependencies, skipping node_modules bundling\")\n return []\n }\n\n // Validate against the as-declared (pre-extraMetadata) production dependencies so a configured\n // `extraMetadata.dependencies` entry that isn't installed cannot reject a correct collection.\n const deps = await resolveFirstMatchingCollection({\n pmApproaches,\n searchDirectories,\n dependencies: platformPackager.originalMetadata.dependencies,\n run: (pm, dir) => getCollectorByPackageManager(pm, dir, tempDirManager).getNodeModules({ packageName: platformPackager.nodePackageName, archFilter, ignoredDependencies }),\n })\n\n if (!deps?.nodeModules?.length) {\n log.warn({ searchDirectories: searchDirectories.map(it => log.filePath(it)) }, \"no node modules returned while searching directories\")\n return []\n }\n\n const summary = Object.entries(deps.logSummary ?? {}).filter(([, dependencies]) => Array.isArray(dependencies) && dependencies.length > 0)\n for (const [errorMessage, dependencies] of summary) {\n const logLevel = logMessageLevelByKey[errorMessage as LogMessageByKey] || \"debug\"\n log[logLevel]({ dependencies }, errorMessage)\n }\n\n // Fail-closed enforcement (issue #10058): collection is complete and the summary above has reached\n // the log, so failing here reports every missing production dependency at once.\n enforceAllowMissingDependencies(platformPackager.config.allowMissingDependencies, deps.logSummary)\n\n // Tripwire: the default-ignored packages are excluded because electron-builder already provides them\n // (e.g. the embedded Electron runtime), so a copy in `node_modules` is redundant. They only reach this\n // point unflagged when a user has removed them from `ignoredProductionDependencies`; record any that\n // are therefore about to be copied (present but not marked `excluded`) so the summary below warns.\n const bundledDefaultIgnored = deps.nodeModules.filter(it => !it.excluded && DEFAULT_IGNORED_PRODUCTION_DEPENDENCIES.includes(it.name)).map(it => it.name)\n if (bundledDefaultIgnored.length > 0) {\n log.warn({ dependencies: bundledDefaultIgnored }, \"copied dependencies that shouldn't be needed, see ignoredProductionDependencies\")\n }\n\n warnAboutDeprecatedElectronPackages(deps.nodeModules)\n\n return deps.nodeModules\n}\n\n/**\n * Long-deprecated Electron packages that v26 rejected outright as production dependencies.\n *\n * v27 dropped that guard without adding them to the default ignore list, so they are now copied into\n * the app instead of failing the build — and `electron-prebuilt` drags a full second Electron binary\n * (hundreds of MB) into app.asar with nothing in the log to explain the size jump.\n */\nconst DEPRECATED_ELECTRON_PACKAGES: Record<string, string> = {\n \"electron-prebuilt\": \"renamed to `electron` in 2016 — replace it with `electron`\",\n \"electron-rebuild\": \"moved to `@electron/rebuild` — replace it and move it to devDependencies\",\n \"electron-nightly\": \"a full Electron distribution — move it to devDependencies if it is not meant to ship\",\n}\n\nfunction warnAboutDeprecatedElectronPackages(nodeModules: Array<{ name: string; excluded?: boolean }>): void {\n const bundled = nodeModules.filter(it => !it.excluded && it.name in DEPRECATED_ELECTRON_PACKAGES)\n for (const { name } of bundled) {\n log.warn(\n { dependency: name, solution: `add \"${name}\" to ignoredProductionDependencies, or move it to devDependencies` },\n `${name} is declared in dependencies and is being packaged into your app (${DEPRECATED_ELECTRON_PACKAGES[name]}). ` +\n \"electron-builder <= 26 rejected this outright; v27 removed that guard and does not exclude it by default. \" +\n \"See https://www.electron.build/docs/migration/v27-breaking-changes#electron-prebuilt-electron-rebuild-no-longer-error-and-are-not-excluded\"\n )\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"appFileCopier.js","sourceRoot":"","sources":["../../src/util/appFileCopier.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,6BAA6B,EAC7B,gBAAgB,EA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former,\n InvalidConfigurationError,\n isEmptyOrSpaces,\n Link,\n log,\n MAX_FILE_REQUESTS,\n rebaseCopiedSymlinkTarget,\n statOrNull,\n walk,\n WriteContainment,\n} from \"builder-util\"\nimport { DEFAULT_IGNORED_PRODUCTION_DEPENDENCIES } from \"../configuration.js\"\nimport { Stats } from \"fs\"\nimport fsExtra from \"fs-extra\"\nimport { readlink } from \"fs/promises\"\nimport * as path from \"path\"\nimport asyncPool from \"tiny-async-pool\"\nimport { isLibOrExe } from \"../asar/unpackDetector.js\"\nimport { Platform } from \"../core.js\"\nimport { FileMatcher, resolveExcludedExtensions } from \"../fileMatcher.js\"\nimport { getCollectorByPackageManager, PM } from \"../node-module-collector/index.js\"\nimport { LogMessageByKey, logMessageLevelByKey, ModuleManager } from \"../node-module-collector/moduleManager.js\"\nimport { Packager } from \"../packager.js\"\nimport { PlatformPackager } from \"../platformPackager.js\"\nimport { AppFileWalker } from \"./AppFileWalker.js\"\nimport { NodeModuleCopyHelper } from \"./NodeModuleCopyHelper.js\"\nimport { NodeModuleInfo } from \"../node-module-collector/types.js\"\nimport { PlatformSpecificBuildOptions } from \"../options/PlatformSpecificBuildOptions.js\"\nimport { archToNodeCpu } from \"./archCompatibility.js\"\nimport { assertSourceFileInTrustedRoots } from \"./trustedSourceRoots.js\"\nimport { BUILD_CHANGES_URL } from \"./config/legacyOptions.js\"\n\nexport function getDestinationPath(file: string, fileSet: ResolvedFileSet) {\n if (file === fileSet.src) {\n return fileSet.destination\n }\n\n const src = fileSet.src\n const dest = fileSet.destination\n // get node_modules path relative to src and then append to dest\n if (file.startsWith(src + path.sep)) {\n return path.join(dest, path.relative(src, file))\n }\n return dest\n}\n\nexport interface CopyAppFilesOptions {\n /** Every file, directory and symlink is written inside it, checked by its real path: the resources directory of the app. */\n readonly containmentRoot: string\n /** The real paths files may be copied from, see `getTrustedSourceRoots`. Each file is checked when given. */\n readonly trustedSourceRoots?: ReadonlyArray<string> | null\n /** The `fileOptions.allowExternalLinks` build option: allows a file outside the trusted source roots, or a kept symlink that leaves the containment root. */\n readonly externalLinks?: ExternalLinkPolicy | null\n}\n\n/**\n * Copies the files of the app when they are not packed into an asar archive. Like the asar packer, it refuses a file whose real path is\n * outside the trusted source roots, writes only inside the containment root, checked by real path, and recreates a symlink only when it\n * stays inside the containment root.\n */\nexport async function copyAppFiles(fileSet: ResolvedFileSet, packager: Pick<Packager, \"cancellationToken\">, transformer: FileTransformer, options?: CopyAppFilesOptions | null) {\n const metadata = fileSet.metadata\n // search auto unpacked dir\n const taskManager = new AsyncTaskManager(packager.cancellationToken)\n const containment = new WriteContainment(options?.containmentRoot ?? fileSet.destination, \"app file\")\n const trustedSourceRoots = options?.trustedSourceRoots\n\n const fileCopier = new FileCopier(file => {\n return !isLibOrExe(file)\n }, transformer)\n const links: Array<Link & { source: string }> = []\n for (let i = 0, n = fileSet.files.length; i < n; i++) {\n const sourceFile = fileSet.files[i]\n const stat = metadata.get(sourceFile)\n if (stat == null) {\n // dir\n continue\n }\n\n if (trustedSourceRoots != null) {\n await assertSourceFileInTrustedRoots(sourceFile, trustedSourceRoots, options?.externalLinks)\n }\n\n const destinationFile = getDestinationPath(sourceFile, fileSet)\n if (stat.isSymbolicLink()) {\n links.push({ file: destinationFile, link: rebaseCopiedSymlinkTarget(fileSet.src, sourceFile, await readlink(sourceFile)), source: sourceFile })\n continue\n }\n\n // creates the directory once, checked by its real path, and removes a symlink planted at the destination\n await containment.prepareFile(destinationFile)\n\n taskManager.addTask(fileCopier.copy(sourceFile, destinationFile, stat))\n if (taskManager.tasks.length > MAX_FILE_REQUESTS) {\n await taskManager.awaitTasks()\n }\n }\n\n if (taskManager.tasks.length > 0) {\n await taskManager.awaitTasks()\n }\n\n await asyncPool(MAX_FILE_REQUESTS, links, async it => {\n await containment.prepareFile(it.file)\n await fsExtra.ensureSymlink(it.link, it.file)\n })\n // the walker follows a symlink that leaves the app directory and copies what it points to, so a symlink kept as it is has to stay inside\n await assertCopiedSymlinksContained(containment, links, [], \"app file\", options?.externalLinks)\n}\n\n// os path separator is used\nexport interface ResolvedFileSet {\n src: string\n destination: string\n\n files: Array<string>\n metadata: Map<string, Stats>\n transformedFiles?: Map<number, string | Buffer> | null\n}\n\n// used only for ASAR, if no asar, file transformed on the fly\nexport async function transformFiles(transformer: FileTransformer, fileSet: ResolvedFileSet): Promise<void> {\n if (transformer == null) {\n return\n }\n\n let transformedFiles = fileSet.transformedFiles\n if (fileSet.transformedFiles == null) {\n transformedFiles = new Map()\n fileSet.transformedFiles = transformedFiles\n }\n\n const metadata = fileSet.metadata\n const filesPromise = fileSet.files.map(async (it, index) => {\n const fileStat = metadata.get(it)\n if (fileStat == null || !fileStat.isFile()) {\n return\n }\n\n const transformedValue = transformer(it)\n if (transformedValue == null) {\n return\n }\n\n if (typeof transformedValue === \"object\" && \"then\" in transformedValue) {\n return (transformedValue as Promise<any>).then(it => {\n if (it != null) {\n transformedFiles!.set(index, it)\n }\n return\n })\n }\n transformedFiles!.set(index, transformedValue as string | Buffer)\n return\n })\n // `asyncPool` doesn't provide `index` in it's handler, so we `map` first before using it\n await asyncPool(MAX_FILE_REQUESTS, filesPromise, promise => promise)\n}\n\nexport async function computeFileSets(matchers: Array<FileMatcher>, transformer: FileTransformer | null, platformPackager: PlatformPackager<any>): Promise<Array<ResolvedFileSet>> {\n const fileSets: Array<ResolvedFileSet> = []\n\n for (const matcher of matchers) {\n const fileWalker = new AppFileWalker(matcher, platformPackager)\n\n const fromStat = await statOrNull(matcher.from)\n if (fromStat == null) {\n log.debug({ directory: matcher.from, reason: \"doesn't exist\" }, `skipped copying`)\n continue\n }\n\n const files = await walk(matcher.from, fileWalker.filter, fileWalker)\n const metadata = fileWalker.metadata\n fileSets.push(validateFileSet({ src: matcher.from, files, metadata, destination: matcher.to }))\n }\n\n return fileSets\n}\n\nfunction getNodeModuleExcludedExts(platformPackager: PlatformPackager<any>, platformSpecificBuildOptions: PlatformSpecificBuildOptions) {\n // do not exclude *.h files (https://github.com/electron-userland/electron-builder/issues/2852)\n const result = resolveExcludedExtensions(platformPackager.config, platformSpecificBuildOptions).map(it => `.${it}`)\n if (platformPackager.platform !== Platform.WINDOWS) {\n // https://github.com/electron-userland/electron-builder/issues/1738\n result.push(\".dll\")\n result.push(\".exe\")\n }\n return result\n}\n\nfunction validateFileSet(fileSet: ResolvedFileSet): ResolvedFileSet {\n if (fileSet.src == null || fileSet.src.length === 0) {\n throw new Error(\"fileset src is empty\")\n }\n return fileSet\n}\n\n/** @internal */\nexport async function computeNodeModuleFileSets(\n platformPackager: PlatformPackager<any>,\n platformSpecificBuildOptions: PlatformSpecificBuildOptions,\n mainMatcher: FileMatcher,\n arch: Arch,\n applyArchFilter = true\n): Promise<Array<ResolvedFileSet>> {\n const deps = await collectNodeModulesWithLogging(platformPackager, applyArchFilter ? arch : null)\n\n // the options this pack uses for the app files too (e.g. mac → mas → masDev cascaded), not always the platform section's own\n const nodeModuleExcludedExts = getNodeModuleExcludedExts(platformPackager, platformSpecificBuildOptions)\n // serial execution because copyNodeModules is concurrent and so, no need to increase queue/pressure\n const result = new Array<ResolvedFileSet>()\n let index = 0\n const NODE_MODULES = \"node_modules\"\n\n const collectNodeModules = async (dep: NodeModuleInfo, destination: string) => {\n // Ignore excluded dependencies.\n if (dep.excluded) {\n return\n }\n\n const source = dep.dir\n const matcher = new FileMatcher(source, destination, mainMatcher.macroExpander, mainMatcher.patterns)\n const copier = new NodeModuleCopyHelper(matcher, platformPackager)\n const files = await copier.collectNodeModules(dep, nodeModuleExcludedExts, path.relative(mainMatcher.to, destination))\n result[index++] = validateFileSet({ src: source, destination, files, metadata: copier.metadata })\n\n log.debug({ dep: dep.name, from: log.filePath(source), to: log.filePath(destination), filesCount: files.length }, \"identified module\")\n\n if (dep.dependencies) {\n for (const c of dep.dependencies) {\n await collectNodeModules(c, path.join(destination, NODE_MODULES, c.name))\n }\n }\n }\n\n for (const dep of deps) {\n const destination = path.join(mainMatcher.to, NODE_MODULES, dep.name)\n await collectNodeModules(dep, destination)\n }\n return result\n}\n\ntype CollectedNodeModules = { nodeModules: NodeModuleInfo[]; logSummary: ModuleManager[\"logSummary\"] }\n\n/** Runs a single package-manager collector against a single directory. */\ntype CollectorRunner = (pm: PM, dir: string) => Promise<CollectedNodeModules>\n\n// `workspace:`/`file:`/`link:`/`portal:` dependencies are symlinked into place rather than\n// installed as standalone, hoistable packages, so they may legitimately be absent from a\n// collected tree and cannot be used to validate it.\nconst LOCAL_DEPENDENCY_SPEC = /^(?:workspace|file|link|portal):/\n\n// Log-summary buckets in which a collector reports a declared dependency it deliberately or\n// unavoidably left out of the collected tree. A direct dependency recorded in one of these is\n// accounted for even though it is absent from the top level of an otherwise correct collection.\nconst ACCOUNTED_ABSENT_DEPENDENCY_KEYS: ReadonlyArray<LogMessageByKey> = [\n // dropped by the target arch/platform filter (`archFilter`, package.json `cpu`/`os`)\n LogMessageByKey.PKG_INCOMPATIBLE_PLATFORM,\n // not installed / not resolvable on disk — whether that is fatal is decided afterwards by\n // `allowMissingDependencies` (see enforceAllowMissingDependencies), not by collection matching\n LogMessageByKey.PKG_NOT_FOUND,\n LogMessageByKey.PKG_NOT_ON_DISK,\n LogMessageByKey.PKG_OPTIONAL_NOT_INSTALLED,\n LogMessageByKey.PKG_OPTIONAL_PLATFORM_NOT_INSTALLED,\n // excluded via `ignoredProductionDependencies` (such modules normally stay in the tree flagged\n // `excluded`, so this only matters if a collector ever drops them instead)\n LogMessageByKey.PKG_EXCLUDED_IGNORED,\n // a dependency that resolves to the package itself is skipped rather than collected\n LogMessageByKey.PKG_SELF_REF,\n]\n\n/**\n * Determines whether a collected module tree actually describes the package being built.\n *\n * A package-manager `list` invocation can resolve to the wrong project root — most notably when\n * electron-builder is run from a workspace sub-package whose dependencies are hoisted to the\n * workspace root (#9945) — or a collector can resolve the root node to the wrong package (e.g. an\n * app named like one of its own dependencies, #10277). In both cases the collector returns a\n * non-empty but wrong tree. Accepting it would suppress the manual-traversal fallback that resolves\n * the correct modules, so we need to tell a matching collection from a mismatched one.\n *\n * Only the package's declared external (registry-installed, non-`workspace:`/`file:`/`link:`/`portal:`)\n * production `dependencies` are checked; they are always placed at the top level of a correct\n * collection. A collection matches when:\n * - at least one of them is present at the top level, and\n * - every one of them is either present at the top level (including modules flagged `excluded` by\n * `ignoredProductionDependencies`) or reported in the collection's own `logSummary` as\n * legitimately absent: dropped by the arch/platform filter, missing on disk (enforced later by\n * `allowMissingDependencies`), a missing optional/platform-specific package, excluded as ignored,\n * or a self-reference.\n *\n * When the package declares no external production dependencies there is nothing to validate\n * against, so any non-empty collection is accepted.\n */\nexport function collectionMatchesAppDependencies(\n nodeModules: NodeModuleInfo[],\n dependencies: Record<string, string> | undefined,\n logSummary?: ModuleManager[\"logSummary\"]\n): boolean {\n const requiredExternalDeps = Object.entries(dependencies ?? {})\n .filter(([, spec]) => !LOCAL_DEPENDENCY_SPEC.test(spec))\n .map(([name]) => name)\n if (requiredExternalDeps.length === 0) {\n return true\n }\n const collected = new Set(nodeModules.map(it => it.name))\n if (!requiredExternalDeps.some(name => collected.has(name))) {\n return false\n }\n const accountedAbsent = new Set(ACCOUNTED_ABSENT_DEPENDENCY_KEYS.flatMap(key => logSummary?.[key] ?? []).map(dependencyNameFromSummaryId))\n return requiredExternalDeps.every(name => collected.has(name) || accountedAbsent.has(name))\n}\n\n/**\n * Walks the candidate (package-manager, directory) combinations and returns the first collection\n * that both contains modules and matches the package being built (see\n * {@link collectionMatchesAppDependencies}). A non-empty collection that does NOT match — e.g. a\n * workspace-root tree returned for a sub-package — is retained only as a last-resort fallback so a\n * later approach (notably {@link PM.TRAVERSAL}) can supply the correct modules.\n *\n * An approach that throws (e.g. the package manager exited without producing its dependency tree,\n * issue #10208) is logged as a warning and skipped so the remaining approaches still run. If every\n * approach fails to produce a collection and at least one threw, the first error is rethrown rather\n * than silently reporting \"no node modules\".\n */\nexport async function resolveFirstMatchingCollection(options: {\n pmApproaches: PM[]\n searchDirectories: string[]\n dependencies: Record<string, string> | undefined\n run: CollectorRunner\n}): Promise<CollectedNodeModules | undefined> {\n const { pmApproaches, searchDirectories, dependencies, run } = options\n let fallback: CollectedNodeModules | undefined\n let firstError: Error | undefined\n\n for (const pm of pmApproaches) {\n for (const dir of searchDirectories) {\n log.info({ pm, searchDir: dir }, \"searching for node modules\")\n let deps: CollectedNodeModules\n try {\n deps = await run(pm, dir)\n } catch (error: any) {\n log.warn({ pm, searchDir: dir, error: error?.message ?? String(error) }, \"node module collection failed, trying next search directory/approach\")\n firstError ??= error instanceof Error ? error : new Error(String(error))\n continue\n }\n if (deps.nodeModules.length === 0) {\n log.info({ pm, searchDir: dir }, \"no node modules found in collection, trying next search directory\")\n continue\n }\n if (collectionMatchesAppDependencies(deps.nodeModules, dependencies, deps.logSummary)) {\n log.debug({ pm, searchDir: dir, depCount: deps.nodeModules.length }, \"collected node modules\")\n return deps\n }\n log.info({ pm, searchDir: dir }, \"collected node modules do not match the target package, trying next search directory/approach\")\n fallback ??= deps\n }\n }\n if (fallback == null && firstError != null) {\n throw firstError\n }\n return fallback\n}\n\n/** Extracts the package name from a `name@version` log-summary entry, handling `@scope/name@version`. */\nfunction dependencyNameFromSummaryId(id: string): string {\n let at: number\n if (id.startsWith(\"@\")) {\n // Scoped package: the version separator is the first `@` after the scope's `/`\n const slashIndex = id.indexOf(\"/\")\n if (slashIndex === -1) {\n return id\n }\n at = id.indexOf(\"@\", slashIndex + 1)\n } else {\n at = id.indexOf(\"@\")\n }\n return at > 0 ? id.slice(0, at) : id\n}\n\n/**\n * Enforces {@link CommonConfiguration.allowMissingDependencies} against the finished collection\n * summary (issue #10058). Runs only after collection completes, so the error reports the COMPLETE\n * set of missing production dependencies at once instead of failing on the first one.\n *\n * Fail-closed by default: `false`, `null` and omitted all fail the build when a production\n * dependency is missing; `true` restores the historical warn-only behavior. When the option is a\n * `string[]`, only the listed dependency names are allowed to be missing — matched against the\n * package name parsed from the summary's `name@version` entries (scoped names included), with an\n * exact-entry match accepted as well.\n *\n * Only genuinely missing production dependencies (`PKG_NOT_FOUND` / `PKG_NOT_ON_DISK`) are fatal;\n * missing optional dependencies (`PKG_OPTIONAL_NOT_INSTALLED` / `PKG_OPTIONAL_PLATFORM_NOT_INSTALLED`)\n * never fail the build.\n *\n * @internal exported for tests\n */\nexport function enforceAllowMissingDependencies(allowMissingDependencies: boolean | Array<string> | null | undefined, logSummary: ModuleManager[\"logSummary\"] | undefined): void {\n if (allowMissingDependencies === true) {\n return\n }\n const missing = new Set<string>([...(logSummary?.[LogMessageByKey.PKG_NOT_FOUND] ?? []), ...(logSummary?.[LogMessageByKey.PKG_NOT_ON_DISK] ?? [])])\n const allowed = new Set(Array.isArray(allowMissingDependencies) ? allowMissingDependencies : [])\n const fatal = Array.from(missing)\n .filter(id => !allowed.has(dependencyNameFromSummaryId(id)) && !allowed.has(id))\n .sort()\n if (fatal.length === 0) {\n return\n }\n throw new InvalidConfigurationError(\n `The following production dependencies could not be resolved during node-module collection:\\n` +\n fatal.map(id => ` - ${id}`).join(\"\\n\") +\n `\\nInstall the missing dependencies, list names in \\`allowMissingDependencies\\` to allow specific ones to be missing, or set \\`allowMissingDependencies\\` to true to only warn (electron-builder <= 26 behavior).` +\n `\\nSee ${BUILD_CHANGES_URL}#allowmissingdependencies-now-fails-the-build`\n )\n}\n\n/** @internal */\nexport async function collectNodeModulesWithLogging(platformPackager: PlatformPackager<any>, arch: Arch | null) {\n const { tempDirManager, appDir, projectDir } = platformPackager\n\n // Drop packages whose `package.json` `cpu`/`os` is incompatible with the target arch/platform while\n // collecting (e.g. exclude `@esbuild/darwin-arm64` from the x64 slice). See NodeModulesCollector.\n // `null` arch (universal slices) disables the filter so both slices stay symmetric for the merge.\n const archFilter = arch == null ? undefined : { cpu: archToNodeCpu(arch), os: platformPackager.platform.nodeName }\n\n const searchDirectories = Array.from(new Set([appDir, projectDir, await platformPackager.getWorkspaceRoot()])).filter((it): it is string => isEmptyOrSpaces(it) === false)\n const pmApproaches = [await platformPackager.getPackageManager(), PM.TRAVERSAL]\n\n // The default-ignored packages are excluded from the copied `node_modules` — together with any\n // transitive dependency they alone require — because electron-builder already provides them another\n // way (the Electron runtime is embedded separately), so copying them would be redundant. They remain\n // valid production dependencies for tooling such as SBOM generation. See NodeModulesCollector.getNodeModules.\n const configuredIgnored = platformPackager.config.ignoredProductionDependencies\n const ignoredDependencies = configuredIgnored == null ? DEFAULT_IGNORED_PRODUCTION_DEPENDENCIES : configuredIgnored\n\n // An app that declares no production dependencies at all (neither as-installed nor via\n // `extraMetadata`) has nothing to bundle. Without this guard the search would skip the app's\n // empty `node_modules`, climb to the workspace root, and the vacuous match in\n // `collectionMatchesAppDependencies` would accept the entire hoisted workspace tree (#10033).\n const declaredDependencies = Object.keys({ ...platformPackager.originalMetadata.dependencies, ...platformPackager.metadata.dependencies })\n if (declaredDependencies.length === 0) {\n log.info(null, \"app has no production dependencies, skipping node_modules bundling\")\n return []\n }\n\n // Validate against the as-declared (pre-extraMetadata) production dependencies so a configured\n // `extraMetadata.dependencies` entry that isn't installed cannot reject a correct collection.\n const deps = await resolveFirstMatchingCollection({\n pmApproaches,\n searchDirectories,\n dependencies: platformPackager.originalMetadata.dependencies,\n run: (pm, dir) =>\n getCollectorByPackageManager(pm, dir, tempDirManager).getNodeModules({\n packageName: platformPackager.nodePackageName,\n archFilter,\n ignoredDependencies,\n }),\n })\n\n if (!deps?.nodeModules?.length) {\n log.warn({ searchDirectories: searchDirectories.map(it => log.filePath(it)) }, \"no node modules returned while searching directories\")\n return []\n }\n\n const summary = Object.entries(deps.logSummary ?? {}).filter(([, dependencies]) => Array.isArray(dependencies) && dependencies.length > 0)\n for (const [errorMessage, dependencies] of summary) {\n const logLevel = logMessageLevelByKey[errorMessage as LogMessageByKey] || \"debug\"\n log[logLevel]({ dependencies }, errorMessage)\n }\n\n // Fail-closed enforcement (issue #10058): collection is complete and the summary above has reached\n // the log, so failing here reports every missing production dependency at once.\n enforceAllowMissingDependencies(platformPackager.config.allowMissingDependencies, deps.logSummary)\n\n // Tripwire: the default-ignored packages are excluded because electron-builder already provides them\n // (e.g. the embedded Electron runtime), so a copy in `node_modules` is redundant. They only reach this\n // point unflagged when a user has removed them from `ignoredProductionDependencies`; record any that\n // are therefore about to be copied (present but not marked `excluded`) so the summary below warns.\n const bundledDefaultIgnored = deps.nodeModules.filter(it => !it.excluded && DEFAULT_IGNORED_PRODUCTION_DEPENDENCIES.includes(it.name)).map(it => it.name)\n if (bundledDefaultIgnored.length > 0) {\n log.warn({ dependencies: bundledDefaultIgnored }, \"copied dependencies that shouldn't be needed, see ignoredProductionDependencies\")\n }\n\n warnAboutDeprecatedElectronPackages(deps.nodeModules)\n\n return deps.nodeModules\n}\n\n/**\n * Long-deprecated Electron packages that v26 rejected outright as production dependencies.\n *\n * v27 dropped that guard without adding them to the default ignore list, so they are now copied into\n * the app instead of failing the build — and `electron-prebuilt` drags a full second Electron binary\n * (hundreds of MB) into app.asar with nothing in the log to explain the size jump.\n */\nconst DEPRECATED_ELECTRON_PACKAGES: Record<string, string> = {\n \"electron-prebuilt\": \"renamed to `electron` in 2016 — replace it with `electron`\",\n \"electron-rebuild\": \"moved to `@electron/rebuild` — replace it and move it to devDependencies\",\n \"electron-nightly\": \"a full Electron distribution — move it to devDependencies if it is not meant to ship\",\n}\n\nfunction warnAboutDeprecatedElectronPackages(nodeModules: Array<{ name: string; excluded?: boolean }>): void {\n const bundled = nodeModules.filter(it => !it.excluded && it.name in DEPRECATED_ELECTRON_PACKAGES)\n for (const { name } of bundled) {\n log.warn(\n { dependency: name, solution: `add \"${name}\" to ignoredProductionDependencies, or move it to devDependencies` },\n `${name} is declared in dependencies and is being packaged into your app (${DEPRECATED_ELECTRON_PACKAGES[name]}). ` +\n \"electron-builder <= 26 rejected this outright; v27 removed that guard and does not exclude it by default. \" +\n \"See https://www.electron.build/docs/migration/v27-build-changes#electron-prebuilt-electron-rebuild-no-longer-error-and-are-not-excluded\"\n )\n }\n}\n"]}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { AuthenticodeSignerReader } from "../codeSign/win/authenticodeSignature.js";
|
|
2
|
+
import type { Configuration } from "../configuration.js";
|
|
3
|
+
/**
|
|
4
|
+
* - `verified` — the check passed
|
|
5
|
+
* - `failed` — the check ran and failed
|
|
6
|
+
* - `unverifiable` — the check cannot run here (e.g. codesign off macOS, no trust list to verify a manifest against)
|
|
7
|
+
* - `skipped` — the configuration opts out of what the check verifies (e.g. `mac.notarize: false`)
|
|
8
|
+
*/
|
|
9
|
+
export type VerificationStatus = "verified" | "failed" | "unverifiable" | "skipped";
|
|
10
|
+
export interface VerificationResult {
|
|
11
|
+
readonly status: VerificationStatus;
|
|
12
|
+
/** What was checked, e.g. "update manifest signature". */
|
|
13
|
+
readonly check: string;
|
|
14
|
+
/** The file or directory the check is about. */
|
|
15
|
+
readonly file: string;
|
|
16
|
+
readonly message: string;
|
|
17
|
+
}
|
|
18
|
+
export interface VerifyBuildOutputOptions {
|
|
19
|
+
/** The output directory of the build (`directories.output`). */
|
|
20
|
+
readonly outDir: string;
|
|
21
|
+
/** The configuration of the build that produced the output: its opt-outs are honored. */
|
|
22
|
+
readonly config: Configuration;
|
|
23
|
+
/** Reads Windows Authenticode signatures; defaults to {@link readAuthenticodeSigner}. */
|
|
24
|
+
readonly readSigner?: AuthenticodeSignerReader;
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Verifies the built artifacts in an output directory, the checks `forceCodeSigning` makes during a build plus what can
|
|
28
|
+
* only be seen afterwards:
|
|
29
|
+
* - every update manifest (`latest*.yml`, found by its shape) is signed by a key in the trust list (`updateManifestPublicKey`)
|
|
30
|
+
* of every packaged app of its platform, and each file it lists matches an artifact (sha512 and size);
|
|
31
|
+
* - macOS (on macOS only): every `.app` has a valid code signature and, outside the Mac App Store, a stapled notarization
|
|
32
|
+
* ticket; a `.pkg` is signed (and notarized); a DMG with `dmg.sign: true` is signed;
|
|
33
|
+
* - Windows: every installer, package and app executable carries a valid Authenticode signature (whose hash only Windows
|
|
34
|
+
* can validate), and the update installers match the `publisherName` electron-updater verifies them against.
|
|
35
|
+
*
|
|
36
|
+
* Opt-outs in `config` (`updateManifest: false`, `mac.notarize: false`, `win.sign: false`, `signExts` exclusions, ...)
|
|
37
|
+
* turn the affected checks into `skipped` results, whatever the host.
|
|
38
|
+
*/
|
|
39
|
+
export declare function verifyBuildOutput(options: VerifyBuildOutputOptions): Promise<Array<VerificationResult>>;
|
|
40
|
+
//# sourceMappingURL=buildOutputVerifier.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"buildOutputVerifier.d.ts","sourceRoot":"","sources":["../../src/util/buildOutputVerifier.ts"],"names":[],"mappings":"AAMA,OAAO,EAGL,wBAAwB,EAGzB,MAAM,0CAA0C,CAAA;AACjD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAA;AAKxD;;;;;GAKG;AACH,MAAM,MAAM,kBAAkB,GAAG,UAAU,GAAG,QAAQ,GAAG,cAAc,GAAG,SAAS,CAAA;AAEnF,MAAM,WAAW,kBAAkB;IACjC,QAAQ,CAAC,MAAM,EAAE,kBAAkB,CAAA;IACnC,0DAA0D;IAC1D,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAA;IACtB,gDAAgD;IAChD,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;IACrB,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAA;CACzB;AAED,MAAM,WAAW,wBAAwB;IACvC,gEAAgE;IAChE,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAA;IACvB,yFAAyF;IACzF,QAAQ,CAAC,MAAM,EAAE,aAAa,CAAA;IAC9B,yFAAyF;IACzF,QAAQ,CAAC,UAAU,CAAC,EAAE,wBAAwB,CAAA;CAC/C;AAmCD;;;;;;;;;;;;GAYG;AACH,wBAAsB,iBAAiB,CAAC,OAAO,EAAE,wBAAwB,GAAG,OAAO,CAAC,KAAK,CAAC,kBAAkB,CAAC,CAAC,CA8C7G"}
|