app-builder-lib 27.0.0-alpha.12 → 27.0.0-alpha.14
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 +93 -4
- 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 +19 -13
- 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 +7 -0
- package/dist/packager.d.ts.map +1 -1
- package/dist/packager.js +21 -5
- 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 +58 -22
- 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/blockmap/blockmap.d.ts +30 -0
- package/dist/targets/blockmap/blockmap.d.ts.map +1 -1
- package/dist/targets/blockmap/blockmap.js +99 -31
- package/dist/targets/blockmap/blockmap.js.map +1 -1
- package/dist/targets/blockmap/blockmapV3.d.ts +36 -0
- package/dist/targets/blockmap/blockmapV3.d.ts.map +1 -0
- package/dist/targets/blockmap/blockmapV3.js +41 -0
- package/dist/targets/blockmap/blockmapV3.js.map +1 -0
- package/dist/targets/blockmap/verbatimRange.d.ts +6 -0
- package/dist/targets/blockmap/verbatimRange.d.ts.map +1 -1
- package/dist/targets/blockmap/verbatimRange.js +11 -0
- package/dist/targets/blockmap/verbatimRange.js.map +1 -1
- package/dist/targets/differentialUpdateInfoBuilder.d.ts +92 -4
- package/dist/targets/differentialUpdateInfoBuilder.d.ts.map +1 -1
- package/dist/targets/differentialUpdateInfoBuilder.js +266 -10
- package/dist/targets/differentialUpdateInfoBuilder.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 +25 -8
- 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/targetFactory.d.ts +1 -1
- package/dist/targets/targetFactory.d.ts.map +1 -1
- package/dist/targets/targetFactory.js +22 -0
- package/dist/targets/targetFactory.js.map +1 -1
- package/dist/targets/win/MsiTarget.d.ts +7 -0
- package/dist/targets/win/MsiTarget.d.ts.map +1 -1
- package/dist/targets/win/MsiTarget.js +140 -21
- package/dist/targets/win/MsiTarget.js.map +1 -1
- package/dist/targets/win/nsis/NsisTarget.d.ts.map +1 -1
- package/dist/targets/win/nsis/NsisTarget.js +22 -8
- 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/appimage.d.ts +3 -0
- package/dist/toolsets/appimage.d.ts.map +1 -1
- package/dist/toolsets/appimage.js +4 -1
- package/dist/toolsets/appimage.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/toolsets/wix.d.ts +44 -0
- package/dist/toolsets/wix.d.ts.map +1 -0
- package/dist/toolsets/wix.js +91 -0
- package/dist/toolsets/wix.js.map +1 -0
- 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/electronUpdaterCompatibility.d.ts +43 -0
- package/dist/util/electronUpdaterCompatibility.d.ts.map +1 -0
- package/dist/util/electronUpdaterCompatibility.js +53 -0
- package/dist/util/electronUpdaterCompatibility.js.map +1 -0
- 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 +116 -52
- 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 +542 -29
- package/templates/msi/template.xml +5 -5
- package/templates/msiWrapped/template.xml +1 -1
- package/templates/nsis/assistedInstaller.nsh +32 -1
- 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
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"flatpakBundle.js","sourceRoot":"","sources":["../../../src/targets/linux/flatpakBundle.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,yBAAyB,EAAE,GAAG,EAAE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F;QACjF,MAAM,2BAA2B,CAAC,MAAM,EAAE,UAAU,EAAE,QAAQ,EAAE,uBAAuB,CAAC,CAAA;QACxF,MAAM,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAA;QACxD,+DAA+D;QAC/D,MAAM,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,EAAE,MAAM,CAAC,EAAE,QAAQ,CAAC,CAAA;IAC1D,CAAC;IAED,MAAM,iBAAiB,CAAC,eAAe,CAAC,CAAA;IAExC,MAAM,IAAI,CAAC,SAAS,EAAE,CAAC,cAAc,EAAE,QAAQ,EAAE,IAAI,EAAE,GAAG,OAAO,CAAC,eAAe,EAAE,IAAI,EAAE,MAAM,EAAE,GAAG,MAAM,CAAC,EAAE,EAAE,GAAG,EAAE,CAAC,CAAC,KAAK,CACzH,MAAM,CAAC;QACL,SAAS;QACT,iPAAiP,4BAA4B,EAAE;KAChR,CAAC,CACH,CAAA;IAED,MAAM,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,YAAY,CAAC,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAA;IACpE,MAAM,IAAI,CAAC,SAAS,EAAE,CAAC,cAAc,EAAE,QAAQ,EAAE,IAAI,EAAE,GAAG,OAAO,CAAC,eAAe,EAAE,IAAI,EAAE,OAAO,CAAC,YAAY,EAAE,QAAQ,CAAC,EAAE,EAAE,GAAG,MAAM,CAAC,EAAE,EAAE,GAAG,EAAE,CAAC,CAAA;AAClJ,CAAC","sourcesContent":["import { exec, InvalidConfigurationError, log } from \"builder-util\"\nimport { cp, mkdir, realpath, symlink, writeFile } from \"fs/promises\"\nimport * as path from \"path\"\nimport * as semver from \"semver\"\nimport { BREAKING_CHANGES_URL } from \"../../util/config/legacyOptions.js\"\n\n// flatpak-builder 1.2.2 is the one of Ubuntu 22.04, the oldest current distribution release (Debian 12 and RHEL 8/9 have 1.2.3). It fixes\n// CVE-2022-21682 with an option that flatpak supports from 1.12.4 on; Ubuntu 22.04 has flatpak 1.12.7\nconst MIN_VERSIONS = { flatpak: \"1.12.4\", \"flatpak-builder\": \"1.2.2\" }\n\n// the freedesktop SDK 24.08 and newer recommend it for meson and cmake modules\nconst MODULES_FLATPAK_BUILDER_VERSION = \"1.4.4\"\nconst MODULES_FREEDESKTOP_SDK_VERSION = \"24.8.0\"\n\nconst NEW_IN_V27 = `This is new in electron-builder v27. See ${BREAKING_CHANGES_URL}#flatpak-tooling-requirements`\n\nconst FLATPAK_DOCS = \"https://www.electron.build/docs/flatpak\"\nconst UNPRIVILEGED_CONTAINERS_DOCS = `${FLATPAK_DOCS}#building-in-unprivileged-containers`\n\n/** The part of a [flatpak-builder manifest](https://docs.flatpak.org/en/latest/flatpak-builder-command-reference.html#flatpak-manifest) that the flatpak target writes. */\nexport interface FlatpakBuilderManifest {\n id: string\n command: string\n runtime: string\n \"runtime-version\": string\n sdk: string\n base: string\n \"base-version\": string\n \"finish-args\": string[]\n branch?: string\n modules?: (string | any)[]\n}\n\n/** The refs a build needs: the runtime, the SDK and the base app of the manifest. */\nexport type FlatpakRefKind = \"runtime\" | \"sdk\" | \"base\"\n\nexport interface FlatpakBundleOptions {\n manifest: FlatpakBuilderManifest\n /** flatpak's name for the target architecture, e.g. `x86_64` */\n arch: string\n /** where to write the single-file bundle */\n artifactPath: string\n /** an empty directory for the manifest, the app directory, the repository and the state of flatpak-builder */\n tempDir: string\n /** `[source, destination]` pairs, copied in order; a destination is relative to the app prefix (`/app` in the sandbox) */\n files: [string, string][]\n /** `[target, link]` pairs, both relative to the app prefix */\n symlinks: [string, string][]\n /** the refs to install when they are missing and update when they are installed; the others are used as installed, and have to be */\n installOrUpdateRefs: ReadonlyArray<FlatpakRefKind>\n /** added to both runs of flatpak-builder */\n flatpakBuilderArgs: string[]\n buildExportArgs: string[]\n buildBundleArgs: string[]\n}\n\n/**\n * Logs how to fix a failure that has a known cause, given as `[marker, hint]` pairs: the hint of the first marker that the error\n * contains. The error is rethrown as is: `exec` has already put the output of the tool in it.\n */\nfunction hintOn(...hints: Array<[marker: string, hint: string]>) {\n return (e: Error): never => {\n const hint = hints.find(([marker]) => e.message.includes(marker))\n if (hint != null) {\n log.error(null, hint[1])\n }\n throw e\n }\n}\n\n/** Checks that the tool runs and is new enough, and returns its version, or null when the output has none. */\nasync function requireTool(tool: keyof typeof MIN_VERSIONS, cwd: string): Promise<semver.SemVer | null> {\n let stdout: string\n try {\n stdout = await exec(tool, [\"--version\"], { cwd })\n } catch (e: any) {\n log.error({ error: e.message }, `cannot run ${tool}`)\n throw new InvalidConfigurationError(`cannot run ${tool} - flatpak and flatpak-builder must be installed to build the flatpak target`)\n }\n log.info({ version: stdout.trim() }, `${tool} found`)\n\n // the output is \"Flatpak 1.16.6\", \"flatpak-builder 1.2.3\" or \"flatpak-builder-1.4.4\" depending on the tool and the distribution\n const version = semver.coerce(stdout)\n if (version != null && semver.lt(version, MIN_VERSIONS[tool])) {\n throw new InvalidConfigurationError(\n `${tool} ${version.version} is not supported - version ${MIN_VERSIONS[tool]} or newer is required to build the flatpak target. ${NEW_IN_V27}`\n )\n }\n return version\n}\n\nfunction isInside(dir: string, file: string): boolean {\n const relative = path.relative(dir, file)\n return relative !== \"..\" && !relative.startsWith(`..${path.sep}`) && !path.isAbsolute(relative)\n}\n\n/**\n * Where a path given relative to the app prefix lands in the build directory. One that leaves the prefix is refused: the copy or\n * the link would be written elsewhere on the build machine, such as over the metadata of the build directory.\n */\nfunction inAppPrefix(prefix: string, relativePath: string, what: string): string {\n const resolved = path.join(prefix, relativePath)\n if (!isInside(prefix, resolved)) {\n throw new InvalidConfigurationError(`${what} \"${relativePath}\" is outside the app prefix (/app in the sandbox): use a path inside it, such as \"/lib/<name>\". ${NEW_IN_V27}`)\n }\n return resolved\n}\n\n/**\n * Refuses to write `file` when a symlink takes its directory out of the app prefix, which inAppPrefix cannot see: the base app, the\n * modules and an earlier flatpak.files pair put files into the prefix that are not checked, and a link among them, such as\n * `lib -> ../..` or `lib -> /home`, would make the copy or the link land elsewhere on the build machine. Only the directory is\n * resolved: what is at `file` itself is replaced, not followed, by both cp and symlink.\n */\nasync function requireDirectoryInAppPrefix(prefix: string, realPrefix: string, file: string, what: string): Promise<void> {\n const relative = path.relative(prefix, file)\n if (relative === \"\") {\n // the prefix itself, which a directory is merged into\n return\n }\n // the deepest directory that exists, since what is still to be created cannot be a link. A link that leads nowhere is passed over\n // as well: mkdir and cp fail on it rather than create anything through it\n let existing = path.dirname(file)\n let resolved: string | null = null\n while (resolved == null) {\n try {\n resolved = await realpath(existing)\n } catch (e: any) {\n // ENOTDIR: a file of an earlier pair is in the way, which the copy or mkdir reports itself\n if ((e.code !== \"ENOENT\" && e.code !== \"ENOTDIR\") || existing === path.dirname(existing)) {\n throw e\n }\n existing = path.dirname(existing)\n }\n }\n if (!isInside(realPrefix, resolved)) {\n const shown = `/${relative.split(path.sep).join(\"/\")}`\n throw new InvalidConfigurationError(\n `${what} \"${shown}\" resolves outside the app prefix (/app in the sandbox) through a symlink, to \"${resolved}\": a link in the prefix, from the base app, a module or an earlier flatpak.files pair, points outside it. ${NEW_IN_V27}`\n )\n }\n}\n\n/** Whether a ref is installed for the user and system-wide. */\nasync function findRef(ref: string, cwd: string): Promise<{ inUser: boolean; inSystem: boolean }> {\n const isInstalled = (installation: \"--user\" | \"--system\") =>\n exec(\"flatpak\", [\"info\", \"--show-commit\", installation, ref], { cwd }).then(\n () => true,\n () => false\n )\n const [inUser, inSystem] = await Promise.all([isInstalled(\"--user\"), isInstalled(\"--system\")])\n return { inUser, inSystem }\n}\n\n/** Brings a ref that the build needs up to date, wherever it is installed, and installs it for the user when it is installed nowhere. */\nasync function installOrUpdateRef(ref: string, cwd: string): Promise<void> {\n const { inUser, inSystem } = await findRef(ref, cwd)\n\n if (inUser || inSystem) {\n await exec(\"flatpak\", [\"update\", ...(inUser ? [\"--user\"] : []), \"--no-deps\", \"--noninteractive\", ref], { cwd })\n return\n }\n\n log.info({ ref }, \"installing flatpak ref, this can download several gigabytes\")\n await exec(\"flatpak\", [\"install\", \"--user\", \"--no-deps\", \"--noninteractive\", ref], { cwd }).catch(\n hintOn([\n \"No remote refs found\",\n `missing flatpak refs are installed with \"flatpak install --user\", which only searches the remotes of the user installation. If flathub is not one of them, add it with: flatpak remote-add --user --if-not-exists flathub https://dl.flathub.org/repo/flathub.flatpakrepo (otherwise check that the configured runtime, sdk and base versions exist)`,\n ])\n )\n}\n\n/** Checks that a ref that the build is not to install or update is installed, in either installation. */\nasync function requireInstalledRef(kind: FlatpakRefKind, ref: string, cwd: string): Promise<void> {\n const { inUser, inSystem } = await findRef(ref, cwd)\n if (!inUser && !inSystem) {\n throw new InvalidConfigurationError(\n `the ${kind} ${ref} is not installed, and flatpak.installOrUpdateRefs does not include \"${kind}\", so the build does not install it. Install it, for example with: flatpak install --user flathub ${ref} (or add \"${kind}\" to flatpak.installOrUpdateRefs)`\n )\n }\n log.info({ ref }, \"flatpak ref is used as installed, without an update\")\n}\n\n/**\n * Builds a single-file flatpak bundle out of files that are already built.\n *\n * flatpak-builder runs twice. `--build-only` creates the app directory from the base app (and builds the modules of the\n * manifest, if any) and stops, the files are then placed into the app prefix, and `--finish-only` turns the directory into an\n * app with the permissions of the manifest. Nothing has to run inside the build sandbox to get the files in.\n */\nexport async function buildFlatpakBundle(options: FlatpakBundleOptions): Promise<void> {\n const { manifest, arch, tempDir: cwd } = options\n const manifestFile = path.join(cwd, \"manifest.json\")\n const appDir = path.join(cwd, \"build\")\n const prefix = path.join(appDir, \"files\")\n const repo = path.join(cwd, \"repo\")\n const branch = manifest.branch ? [manifest.branch] : []\n // checked before anything is installed or built\n const copies = options.files.map(([source, destination]) => [source, inAppPrefix(prefix, destination, \"flatpak.files destination\")] as const)\n const links = options.symlinks.map(([target, link]) => [target, inAppPrefix(prefix, link, \"flatpak.symlinks link\")] as const)\n\n await requireTool(\"flatpak\", cwd)\n const builderVersion = await requireTool(\"flatpak-builder\", cwd)\n // a freedesktop SDK before 24.08 is left out; any other SDK is not modelled and warned about. Loose, because the strict coerce rejects\n // the zero-padded minor of \"22.08\"\n const sdkVersion = manifest.sdk === \"org.freedesktop.Sdk\" ? semver.coerce(manifest[\"runtime-version\"], { loose: true }) : null\n const isOldFreedesktopSdk = sdkVersion != null && semver.lt(sdkVersion, MODULES_FREEDESKTOP_SDK_VERSION)\n if ((manifest.modules?.length ?? 0) > 0 && builderVersion != null && semver.lt(builderVersion, MODULES_FLATPAK_BUILDER_VERSION) && !isOldFreedesktopSdk) {\n // once per process: every arch is built with the same flatpak-builder\n log\n .once(\"flatpak-builder-modules-version\")\n .warn(\n { flatpakBuilder: builderVersion.version, recommended: MODULES_FLATPAK_BUILDER_VERSION },\n `flatpak.modules are built with flatpak-builder ${builderVersion.version}. The freedesktop SDK 24.08 and newer recommend flatpak-builder ${MODULES_FLATPAK_BUILDER_VERSION} or newer for meson and cmake modules: update it if a module fails to build or does not install where it should`\n )\n }\n\n // the sdk has the version of the runtime\n const refs: [FlatpakRefKind, string][] = [\n [\"runtime\", `runtime/${manifest.runtime}/${arch}/${manifest[\"runtime-version\"]}`],\n [\"sdk\", `runtime/${manifest.sdk}/${arch}/${manifest[\"runtime-version\"]}`],\n [\"base\", `app/${manifest.base}/${arch}/${manifest[\"base-version\"]}`],\n ]\n // the refs to use as installed are checked first, so that a missing one fails the build before anything is downloaded\n const toInstallOrUpdate = refs.filter(([kind]) => options.installOrUpdateRefs.includes(kind))\n for (const [kind, ref] of refs.filter(it => !toInstallOrUpdate.includes(it))) {\n await requireInstalledRef(kind, ref, cwd)\n }\n for (const [, ref] of toInstallOrUpdate) {\n await installOrUpdateRef(ref, cwd)\n }\n\n await writeFile(manifestFile, JSON.stringify(manifest, null, 2))\n\n // flatpak-builder downloads the sources of the modules, and git or curl may need credentials from the environment for that. Without\n // modules it fetches nothing, so it gets the environment that exec filters for every other command\n const builderEnv = (manifest.modules?.length ?? 0) > 0 ? process.env : undefined\n const runFlatpakBuilder = (stage: \"--build-only\" | \"--finish-only\") =>\n exec(\"flatpak-builder\", [\"--arch\", arch, stage, ...options.flatpakBuilderArgs, appDir, manifestFile], { cwd, env: builderEnv }).catch(\n hintOn(\n [\n \"Failure spawning rofiles-fuse\",\n `flatpak-builder could not start rofiles-fuse because FUSE is not available, which is typical in unprivileged containers. Set flatpak.additionalArgs.flatpakBuilder to [\"--disable-rofiles-fuse\"]. Such containers usually also need flatpak.additionalArgs.buildExport set to [\"--disable-sandbox\"]. See ${UNPRIVILEGED_CONTAINERS_DOCS}`,\n ],\n // rofiles-fuse started, but could not mount the app directory, so flatpak-builder finds it empty\n [\n `Command '${manifest.command}' not found`,\n `flatpak-builder did not find ${manifest.command}, which electron-builder placed in the app directory, because rofiles-fuse could not mount that directory. It needs the FUSE mount helper on the build machine: fusermount3 from the fuse3 package, or fusermount from the fuse package where rofiles-fuse is built against FUSE 2. Install it, or set flatpak.additionalArgs.flatpakBuilder to [\"--disable-rofiles-fuse\"]. See ${UNPRIVILEGED_CONTAINERS_DOCS}`,\n ],\n // flatpak-builder before 1.4 composes AppStream metadata with appstream-compose, which the freedesktop SDK 24.08 and newer do\n // not ship; it runs only when the app has a metainfo or appdata file named after its id\n [\n \"execvp appstream-compose\",\n `flatpak-builder could not compose the AppStream metadata of the app (share/metainfo/${manifest.id}.metainfo.xml or share/appdata/${manifest.id}.appdata.xml, from flatpak.files or a module): it runs appstream-compose, which the freedesktop SDK no longer ships from 24.08 on. flatpak-builder 1.4 and newer use appstreamcli instead: update flatpak-builder, or leave the file out. See ${FLATPAK_DOCS}#build-requirements`,\n ]\n )\n )\n\n await runFlatpakBuilder(\"--build-only\")\n\n // flatpak-builder has created it, and the paths that the links in it lead to are compared with the one it resolves to\n const realPrefix = await realpath(prefix)\n // one after another, so that a pair can add to what an earlier one has placed. The filter sees every item of a directory, and the\n // destination itself, before it is written or its parent directory created; a symlink in the copied directory is still kept as it is\n const filter = async (_source: string, file: string) => {\n await requireDirectoryInAppPrefix(prefix, realPrefix, file, \"flatpak.files destination\")\n return true\n }\n for (const [source, destination] of copies) {\n await cp(source, destination, { recursive: true, verbatimSymlinks: true, filter })\n }\n for (const [target, linkPath] of links) {\n // before mkdir, which would create the missing directories wherever a link leads\n await requireDirectoryInAppPrefix(prefix, realPrefix, linkPath, \"flatpak.symlinks link\")\n await mkdir(path.dirname(linkPath), { recursive: true })\n // resolved in the sandbox, where the prefix is mounted at /app\n await symlink(path.posix.join(\"/app\", target), linkPath)\n }\n\n await runFlatpakBuilder(\"--finish-only\")\n\n await exec(\"flatpak\", [\"build-export\", \"--arch\", arch, ...options.buildExportArgs, repo, appDir, ...branch], { cwd }).catch(\n hintOn([\n \"bwrap: \",\n `flatpak build-export could not start the sandbox of its icon validator because bubblewrap (bwrap) cannot create namespaces, which is typical in unprivileged containers. Set flatpak.additionalArgs.buildExport to [\"--disable-sandbox\"]. See ${UNPRIVILEGED_CONTAINERS_DOCS}`,\n ])\n )\n\n await mkdir(path.dirname(options.artifactPath), { recursive: true })\n await exec(\"flatpak\", [\"build-bundle\", \"--arch\", arch, ...options.buildBundleArgs, repo, options.artifactPath, manifest.id, ...branch], { cwd })\n}\n"]}
|
|
1
|
+
{"version":3,"file":"flatpakBundle.js","sourceRoot":"","sources":["../../../src/targets/linux/flatpakBundle.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,WAAW,EAAE,yBAAyB,EAAE,GAAG,EAAE,MAAM,cAAc,CAAA;AAChF,OAAO,EAAE,EAAE,EAAE,KAAK,EAAE,QAAQ,EAAE,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAA;AACrE,OAAO,KAAK,IAAI,MAAM,MAAM,CAAA;AAC5B,OAAO,KAAK,MAAM,MAAM,QAAQ,CAAA;AAChC,OAAO,EAAE,iBAAiB,EAAE,MAAM,oCAAoC,CAAA;AAEtE,0IAA0I;AAC1I,sGAAsG;AACtG,MAAM,YAAY,GAAG,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AAC,IAAI,KAAK,EAAE,CAAC;QACvC,iFAAiF;QACjF,MAAM,2BAA2B,CAAC,MAAM,EAAE,UAAU,EAAE,QAAQ,EAAE,uBAAuB,CAAC,CAAA;QACxF,MAAM,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAA;QACxD,+DAA+D;QAC/D,MAAM,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,EAAE,MAAM,CAAC,EAAE,QAAQ,CAAC,CAAA;IAC1D,CAAC;IAED,MAAM,iBAAiB,CAAC,eAAe,CAAC,CAAA;IAExC,MAAM,IAAI,CAAC,KAAK,CAAC,OAAO,EAAE,CAAC,cAAc,EAAE,QAAQ,EAAE,IAAI,EAAE,GAAG,OAAO,CAAC,eAAe,EAAE,IAAI,EAAE,MAAM,EAAE,GAAG,MAAM,CAAC,EAAE,EAAE,GAAG,EAAE,CAAC,CAAC,KAAK,CAC7H,MAAM,CAAC;QACL,SAAS;QACT,iPAAiP,4BAA4B,EAAE;KAChR,CAAC,CACH,CAAA;IAED,MAAM,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,YAAY,CAAC,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAA;IACpE,MAAM,IAAI,CAAC,KAAK,CAAC,OAAO,EAAE,CAAC,cAAc,EAAE,QAAQ,EAAE,IAAI,EAAE,GAAG,OAAO,CAAC,eAAe,EAAE,IAAI,EAAE,OAAO,CAAC,YAAY,EAAE,QAAQ,CAAC,EAAE,EAAE,GAAG,MAAM,CAAC,EAAE,EAAE,GAAG,EAAE,CAAC,CAAA;AACtJ,CAAC","sourcesContent":["import { exec, Executables, InvalidConfigurationError, log } from \"builder-util\"\nimport { cp, mkdir, realpath, symlink, writeFile } from \"fs/promises\"\nimport * as path from \"path\"\nimport * as semver from \"semver\"\nimport { BUILD_CHANGES_URL } from \"../../util/config/legacyOptions.js\"\n\n// flatpak-builder 1.2.2 is the one of Ubuntu 22.04, the oldest current distribution release (Debian 12 and RHEL 8/9 have 1.2.3). It fixes\n// CVE-2022-21682 with an option that flatpak supports from 1.12.4 on; Ubuntu 22.04 has flatpak 1.12.7\nconst MIN_VERSIONS = { flatpak: \"1.12.4\", \"flatpak-builder\": \"1.2.2\" }\n\n// the freedesktop SDK 24.08 and newer recommend it for meson and cmake modules\nconst MODULES_FLATPAK_BUILDER_VERSION = \"1.4.4\"\nconst MODULES_FREEDESKTOP_SDK_VERSION = \"24.8.0\"\n\nconst NEW_IN_V27 = `This is new in electron-builder v27. See ${BUILD_CHANGES_URL}#flatpak-tooling-requirements`\n\nconst FLATPAK_DOCS = \"https://www.electron.build/docs/flatpak\"\nconst UNPRIVILEGED_CONTAINERS_DOCS = `${FLATPAK_DOCS}#building-in-unprivileged-containers`\n\n/** The part of a [flatpak-builder manifest](https://docs.flatpak.org/en/latest/flatpak-builder-command-reference.html#flatpak-manifest) that the flatpak target writes. */\nexport interface FlatpakBuilderManifest {\n id: string\n command: string\n runtime: string\n \"runtime-version\": string\n sdk: string\n base: string\n \"base-version\": string\n \"finish-args\": string[]\n branch?: string\n modules?: (string | any)[]\n}\n\n/** The refs a build needs: the runtime, the SDK and the base app of the manifest. */\nexport type FlatpakRefKind = \"runtime\" | \"sdk\" | \"base\"\n\nexport interface FlatpakBundleOptions {\n manifest: FlatpakBuilderManifest\n /** flatpak's name for the target architecture, e.g. `x86_64` */\n arch: string\n /** where to write the single-file bundle */\n artifactPath: string\n /** an empty directory for the manifest, the app directory, the repository and the state of flatpak-builder */\n tempDir: string\n /** `[source, destination]` pairs, copied in order; a destination is relative to the app prefix (`/app` in the sandbox) */\n files: [string, string][]\n /** `[target, link]` pairs, both relative to the app prefix */\n symlinks: [string, string][]\n /** the refs to install when they are missing and update when they are installed; the others are used as installed, and have to be */\n installOrUpdateRefs: ReadonlyArray<FlatpakRefKind>\n /** added to both runs of flatpak-builder */\n flatpakBuilderArgs: string[]\n buildExportArgs: string[]\n buildBundleArgs: string[]\n}\n\n/** The absolute paths of the tools, which are never looked up on PATH. */\ninterface FlatpakTools {\n flatpak: string\n \"flatpak-builder\": string\n}\n\n/**\n * Logs how to fix a failure that has a known cause, given as `[marker, hint]` pairs: the hint of the first marker that the error\n * contains. The error is rethrown as is: `exec` has already put the output of the tool in it.\n */\nfunction hintOn(...hints: Array<[marker: string, hint: string]>) {\n return (e: Error): never => {\n const hint = hints.find(([marker]) => e.message.includes(marker))\n if (hint != null) {\n log.error(null, hint[1])\n }\n throw e\n }\n}\n\n/** Checks that the tool runs and is new enough, and returns its version, or null when the output has none. */\nasync function requireTool(tools: FlatpakTools, tool: keyof typeof MIN_VERSIONS, cwd: string): Promise<semver.SemVer | null> {\n let stdout: string\n try {\n stdout = await exec(tools[tool], [\"--version\"], { cwd })\n } catch (e: any) {\n log.error({ error: e.message }, `cannot run ${tool}`)\n throw new InvalidConfigurationError(`cannot run ${tool} - flatpak and flatpak-builder must be installed to build the flatpak target`)\n }\n log.info({ version: stdout.trim() }, `${tool} found`)\n\n // the output is \"Flatpak 1.16.6\", \"flatpak-builder 1.2.3\" or \"flatpak-builder-1.4.4\" depending on the tool and the distribution\n const version = semver.coerce(stdout)\n if (version != null && semver.lt(version, MIN_VERSIONS[tool])) {\n throw new InvalidConfigurationError(\n `${tool} ${version.version} is not supported - version ${MIN_VERSIONS[tool]} or newer is required to build the flatpak target. ${NEW_IN_V27}`\n )\n }\n return version\n}\n\nfunction isInside(dir: string, file: string): boolean {\n const relative = path.relative(dir, file)\n return relative !== \"..\" && !relative.startsWith(`..${path.sep}`) && !path.isAbsolute(relative)\n}\n\n/**\n * Where a path given relative to the app prefix lands in the build directory. One that leaves the prefix is refused: the copy or\n * the link would be written elsewhere on the build machine, such as over the metadata of the build directory.\n */\nfunction inAppPrefix(prefix: string, relativePath: string, what: string): string {\n const resolved = path.join(prefix, relativePath)\n if (!isInside(prefix, resolved)) {\n throw new InvalidConfigurationError(`${what} \"${relativePath}\" is outside the app prefix (/app in the sandbox): use a path inside it, such as \"/lib/<name>\". ${NEW_IN_V27}`)\n }\n return resolved\n}\n\n/**\n * Refuses to write `file` when a symlink takes its directory out of the app prefix, which inAppPrefix cannot see: the base app, the\n * modules and an earlier flatpak.files pair put files into the prefix that are not checked, and a link among them, such as\n * `lib -> ../..` or `lib -> /home`, would make the copy or the link land elsewhere on the build machine. Only the directory is\n * resolved: what is at `file` itself is replaced, not followed, by both cp and symlink.\n */\nasync function requireDirectoryInAppPrefix(prefix: string, realPrefix: string, file: string, what: string): Promise<void> {\n const relative = path.relative(prefix, file)\n if (relative === \"\") {\n // the prefix itself, which a directory is merged into\n return\n }\n // the deepest directory that exists, since what is still to be created cannot be a link. A link that leads nowhere is passed over\n // as well: mkdir and cp fail on it rather than create anything through it\n let existing = path.dirname(file)\n let resolved: string | null = null\n while (resolved == null) {\n try {\n resolved = await realpath(existing)\n } catch (e: any) {\n // ENOTDIR: a file of an earlier pair is in the way, which the copy or mkdir reports itself\n if ((e.code !== \"ENOENT\" && e.code !== \"ENOTDIR\") || existing === path.dirname(existing)) {\n throw e\n }\n existing = path.dirname(existing)\n }\n }\n if (!isInside(realPrefix, resolved)) {\n const shown = `/${relative.split(path.sep).join(\"/\")}`\n throw new InvalidConfigurationError(\n `${what} \"${shown}\" resolves outside the app prefix (/app in the sandbox) through a symlink, to \"${resolved}\": a link in the prefix, from the base app, a module or an earlier flatpak.files pair, points outside it. ${NEW_IN_V27}`\n )\n }\n}\n\n/** Whether a ref is installed for the user and system-wide. */\nasync function findRef(flatpak: string, ref: string, cwd: string): Promise<{ inUser: boolean; inSystem: boolean }> {\n const isInstalled = (installation: \"--user\" | \"--system\") =>\n exec(flatpak, [\"info\", \"--show-commit\", installation, ref], { cwd }).then(\n () => true,\n () => false\n )\n const [inUser, inSystem] = await Promise.all([isInstalled(\"--user\"), isInstalled(\"--system\")])\n return { inUser, inSystem }\n}\n\n/** Brings a ref that the build needs up to date, wherever it is installed, and installs it for the user when it is installed nowhere. */\nasync function installOrUpdateRef(flatpak: string, ref: string, cwd: string): Promise<void> {\n const { inUser, inSystem } = await findRef(flatpak, ref, cwd)\n\n if (inUser || inSystem) {\n await exec(flatpak, [\"update\", ...(inUser ? [\"--user\"] : []), \"--no-deps\", \"--noninteractive\", ref], { cwd })\n return\n }\n\n log.info({ ref }, \"installing flatpak ref, this can download several gigabytes\")\n await exec(flatpak, [\"install\", \"--user\", \"--no-deps\", \"--noninteractive\", ref], { cwd }).catch(\n hintOn([\n \"No remote refs found\",\n `missing flatpak refs are installed with \"flatpak install --user\", which only searches the remotes of the user installation. If flathub is not one of them, add it with: flatpak remote-add --user --if-not-exists flathub https://dl.flathub.org/repo/flathub.flatpakrepo (otherwise check that the configured runtime, sdk and base versions exist)`,\n ])\n )\n}\n\n/** Checks that a ref that the build is not to install or update is installed, in either installation. */\nasync function requireInstalledRef(flatpak: string, kind: FlatpakRefKind, ref: string, cwd: string): Promise<void> {\n const { inUser, inSystem } = await findRef(flatpak, ref, cwd)\n if (!inUser && !inSystem) {\n throw new InvalidConfigurationError(\n `the ${kind} ${ref} is not installed, and flatpak.installOrUpdateRefs does not include \"${kind}\", so the build does not install it. Install it, for example with: flatpak install --user flathub ${ref} (or add \"${kind}\" to flatpak.installOrUpdateRefs)`\n )\n }\n log.info({ ref }, \"flatpak ref is used as installed, without an update\")\n}\n\n/**\n * Builds a single-file flatpak bundle out of files that are already built.\n *\n * flatpak-builder runs twice. `--build-only` creates the app directory from the base app (and builds the modules of the\n * manifest, if any) and stops, the files are then placed into the app prefix, and `--finish-only` turns the directory into an\n * app with the permissions of the manifest. Nothing has to run inside the build sandbox to get the files in.\n */\nexport async function buildFlatpakBundle(options: FlatpakBundleOptions): Promise<void> {\n const { manifest, arch, tempDir: cwd } = options\n const manifestFile = path.join(cwd, \"manifest.json\")\n const appDir = path.join(cwd, \"build\")\n const prefix = path.join(appDir, \"files\")\n const repo = path.join(cwd, \"repo\")\n const branch = manifest.branch ? [manifest.branch] : []\n // checked before anything is installed or built\n const copies = options.files.map(([source, destination]) => [source, inAppPrefix(prefix, destination, \"flatpak.files destination\")] as const)\n const links = options.symlinks.map(([target, link]) => [target, inAppPrefix(prefix, link, \"flatpak.symlinks link\")] as const)\n\n // by absolute path (toolsets.executables or their default install locations), never looked up on PATH\n const tools: FlatpakTools = {\n flatpak: Executables.resolve(\"flatpak\"),\n \"flatpak-builder\": Executables.resolve(\"flatpak-builder\"),\n }\n await requireTool(tools, \"flatpak\", cwd)\n const builderVersion = await requireTool(tools, \"flatpak-builder\", cwd)\n // a freedesktop SDK before 24.08 is left out; any other SDK is not modelled and warned about. Loose, because the strict coerce rejects\n // the zero-padded minor of \"22.08\"\n const sdkVersion = manifest.sdk === \"org.freedesktop.Sdk\" ? semver.coerce(manifest[\"runtime-version\"], { loose: true }) : null\n const isOldFreedesktopSdk = sdkVersion != null && semver.lt(sdkVersion, MODULES_FREEDESKTOP_SDK_VERSION)\n if ((manifest.modules?.length ?? 0) > 0 && builderVersion != null && semver.lt(builderVersion, MODULES_FLATPAK_BUILDER_VERSION) && !isOldFreedesktopSdk) {\n // once per process: every arch is built with the same flatpak-builder\n log\n .once(\"flatpak-builder-modules-version\")\n .warn(\n { flatpakBuilder: builderVersion.version, recommended: MODULES_FLATPAK_BUILDER_VERSION },\n `flatpak.modules are built with flatpak-builder ${builderVersion.version}. The freedesktop SDK 24.08 and newer recommend flatpak-builder ${MODULES_FLATPAK_BUILDER_VERSION} or newer for meson and cmake modules: update it if a module fails to build or does not install where it should`\n )\n }\n\n // the sdk has the version of the runtime\n const refs: [FlatpakRefKind, string][] = [\n [\"runtime\", `runtime/${manifest.runtime}/${arch}/${manifest[\"runtime-version\"]}`],\n [\"sdk\", `runtime/${manifest.sdk}/${arch}/${manifest[\"runtime-version\"]}`],\n [\"base\", `app/${manifest.base}/${arch}/${manifest[\"base-version\"]}`],\n ]\n // the refs to use as installed are checked first, so that a missing one fails the build before anything is downloaded\n const toInstallOrUpdate = refs.filter(([kind]) => options.installOrUpdateRefs.includes(kind))\n for (const [kind, ref] of refs.filter(it => !toInstallOrUpdate.includes(it))) {\n await requireInstalledRef(tools.flatpak, kind, ref, cwd)\n }\n for (const [, ref] of toInstallOrUpdate) {\n await installOrUpdateRef(tools.flatpak, ref, cwd)\n }\n\n await writeFile(manifestFile, JSON.stringify(manifest, null, 2))\n\n // flatpak-builder downloads the sources of the modules, and git or curl may need credentials from the environment for that. Without\n // modules it fetches nothing, so it gets the environment that exec filters for every other command\n const builderEnv = (manifest.modules?.length ?? 0) > 0 ? process.env : undefined\n const runFlatpakBuilder = (stage: \"--build-only\" | \"--finish-only\") =>\n exec(tools[\"flatpak-builder\"], [\"--arch\", arch, stage, ...options.flatpakBuilderArgs, appDir, manifestFile], { cwd, env: builderEnv }).catch(\n hintOn(\n [\n \"Failure spawning rofiles-fuse\",\n `flatpak-builder could not start rofiles-fuse because FUSE is not available, which is typical in unprivileged containers. Set flatpak.additionalArgs.flatpakBuilder to [\"--disable-rofiles-fuse\"]. Such containers usually also need flatpak.additionalArgs.buildExport set to [\"--disable-sandbox\"]. See ${UNPRIVILEGED_CONTAINERS_DOCS}`,\n ],\n // rofiles-fuse started, but could not mount the app directory, so flatpak-builder finds it empty\n [\n `Command '${manifest.command}' not found`,\n `flatpak-builder did not find ${manifest.command}, which electron-builder placed in the app directory, because rofiles-fuse could not mount that directory. It needs the FUSE mount helper on the build machine: fusermount3 from the fuse3 package, or fusermount from the fuse package where rofiles-fuse is built against FUSE 2. Install it, or set flatpak.additionalArgs.flatpakBuilder to [\"--disable-rofiles-fuse\"]. See ${UNPRIVILEGED_CONTAINERS_DOCS}`,\n ],\n // flatpak-builder before 1.4 composes AppStream metadata with appstream-compose, which the freedesktop SDK 24.08 and newer do\n // not ship; it runs only when the app has a metainfo or appdata file named after its id\n [\n \"execvp appstream-compose\",\n `flatpak-builder could not compose the AppStream metadata of the app (share/metainfo/${manifest.id}.metainfo.xml or share/appdata/${manifest.id}.appdata.xml, from flatpak.files or a module): it runs appstream-compose, which the freedesktop SDK no longer ships from 24.08 on. flatpak-builder 1.4 and newer use appstreamcli instead: update flatpak-builder, or leave the file out. See ${FLATPAK_DOCS}#build-requirements`,\n ]\n )\n )\n\n await runFlatpakBuilder(\"--build-only\")\n\n // flatpak-builder has created it, and the paths that the links in it lead to are compared with the one it resolves to\n const realPrefix = await realpath(prefix)\n // one after another, so that a pair can add to what an earlier one has placed. The filter sees every item of a directory, and the\n // destination itself, before it is written or its parent directory created; a symlink in the copied directory is still kept as it is\n const filter = async (_source: string, file: string) => {\n await requireDirectoryInAppPrefix(prefix, realPrefix, file, \"flatpak.files destination\")\n return true\n }\n for (const [source, destination] of copies) {\n await cp(source, destination, { recursive: true, verbatimSymlinks: true, filter })\n }\n for (const [target, linkPath] of links) {\n // before mkdir, which would create the missing directories wherever a link leads\n await requireDirectoryInAppPrefix(prefix, realPrefix, linkPath, \"flatpak.symlinks link\")\n await mkdir(path.dirname(linkPath), { recursive: true })\n // resolved in the sandbox, where the prefix is mounted at /app\n await symlink(path.posix.join(\"/app\", target), linkPath)\n }\n\n await runFlatpakBuilder(\"--finish-only\")\n\n await exec(tools.flatpak, [\"build-export\", \"--arch\", arch, ...options.buildExportArgs, repo, appDir, ...branch], { cwd }).catch(\n hintOn([\n \"bwrap: \",\n `flatpak build-export could not start the sandbox of its icon validator because bubblewrap (bwrap) cannot create namespaces, which is typical in unprivileged containers. Set flatpak.additionalArgs.buildExport to [\"--disable-sandbox\"]. See ${UNPRIVILEGED_CONTAINERS_DOCS}`,\n ])\n )\n\n await mkdir(path.dirname(options.artifactPath), { recursive: true })\n await exec(tools.flatpak, [\"build-bundle\", \"--arch\", arch, ...options.buildBundleArgs, repo, options.artifactPath, manifest.id, ...branch], { cwd })\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"coreLegacy.d.ts","sourceRoot":"","sources":["../../../../src/targets/linux/snap/coreLegacy.ts"],"names":[],"mappings":"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GAAG,IAAI,CAQ5H;AAED,wBAAgB,qBAAqB,CAAC,IAAI,EAAE;IAAE,UAAU,EAAE,OAAO,CAAC;IAAC,cAAc,EAAE,MAAM,CAAC;IAAC,YAAY,EAAE,MAAM,EAAE,CAAA;CAAE,GAAG,MAAM,CAS3H"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { replaceDefault as _replaceDefault, Arch, copyDir, exec, InvalidConfigurationError, log, serializeToYaml, toLinuxArchString, validateShellEmbeddable } from "builder-util";
|
|
1
|
+
import { replaceDefault as _replaceDefault, Arch, copyDir, exec, Executables, InvalidConfigurationError, log, serializeToYaml, stripSensitiveEnvVars, toLinuxArchString, validateShellEmbeddable, } from "builder-util";
|
|
2
2
|
import { asArray, deepAssign, isValidKey } from "builder-util-runtime";
|
|
3
3
|
import _fsExtra from "fs-extra";
|
|
4
|
-
import { chmod, copyFile, mkdir, readdir, rename, writeFile } from "fs/promises";
|
|
4
|
+
import { chmod, copyFile, lstat, mkdir, readdir, rename, writeFile } from "fs/promises";
|
|
5
5
|
import { load } from "js-yaml";
|
|
6
6
|
import * as path from "path";
|
|
7
7
|
import { getAppImageTools } from "../../../toolsets/appimage.js";
|
|
@@ -254,9 +254,9 @@ export class SnapCoreLegacy extends SnapCore {
|
|
|
254
254
|
log.info({ releaseName }, "downloading snap template");
|
|
255
255
|
const templateDir = await downloadBuilderToolset({ releaseName, filenameWithExt, checksums, githubOrgRepo: "electron-userland/electron-builder-binaries" });
|
|
256
256
|
await this.stageSnapFiles({ stageDir, appOutDir, hooksDir, extraAppArgs, isTemplate: true });
|
|
257
|
-
//
|
|
257
|
+
// no setgid bits in the final image (chmod -R g-s)
|
|
258
258
|
for (const dir of [stageDir, appOutDir, templateDir]) {
|
|
259
|
-
await
|
|
259
|
+
await clearSetgidBits(dir).catch(err => log.warn({ error: err.message }, "chmod g-s failed"));
|
|
260
260
|
}
|
|
261
261
|
const { mksquashfs } = await getAppImageTools(appimageToolset, snapArch, this.packager.buildResourcesDir);
|
|
262
262
|
// Collect top-level entries from each dir as individual path args (mirrors Go ReadDirContentTo)
|
|
@@ -298,9 +298,10 @@ export class SnapCoreLegacy extends SnapCore {
|
|
|
298
298
|
if (isDestructiveMode) {
|
|
299
299
|
snapArgs.push("--destructive-mode");
|
|
300
300
|
}
|
|
301
|
-
|
|
301
|
+
// a local build: snapcraft needs no credentials
|
|
302
|
+
await exec(Executables.resolve("snapcraft"), snapArgs, {
|
|
302
303
|
cwd: stageDir,
|
|
303
|
-
env: { ...process.env, SNAPCRAFT_HAS_TTY: "false" },
|
|
304
|
+
env: { ...stripSensitiveEnvVars(process.env), SNAPCRAFT_HAS_TTY: "false" },
|
|
304
305
|
});
|
|
305
306
|
if (!isDestructiveMode) {
|
|
306
307
|
await rename(path.join(stageDir, snapOutputName), artifactPath);
|
|
@@ -373,6 +374,21 @@ export class SnapCoreLegacy extends SnapCore {
|
|
|
373
374
|
}
|
|
374
375
|
}
|
|
375
376
|
}
|
|
377
|
+
/** Clears the setgid bit of a directory and of everything in it, like `chmod -R g-s`: symlinks are not followed. */
|
|
378
|
+
async function clearSetgidBits(file) {
|
|
379
|
+
const stat = await lstat(file);
|
|
380
|
+
if (stat.isSymbolicLink()) {
|
|
381
|
+
return;
|
|
382
|
+
}
|
|
383
|
+
if ((stat.mode & 0o2000) !== 0) {
|
|
384
|
+
await chmod(file, stat.mode & 0o7777 & ~0o2000);
|
|
385
|
+
}
|
|
386
|
+
if (stat.isDirectory()) {
|
|
387
|
+
for (const name of await readdir(file)) {
|
|
388
|
+
await clearSetgidBits(path.join(file, name));
|
|
389
|
+
}
|
|
390
|
+
}
|
|
391
|
+
}
|
|
376
392
|
async function readDirPaths(dir, filter) {
|
|
377
393
|
const entries = await readdir(dir);
|
|
378
394
|
const result = [];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"coreLegacy.js","sourceRoot":"","sources":["../../../../src/targets/linux/snap/coreLegacy.ts"],"names":[],"mappings":"AAAA,OAAO,EA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,cAAc,EAAE,YAAY,EAAE,GAAG,IAAI,CAAA;IACzD,uBAAuB,CAAC,cAAc,EAAE,gBAAgB,CAAC,CAAA;IACzD,MAAM,SAAS,GAAG,UAAU,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,MAAM,CAAA;IAC1C,OAAO,mBAAmB,CAAC;QACzB,OAAO,EAAE,gBAAgB;QACzB,OAAO,EAAE,CAAC,yBAAyB,EAAE,2BAA2B,EAAE,mCAAmC,EAAE,UAAU,SAAS,GAAG,cAAc,GAAG,CAAC;QAC/I,IAAI,EAAE,YAAY;KACnB,CAAC,CAAA;AACJ,CAAC","sourcesContent":["import { replaceDefault as _replaceDefault, Arch, copyDir, exec, InvalidConfigurationError, log, serializeToYaml, toLinuxArchString, validateShellEmbeddable } from \"builder-util\"\nimport { asArray, deepAssign, isValidKey, Nullish } from \"builder-util-runtime\"\nimport _fsExtra from \"fs-extra\"\nimport { chmod, copyFile, mkdir, readdir, rename, writeFile } from \"fs/promises\"\nimport { load } from \"js-yaml\"\nimport * as path from \"path\"\nimport { ToolsetConfig } from \"../../../configuration.js\"\nimport { PlugDescriptor, SnapOptionsLegacy } from \"../../../options/SnapOptions.js\"\nimport { getAppImageTools } from \"../../../toolsets/appimage.js\"\nimport { downloadBuilderToolset } from \"../../../util/electronGet.js\"\nimport { isSnapDestructiveMode } from \"../../../util/flags.js\"\nimport { getTemplatePath } from \"../../../util/pathManager.js\"\nimport { buildLauncherScript } from \"../launcherScript.js\"\nimport { SnapCore } from \"./SnapTarget.js\"\nimport { getStagingCopyLinkOptions } from \"../../../util/trustedSourceRoots.js\"\nimport { shellQuote } from \"./snapCommand.js\"\nimport { SnapcraftYAML } from \"./snapcraft.js\"\nimport { warnAboutAllowSandboxPlugs } from \"./snapPlugs.js\"\nimport { DEFAULT_STAGE_PACKAGES } from \"./snapcraftBuilder.js\"\nconst { outputFile, readFile } = _fsExtra\n\n// Re-exported for backwards compatibility with existing imports/tests.\nexport { shellQuote }\n\n// Snap template release info from electron-userland/electron-builder-binaries\nconst SNAP_TEMPLATES = {\n amd64: {\n releaseName: \"snap-template-4.0-2\",\n filenameWithExt: \"snap-template-electron-4.0-2-amd64.tar.7z\",\n checksums: { \"snap-template-electron-4.0-2-amd64.tar.7z\": \"5e3ab4e09364ac06f0072b1c2dab9138318c933f6b2c7374f893b5ec44d19e6f\" },\n },\n armhf: {\n releaseName: \"snap-template-4.0-1\",\n filenameWithExt: \"snap-template-electron-4.0-1-armhf.tar.7z\",\n checksums: { \"snap-template-electron-4.0-1-armhf.tar.7z\": \"6f7553e904f4e043bc3019f0899d05e01a283b00b61fec22e932296490e3be6b\" },\n },\n} as const\n\n// Handles core18/core20/core22 snaps via mksquashfs (template) or snapcraft CLI (no-template).\n// See: https://github.com/develar/app-builder/blob/master/pkg/package-format/snap\nexport class SnapCoreLegacy extends SnapCore<SnapOptionsLegacy & { base: \"core18\" | \"core20\" | \"core22\" }> {\n private isUseTemplateApp = false\n\n defaultPlugs = [\"desktop\", \"desktop-legacy\", \"home\", \"x11\", \"wayland\", \"unity7\", \"browser-support\", \"network\", \"gsettings\", \"audio-playback\", \"pulseaudio\", \"opengl\"]\n\n private replaceDefault(inList: Array<string> | Nullish, defaultList: Array<string>) {\n const result = _replaceDefault(inList, defaultList)\n if (result !== defaultList) {\n this.isUseTemplateApp = false\n }\n return result\n }\n\n async createDescriptor(arch: Arch): Promise<SnapcraftYAML> {\n const appInfo = this.packager.appInfo\n const snapName = this.packager.executableName.toLowerCase()\n const options = this.options\n\n const plugs = this.normalizePlugConfiguration(this.options.plugs)\n if (options.confinement !== \"classic\") {\n warnAboutAllowSandboxPlugs(plugs, `snapcraft.${options.base}.plugs`, this.packager)\n }\n\n const plugNames = this.replaceDefault(plugs == null ? null : Object.getOwnPropertyNames(plugs), this.defaultPlugs)\n\n const slots = this.normalizePlugConfiguration(this.options.slots)\n\n const buildPackages = asArray(options.buildPackages)\n const stagePackages = this.replaceDefault(options.stagePackages, DEFAULT_STAGE_PACKAGES)\n\n const stageSet = new Set(stagePackages)\n const stageMatchesDefaults = stagePackages.length === DEFAULT_STAGE_PACKAGES.length && DEFAULT_STAGE_PACKAGES.every((p: string) => stageSet.has(p))\n\n // Template app is only available for x64/armv7l, and only when no packages are customised.\n this.isUseTemplateApp = this.options.useTemplateApp !== false && (arch === Arch.x64 || arch === Arch.armv7l) && buildPackages.length === 0 && stageMatchesDefaults\n\n const appDescriptor: any = {\n command: \"command.sh\",\n plugs: plugNames,\n adapter: \"none\",\n }\n\n const snap: any = load(await readFile(path.join(getTemplatePath(\"snap\"), \"snapcraft.yaml\"), \"utf-8\"))\n if (this.isUseTemplateApp) {\n delete appDescriptor.adapter\n }\n if (options.base != null) {\n snap.base = options.base\n if (Number(snap.base.split(\"core\")[1]) >= 22) {\n delete appDescriptor.adapter\n }\n }\n if (options.grade != null) {\n snap.grade = options.grade\n }\n if (options.confinement != null) {\n snap.confinement = options.confinement\n }\n if (options.appPartStage != null) {\n snap.parts.app.stage = options.appPartStage\n }\n if (options.layout != null) {\n snap.layout = options.layout\n }\n if (slots != null) {\n appDescriptor.slots = Object.getOwnPropertyNames(slots)\n for (const slotName of appDescriptor.slots) {\n if (!isValidKey(slotName)) {\n throw new Error(`Invalid plug/slot name: ${slotName}`)\n }\n const slotOptions = slots[slotName]\n if (slotOptions == null) {\n continue\n }\n if (!snap.slots) {\n snap.slots = {}\n }\n snap.slots[slotName] = slotOptions\n }\n }\n\n deepAssign(snap, {\n name: snapName,\n version: appInfo.version,\n title: options.title || appInfo.productName,\n summary: options.summary || appInfo.productName,\n compression: options.compression,\n description: this.helper.getDescription(options),\n architectures: [toLinuxArchString(arch, \"snap\")],\n apps: {\n [snapName]: appDescriptor,\n },\n parts: {\n app: {\n \"stage-packages\": stagePackages,\n },\n },\n })\n\n if (options.autoStart) {\n appDescriptor.autostart = `${this.helper.getDesktopFileName(snap.name)}.desktop`\n }\n\n if (options.confinement === \"classic\") {\n delete appDescriptor.plugs\n delete snap.plugs\n } else {\n const archTriplet = this.archNameToTriplet(arch)\n const environment: Record<string, string> = {\n PATH: \"$SNAP/usr/sbin:$SNAP/usr/bin:$SNAP/sbin:$SNAP/bin:$PATH\",\n SNAP_DESKTOP_RUNTIME: \"$SNAP/gnome-platform\",\n LD_LIBRARY_PATH: [\n \"$SNAP_LIBRARY_PATH\",\n \"$SNAP/lib:$SNAP/usr/lib:$SNAP/lib/\" + archTriplet + \":$SNAP/usr/lib/\" + archTriplet,\n \"$LD_LIBRARY_PATH:$SNAP/lib:$SNAP/usr/lib\",\n \"$SNAP/lib/\" + archTriplet + \":$SNAP/usr/lib/\" + archTriplet,\n ].join(\":\"),\n ...options.environment,\n }\n const allow = options.allowNativeWayland\n const isOldElectron = !this.helper.isElectronVersionGreaterOrEqualThan(\"38.0.0\", \"7.0.0\")\n if ((allow == null && isOldElectron) || allow === false) {\n environment.DISABLE_WAYLAND = \"1\"\n }\n\n appDescriptor.environment = environment\n\n if (plugs != null) {\n for (const plugName of plugNames) {\n if (!isValidKey(plugName)) {\n throw new Error(`Invalid plug/slot name: ${plugName}`)\n }\n const plugOptions = plugs[plugName]\n if (plugOptions == null) {\n continue\n }\n if (!snap.plugs) {\n snap.plugs = {}\n }\n snap.plugs[plugName] = plugOptions\n }\n }\n }\n\n if (buildPackages.length > 0) {\n snap.parts.app[\"build-packages\"] = buildPackages\n }\n if (options.after != null) {\n snap.parts.app.after = options.after\n }\n\n if (options.assumes != null) {\n snap.assumes = asArray(options.assumes)\n }\n\n return snap\n }\n\n async buildSnap(props: { snap: any; appOutDir: string; stageDir: string; snapArch: Arch; artifactPath: string }): Promise<string[]> {\n const { snap, appOutDir, stageDir, snapArch, artifactPath } = props\n\n // Build the args array for effectiveOptionComputed compatibility — tests inspect this.\n const args = [\n \"snap\",\n \"--app\",\n appOutDir,\n \"--stage\",\n stageDir,\n \"--arch\",\n toLinuxArchString(snapArch, \"snap\"),\n \"--output\",\n artifactPath,\n \"--executable\",\n this.packager.executableName,\n ]\n\n await this.helper.icons\n if (this.helper.maxIconPath != null) {\n if (!this.isUseTemplateApp) {\n snap.icon = \"snap/gui/icon.png\"\n }\n args.push(\"--icon\", this.helper.maxIconPath)\n }\n\n const snapMetaDir = path.join(stageDir, this.isUseTemplateApp ? \"meta\" : \"snap\")\n const desktopFile = path.join(snapMetaDir, \"gui\", `${this.helper.getDesktopFileName(snap.name)}.desktop`)\n await this.helper.writeDesktopEntry(this.options, snap.name + \" %U\", desktopFile, {\n Icon: \"${SNAP}/meta/gui/icon.png\",\n })\n\n const extraAppArgs: Array<string> = this.options.executableArgs ?? []\n if (this.helper.isElectronVersionGreaterOrEqualThan(\"5.0.0\") && !this.isBrowserSandboxAllowed(snap)) {\n const noSandboxArg = \"--no-sandbox\"\n if (!extraAppArgs.includes(noSandboxArg)) {\n extraAppArgs.push(noSandboxArg)\n }\n if (this.isUseTemplateApp) {\n args.push(\"--exclude\", \"chrome-sandbox\")\n }\n }\n if (extraAppArgs.length > 0) {\n args.push(\"--extraAppArgs=\" + extraAppArgs.join(\" \"))\n }\n\n // Capture compression BEFORE it gets stripped from snap for template builds.\n const compression = this.options.compression ?? \"xz\"\n if (snap.compression != null) {\n args.push(\"--compression\", snap.compression)\n }\n\n if (this.isUseTemplateApp) {\n const fieldsToStrip = [\"compression\", \"contact\", \"donation\", \"issues\", \"parts\", \"source-code\", \"website\"]\n for (const field of fieldsToStrip) {\n delete snap[field]\n }\n }\n\n if (this.packager.packagerOptions.effectiveOptionComputed != null && (await this.packager.packagerOptions.effectiveOptionComputed({ snap, desktopFile, args }))) {\n return [artifactPath]\n }\n\n await outputFile(path.join(snapMetaDir, this.isUseTemplateApp ? \"snap.yaml\" : \"snapcraft.yaml\"), serializeToYaml(snap))\n\n const hooksDir = await this.packager.getResource(this.options.hooks, \"snap-hooks\")\n if (hooksDir != null) {\n args.push(\"--hooks\", hooksDir)\n }\n\n if (this.isUseTemplateApp) {\n const templateArch = snapArch === Arch.x64 ? \"amd64\" : \"armhf\"\n args.push(\"--template-url\", `electron4:${templateArch}`)\n await this.buildWithTemplate({ appOutDir, stageDir, snapArch, artifactPath, compression, hooksDir, extraAppArgs })\n } else {\n await this.buildWithoutTemplate({ appOutDir, stageDir, artifactPath, hooksDir, extraAppArgs })\n }\n return [artifactPath]\n }\n\n private async buildWithTemplate(opts: {\n appOutDir: string\n stageDir: string\n snapArch: Arch\n artifactPath: string\n compression: string\n hooksDir: string | null\n extraAppArgs: string[]\n }): Promise<void> {\n const { appOutDir, stageDir, snapArch, artifactPath, compression, hooksDir, extraAppArgs } = opts\n const appimageToolset = this.packager.config.toolsets?.appimage\n // Fail before downloading the template rather than deep inside mksquashfs.\n assertTemplateSnapCompressionSupported(appimageToolset, compression)\n const templateArch = snapArch === Arch.x64 ? \"amd64\" : \"armhf\"\n const { releaseName, filenameWithExt, checksums } = SNAP_TEMPLATES[templateArch]\n\n log.info({ releaseName }, \"downloading snap template\")\n const templateDir = await downloadBuilderToolset({ releaseName, filenameWithExt, checksums, githubOrgRepo: \"electron-userland/electron-builder-binaries\" })\n\n await this.stageSnapFiles({ stageDir, appOutDir, hooksDir, extraAppArgs, isTemplate: true })\n\n // chmod -R g-s to avoid setgid bits in final image\n for (const dir of [stageDir, appOutDir, templateDir]) {\n await exec(\"chmod\", [\"-R\", \"g-s\", dir]).catch(err => log.warn({ error: err.message }, \"chmod g-s failed\"))\n }\n\n const { mksquashfs } = await getAppImageTools(appimageToolset, snapArch, this.packager.buildResourcesDir)\n\n // Collect top-level entries from each dir as individual path args (mirrors Go ReadDirContentTo)\n // chrome-sandbox is filtered out here, not deleted: appOutDir is shared with the other Linux targets (deb, rpm, AppImage), which pack from it concurrently.\n const mksquashfsArgs: string[] = [\n ...(await readDirPaths(templateDir)),\n ...(await readDirPaths(stageDir)),\n ...(await readDirPaths(appOutDir, name => name !== \"LICENSES.chromium.html\" && name !== \"LICENSE.electron.txt\" && name !== \"chrome-sandbox\")),\n artifactPath,\n \"-no-progress\",\n \"-quiet\",\n \"-noappend\",\n \"-comp\",\n compression,\n \"-no-xattrs\",\n \"-no-fragments\",\n \"-all-root\",\n ]\n\n await exec(mksquashfs, mksquashfsArgs, { cwd: stageDir })\n }\n\n private async buildWithoutTemplate(opts: { appOutDir: string; stageDir: string; artifactPath: string; hooksDir: string | null; extraAppArgs: string[] }): Promise<void> {\n const { appOutDir, stageDir, artifactPath, hooksDir, extraAppArgs } = opts\n\n await this.stageSnapFiles({ stageDir, appOutDir, hooksDir, extraAppArgs, isTemplate: false })\n\n // Write desktop integration scripts (embedded in the Go binary, now in our templates)\n const snapTemplateDir = getTemplatePath(\"snap\")\n for (const script of [\"desktop-init.sh\", \"desktop-common.sh\", \"desktop-gnome-specific.sh\"]) {\n const src = path.join(snapTemplateDir, script)\n const dest = path.join(stageDir, \"scripts\", script)\n await copyFile(src, dest)\n // copyFile doesn't preserve mode; chmod 755 explicitly\n await chmod(dest, 0o755)\n }\n\n // Copy app dir into stage/app/ so snapcraft can pick it up\n await copyDir(appOutDir, path.join(stageDir, \"app\"), await getStagingCopyLinkOptions(this.packager))\n\n // Run snapcraft (legacy `snap` subcommand)\n const isDestructiveMode = isSnapDestructiveMode()\n const snapOutputName = \"out.snap\"\n const snapArgs = [\"snap\", \"--output\", isDestructiveMode ? artifactPath : snapOutputName]\n if (isDestructiveMode) {\n snapArgs.push(\"--destructive-mode\")\n }\n\n await exec(\"snapcraft\", snapArgs, {\n cwd: stageDir,\n env: { ...process.env, SNAPCRAFT_HAS_TTY: \"false\" },\n })\n\n if (!isDestructiveMode) {\n await rename(path.join(stageDir, snapOutputName), artifactPath)\n }\n }\n\n private async stageSnapFiles(opts: { stageDir: string; appOutDir: string; hooksDir: string | null; extraAppArgs: string[]; isTemplate: boolean }): Promise<void> {\n const { stageDir, hooksDir, extraAppArgs, isTemplate } = opts\n\n const snapMetaDir = path.join(stageDir, isTemplate ? \"meta\" : \"snap\")\n // No-template builds place command.sh + desktop scripts in scripts/ which snapcraft stages to snap root.\n // Template builds write command.sh to the stage root directly; no scripts/ dir is needed.\n const scriptDir = path.join(stageDir, \"scripts\")\n if (!isTemplate) {\n await mkdir(scriptDir, { recursive: true })\n }\n\n if (this.helper.maxIconPath != null) {\n const iconDest = path.join(snapMetaDir, \"gui\", `icon${path.extname(this.helper.maxIconPath)}`)\n await mkdir(path.dirname(iconDest), { recursive: true })\n await copyFile(this.helper.maxIconPath, iconDest)\n }\n\n if (hooksDir != null) {\n await copyDir(hooksDir, path.join(snapMetaDir, \"hooks\"))\n }\n\n // command.sh — template builds write to stage root; no-template writes to scripts/\n const commandWrapperPath = isTemplate ? path.join(stageDir, \"command.sh\") : path.join(scriptDir, \"command.sh\")\n const commandContent = buildCommandShContent({ isTemplate, executableName: this.packager.executableName, extraAppArgs })\n await writeFile(commandWrapperPath, commandContent, { mode: 0o755 })\n await chmod(commandWrapperPath, 0o755)\n }\n\n private normalizePlugConfiguration(raw: Array<string | PlugDescriptor> | PlugDescriptor | Nullish): Record<string, Record<string, any> | null> | null {\n if (raw == null) {\n return null\n }\n\n const result: any = {}\n for (const item of Array.isArray(raw) ? raw : [raw]) {\n if (typeof item === \"string\") {\n if (!isValidKey(item)) {\n throw new Error(`Invalid plug/slot name: ${item}`)\n }\n result[item] = null\n } else {\n deepAssign(result, item)\n }\n }\n return result\n }\n\n private isBrowserSandboxAllowed(snap: any): boolean {\n if (snap.plugs != null) {\n for (const plugName of Object.keys(snap.plugs)) {\n const plug = snap.plugs[plugName]\n if (plug.interface === \"browser-support\" && plug[\"allow-sandbox\"] === true) {\n return true\n }\n }\n }\n return false\n }\n\n private archNameToTriplet(arch: Arch): string {\n switch (arch) {\n case Arch.x64:\n return \"x86_64-linux-gnu\"\n case Arch.ia32:\n return \"i386-linux-gnu\"\n case Arch.armv7l:\n return \"arm-linux-gnueabihf\"\n case Arch.arm64:\n return \"aarch64-linux-gnu\"\n\n default:\n throw new Error(`Unsupported arch ${arch}`)\n }\n }\n}\n\nasync function readDirPaths(dir: string, filter?: (name: string) => boolean): Promise<string[]> {\n const entries = await readdir(dir)\n const result: string[] = []\n for (const name of entries) {\n if (!filter || filter(name)) {\n result.push(path.join(dir, name))\n }\n }\n return result\n}\n\n/**\n * Builds the content of command.sh for a snap package.\n *\n * For both template and no-template builds, the desktop-integration scripts are\n * sourced from the snap root ($SNAP):\n * - Template: scripts are embedded in the template tarball at the snap root.\n * - No-template: the snapcraft.yaml `launch-scripts` part uses `plugin: dump,\n * source: scripts`, which stages stageDir/scripts/ contents directly into the\n * snap root — so $SNAP/desktop-init.sh is correct in both cases.\n *\n * The only difference between template and no-template is the app executable prefix:\n * template apps are at $SNAP/<name>; no-template apps are at $SNAP/app/<name>.\n */\n/**\n * Template snaps are packed with the `mksquashfs` from `toolsets.appimage`. The legacy `\"0.0.0\"` bundle's\n * `mksquashfs` supports only gzip/xz, so reject `lzo` (explicit, or mapped from `linux.compression: \"store\"`)\n * up front instead of letting mksquashfs fail with `Compressor \"lzo\" is not supported`.\n */\nexport function assertTemplateSnapCompressionSupported(appimageToolset: ToolsetConfig[\"appimage\"], compression: string): void {\n // Only an explicit pin selects \"0.0.0\"; unset / null / \"latest\" resolve to the newest bundle, and a custom bundle is the user's choice.\n if (appimageToolset === \"0.0.0\" && compression === \"lzo\") {\n throw new InvalidConfigurationError(\n `Snap compression \"lzo\" is not supported with toolsets.appimage \"0.0.0\": template snaps (useTemplateApp) are packed with that toolset's mksquashfs, which supports only gzip and xz. ` +\n `Set toolsets.appimage to \"latest\" (or \"1.0.3\" or newer), or set the snap compression to \"xz\" (note that linux.compression \"store\" maps to \"lzo\").`\n )\n }\n}\n\nexport function buildCommandShContent(opts: { isTemplate: boolean; executableName: string; extraAppArgs: string[] }): string {\n const { isTemplate, executableName, extraAppArgs } = opts\n validateShellEmbeddable(executableName, \"executableName\")\n const appPrefix = isTemplate ? \"\" : \"app/\"\n return buildLauncherScript({\n shebang: \"#!/bin/bash -e\",\n command: ['\"$SNAP/desktop-init.sh\"', '\"$SNAP/desktop-common.sh\"', '\"$SNAP/desktop-gnome-specific.sh\"', `\"$SNAP/${appPrefix}${executableName}\"`],\n args: extraAppArgs,\n })\n}\n"]}
|
|
1
|
+
{"version":3,"file":"coreLegacy.js","sourceRoot":"","sources":["../../../../src/targets/linux/snap/coreLegacy.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,cAAc,IAAI,eAAe,EACjC,IAAI,EACJ,OAAO,EACP,IAAI,EACJ,WAAW,EACX,yBAAyB,EACzB,GAAG,EACH,eAAe,EACf,qBAAqB,EACrB,iBAAiB,EACjB,uBAAuB,GACxB,MAAM,cAAc,CAAA;AACrB,OAAO,EAAE,OAAO,EAAE,UAAU,EAAE,UAAU,EAAW,MAAM,sBAAsB,CAAA;AAC/E,OAAO,QAAQ,MAAM,UAAU,CAAA;AAC/B,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,KAAK,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,aAAa,CAAA;AACvF,OAAO,EAAE,IAAI,EAAE,MAAM,SAAS,CAAA;AAC9B,OAAO,KAAK,IAAI,MAAM,MAAM,CAAA;AAG5B,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAA;AAChE,OAAO,EAAE,sBAAsB,EAAE,MAAM,8BAA8B,CAAA;AACrE,OAAO,EAAE,qBAAqB,EAAE,MAAM,wBAAwB,CAAA;AAC9D,OAAO,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAA;AAC9D,OAAO,EAAE,mBAAmB,EAAE,MAAM,sBAAsB,CAAA;AAC1D,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAA;AAC1C,OAAO,EAAE,yBAAyB,EAAE,MAAM,qCAAqC,CAAA;AAC/E,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAA;AAE7C,OAAO,EAAE,0BAA0B,EAAE,MAAM,gBAAgB,CAAA;AAC3D,OAAO,EAAE,sBAAsB,EAAE,MAAM,uBAAuB,CAAA;AAC9D,MAAM,EAAE,UAAU,EAAE,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import {\n replaceDefault as _replaceDefault,\n Arch,\n copyDir,\n exec,\n Executables,\n InvalidConfigurationError,\n log,\n serializeToYaml,\n stripSensitiveEnvVars,\n toLinuxArchString,\n validateShellEmbeddable,\n} from \"builder-util\"\nimport { asArray, deepAssign, isValidKey, Nullish } from \"builder-util-runtime\"\nimport _fsExtra from \"fs-extra\"\nimport { chmod, copyFile, lstat, mkdir, readdir, rename, writeFile } from \"fs/promises\"\nimport { load } from \"js-yaml\"\nimport * as path from \"path\"\nimport { ToolsetConfig } from \"../../../configuration.js\"\nimport { PlugDescriptor, SnapOptionsLegacy } from \"../../../options/SnapOptions.js\"\nimport { getAppImageTools } from \"../../../toolsets/appimage.js\"\nimport { downloadBuilderToolset } from \"../../../util/electronGet.js\"\nimport { isSnapDestructiveMode } from \"../../../util/flags.js\"\nimport { getTemplatePath } from \"../../../util/pathManager.js\"\nimport { buildLauncherScript } from \"../launcherScript.js\"\nimport { SnapCore } from \"./SnapTarget.js\"\nimport { getStagingCopyLinkOptions } from \"../../../util/trustedSourceRoots.js\"\nimport { shellQuote } from \"./snapCommand.js\"\nimport { SnapcraftYAML } from \"./snapcraft.js\"\nimport { warnAboutAllowSandboxPlugs } from \"./snapPlugs.js\"\nimport { DEFAULT_STAGE_PACKAGES } from \"./snapcraftBuilder.js\"\nconst { outputFile, readFile } = _fsExtra\n\n// Re-exported for backwards compatibility with existing imports/tests.\nexport { shellQuote }\n\n// Snap template release info from electron-userland/electron-builder-binaries\nconst SNAP_TEMPLATES = {\n amd64: {\n releaseName: \"snap-template-4.0-2\",\n filenameWithExt: \"snap-template-electron-4.0-2-amd64.tar.7z\",\n checksums: { \"snap-template-electron-4.0-2-amd64.tar.7z\": \"5e3ab4e09364ac06f0072b1c2dab9138318c933f6b2c7374f893b5ec44d19e6f\" },\n },\n armhf: {\n releaseName: \"snap-template-4.0-1\",\n filenameWithExt: \"snap-template-electron-4.0-1-armhf.tar.7z\",\n checksums: { \"snap-template-electron-4.0-1-armhf.tar.7z\": \"6f7553e904f4e043bc3019f0899d05e01a283b00b61fec22e932296490e3be6b\" },\n },\n} as const\n\n// Handles core18/core20/core22 snaps via mksquashfs (template) or snapcraft CLI (no-template).\n// See: https://github.com/develar/app-builder/blob/master/pkg/package-format/snap\nexport class SnapCoreLegacy extends SnapCore<SnapOptionsLegacy & { base: \"core18\" | \"core20\" | \"core22\" }> {\n private isUseTemplateApp = false\n\n defaultPlugs = [\"desktop\", \"desktop-legacy\", \"home\", \"x11\", \"wayland\", \"unity7\", \"browser-support\", \"network\", \"gsettings\", \"audio-playback\", \"pulseaudio\", \"opengl\"]\n\n private replaceDefault(inList: Array<string> | Nullish, defaultList: Array<string>) {\n const result = _replaceDefault(inList, defaultList)\n if (result !== defaultList) {\n this.isUseTemplateApp = false\n }\n return result\n }\n\n async createDescriptor(arch: Arch): Promise<SnapcraftYAML> {\n const appInfo = this.packager.appInfo\n const snapName = this.packager.executableName.toLowerCase()\n const options = this.options\n\n const plugs = this.normalizePlugConfiguration(this.options.plugs)\n if (options.confinement !== \"classic\") {\n warnAboutAllowSandboxPlugs(plugs, `snapcraft.${options.base}.plugs`, this.packager)\n }\n\n const plugNames = this.replaceDefault(plugs == null ? null : Object.getOwnPropertyNames(plugs), this.defaultPlugs)\n\n const slots = this.normalizePlugConfiguration(this.options.slots)\n\n const buildPackages = asArray(options.buildPackages)\n const stagePackages = this.replaceDefault(options.stagePackages, DEFAULT_STAGE_PACKAGES)\n\n const stageSet = new Set(stagePackages)\n const stageMatchesDefaults = stagePackages.length === DEFAULT_STAGE_PACKAGES.length && DEFAULT_STAGE_PACKAGES.every((p: string) => stageSet.has(p))\n\n // Template app is only available for x64/armv7l, and only when no packages are customised.\n this.isUseTemplateApp = this.options.useTemplateApp !== false && (arch === Arch.x64 || arch === Arch.armv7l) && buildPackages.length === 0 && stageMatchesDefaults\n\n const appDescriptor: any = {\n command: \"command.sh\",\n plugs: plugNames,\n adapter: \"none\",\n }\n\n const snap: any = load(await readFile(path.join(getTemplatePath(\"snap\"), \"snapcraft.yaml\"), \"utf-8\"))\n if (this.isUseTemplateApp) {\n delete appDescriptor.adapter\n }\n if (options.base != null) {\n snap.base = options.base\n if (Number(snap.base.split(\"core\")[1]) >= 22) {\n delete appDescriptor.adapter\n }\n }\n if (options.grade != null) {\n snap.grade = options.grade\n }\n if (options.confinement != null) {\n snap.confinement = options.confinement\n }\n if (options.appPartStage != null) {\n snap.parts.app.stage = options.appPartStage\n }\n if (options.layout != null) {\n snap.layout = options.layout\n }\n if (slots != null) {\n appDescriptor.slots = Object.getOwnPropertyNames(slots)\n for (const slotName of appDescriptor.slots) {\n if (!isValidKey(slotName)) {\n throw new Error(`Invalid plug/slot name: ${slotName}`)\n }\n const slotOptions = slots[slotName]\n if (slotOptions == null) {\n continue\n }\n if (!snap.slots) {\n snap.slots = {}\n }\n snap.slots[slotName] = slotOptions\n }\n }\n\n deepAssign(snap, {\n name: snapName,\n version: appInfo.version,\n title: options.title || appInfo.productName,\n summary: options.summary || appInfo.productName,\n compression: options.compression,\n description: this.helper.getDescription(options),\n architectures: [toLinuxArchString(arch, \"snap\")],\n apps: {\n [snapName]: appDescriptor,\n },\n parts: {\n app: {\n \"stage-packages\": stagePackages,\n },\n },\n })\n\n if (options.autoStart) {\n appDescriptor.autostart = `${this.helper.getDesktopFileName(snap.name)}.desktop`\n }\n\n if (options.confinement === \"classic\") {\n delete appDescriptor.plugs\n delete snap.plugs\n } else {\n const archTriplet = this.archNameToTriplet(arch)\n const environment: Record<string, string> = {\n PATH: \"$SNAP/usr/sbin:$SNAP/usr/bin:$SNAP/sbin:$SNAP/bin:$PATH\",\n SNAP_DESKTOP_RUNTIME: \"$SNAP/gnome-platform\",\n LD_LIBRARY_PATH: [\n \"$SNAP_LIBRARY_PATH\",\n \"$SNAP/lib:$SNAP/usr/lib:$SNAP/lib/\" + archTriplet + \":$SNAP/usr/lib/\" + archTriplet,\n \"$LD_LIBRARY_PATH:$SNAP/lib:$SNAP/usr/lib\",\n \"$SNAP/lib/\" + archTriplet + \":$SNAP/usr/lib/\" + archTriplet,\n ].join(\":\"),\n ...options.environment,\n }\n const allow = options.allowNativeWayland\n const isOldElectron = !this.helper.isElectronVersionGreaterOrEqualThan(\"38.0.0\", \"7.0.0\")\n if ((allow == null && isOldElectron) || allow === false) {\n environment.DISABLE_WAYLAND = \"1\"\n }\n\n appDescriptor.environment = environment\n\n if (plugs != null) {\n for (const plugName of plugNames) {\n if (!isValidKey(plugName)) {\n throw new Error(`Invalid plug/slot name: ${plugName}`)\n }\n const plugOptions = plugs[plugName]\n if (plugOptions == null) {\n continue\n }\n if (!snap.plugs) {\n snap.plugs = {}\n }\n snap.plugs[plugName] = plugOptions\n }\n }\n }\n\n if (buildPackages.length > 0) {\n snap.parts.app[\"build-packages\"] = buildPackages\n }\n if (options.after != null) {\n snap.parts.app.after = options.after\n }\n\n if (options.assumes != null) {\n snap.assumes = asArray(options.assumes)\n }\n\n return snap\n }\n\n async buildSnap(props: { snap: any; appOutDir: string; stageDir: string; snapArch: Arch; artifactPath: string }): Promise<string[]> {\n const { snap, appOutDir, stageDir, snapArch, artifactPath } = props\n\n // Build the args array for effectiveOptionComputed compatibility — tests inspect this.\n const args = [\n \"snap\",\n \"--app\",\n appOutDir,\n \"--stage\",\n stageDir,\n \"--arch\",\n toLinuxArchString(snapArch, \"snap\"),\n \"--output\",\n artifactPath,\n \"--executable\",\n this.packager.executableName,\n ]\n\n await this.helper.icons\n if (this.helper.maxIconPath != null) {\n if (!this.isUseTemplateApp) {\n snap.icon = \"snap/gui/icon.png\"\n }\n args.push(\"--icon\", this.helper.maxIconPath)\n }\n\n const snapMetaDir = path.join(stageDir, this.isUseTemplateApp ? \"meta\" : \"snap\")\n const desktopFile = path.join(snapMetaDir, \"gui\", `${this.helper.getDesktopFileName(snap.name)}.desktop`)\n await this.helper.writeDesktopEntry(this.options, snap.name + \" %U\", desktopFile, {\n Icon: \"${SNAP}/meta/gui/icon.png\",\n })\n\n const extraAppArgs: Array<string> = this.options.executableArgs ?? []\n if (this.helper.isElectronVersionGreaterOrEqualThan(\"5.0.0\") && !this.isBrowserSandboxAllowed(snap)) {\n const noSandboxArg = \"--no-sandbox\"\n if (!extraAppArgs.includes(noSandboxArg)) {\n extraAppArgs.push(noSandboxArg)\n }\n if (this.isUseTemplateApp) {\n args.push(\"--exclude\", \"chrome-sandbox\")\n }\n }\n if (extraAppArgs.length > 0) {\n args.push(\"--extraAppArgs=\" + extraAppArgs.join(\" \"))\n }\n\n // Capture compression BEFORE it gets stripped from snap for template builds.\n const compression = this.options.compression ?? \"xz\"\n if (snap.compression != null) {\n args.push(\"--compression\", snap.compression)\n }\n\n if (this.isUseTemplateApp) {\n const fieldsToStrip = [\"compression\", \"contact\", \"donation\", \"issues\", \"parts\", \"source-code\", \"website\"]\n for (const field of fieldsToStrip) {\n delete snap[field]\n }\n }\n\n if (this.packager.packagerOptions.effectiveOptionComputed != null && (await this.packager.packagerOptions.effectiveOptionComputed({ snap, desktopFile, args }))) {\n return [artifactPath]\n }\n\n await outputFile(path.join(snapMetaDir, this.isUseTemplateApp ? \"snap.yaml\" : \"snapcraft.yaml\"), serializeToYaml(snap))\n\n const hooksDir = await this.packager.getResource(this.options.hooks, \"snap-hooks\")\n if (hooksDir != null) {\n args.push(\"--hooks\", hooksDir)\n }\n\n if (this.isUseTemplateApp) {\n const templateArch = snapArch === Arch.x64 ? \"amd64\" : \"armhf\"\n args.push(\"--template-url\", `electron4:${templateArch}`)\n await this.buildWithTemplate({ appOutDir, stageDir, snapArch, artifactPath, compression, hooksDir, extraAppArgs })\n } else {\n await this.buildWithoutTemplate({ appOutDir, stageDir, artifactPath, hooksDir, extraAppArgs })\n }\n return [artifactPath]\n }\n\n private async buildWithTemplate(opts: {\n appOutDir: string\n stageDir: string\n snapArch: Arch\n artifactPath: string\n compression: string\n hooksDir: string | null\n extraAppArgs: string[]\n }): Promise<void> {\n const { appOutDir, stageDir, snapArch, artifactPath, compression, hooksDir, extraAppArgs } = opts\n const appimageToolset = this.packager.config.toolsets?.appimage\n // Fail before downloading the template rather than deep inside mksquashfs.\n assertTemplateSnapCompressionSupported(appimageToolset, compression)\n const templateArch = snapArch === Arch.x64 ? \"amd64\" : \"armhf\"\n const { releaseName, filenameWithExt, checksums } = SNAP_TEMPLATES[templateArch]\n\n log.info({ releaseName }, \"downloading snap template\")\n const templateDir = await downloadBuilderToolset({ releaseName, filenameWithExt, checksums, githubOrgRepo: \"electron-userland/electron-builder-binaries\" })\n\n await this.stageSnapFiles({ stageDir, appOutDir, hooksDir, extraAppArgs, isTemplate: true })\n\n // no setgid bits in the final image (chmod -R g-s)\n for (const dir of [stageDir, appOutDir, templateDir]) {\n await clearSetgidBits(dir).catch(err => log.warn({ error: err.message }, \"chmod g-s failed\"))\n }\n\n const { mksquashfs } = await getAppImageTools(appimageToolset, snapArch, this.packager.buildResourcesDir)\n\n // Collect top-level entries from each dir as individual path args (mirrors Go ReadDirContentTo)\n // chrome-sandbox is filtered out here, not deleted: appOutDir is shared with the other Linux targets (deb, rpm, AppImage), which pack from it concurrently.\n const mksquashfsArgs: string[] = [\n ...(await readDirPaths(templateDir)),\n ...(await readDirPaths(stageDir)),\n ...(await readDirPaths(appOutDir, name => name !== \"LICENSES.chromium.html\" && name !== \"LICENSE.electron.txt\" && name !== \"chrome-sandbox\")),\n artifactPath,\n \"-no-progress\",\n \"-quiet\",\n \"-noappend\",\n \"-comp\",\n compression,\n \"-no-xattrs\",\n \"-no-fragments\",\n \"-all-root\",\n ]\n\n await exec(mksquashfs, mksquashfsArgs, { cwd: stageDir })\n }\n\n private async buildWithoutTemplate(opts: { appOutDir: string; stageDir: string; artifactPath: string; hooksDir: string | null; extraAppArgs: string[] }): Promise<void> {\n const { appOutDir, stageDir, artifactPath, hooksDir, extraAppArgs } = opts\n\n await this.stageSnapFiles({ stageDir, appOutDir, hooksDir, extraAppArgs, isTemplate: false })\n\n // Write desktop integration scripts (embedded in the Go binary, now in our templates)\n const snapTemplateDir = getTemplatePath(\"snap\")\n for (const script of [\"desktop-init.sh\", \"desktop-common.sh\", \"desktop-gnome-specific.sh\"]) {\n const src = path.join(snapTemplateDir, script)\n const dest = path.join(stageDir, \"scripts\", script)\n await copyFile(src, dest)\n // copyFile doesn't preserve mode; chmod 755 explicitly\n await chmod(dest, 0o755)\n }\n\n // Copy app dir into stage/app/ so snapcraft can pick it up\n await copyDir(appOutDir, path.join(stageDir, \"app\"), await getStagingCopyLinkOptions(this.packager))\n\n // Run snapcraft (legacy `snap` subcommand)\n const isDestructiveMode = isSnapDestructiveMode()\n const snapOutputName = \"out.snap\"\n const snapArgs = [\"snap\", \"--output\", isDestructiveMode ? artifactPath : snapOutputName]\n if (isDestructiveMode) {\n snapArgs.push(\"--destructive-mode\")\n }\n\n // a local build: snapcraft needs no credentials\n await exec(Executables.resolve(\"snapcraft\"), snapArgs, {\n cwd: stageDir,\n env: { ...stripSensitiveEnvVars(process.env), SNAPCRAFT_HAS_TTY: \"false\" },\n })\n\n if (!isDestructiveMode) {\n await rename(path.join(stageDir, snapOutputName), artifactPath)\n }\n }\n\n private async stageSnapFiles(opts: { stageDir: string; appOutDir: string; hooksDir: string | null; extraAppArgs: string[]; isTemplate: boolean }): Promise<void> {\n const { stageDir, hooksDir, extraAppArgs, isTemplate } = opts\n\n const snapMetaDir = path.join(stageDir, isTemplate ? \"meta\" : \"snap\")\n // No-template builds place command.sh + desktop scripts in scripts/ which snapcraft stages to snap root.\n // Template builds write command.sh to the stage root directly; no scripts/ dir is needed.\n const scriptDir = path.join(stageDir, \"scripts\")\n if (!isTemplate) {\n await mkdir(scriptDir, { recursive: true })\n }\n\n if (this.helper.maxIconPath != null) {\n const iconDest = path.join(snapMetaDir, \"gui\", `icon${path.extname(this.helper.maxIconPath)}`)\n await mkdir(path.dirname(iconDest), { recursive: true })\n await copyFile(this.helper.maxIconPath, iconDest)\n }\n\n if (hooksDir != null) {\n await copyDir(hooksDir, path.join(snapMetaDir, \"hooks\"))\n }\n\n // command.sh — template builds write to stage root; no-template writes to scripts/\n const commandWrapperPath = isTemplate ? path.join(stageDir, \"command.sh\") : path.join(scriptDir, \"command.sh\")\n const commandContent = buildCommandShContent({ isTemplate, executableName: this.packager.executableName, extraAppArgs })\n await writeFile(commandWrapperPath, commandContent, { mode: 0o755 })\n await chmod(commandWrapperPath, 0o755)\n }\n\n private normalizePlugConfiguration(raw: Array<string | PlugDescriptor> | PlugDescriptor | Nullish): Record<string, Record<string, any> | null> | null {\n if (raw == null) {\n return null\n }\n\n const result: any = {}\n for (const item of Array.isArray(raw) ? raw : [raw]) {\n if (typeof item === \"string\") {\n if (!isValidKey(item)) {\n throw new Error(`Invalid plug/slot name: ${item}`)\n }\n result[item] = null\n } else {\n deepAssign(result, item)\n }\n }\n return result\n }\n\n private isBrowserSandboxAllowed(snap: any): boolean {\n if (snap.plugs != null) {\n for (const plugName of Object.keys(snap.plugs)) {\n const plug = snap.plugs[plugName]\n if (plug.interface === \"browser-support\" && plug[\"allow-sandbox\"] === true) {\n return true\n }\n }\n }\n return false\n }\n\n private archNameToTriplet(arch: Arch): string {\n switch (arch) {\n case Arch.x64:\n return \"x86_64-linux-gnu\"\n case Arch.ia32:\n return \"i386-linux-gnu\"\n case Arch.armv7l:\n return \"arm-linux-gnueabihf\"\n case Arch.arm64:\n return \"aarch64-linux-gnu\"\n\n default:\n throw new Error(`Unsupported arch ${arch}`)\n }\n }\n}\n\n/** Clears the setgid bit of a directory and of everything in it, like `chmod -R g-s`: symlinks are not followed. */\nasync function clearSetgidBits(file: string): Promise<void> {\n const stat = await lstat(file)\n if (stat.isSymbolicLink()) {\n return\n }\n if ((stat.mode & 0o2000) !== 0) {\n await chmod(file, stat.mode & 0o7777 & ~0o2000)\n }\n if (stat.isDirectory()) {\n for (const name of await readdir(file)) {\n await clearSetgidBits(path.join(file, name))\n }\n }\n}\n\nasync function readDirPaths(dir: string, filter?: (name: string) => boolean): Promise<string[]> {\n const entries = await readdir(dir)\n const result: string[] = []\n for (const name of entries) {\n if (!filter || filter(name)) {\n result.push(path.join(dir, name))\n }\n }\n return result\n}\n\n/**\n * Builds the content of command.sh for a snap package.\n *\n * For both template and no-template builds, the desktop-integration scripts are\n * sourced from the snap root ($SNAP):\n * - Template: scripts are embedded in the template tarball at the snap root.\n * - No-template: the snapcraft.yaml `launch-scripts` part uses `plugin: dump,\n * source: scripts`, which stages stageDir/scripts/ contents directly into the\n * snap root — so $SNAP/desktop-init.sh is correct in both cases.\n *\n * The only difference between template and no-template is the app executable prefix:\n * template apps are at $SNAP/<name>; no-template apps are at $SNAP/app/<name>.\n */\n/**\n * Template snaps are packed with the `mksquashfs` from `toolsets.appimage`. The legacy `\"0.0.0\"` bundle's\n * `mksquashfs` supports only gzip/xz, so reject `lzo` (explicit, or mapped from `linux.compression: \"store\"`)\n * up front instead of letting mksquashfs fail with `Compressor \"lzo\" is not supported`.\n */\nexport function assertTemplateSnapCompressionSupported(appimageToolset: ToolsetConfig[\"appimage\"], compression: string): void {\n // Only an explicit pin selects \"0.0.0\"; unset / null / \"latest\" resolve to the newest bundle, and a custom bundle is the user's choice.\n if (appimageToolset === \"0.0.0\" && compression === \"lzo\") {\n throw new InvalidConfigurationError(\n `Snap compression \"lzo\" is not supported with toolsets.appimage \"0.0.0\": template snaps (useTemplateApp) are packed with that toolset's mksquashfs, which supports only gzip and xz. ` +\n `Set toolsets.appimage to \"latest\" (or \"1.0.3\" or newer), or set the snap compression to \"xz\" (note that linux.compression \"store\" maps to \"lzo\").`\n )\n }\n}\n\nexport function buildCommandShContent(opts: { isTemplate: boolean; executableName: string; extraAppArgs: string[] }): string {\n const { isTemplate, executableName, extraAppArgs } = opts\n validateShellEmbeddable(executableName, \"executableName\")\n const appPrefix = isTemplate ? \"\" : \"app/\"\n return buildLauncherScript({\n shebang: \"#!/bin/bash -e\",\n command: ['\"$SNAP/desktop-init.sh\"', '\"$SNAP/desktop-common.sh\"', '\"$SNAP/desktop-gnome-specific.sh\"', `\"$SNAP/${appPrefix}${executableName}\"`],\n args: extraAppArgs,\n })\n}\n"]}
|
|
@@ -4,8 +4,8 @@ import { PlugDescriptor } from "../../../options/SnapOptions.js";
|
|
|
4
4
|
export declare const BROWSER_SUPPORT_INTERFACE = "browser-support";
|
|
5
5
|
/** Keyword in a `plugs` list that stands for electron-builder's default plug set. */
|
|
6
6
|
export declare const DEFAULT_PLUGS_KEYWORD = "default";
|
|
7
|
-
export declare const CORE24_NO_ALLOW_SANDBOX_DOCS = "https://www.electron.build/docs/migration/v27-
|
|
8
|
-
export declare const CORE24_DEFAULT_PLUGS_MERGE_DOCS = "https://www.electron.build/docs/migration/v27-
|
|
7
|
+
export declare const CORE24_NO_ALLOW_SANDBOX_DOCS = "https://www.electron.build/docs/migration/v27-runtime-changes#snap-core24-no-allow-sandbox-by-default";
|
|
8
|
+
export declare const CORE24_DEFAULT_PLUGS_MERGE_DOCS = "https://www.electron.build/docs/migration/v27-runtime-changes#snap-core24-default-in-plugs-merges-the-full-default-set";
|
|
9
9
|
/** App-level plugs core24 declares when it is not delegating them to the `gnome` extension. */
|
|
10
10
|
export declare const CORE24_DEFAULT_APP_PLUGS: ReadonlyArray<string>;
|
|
11
11
|
export type SnapPlugsConfig = Array<string | PlugDescriptor> | PlugDescriptor | Nullish;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"snapPlugs.d.ts","sourceRoot":"","sources":["../../../../src/targets/linux/snap/snapPlugs.ts"],"names":[],"mappings":"AACA,OAAO,EAAc,OAAO,EAAE,MAAM,sBAAsB,CAAA;AAC1D,OAAO,EAAE,cAAc,EAAE,MAAM,iCAAiC,CAAA;AAEhE,kHAAkH;AAElH,eAAO,MAAM,yBAAyB,oBAAoB,CAAA;AAE1D,qFAAqF;AACrF,eAAO,MAAM,qBAAqB,YAAY,CAAA;AAG9C,eAAO,MAAM,4BAA4B,
|
|
1
|
+
{"version":3,"file":"snapPlugs.d.ts","sourceRoot":"","sources":["../../../../src/targets/linux/snap/snapPlugs.ts"],"names":[],"mappings":"AACA,OAAO,EAAc,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CAAC,MAAM,CAA4B,GAAG,oBAAoB,CAsExK;AAED,4GAA4G;AAC5G,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,eAAe,GAAG,iBAAiB,CA4B5E;AAED,mHAAmH;AACnH,wBAAgB,uBAAuB,CAAC,SAAS,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,OAAO,GAAG,OAAO,CAKzF;AAED;;;GAGG;AACH,wBAAgB,qBAAqB,CAAC,SAAS,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,OAAO,GAAG,MAAM,EAAE,CAOxF;AAUD,gHAAgH;AAChH,wBAAgB,0BAA0B,CAAC,SAAS,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,OAAO,EAAE,UAAU,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,IAAI,CAc5H;AAED,2FAA2F;AAC3F,wBAAgB,+BAA+B,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,CASnE;AAED,sGAAsG;AACtG,wBAAgB,oCAAoC,CAAC,KAAK,EAAE,MAAM,EAAE,EAAE,KAAK,EAAE,MAAM,GAAG,IAAI,CAYzF"}
|
|
@@ -4,7 +4,7 @@ import { isValidKey } from "builder-util-runtime";
|
|
|
4
4
|
export const BROWSER_SUPPORT_INTERFACE = "browser-support";
|
|
5
5
|
/** Keyword in a `plugs` list that stands for electron-builder's default plug set. */
|
|
6
6
|
export const DEFAULT_PLUGS_KEYWORD = "default";
|
|
7
|
-
const MIGRATION_GUIDE = "https://www.electron.build/docs/migration/v27-
|
|
7
|
+
const MIGRATION_GUIDE = "https://www.electron.build/docs/migration/v27-runtime-changes";
|
|
8
8
|
export const CORE24_NO_ALLOW_SANDBOX_DOCS = `${MIGRATION_GUIDE}#snap-core24-no-allow-sandbox-by-default`;
|
|
9
9
|
export const CORE24_DEFAULT_PLUGS_MERGE_DOCS = `${MIGRATION_GUIDE}#snap-core24-default-in-plugs-merges-the-full-default-set`;
|
|
10
10
|
/** App-level plugs core24 declares when it is not delegating them to the `gnome` extension. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"snapPlugs.js","sourceRoot":"","sources":["../../../../src/targets/linux/snap/snapPlugs.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,cAAc,CAAA;AAClC,OAAO,EAAE,UAAU,EAAW,MAAM,sBAAsB,CAAA;AAG1D,kHAAkH;AAElH,MAAM,CAAC,MAAM,yBAAyB,GAAG,iBAAiB,CAAA;AAE1D,qFAAqF;AACrF,MAAM,CAAC,MAAM,qBAAqB,GAAG,SAAS,CAAA;AAE9C,MAAM,eAAe,GAAG,gEAAgE,CAAA;AACxF,MAAM,CAAC,MAAM,4BAA4B,GAAG,GAAG,eAAe,0CAA0C,CAAA;AACxG,MAAM,CAAC,MAAM,+BAA+B,GAAG,GAAG,eAAe,2DAA2D,CAAA;AAE5H,+FAA+F;AAC/F,MAAM,CAAC,MAAM,wBAAwB,GAA0B;IAC7D,SAAS;IACT,gBAAgB;IAChB,MAAM;IACN,KAAK;IACL,SAAS;IACT,QAAQ;IACR,SAAS;IACT,WAAW;IACX,gBAAgB;IAChB,YAAY;IACZ,QAAQ;CACT,CAAA;AAkCD,wHAAwH;AACxH,MAAM,UAAU,kBAAkB;IAChC,OAAO;QACL,cAAc,EAAE;YACd,SAAS,EAAE,SAAS;YACpB,MAAM,EAAE,uBAAuB;YAC/B,kBAAkB,EAAE,mBAAmB;SACxC;QACD,aAAa,EAAE;YACb,SAAS,EAAE,SAAS;YACpB,MAAM,EAAE,sBAAsB;YAC9B,kBAAkB,EAAE,mBAAmB;SACxC;QACD,cAAc,EAAE;YACd,SAAS,EAAE,SAAS;YACpB,MAAM,EAAE,uBAAuB;YAC/B,kBAAkB,EAAE,mBAAmB;SACxC;QACD,eAAe,EAAE;YACf,SAAS,EAAE,SAAS;YACpB,MAAM,EAAE,sBAAsB;YAC9B,kBAAkB,EAAE,eAAe;SACpC;Q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,UAAU,oCAAoC,CAAC,KAAe,EAAE,KAAa;IACjF,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QACvB,OAAM;IACR,CAAC;IACD,gBAAgB,CACd,wBAAwB,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,EACzC,KAAK,EACL,EAAE,KAAK,EAAE,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,EAC3B,uHAAuH;QACrH,0EAA0E;QAC1E,OAAO,+BAA+B,EAAE,CAC3C,CAAA;AACH,CAAC;AAED,SAAS,mBAAmB,CAAC,IAAY;IACvC,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,EAAE,CAAC;QACtB,MAAM,IAAI,KAAK,CAAC,2BAA2B,IAAI,EAAE,CAAC,CAAA;IACpD,CAAC;AACH,CAAC;AAED,gHAAgH;AAChH,SAAS,aAAa,CAAC,IAAY,EAAE,UAAmB;IACtD,OAAO,aAAa,CAAC,UAAU,CAAC,IAAI,OAAO,UAAU,CAAC,SAAS,KAAK,QAAQ,IAAI,UAAU,CAAC,SAAS,KAAK,IAAI,CAAA;AAC/G,CAAC;AAED,SAAS,aAAa,CAAC,KAAc;IACnC,OAAO,KAAK,IAAI,IAAI,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,CAAA;AAC5E,CAAC","sourcesContent":["import { log } from \"builder-util\"\nimport { isValidKey, Nullish } from \"builder-util-runtime\"\nimport { PlugDescriptor } from \"../../../options/SnapOptions.js\"\n\n/** Plug resolution helpers shared by the snap cores. Kept pure (no packager state) so they can be unit tested. */\n\nexport const BROWSER_SUPPORT_INTERFACE = \"browser-support\"\n\n/** Keyword in a `plugs` list that stands for electron-builder's default plug set. */\nexport const DEFAULT_PLUGS_KEYWORD = \"default\"\n\nconst MIGRATION_GUIDE = \"https://www.electron.build/docs/migration/v27-breaking-changes\"\nexport const CORE24_NO_ALLOW_SANDBOX_DOCS = `${MIGRATION_GUIDE}#snap-core24-no-allow-sandbox-by-default`\nexport const CORE24_DEFAULT_PLUGS_MERGE_DOCS = `${MIGRATION_GUIDE}#snap-core24-default-in-plugs-merges-the-full-default-set`\n\n/** App-level plugs core24 declares when it is not delegating them to the `gnome` extension. */\nexport const CORE24_DEFAULT_APP_PLUGS: ReadonlyArray<string> = [\n \"desktop\",\n \"desktop-legacy\",\n \"home\",\n \"x11\",\n \"wayland\",\n \"unity7\",\n \"network\",\n \"gsettings\",\n \"audio-playback\",\n \"pulseaudio\",\n \"opengl\",\n]\n\nexport type SnapPlugsConfig = Array<string | PlugDescriptor> | PlugDescriptor | Nullish\n\n/** Root-level plug definitions plus the app-level plug references for a snap. */\nexport interface ResolvedSnapPlugs {\n root: Record<string, any> | undefined\n app: string[] | undefined\n}\n\n/**\n * Which plugs core24 generates on its own:\n * - `classic`: none — the snap store review rejects classic snaps that declare plugs\n * - `gnome-extension`: only `browser-support` — the extension supplies the desktop plugs and content snaps\n * (gnome-46-2404, gtk-3-themes, icon-themes, sound-themes) itself\n * - `host`: the app-level default plugs plus `browser-support`, no content-snap root plugs\n * - `strict`: the content-snap root plugs, the app-level default plugs and `browser-support`\n */\nexport type Core24PlugFlavor = \"classic\" | \"gnome-extension\" | \"host\" | \"strict\"\n\nexport interface Core24PlugResolution extends ResolvedSnapPlugs {\n /**\n * `generated` — `plugs` is unset, so electron-builder's own set is used;\n * `merged` — the `plugs` list contains `\"default\"`, so the user's entries are merged into the default set;\n * `explicit` — the user's `plugs` replace the defaults.\n */\n source: \"generated\" | \"merged\" | \"explicit\"\n /**\n * Only for `merged`: plugs the v27 `\"default\"` expansion adds that the previous expansion (the app-level\n * default list plus the user's own entries) did not, e.g. `browser-support` and the content-snap plugs.\n */\n addedByDefaultExpansion: string[]\n}\n\n/** Root-level content-snap plugs wiring up the GNOME platform, theme, and GPU content snaps manually (no extension). */\nexport function core24ContentPlugs(): Record<string, any> {\n return {\n \"gtk-3-themes\": {\n interface: \"content\",\n target: \"$SNAP/data-dir/themes\",\n \"default-provider\": \"gtk-common-themes\",\n },\n \"icon-themes\": {\n interface: \"content\",\n target: \"$SNAP/data-dir/icons\",\n \"default-provider\": \"gtk-common-themes\",\n },\n \"sound-themes\": {\n interface: \"content\",\n target: \"$SNAP/data-dir/sounds\",\n \"default-provider\": \"gtk-common-themes\",\n },\n \"gnome-46-2404\": {\n interface: \"content\",\n target: \"$SNAP/gnome-platform\",\n \"default-provider\": \"gnome-46-2404\",\n },\n \"gpu-2404\": {\n interface: \"content\",\n target: \"$SNAP/gpu-2404\",\n \"default-provider\": \"mesa-2404\",\n },\n }\n}\n\n/**\n * The plugs core24 declares when `plugs` is unset.\n *\n * `browser-support` is requested *without* `allow-sandbox`: the snap store reserves that attribute for\n * vetted publishers (browsers) and rejects other uploads that request it. Without it the app is launched\n * with `--no-sandbox` and relies on the snap confinement (see SnapCore24).\n */\nexport function core24GeneratedPlugs(flavor: Core24PlugFlavor, appDefaults: ReadonlyArray<string> = CORE24_DEFAULT_APP_PLUGS): ResolvedSnapPlugs {\n const browserSupport = { [BROWSER_SUPPORT_INTERFACE]: { interface: BROWSER_SUPPORT_INTERFACE } }\n switch (flavor) {\n case \"classic\":\n return { root: undefined, app: undefined }\n case \"gnome-extension\":\n return { root: browserSupport, app: [BROWSER_SUPPORT_INTERFACE] }\n case \"host\":\n return { root: browserSupport, app: [...appDefaults, BROWSER_SUPPORT_INTERFACE] }\n case \"strict\":\n return { root: { ...core24ContentPlugs(), ...browserSupport }, app: [...appDefaults, BROWSER_SUPPORT_INTERFACE] }\n }\n}\n\n/**\n * Resolve core24 plugs from the user's `plugs` option.\n *\n * - unset: the generated set for the build flavor (see core24GeneratedPlugs)\n * - a list containing `\"default\"`: the full default set — the app-level default plugs plus everything the\n * flavor generates — with the user's other entries added to it, deduplicated by plug name. A descriptor\n * whose name matches a default plug overrides that plug's attributes (shallow merge). `null` resets a default\n * plug named like its interface (e.g. `browser-support`) to the snapd defaults for that interface, and removes a\n * content-snap plug (not named like its interface) from both the root and the app plugs.\n * - anything else: the user's plugs replace the defaults.\n */\nexport function resolveCore24Plugs(plugs: SnapPlugsConfig, flavor: Core24PlugFlavor, appDefaults: ReadonlyArray<string> = CORE24_DEFAULT_APP_PLUGS): Core24PlugResolution {\n if (!plugs) {\n return { ...core24GeneratedPlugs(flavor, appDefaults), source: \"generated\", addedByDefaultExpansion: [] }\n }\n if (!Array.isArray(plugs) || !plugs.includes(DEFAULT_PLUGS_KEYWORD)) {\n return { ...normalizeSnapPlugs(plugs), source: \"explicit\", addedByDefaultExpansion: [] }\n }\n\n const generated = core24GeneratedPlugs(flavor, appDefaults)\n const defaultAppPlugs = [...appDefaults, ...(generated.app ?? [])]\n const defaultRoot: Record<string, any> = { ...generated.root }\n\n const app: string[] = []\n const appSeen = new Set<string>()\n const addApp = (name: string) => {\n if (!appSeen.has(name)) {\n appSeen.add(name)\n app.push(name)\n }\n }\n const userRoot: Record<string, any> = {}\n const userNames = new Set<string>()\n\n for (const item of plugs) {\n if (item === DEFAULT_PLUGS_KEYWORD) {\n defaultAppPlugs.forEach(addApp)\n continue\n }\n if (typeof item === \"string\") {\n assertValidPlugName(item)\n userNames.add(item)\n addApp(item)\n continue\n }\n for (const [name, config] of Object.entries(item)) {\n assertValidPlugName(name)\n userNames.add(name)\n userRoot[name] = config\n addApp(name)\n }\n }\n\n const root: Record<string, any> = { ...defaultRoot }\n const contentPlugs = core24ContentPlugs()\n const removed = new Set<string>()\n for (const [name, config] of Object.entries(userRoot)) {\n const base = defaultRoot[name]\n // `null` drops the root definition, which leaves snapd to treat the plug name as the interface. A content-snap\n // plug (e.g. `gpu-2404`, interface `content`) is not named like its interface, so the app would reference an\n // undefined plug — remove it entirely instead. The content plugs are checked even when this flavor does not\n // declare them (host builds, the gnome extension), so `null` never leaves such a reference behind.\n if (config == null && isRenamedPlug(name, base ?? contentPlugs[name])) {\n removed.add(name)\n delete root[name]\n continue\n }\n root[name] = isPlainObject(base) && isPlainObject(config) ? { ...base, ...config } : config\n }\n const appPlugs = app.filter(name => !removed.has(name))\n\n // Before v27, \"default\" expanded to the app-level default list only, followed by the user's own entries.\n const previousExpansion = new Set<string>([...appDefaults, ...userNames])\n const addedByDefaultExpansion = [...new Set([...appPlugs, ...Object.keys(root)])].filter(name => !previousExpansion.has(name))\n\n return {\n root: Object.keys(root).length > 0 ? root : undefined,\n app: appPlugs.length > 0 ? appPlugs : undefined,\n source: \"merged\",\n addedByDefaultExpansion,\n }\n}\n\n/** Split a plugs config (no `\"default\"` expansion) into root-level definitions and app-level references. */\nexport function normalizeSnapPlugs(plugs: SnapPlugsConfig): ResolvedSnapPlugs {\n if (!plugs || (Array.isArray(plugs) && plugs.length === 0)) {\n return { root: undefined, app: undefined }\n }\n const root: Record<string, any> = {}\n const app: string[] = []\n\n if (!Array.isArray(plugs)) {\n for (const [name, config] of Object.entries(plugs)) {\n assertValidPlugName(name)\n root[name] = config\n app.push(name)\n }\n return { root, app }\n }\n\n for (const item of plugs) {\n if (typeof item === \"string\") {\n app.push(item)\n continue\n }\n for (const [name, config] of Object.entries(item)) {\n assertValidPlugName(name)\n root[name] = config\n app.push(name)\n }\n }\n return { root: Object.keys(root).length > 0 ? root : undefined, app: app.length > 0 ? app : undefined }\n}\n\n/** Whether the resolved root plugs grant Chromium's own sandbox (`browser-support` with `allow-sandbox: true`). */\nexport function isBrowserSandboxAllowed(rootPlugs: Record<string, any> | Nullish): boolean {\n if (!rootPlugs) {\n return false\n }\n return Object.values(rootPlugs).some(plug => plug?.interface === BROWSER_SUPPORT_INTERFACE && plug[\"allow-sandbox\"] === true)\n}\n\n/**\n * Names of the root-level plugs that request `browser-support` with `allow-sandbox: true`. A plug without an\n * explicit `interface` uses its name as the interface, as snapd does.\n */\nexport function findAllowSandboxPlugs(rootPlugs: Record<string, any> | Nullish): string[] {\n if (!rootPlugs) {\n return []\n }\n return Object.entries(rootPlugs)\n .filter(([name, plug]) => isPlainObject(plug) && (plug.interface ?? name) === BROWSER_SUPPORT_INTERFACE && plug[\"allow-sandbox\"] === true)\n .map(([name]) => name)\n}\n\n/**\n * Log a snap plug notice once per `scope` (the build's packager) and `key`, so a multi-arch build of one app warns once\n * while every project built in the same process (programmatic API, watch tooling) still gets its own warning.\n */\nfunction warnOncePerBuild(key: string, scope: object, fields: Record<string, any>, message: string): void {\n log.once(`snap-plugs:${key}`, scope).warn(fields, message)\n}\n\n/** Warn that the snap store reserves `allow-sandbox` for vetted publishers. The configuration is left as is. */\nexport function warnAboutAllowSandboxPlugs(rootPlugs: Record<string, any> | Nullish, optionPath: string, scope: object): void {\n const plugNames = findAllowSandboxPlugs(rootPlugs)\n if (plugNames.length === 0) {\n return\n }\n warnOncePerBuild(\n `allow-sandbox:${optionPath}:${plugNames.join(\",\")}`,\n scope,\n { plugs: plugNames.join(\", \"), option: optionPath },\n `${optionPath} requests the browser-support interface with \"allow-sandbox: true\". ` +\n \"The Snap Store reserves allow-sandbox for vetted publishers (browsers), so store review rejects this snap unless your publisher has been granted it. \" +\n \"Remove the attribute to launch with --no-sandbox under snap confinement instead. \" +\n `See ${CORE24_NO_ALLOW_SANDBOX_DOCS}`\n )\n}\n\n/** v27 behaviour-change notice: default core24 plugs no longer keep Chromium's sandbox. */\nexport function warnAboutCore24NoSandboxDefault(scope: object): void {\n warnOncePerBuild(\n \"core24-no-sandbox-default\",\n scope,\n { reason: \"the Snap Store rejects allow-sandbox from non-vetted publishers\", solution: \"no action needed unless you are a vetted publisher\" },\n `snapcraft.core24 now requests the plain browser-support interface by default (electron-builder <= 26 added \"allow-sandbox: true\", which the Snap Store rejects for most publishers). ` +\n \"The app is launched with --no-sandbox and chrome-sandbox is left out of the snap; snap confinement isolates the app instead. \" +\n `See ${CORE24_NO_ALLOW_SANDBOX_DOCS}`\n )\n}\n\n/** v27 behaviour-change notice: `\"default\"` in core24 `plugs` now expands to the full default set. */\nexport function warnAboutCore24DefaultPlugsExpansion(added: string[], scope: object): void {\n if (added.length === 0) {\n return\n }\n warnOncePerBuild(\n `core24-default-plugs:${added.join(\",\")}`,\n scope,\n { added: added.join(\", \") },\n `\"default\" in snapcraft.core24.plugs now expands to the full default plug set, so these plugs are added to your snap. ` +\n `electron-builder <= 26 expanded it to the app-level desktop plugs only. ` +\n `See ${CORE24_DEFAULT_PLUGS_MERGE_DOCS}`\n )\n}\n\nfunction assertValidPlugName(name: string): void {\n if (!isValidKey(name)) {\n throw new Error(`Invalid plug/slot name: ${name}`)\n }\n}\n\n/** Whether a default plug definition declares an interface other than its own name (the content-snap plugs). */\nfunction isRenamedPlug(name: string, definition: unknown): boolean {\n return isPlainObject(definition) && typeof definition.interface === \"string\" && definition.interface !== name\n}\n\nfunction isPlainObject(value: unknown): value is Record<string, any> {\n return value != null && typeof value === \"object\" && !Array.isArray(value)\n}\n"]}
|
|
1
|
+
{"version":3,"file":"snapPlugs.js","sourceRoot":"","sources":["../../../../src/targets/linux/snap/snapPlugs.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,cAAc,CAAA;AAClC,OAAO,EAAE,UAAU,EAAW,MAAM,sBAAsB,CAAA;AAG1D,kHAAkH;AAElH,MAAM,CAAC,MAAM,yBAAyB,GAAG,iBAAiB,CAAA;AAE1D,qFAAqF;AACrF,MAAM,CAAC,MAAM,qBAAqB,GAAG,SAAS,CAAA;AAE9C,MAAM,eAAe,GAAG,+DAA+D,CAAA;AACvF,MAAM,CAAC,MAAM,4BAA4B,GAAG,GAAG,eAAe,0CAA0C,CAAA;AACxG,MAAM,CAAC,MAAM,+BAA+B,GAAG,GAAG,eAAe,2DAA2D,CAAA;AAE5H,+FAA+F;AAC/F,MAAM,CAAC,MAAM,wBAAwB,GAA0B;IAC7D,SAAS;IACT,gBAAgB;IAChB,MAAM;IACN,KAAK;IACL,SAAS;IACT,QAAQ;IACR,SAAS;IACT,WAAW;IACX,gBAAgB;IAChB,YAAY;IACZ,QAAQ;CACT,CAAA;AAkCD,wHAAwH;AACxH,MAAM,UAAU,kBAAkB;IAChC,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C,OAAO,CAAC,KAAK,CAAC,CAAA;AAC5E,CAAC","sourcesContent":["import { log } from \"builder-util\"\nimport { isValidKey, Nullish } from \"builder-util-runtime\"\nimport { PlugDescriptor } from \"../../../options/SnapOptions.js\"\n\n/** Plug resolution helpers shared by the snap cores. Kept pure (no packager state) so they can be unit tested. */\n\nexport const BROWSER_SUPPORT_INTERFACE = \"browser-support\"\n\n/** Keyword in a `plugs` list that stands for electron-builder's default plug set. */\nexport const DEFAULT_PLUGS_KEYWORD = \"default\"\n\nconst MIGRATION_GUIDE = \"https://www.electron.build/docs/migration/v27-runtime-changes\"\nexport const CORE24_NO_ALLOW_SANDBOX_DOCS = `${MIGRATION_GUIDE}#snap-core24-no-allow-sandbox-by-default`\nexport const CORE24_DEFAULT_PLUGS_MERGE_DOCS = `${MIGRATION_GUIDE}#snap-core24-default-in-plugs-merges-the-full-default-set`\n\n/** App-level plugs core24 declares when it is not delegating them to the `gnome` extension. */\nexport const CORE24_DEFAULT_APP_PLUGS: ReadonlyArray<string> = [\n \"desktop\",\n \"desktop-legacy\",\n \"home\",\n \"x11\",\n \"wayland\",\n \"unity7\",\n \"network\",\n \"gsettings\",\n \"audio-playback\",\n \"pulseaudio\",\n \"opengl\",\n]\n\nexport type SnapPlugsConfig = Array<string | PlugDescriptor> | PlugDescriptor | Nullish\n\n/** Root-level plug definitions plus the app-level plug references for a snap. */\nexport interface ResolvedSnapPlugs {\n root: Record<string, any> | undefined\n app: string[] | undefined\n}\n\n/**\n * Which plugs core24 generates on its own:\n * - `classic`: none — the snap store review rejects classic snaps that declare plugs\n * - `gnome-extension`: only `browser-support` — the extension supplies the desktop plugs and content snaps\n * (gnome-46-2404, gtk-3-themes, icon-themes, sound-themes) itself\n * - `host`: the app-level default plugs plus `browser-support`, no content-snap root plugs\n * - `strict`: the content-snap root plugs, the app-level default plugs and `browser-support`\n */\nexport type Core24PlugFlavor = \"classic\" | \"gnome-extension\" | \"host\" | \"strict\"\n\nexport interface Core24PlugResolution extends ResolvedSnapPlugs {\n /**\n * `generated` — `plugs` is unset, so electron-builder's own set is used;\n * `merged` — the `plugs` list contains `\"default\"`, so the user's entries are merged into the default set;\n * `explicit` — the user's `plugs` replace the defaults.\n */\n source: \"generated\" | \"merged\" | \"explicit\"\n /**\n * Only for `merged`: plugs the v27 `\"default\"` expansion adds that the previous expansion (the app-level\n * default list plus the user's own entries) did not, e.g. `browser-support` and the content-snap plugs.\n */\n addedByDefaultExpansion: string[]\n}\n\n/** Root-level content-snap plugs wiring up the GNOME platform, theme, and GPU content snaps manually (no extension). */\nexport function core24ContentPlugs(): Record<string, any> {\n return {\n \"gtk-3-themes\": {\n interface: \"content\",\n target: \"$SNAP/data-dir/themes\",\n \"default-provider\": \"gtk-common-themes\",\n },\n \"icon-themes\": {\n interface: \"content\",\n target: \"$SNAP/data-dir/icons\",\n \"default-provider\": \"gtk-common-themes\",\n },\n \"sound-themes\": {\n interface: \"content\",\n target: \"$SNAP/data-dir/sounds\",\n \"default-provider\": \"gtk-common-themes\",\n },\n \"gnome-46-2404\": {\n interface: \"content\",\n target: \"$SNAP/gnome-platform\",\n \"default-provider\": \"gnome-46-2404\",\n },\n \"gpu-2404\": {\n interface: \"content\",\n target: \"$SNAP/gpu-2404\",\n \"default-provider\": \"mesa-2404\",\n },\n }\n}\n\n/**\n * The plugs core24 declares when `plugs` is unset.\n *\n * `browser-support` is requested *without* `allow-sandbox`: the snap store reserves that attribute for\n * vetted publishers (browsers) and rejects other uploads that request it. Without it the app is launched\n * with `--no-sandbox` and relies on the snap confinement (see SnapCore24).\n */\nexport function core24GeneratedPlugs(flavor: Core24PlugFlavor, appDefaults: ReadonlyArray<string> = CORE24_DEFAULT_APP_PLUGS): ResolvedSnapPlugs {\n const browserSupport = { [BROWSER_SUPPORT_INTERFACE]: { interface: BROWSER_SUPPORT_INTERFACE } }\n switch (flavor) {\n case \"classic\":\n return { root: undefined, app: undefined }\n case \"gnome-extension\":\n return { root: browserSupport, app: [BROWSER_SUPPORT_INTERFACE] }\n case \"host\":\n return { root: browserSupport, app: [...appDefaults, BROWSER_SUPPORT_INTERFACE] }\n case \"strict\":\n return { root: { ...core24ContentPlugs(), ...browserSupport }, app: [...appDefaults, BROWSER_SUPPORT_INTERFACE] }\n }\n}\n\n/**\n * Resolve core24 plugs from the user's `plugs` option.\n *\n * - unset: the generated set for the build flavor (see core24GeneratedPlugs)\n * - a list containing `\"default\"`: the full default set — the app-level default plugs plus everything the\n * flavor generates — with the user's other entries added to it, deduplicated by plug name. A descriptor\n * whose name matches a default plug overrides that plug's attributes (shallow merge). `null` resets a default\n * plug named like its interface (e.g. `browser-support`) to the snapd defaults for that interface, and removes a\n * content-snap plug (not named like its interface) from both the root and the app plugs.\n * - anything else: the user's plugs replace the defaults.\n */\nexport function resolveCore24Plugs(plugs: SnapPlugsConfig, flavor: Core24PlugFlavor, appDefaults: ReadonlyArray<string> = CORE24_DEFAULT_APP_PLUGS): Core24PlugResolution {\n if (!plugs) {\n return { ...core24GeneratedPlugs(flavor, appDefaults), source: \"generated\", addedByDefaultExpansion: [] }\n }\n if (!Array.isArray(plugs) || !plugs.includes(DEFAULT_PLUGS_KEYWORD)) {\n return { ...normalizeSnapPlugs(plugs), source: \"explicit\", addedByDefaultExpansion: [] }\n }\n\n const generated = core24GeneratedPlugs(flavor, appDefaults)\n const defaultAppPlugs = [...appDefaults, ...(generated.app ?? [])]\n const defaultRoot: Record<string, any> = { ...generated.root }\n\n const app: string[] = []\n const appSeen = new Set<string>()\n const addApp = (name: string) => {\n if (!appSeen.has(name)) {\n appSeen.add(name)\n app.push(name)\n }\n }\n const userRoot: Record<string, any> = {}\n const userNames = new Set<string>()\n\n for (const item of plugs) {\n if (item === DEFAULT_PLUGS_KEYWORD) {\n defaultAppPlugs.forEach(addApp)\n continue\n }\n if (typeof item === \"string\") {\n assertValidPlugName(item)\n userNames.add(item)\n addApp(item)\n continue\n }\n for (const [name, config] of Object.entries(item)) {\n assertValidPlugName(name)\n userNames.add(name)\n userRoot[name] = config\n addApp(name)\n }\n }\n\n const root: Record<string, any> = { ...defaultRoot }\n const contentPlugs = core24ContentPlugs()\n const removed = new Set<string>()\n for (const [name, config] of Object.entries(userRoot)) {\n const base = defaultRoot[name]\n // `null` drops the root definition, which leaves snapd to treat the plug name as the interface. A content-snap\n // plug (e.g. `gpu-2404`, interface `content`) is not named like its interface, so the app would reference an\n // undefined plug — remove it entirely instead. The content plugs are checked even when this flavor does not\n // declare them (host builds, the gnome extension), so `null` never leaves such a reference behind.\n if (config == null && isRenamedPlug(name, base ?? contentPlugs[name])) {\n removed.add(name)\n delete root[name]\n continue\n }\n root[name] = isPlainObject(base) && isPlainObject(config) ? { ...base, ...config } : config\n }\n const appPlugs = app.filter(name => !removed.has(name))\n\n // Before v27, \"default\" expanded to the app-level default list only, followed by the user's own entries.\n const previousExpansion = new Set<string>([...appDefaults, ...userNames])\n const addedByDefaultExpansion = [...new Set([...appPlugs, ...Object.keys(root)])].filter(name => !previousExpansion.has(name))\n\n return {\n root: Object.keys(root).length > 0 ? root : undefined,\n app: appPlugs.length > 0 ? appPlugs : undefined,\n source: \"merged\",\n addedByDefaultExpansion,\n }\n}\n\n/** Split a plugs config (no `\"default\"` expansion) into root-level definitions and app-level references. */\nexport function normalizeSnapPlugs(plugs: SnapPlugsConfig): ResolvedSnapPlugs {\n if (!plugs || (Array.isArray(plugs) && plugs.length === 0)) {\n return { root: undefined, app: undefined }\n }\n const root: Record<string, any> = {}\n const app: string[] = []\n\n if (!Array.isArray(plugs)) {\n for (const [name, config] of Object.entries(plugs)) {\n assertValidPlugName(name)\n root[name] = config\n app.push(name)\n }\n return { root, app }\n }\n\n for (const item of plugs) {\n if (typeof item === \"string\") {\n app.push(item)\n continue\n }\n for (const [name, config] of Object.entries(item)) {\n assertValidPlugName(name)\n root[name] = config\n app.push(name)\n }\n }\n return { root: Object.keys(root).length > 0 ? root : undefined, app: app.length > 0 ? app : undefined }\n}\n\n/** Whether the resolved root plugs grant Chromium's own sandbox (`browser-support` with `allow-sandbox: true`). */\nexport function isBrowserSandboxAllowed(rootPlugs: Record<string, any> | Nullish): boolean {\n if (!rootPlugs) {\n return false\n }\n return Object.values(rootPlugs).some(plug => plug?.interface === BROWSER_SUPPORT_INTERFACE && plug[\"allow-sandbox\"] === true)\n}\n\n/**\n * Names of the root-level plugs that request `browser-support` with `allow-sandbox: true`. A plug without an\n * explicit `interface` uses its name as the interface, as snapd does.\n */\nexport function findAllowSandboxPlugs(rootPlugs: Record<string, any> | Nullish): string[] {\n if (!rootPlugs) {\n return []\n }\n return Object.entries(rootPlugs)\n .filter(([name, plug]) => isPlainObject(plug) && (plug.interface ?? name) === BROWSER_SUPPORT_INTERFACE && plug[\"allow-sandbox\"] === true)\n .map(([name]) => name)\n}\n\n/**\n * Log a snap plug notice once per `scope` (the build's packager) and `key`, so a multi-arch build of one app warns once\n * while every project built in the same process (programmatic API, watch tooling) still gets its own warning.\n */\nfunction warnOncePerBuild(key: string, scope: object, fields: Record<string, any>, message: string): void {\n log.once(`snap-plugs:${key}`, scope).warn(fields, message)\n}\n\n/** Warn that the snap store reserves `allow-sandbox` for vetted publishers. The configuration is left as is. */\nexport function warnAboutAllowSandboxPlugs(rootPlugs: Record<string, any> | Nullish, optionPath: string, scope: object): void {\n const plugNames = findAllowSandboxPlugs(rootPlugs)\n if (plugNames.length === 0) {\n return\n }\n warnOncePerBuild(\n `allow-sandbox:${optionPath}:${plugNames.join(\",\")}`,\n scope,\n { plugs: plugNames.join(\", \"), option: optionPath },\n `${optionPath} requests the browser-support interface with \"allow-sandbox: true\". ` +\n \"The Snap Store reserves allow-sandbox for vetted publishers (browsers), so store review rejects this snap unless your publisher has been granted it. \" +\n \"Remove the attribute to launch with --no-sandbox under snap confinement instead. \" +\n `See ${CORE24_NO_ALLOW_SANDBOX_DOCS}`\n )\n}\n\n/** v27 behaviour-change notice: default core24 plugs no longer keep Chromium's sandbox. */\nexport function warnAboutCore24NoSandboxDefault(scope: object): void {\n warnOncePerBuild(\n \"core24-no-sandbox-default\",\n scope,\n { reason: \"the Snap Store rejects allow-sandbox from non-vetted publishers\", solution: \"no action needed unless you are a vetted publisher\" },\n `snapcraft.core24 now requests the plain browser-support interface by default (electron-builder <= 26 added \"allow-sandbox: true\", which the Snap Store rejects for most publishers). ` +\n \"The app is launched with --no-sandbox and chrome-sandbox is left out of the snap; snap confinement isolates the app instead. \" +\n `See ${CORE24_NO_ALLOW_SANDBOX_DOCS}`\n )\n}\n\n/** v27 behaviour-change notice: `\"default\"` in core24 `plugs` now expands to the full default set. */\nexport function warnAboutCore24DefaultPlugsExpansion(added: string[], scope: object): void {\n if (added.length === 0) {\n return\n }\n warnOncePerBuild(\n `core24-default-plugs:${added.join(\",\")}`,\n scope,\n { added: added.join(\", \") },\n `\"default\" in snapcraft.core24.plugs now expands to the full default plug set, so these plugs are added to your snap. ` +\n `electron-builder <= 26 expanded it to the app-level desktop plugs only. ` +\n `See ${CORE24_DEFAULT_PLUGS_MERGE_DOCS}`\n )\n}\n\nfunction assertValidPlugName(name: string): void {\n if (!isValidKey(name)) {\n throw new Error(`Invalid plug/slot name: ${name}`)\n }\n}\n\n/** Whether a default plug definition declares an interface other than its own name (the content-snap plugs). */\nfunction isRenamedPlug(name: string, definition: unknown): boolean {\n return isPlainObject(definition) && typeof definition.interface === \"string\" && definition.interface !== name\n}\n\nfunction isPlainObject(value: unknown): value is Record<string, any> {\n return value != null && typeof value === \"object\" && !Array.isArray(value)\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"snapcraftBuilder.d.ts","sourceRoot":"","sources":["../../../../src/targets/linux/snap/snapcraftBuilder.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,
|
|
1
|
+
{"version":3,"file":"snapcraftBuilder.d.ts","sourceRoot":"","sources":["../../../../src/targets/linux/snap/snapcraftBuilder.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAoG,MAAM,cAAc,CAAA;AAKrI,OAAO,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAA;AACzD,OAAO,EAAE,kBAAkB,EAAE,MAAM,iCAAiC,CAAA;AACpE,OAAO,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAA;AAK9C,eAAO,MAAM,sBAAsB;;;;CAAsD,CAAA;AACzF,eAAO,MAAM,sBAAsB,EAAE,MAAM,EAA8E,CAAA;AAEzH,UAAU,gBAAgB;IACxB,uCAAuC;IACvC,eAAe,EAAE,aAAa,CAAA;IAC9B,+EAA+E;IAC/E,QAAQ,EAAE,MAAM,CAAA;IAChB,wDAAwD;IACxD,WAAW,CAAC,EAAE,kBAAkB,CAAA;IAChC,0CAA0C;IAC1C,MAAM,CAAC,EAAE,OAAO,CAAA;IAChB,gDAAgD;IAChD,YAAY,CAAC,EAAE,OAAO,CAAA;IACtB,4EAA4E;IAC5E,kBAAkB,CAAC,EAAE,OAAO,CAAA;IAC5B,2BAA2B;IAC3B,YAAY,EAAE,MAAM,CAAA;IACpB,4FAA4F;IAC5F,QAAQ,EAAE,aAAa,CAAA;IACvB,qFAAqF;IACrF,OAAO,CAAC,EAAE,MAAM,CAAA;CACjB;AAuJD;;;GAGG;AACH,wBAAgB,oBAAoB,CAAC,QAAQ,EAAE,MAAM,GAAG,IAAI,CAe3D;AAYD;;;;;;;GAOG;AACH,wBAAsB,SAAS,CAAC,OAAO,EAAE,gBAAgB,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC,CAgF5E"}
|