app-builder-lib 27.0.0-alpha.10 → 27.0.0-alpha.12

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.
Files changed (217) hide show
  1. package/dist/asar/asarAlign.d.ts +35 -0
  2. package/dist/asar/asarAlign.d.ts.map +1 -0
  3. package/dist/asar/asarAlign.js +149 -0
  4. package/dist/asar/asarAlign.js.map +1 -0
  5. package/dist/asar/asarUtil.d.ts +15 -1
  6. package/dist/asar/asarUtil.d.ts.map +1 -1
  7. package/dist/asar/asarUtil.js +111 -61
  8. package/dist/asar/asarUtil.js.map +1 -1
  9. package/dist/codeSign/win/authenticodeSignature.d.ts +71 -0
  10. package/dist/codeSign/win/authenticodeSignature.d.ts.map +1 -0
  11. package/dist/codeSign/win/authenticodeSignature.js +241 -0
  12. package/dist/codeSign/win/authenticodeSignature.js.map +1 -0
  13. package/dist/codeSign/win/signtoolBaseSignManager.d.ts +11 -0
  14. package/dist/codeSign/win/signtoolBaseSignManager.d.ts.map +1 -1
  15. package/dist/codeSign/win/signtoolBaseSignManager.js +36 -16
  16. package/dist/codeSign/win/signtoolBaseSignManager.js.map +1 -1
  17. package/dist/codeSign/win/verifyUpdatePublisher.d.ts +25 -0
  18. package/dist/codeSign/win/verifyUpdatePublisher.d.ts.map +1 -0
  19. package/dist/codeSign/win/verifyUpdatePublisher.js +98 -0
  20. package/dist/codeSign/win/verifyUpdatePublisher.js.map +1 -0
  21. package/dist/configuration.d.ts +16 -13
  22. package/dist/configuration.d.ts.map +1 -1
  23. package/dist/configuration.js.map +1 -1
  24. package/dist/electron/ElectronFramework.d.ts +15 -0
  25. package/dist/electron/ElectronFramework.d.ts.map +1 -1
  26. package/dist/electron/ElectronFramework.js +33 -2
  27. package/dist/electron/ElectronFramework.js.map +1 -1
  28. package/dist/electron/mac/asarIntegrityDigest.d.ts +10 -0
  29. package/dist/electron/mac/asarIntegrityDigest.d.ts.map +1 -0
  30. package/dist/electron/mac/asarIntegrityDigest.js +122 -0
  31. package/dist/electron/mac/asarIntegrityDigest.js.map +1 -0
  32. package/dist/electron/mac/electronMac.js +1 -28
  33. package/dist/electron/mac/electronMac.js.map +1 -1
  34. package/dist/electron/mac/electronMacUtils.d.ts +8 -0
  35. package/dist/electron/mac/electronMacUtils.d.ts.map +1 -1
  36. package/dist/electron/mac/electronMacUtils.js +36 -0
  37. package/dist/electron/mac/electronMacUtils.js.map +1 -1
  38. package/dist/fileMatcher.d.ts +47 -12
  39. package/dist/fileMatcher.d.ts.map +1 -1
  40. package/dist/fileMatcher.js +150 -45
  41. package/dist/fileMatcher.js.map +1 -1
  42. package/dist/forge-maker.d.ts +64 -0
  43. package/dist/forge-maker.d.ts.map +1 -1
  44. package/dist/forge-maker.js +104 -2
  45. package/dist/forge-maker.js.map +1 -1
  46. package/dist/index.d.ts +4 -4
  47. package/dist/index.d.ts.map +1 -1
  48. package/dist/index.js +1 -1
  49. package/dist/index.js.map +1 -1
  50. package/dist/indexInternal.d.ts +5 -3
  51. package/dist/indexInternal.d.ts.map +1 -1
  52. package/dist/indexInternal.js +5 -3
  53. package/dist/indexInternal.js.map +1 -1
  54. package/dist/macPackager.d.ts +6 -0
  55. package/dist/macPackager.d.ts.map +1 -1
  56. package/dist/macPackager.js +48 -2
  57. package/dist/macPackager.js.map +1 -1
  58. package/dist/options/FuseOptionsV1.d.ts +4 -0
  59. package/dist/options/FuseOptionsV1.d.ts.map +1 -1
  60. package/dist/options/FuseOptionsV1.js.map +1 -1
  61. package/dist/options/PlatformSpecificBuildOptions.d.ts +166 -8
  62. package/dist/options/PlatformSpecificBuildOptions.d.ts.map +1 -1
  63. package/dist/options/PlatformSpecificBuildOptions.js.map +1 -1
  64. package/dist/options/SnapOptions.d.ts +36 -15
  65. package/dist/options/SnapOptions.d.ts.map +1 -1
  66. package/dist/options/SnapOptions.js.map +1 -1
  67. package/dist/options/linuxOptions.d.ts +53 -18
  68. package/dist/options/linuxOptions.d.ts.map +1 -1
  69. package/dist/options/linuxOptions.js.map +1 -1
  70. package/dist/options/macOptions.d.ts +15 -1
  71. package/dist/options/macOptions.d.ts.map +1 -1
  72. package/dist/options/macOptions.js.map +1 -1
  73. package/dist/options/winOptions.d.ts +7 -4
  74. package/dist/options/winOptions.d.ts.map +1 -1
  75. package/dist/options/winOptions.js.map +1 -1
  76. package/dist/packager.d.ts +2 -0
  77. package/dist/packager.d.ts.map +1 -1
  78. package/dist/packager.js +6 -0
  79. package/dist/packager.js.map +1 -1
  80. package/dist/platformPackager.d.ts +11 -4
  81. package/dist/platformPackager.d.ts.map +1 -1
  82. package/dist/platformPackager.js +53 -18
  83. package/dist/platformPackager.js.map +1 -1
  84. package/dist/presets/rectCra.js +3 -1
  85. package/dist/presets/rectCra.js.map +1 -1
  86. package/dist/publish/PublishManager.d.ts +6 -1
  87. package/dist/publish/PublishManager.d.ts.map +1 -1
  88. package/dist/publish/PublishManager.js +80 -58
  89. package/dist/publish/PublishManager.js.map +1 -1
  90. package/dist/publish/updateInfoBuilder.d.ts.map +1 -1
  91. package/dist/publish/updateInfoBuilder.js +8 -10
  92. package/dist/publish/updateInfoBuilder.js.map +1 -1
  93. package/dist/targets/ArchiveTarget.d.ts.map +1 -1
  94. package/dist/targets/ArchiveTarget.js +7 -1
  95. package/dist/targets/ArchiveTarget.js.map +1 -1
  96. package/dist/targets/archive.d.ts +12 -0
  97. package/dist/targets/archive.d.ts.map +1 -1
  98. package/dist/targets/archive.js +17 -3
  99. package/dist/targets/archive.js.map +1 -1
  100. package/dist/targets/blockmap/blockmap.d.ts +3 -2
  101. package/dist/targets/blockmap/blockmap.d.ts.map +1 -1
  102. package/dist/targets/blockmap/blockmap.js +3 -2
  103. package/dist/targets/blockmap/blockmap.js.map +1 -1
  104. package/dist/targets/differentialUpdateInfoBuilder.d.ts.map +1 -1
  105. package/dist/targets/differentialUpdateInfoBuilder.js +4 -0
  106. package/dist/targets/differentialUpdateInfoBuilder.js.map +1 -1
  107. package/dist/targets/linux/FlatpakTarget.d.ts +17 -0
  108. package/dist/targets/linux/FlatpakTarget.d.ts.map +1 -1
  109. package/dist/targets/linux/FlatpakTarget.js +238 -48
  110. package/dist/targets/linux/FlatpakTarget.js.map +1 -1
  111. package/dist/targets/linux/FpmTarget.d.ts.map +1 -1
  112. package/dist/targets/linux/FpmTarget.js +10 -14
  113. package/dist/targets/linux/FpmTarget.js.map +1 -1
  114. package/dist/targets/linux/LinuxTargetHelper.d.ts +1 -3
  115. package/dist/targets/linux/LinuxTargetHelper.d.ts.map +1 -1
  116. package/dist/targets/linux/LinuxTargetHelper.js +45 -20
  117. package/dist/targets/linux/LinuxTargetHelper.js.map +1 -1
  118. package/dist/targets/linux/appimage/AppImageTarget.d.ts.map +1 -1
  119. package/dist/targets/linux/appimage/AppImageTarget.js +5 -1
  120. package/dist/targets/linux/appimage/AppImageTarget.js.map +1 -1
  121. package/dist/targets/linux/appimage/appImageUtil.d.ts +3 -1
  122. package/dist/targets/linux/appimage/appImageUtil.d.ts.map +1 -1
  123. package/dist/targets/linux/appimage/appImageUtil.js +2 -2
  124. package/dist/targets/linux/appimage/appImageUtil.js.map +1 -1
  125. package/dist/targets/linux/appimage/appLauncher.d.ts +6 -0
  126. package/dist/targets/linux/appimage/appLauncher.d.ts.map +1 -1
  127. package/dist/targets/linux/appimage/appLauncher.js +13 -9
  128. package/dist/targets/linux/appimage/appLauncher.js.map +1 -1
  129. package/dist/targets/linux/flatpakBundle.d.ts +43 -0
  130. package/dist/targets/linux/flatpakBundle.d.ts.map +1 -0
  131. package/dist/targets/linux/flatpakBundle.js +210 -0
  132. package/dist/targets/linux/flatpakBundle.js.map +1 -0
  133. package/dist/targets/linux/snap/core24.d.ts +0 -18
  134. package/dist/targets/linux/snap/core24.d.ts.map +1 -1
  135. package/dist/targets/linux/snap/core24.js +29 -100
  136. package/dist/targets/linux/snap/core24.js.map +1 -1
  137. package/dist/targets/linux/snap/coreLegacy.d.ts +7 -0
  138. package/dist/targets/linux/snap/coreLegacy.d.ts.map +1 -1
  139. package/dist/targets/linux/snap/coreLegacy.js +25 -6
  140. package/dist/targets/linux/snap/coreLegacy.js.map +1 -1
  141. package/dist/targets/linux/snap/snapPlugs.d.ts +76 -0
  142. package/dist/targets/linux/snap/snapPlugs.d.ts.map +1 -0
  143. package/dist/targets/linux/snap/snapPlugs.js +242 -0
  144. package/dist/targets/linux/snap/snapPlugs.js.map +1 -0
  145. package/dist/targets/mac/MacTargetHelper.d.ts +6 -0
  146. package/dist/targets/mac/MacTargetHelper.d.ts.map +1 -1
  147. package/dist/targets/mac/MacTargetHelper.js +47 -3
  148. package/dist/targets/mac/MacTargetHelper.js.map +1 -1
  149. package/dist/targets/mac/pkg.d.ts.map +1 -1
  150. package/dist/targets/mac/pkg.js +1 -0
  151. package/dist/targets/mac/pkg.js.map +1 -1
  152. package/dist/targets/win/nsis/Defines.d.ts +1 -0
  153. package/dist/targets/win/nsis/Defines.d.ts.map +1 -1
  154. package/dist/targets/win/nsis/Defines.js.map +1 -1
  155. package/dist/targets/win/nsis/NsisTarget.d.ts +8 -1
  156. package/dist/targets/win/nsis/NsisTarget.d.ts.map +1 -1
  157. package/dist/targets/win/nsis/NsisTarget.js +36 -5
  158. package/dist/targets/win/nsis/NsisTarget.js.map +1 -1
  159. package/dist/targets/win/nsis/nsisOptions.d.ts +6 -4
  160. package/dist/targets/win/nsis/nsisOptions.d.ts.map +1 -1
  161. package/dist/targets/win/nsis/nsisOptions.js.map +1 -1
  162. package/dist/targets/win/nsis/nsisUtil.d.ts.map +1 -1
  163. package/dist/targets/win/nsis/nsisUtil.js +7 -2
  164. package/dist/targets/win/nsis/nsisUtil.js.map +1 -1
  165. package/dist/targets/win/winAppUtil.d.ts +2 -2
  166. package/dist/targets/win/winAppUtil.d.ts.map +1 -1
  167. package/dist/targets/win/winAppUtil.js +5 -3
  168. package/dist/targets/win/winAppUtil.js.map +1 -1
  169. package/dist/toolsets/appimage.d.ts.map +1 -1
  170. package/dist/toolsets/appimage.js +19 -19
  171. package/dist/toolsets/appimage.js.map +1 -1
  172. package/dist/toolsets/nsis.js +1 -1
  173. package/dist/toolsets/nsis.js.map +1 -1
  174. package/dist/toolsets/winCodeSign.d.ts +14 -1
  175. package/dist/toolsets/winCodeSign.d.ts.map +1 -1
  176. package/dist/toolsets/winCodeSign.js +14 -1
  177. package/dist/toolsets/winCodeSign.js.map +1 -1
  178. package/dist/util/AppFileWalker.js +9 -1
  179. package/dist/util/AppFileWalker.js.map +1 -1
  180. package/dist/util/appFileCopier.d.ts +15 -2
  181. package/dist/util/appFileCopier.d.ts.map +1 -1
  182. package/dist/util/appFileCopier.js +30 -20
  183. package/dist/util/appFileCopier.js.map +1 -1
  184. package/dist/util/config/config.d.ts +1 -1
  185. package/dist/util/config/config.d.ts.map +1 -1
  186. package/dist/util/config/config.js +42 -19
  187. package/dist/util/config/config.js.map +1 -1
  188. package/dist/util/config/fileOptions.d.ts +52 -0
  189. package/dist/util/config/fileOptions.d.ts.map +1 -0
  190. package/dist/util/config/fileOptions.js +210 -0
  191. package/dist/util/config/fileOptions.js.map +1 -0
  192. package/dist/util/config/legacyConfigGuard.d.ts.map +1 -1
  193. package/dist/util/config/legacyConfigGuard.js +31 -4
  194. package/dist/util/config/legacyConfigGuard.js.map +1 -1
  195. package/dist/util/config/legacyOptions.d.ts +11 -0
  196. package/dist/util/config/legacyOptions.d.ts.map +1 -1
  197. package/dist/util/config/legacyOptions.js +36 -10
  198. package/dist/util/config/legacyOptions.js.map +1 -1
  199. package/dist/util/electronGet.d.ts +13 -0
  200. package/dist/util/electronGet.d.ts.map +1 -1
  201. package/dist/util/electronGet.js +40 -17
  202. package/dist/util/electronGet.js.map +1 -1
  203. package/dist/util/removedEnvVars.d.ts +25 -0
  204. package/dist/util/removedEnvVars.d.ts.map +1 -0
  205. package/dist/util/removedEnvVars.js +54 -0
  206. package/dist/util/removedEnvVars.js.map +1 -0
  207. package/dist/util/trustedSourceRoots.d.ts +59 -0
  208. package/dist/util/trustedSourceRoots.d.ts.map +1 -0
  209. package/dist/util/trustedSourceRoots.js +127 -0
  210. package/dist/util/trustedSourceRoots.js.map +1 -0
  211. package/dist/version.d.ts +1 -1
  212. package/dist/version.js +1 -1
  213. package/dist/version.js.map +1 -1
  214. package/package.json +18 -17
  215. package/scheme.json +421 -436
  216. package/templates/nsis/include/installer.nsh +11 -8
  217. package/templates/nsis/installSection.nsh +5 -0
@@ -0,0 +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,MAAM,cAAc,CAAA;AACnE,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,oBAAoB,EAAE,MAAM,oCAAoC,CAAA;AAEzE,0IAA0I;AAC1I,sGAAsG;AACtG,MAAM,YAAY,GAAG,EAAE,OAAO,EAAE,QAAQ,EAAE,iBAAiB,EAAE,OAAO,EAAE,CAAA;AAEtE,+EAA+E;AAC/E,MAAM,+BAA+B,GAAG,OAAO,CAAA;AAC/C,MAAM,+BAA+B,GAAG,QAAQ,CAAA;AAEhD,MAAM,UAAU,GAAG,4CAA4C,oBAAoB,+BAA+B,CAAA;AAElH,MAAM,YAAY,GAAG,yCAAyC,CAAA;AAC9D,MAAM,4BAA4B,GAAG,GAAG,YAAY,sCAAsC,CAAA;AAuC1F;;;GAGG;AACH,SAAS,MAAM,CAAC,GAAG,KAA4C;IAC7D,OAAO,CAAC,CAAQ,EAAS,EAAE;QACzB,MAAM,IAAI,GAAG,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,MAAM,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,OAAO,CAAC,QAAQ,CAAC,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AI,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"]}
@@ -22,23 +22,6 @@ export declare class SnapCore24 extends SnapCore<SnapOptions24> {
22
22
  }): Promise<string[]>;
23
23
  /** Converts `SnapOptions24` into a fully resolved `SnapcraftYAML` descriptor for the given architecture. */
24
24
  mapSnapOptionsToSnapcraftYAML(arch: Arch): Promise<SnapcraftYAML>;
25
- /**
26
- * Resolve the root-level plug definitions and the app-level plug references for the build flavor.
27
- *
28
- * Explicitly configured plugs always win — they are kept even under classic confinement
29
- * (with the warning logged in mapSnapOptionsToSnapcraftYAML). Otherwise:
30
- * - classic confinement: no plugs at all — the snap store review rejects classic snaps that declare plugs
31
- * - GNOME extension: no defaults — the extension supplies the common plugs and content snaps
32
- * (gnome-46-2404, gtk-3-themes, icon-themes, sound-themes) itself
33
- * - host/destructive mode: app-level default plugs only, no content-snap root plugs
34
- * - default (strict, no extension): manual content-snap root plugs plus the app-level default plugs
35
- */
36
- private resolvePlugs;
37
- /**
38
- * Default root-level content-snap plugs used without the GNOME extension, wiring up the
39
- * GNOME platform, theme, and GPU content snaps manually.
40
- */
41
- private buildDefaultRootPlugs;
42
25
  /**
43
26
  * Resolve the snap-wide layout for the build flavor.
44
27
  *
@@ -73,7 +56,6 @@ export declare class SnapCore24 extends SnapCore<SnapOptions24> {
73
56
  root: Record<string, unknown> | undefined;
74
57
  app: string[] | undefined;
75
58
  };
76
- private isBrowserSandboxAllowed;
77
59
  /**
78
60
  * Expand "default" keyword in arrays of anything
79
61
  */
@@ -1 +1 @@
1
- {"version":3,"file":"core24.d.ts","sourceRoot":"","sources":["../../../../src/targets/linux/snap/core24.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAA6F,MAAM,cAAc,CAAA;AAE9H,OAAO,EAA0B,OAAO,EAAE,MAAM,sBAAsB,CAAA;AAItE,OAAO,EAAE,cAAc,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,iCAAiC,CAAA;AAC/F,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAA;AAE1C,OAAO,EAAa,aAAa,EAAE,MAAM,gBAAgB,CAAA;AAUzD,wGAAwG;AACxG,qBAAa,UAAW,SAAQ,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B;IA0B1B;;OAEG;YACW,YAAY;IAgC1B;;OAEG;IACH,oBAAoB,CAAC,OAAO,EAAE,KAAK,CAAC,MAAM,CAAC,GAAG,MAAM,GAAG,OAAO,GAAG,MAAM,EAAE,GAAG,SAAS;IAUrF;;OAEG;IACH,kBAAkB,CAAC,CAAC,SAAS,KAAK,CAAC,MAAM,GAAG,cAAc,GAAG,cAAc,CAAC,GAAG,cAAc,GAAG,cAAc,GAAG,IAAI,EACnH,KAAK,EAAE,CAAC,GACP;QACD,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,SAAS,CAAA;QACzC,GAAG,EAAE,MAAM,EAAE,GAAG,SAAS,CAAA;KAC1B;IAwCD;;OAEG;IACH,OAAO,CAAC,qBAAqB;CAI9B"}
@@ -1,11 +1,14 @@
1
- import { archFromString, copyDir, InvalidConfigurationError, log, removeNullish, toLinuxArchString } from "builder-util";
1
+ import { archFromString, copyDir, InvalidConfigurationError, log, prepareFixedNameWrite, removeNullish, toLinuxArchString } from "builder-util";
2
+ import { expandDefaultKeyword } from "builder-util/internal";
2
3
  import { deepAssign, isValidKey } from "builder-util-runtime";
3
4
  import _fsExtra from "fs-extra";
4
5
  import * as yaml from "js-yaml";
5
6
  import * as path from "path";
6
7
  import { SnapCore } from "./SnapTarget.js";
8
+ import { getStagingCopyLinkOptions } from "../../../util/trustedSourceRoots.js";
7
9
  import { buildSnapCommandLauncherScript } from "./snapCommand.js";
8
10
  import { buildSnap, DEFAULT_STAGE_PACKAGES, SNAPCRAFT_YAML_OPTIONS } from "./snapcraftBuilder.js";
11
+ import { CORE24_DEFAULT_APP_PLUGS, isBrowserSandboxAllowed, resolveCore24Plugs, warnAboutAllowSandboxPlugs, warnAboutCore24DefaultPlugsExpansion, warnAboutCore24NoSandboxDefault, } from "./snapPlugs.js";
9
12
  const { chmod, copy, mkdir, readdir, remove, writeFile } = _fsExtra;
10
13
  // Electron's setuid sandbox helper. Removed from the staged app when the snap runs with
11
14
  // `--no-sandbox` (snap confinement supplies its own sandbox via the browser-support interface).
@@ -16,9 +19,9 @@ const SNAP_COMMAND_LAUNCHER = "command.sh";
16
19
  export class SnapCore24 extends SnapCore {
17
20
  constructor() {
18
21
  super(...arguments);
19
- // browser-support is intentionally absent here; it is auto-injected in mapSnapOptionsToSnapcraftYAML
20
- // when the user has not provided custom plugs, so it always lands in both root plugs and app plugs.
21
- this.defaultPlugs = ["desktop", "desktop-legacy", "home", "x11", "wayland", "unity7", "network", "gsettings", "audio-playback", "pulseaudio", "opengl"];
22
+ // App-level default plugs. browser-support is intentionally absent here; resolveCore24Plugs adds it (without
23
+ // allow-sandbox) to both the root and app plugs whenever the defaults apply.
24
+ this.defaultPlugs = [...CORE24_DEFAULT_APP_PLUGS];
22
25
  // Snap file hierarchy:
23
26
  // - snap/gui/ gets automatically copied to meta/gui/ in the final snap
24
27
  // - Desktop files in meta/gui/ are used for menu integration
@@ -69,7 +72,7 @@ export class SnapCore24 extends SnapCore {
69
72
  const appDir = path.resolve(stageDir, "app");
70
73
  if (path.resolve(appDir) !== path.resolve(appOutDir)) {
71
74
  log.debug({ to: log.filePath(appDir), from: log.filePath(appOutDir) }, "copying app files to project root app directory");
72
- await copyDir(appOutDir, appDir);
75
+ await copyDir(appOutDir, appDir, await getStagingCopyLinkOptions(this.packager));
73
76
  }
74
77
  // Drop the setuid chrome-sandbox helper before snapcraft stages the app — it is unusable under
75
78
  // strict confinement when launching with --no-sandbox (mirrors SnapCoreLegacy).
@@ -79,6 +82,8 @@ export class SnapCore24 extends SnapCore {
79
82
  // Write the launcher script the command always points at (see SNAP_COMMAND_LAUNCHER).
80
83
  // It lands at the snap root ($SNAP/command.sh) — it is intentionally not added to `organize`.
81
84
  const launcherPath = path.join(appDir, SNAP_COMMAND_LAUNCHER);
85
+ // the app files were just copied there: replace, never follow, a symlink at the name
86
+ await prepareFixedNameWrite(stageDir, launcherPath, "snap command launcher");
82
87
  await writeFile(launcherPath, buildSnapCommandLauncherScript({ execName: this.packager.executableName, args: this.commandArgs }), { mode: 0o755 });
83
88
  await chmod(launcherPath, 0o755);
84
89
  // Auto-generate `organize` mapping for the app part so top-level helper
@@ -162,7 +167,7 @@ export class SnapCore24 extends SnapCore {
162
167
  ` required stage-packages manually.\n` +
163
168
  ` 2. Switch to an isolated build environment by setting snapcraft.core24.useLXD: true\n` +
164
169
  ` or snapcraft.core24.useMultipass: true instead of useDestructiveMode.\n\n` +
165
- `See: https://snapcraft.io/docs/gnome-extension`);
170
+ `See: https://documentation.ubuntu.com/snapcraft/stable/reference/extensions/gnome-extension/`);
166
171
  }
167
172
  const resolvedExtensions = extensionsList.length > 0 ? extensionsList : undefined;
168
173
  const useGnomeExtension = extensionsList.includes("gnome");
@@ -182,35 +187,37 @@ export class SnapCore24 extends SnapCore {
182
187
  after: this.expandDefaultsInArray(options.after, []),
183
188
  stage: options.appPartStage?.length ? options.appPartStage : undefined,
184
189
  };
185
- // Process plugs and slots (see resolvePlugs for the per-build-flavor rules)
186
- let { root: rootPlugs, app: appPlugs } = this.resolvePlugs(options, isClassic, hostMode, useGnomeExtension);
187
- // Always add browser-support with allow-sandbox so Chromium's internal sandbox
188
- // can create user namespaces under strict confinement. Without allow-sandbox: true
189
- // the app crashes immediately with "FATAL: Permission denied (13)" in credentials.cc.
190
- // Skip the injection when the user has explicitly provided their own plugs
191
- // (they are responsible for including browser-support in that case) and for
192
- // classic confinement, where plugs must not be declared at all.
193
- if (!options.plugs && !isClassic) {
194
- rootPlugs = { ...rootPlugs, "browser-support": { interface: "browser-support", "allow-sandbox": true } };
195
- if (!appPlugs?.includes("browser-support")) {
196
- appPlugs = [...(appPlugs ?? []), "browser-support"];
197
- }
190
+ // Process plugs and slots (see resolveCore24Plugs for the per-build-flavor rules).
191
+ // The defaults request plain browser-support, never allow-sandbox: the Snap Store reserves that
192
+ // attribute for vetted publishers. Without it the app is launched with --no-sandbox below, which is
193
+ // what keeps Chromium from aborting in credentials.cc under strict confinement (see #9659).
194
+ const plugFlavor = isClassic ? "classic" : useGnomeExtension ? "gnome-extension" : hostMode ? "host" : "strict";
195
+ const plugResolution = resolveCore24Plugs(options.plugs, plugFlavor, this.defaultPlugs);
196
+ const { root: rootPlugs, app: appPlugs } = plugResolution;
197
+ warnAboutAllowSandboxPlugs(rootPlugs, "snapcraft.core24.plugs", this.packager);
198
+ if (plugResolution.source === "merged") {
199
+ warnAboutCore24DefaultPlugsExpansion(plugResolution.addedByDefaultExpansion, this.packager);
198
200
  }
199
201
  const { root: rootSlots, app: appSlots } = options.slots ? this.processPlugOrSlots(options.slots) : { root: undefined, app: undefined };
200
202
  // Build the effective arg list for the snap command.
201
203
  // Start with any user-supplied executableArgs, then conditionally add --no-sandbox
202
204
  // if browser-support with allow-sandbox:true is not present in the resolved plugs
203
- // (mirrors the same logic in SnapCoreLegacy.buildSnap).
205
+ // (mirrors the same logic in SnapCoreLegacy.buildSnap). Only a user-configured plug can request
206
+ // allow-sandbox; the generated defaults never do.
204
207
  const extraArgs = [...(this.options.executableArgs ?? [])];
205
208
  if (this.options.forceX11 === true) {
206
209
  if (!extraArgs.includes("--ozone-platform=x11")) {
207
210
  extraArgs.push("--ozone-platform=x11");
208
211
  }
209
212
  }
210
- const noSandbox = this.helper.isElectronVersionGreaterOrEqualThan("5.0.0") && !this.isBrowserSandboxAllowed(rootPlugs);
213
+ const noSandbox = this.helper.isElectronVersionGreaterOrEqualThan("5.0.0") && !isBrowserSandboxAllowed(rootPlugs);
211
214
  if (noSandbox && !extraArgs.includes("--no-sandbox")) {
212
215
  extraArgs.push("--no-sandbox");
213
216
  }
217
+ // electron-builder <= 26 generated browser-support with allow-sandbox, which kept Chromium's sandbox.
218
+ if (noSandbox && plugResolution.source === "generated" && plugFlavor !== "classic") {
219
+ warnAboutCore24NoSandboxDefault(this.packager);
220
+ }
214
221
  // With --no-sandbox the setuid chrome-sandbox helper is unused; strip it from the snap.
215
222
  this.removeChromeSandbox = noSandbox;
216
223
  // The command always points at a generated launcher script (written in buildSnap). This keeps a
@@ -287,65 +294,6 @@ export class SnapCore24 extends SnapCore {
287
294
  };
288
295
  return removeNullish(snapcraft);
289
296
  }
290
- /**
291
- * Resolve the root-level plug definitions and the app-level plug references for the build flavor.
292
- *
293
- * Explicitly configured plugs always win — they are kept even under classic confinement
294
- * (with the warning logged in mapSnapOptionsToSnapcraftYAML). Otherwise:
295
- * - classic confinement: no plugs at all — the snap store review rejects classic snaps that declare plugs
296
- * - GNOME extension: no defaults — the extension supplies the common plugs and content snaps
297
- * (gnome-46-2404, gtk-3-themes, icon-themes, sound-themes) itself
298
- * - host/destructive mode: app-level default plugs only, no content-snap root plugs
299
- * - default (strict, no extension): manual content-snap root plugs plus the app-level default plugs
300
- */
301
- resolvePlugs(options, isClassic, hostMode, useGnomeExtension) {
302
- if (options.plugs) {
303
- return this.processPlugOrSlots(options.plugs);
304
- }
305
- if (isClassic) {
306
- return { root: undefined, app: undefined };
307
- }
308
- if (useGnomeExtension) {
309
- return { root: undefined, app: undefined };
310
- }
311
- if (hostMode) {
312
- return { root: undefined, app: this.defaultPlugs };
313
- }
314
- return { root: this.buildDefaultRootPlugs(), app: this.defaultPlugs };
315
- }
316
- /**
317
- * Default root-level content-snap plugs used without the GNOME extension, wiring up the
318
- * GNOME platform, theme, and GPU content snaps manually.
319
- */
320
- buildDefaultRootPlugs() {
321
- return {
322
- "gtk-3-themes": {
323
- interface: "content",
324
- target: "$SNAP/data-dir/themes",
325
- "default-provider": "gtk-common-themes",
326
- },
327
- "icon-themes": {
328
- interface: "content",
329
- target: "$SNAP/data-dir/icons",
330
- "default-provider": "gtk-common-themes",
331
- },
332
- "sound-themes": {
333
- interface: "content",
334
- target: "$SNAP/data-dir/sounds",
335
- "default-provider": "gtk-common-themes",
336
- },
337
- "gnome-46-2404": {
338
- interface: "content",
339
- target: "$SNAP/gnome-platform",
340
- "default-provider": "gnome-46-2404",
341
- },
342
- "gpu-2404": {
343
- interface: "content",
344
- target: "$SNAP/gpu-2404",
345
- "default-provider": "mesa-2404",
346
- },
347
- };
348
- }
349
297
  /**
350
298
  * Resolve the snap-wide layout for the build flavor.
351
299
  *
@@ -490,30 +438,11 @@ export class SnapCore24 extends SnapCore {
490
438
  }
491
439
  return { root: Object.keys(root).length > 0 ? root : undefined, app: app.length > 0 ? app : undefined };
492
440
  }
493
- isBrowserSandboxAllowed(plugs) {
494
- if (!plugs) {
495
- return false;
496
- }
497
- for (const plug of Object.values(plugs)) {
498
- if (plug?.interface === "browser-support" && plug["allow-sandbox"] === true) {
499
- return true;
500
- }
501
- }
502
- return false;
503
- }
504
441
  /**
505
442
  * Expand "default" keyword in arrays of anything
506
443
  */
507
444
  expandDefaultsInArray(items, defaults) {
508
- const result = [];
509
- for (const item of items ?? []) {
510
- if (typeof item === "string" && item === "default") {
511
- result.push(...defaults);
512
- }
513
- else {
514
- result.push(item);
515
- }
516
- }
445
+ const result = expandDefaultKeyword(items ?? [], defaults);
517
446
  return result.length > 0 ? result : undefined;
518
447
  }
519
448
  }
@@ -1 +1 @@
1
- {"version":3,"file":"core24.js","sourceRoot":"","sources":["../../../../src/targets/linux/snap/core24.ts"],"names":[],"mappings":"AAAA,OAAO,EAAQ,cAAc,EAAE,OAAO,EAAE,yBAAyB,EAAE,GAAG,EAAE,aAAa,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAA;AAE9H,OAAO,EAAE,UAAU,EAAE,UAAU,EAAW,MAAM,sBAAsB,CAAA;AACtE,OAAO,QAAQ,MAAM,UAAU,CAAA;AAC/B,OAAO,KAAK,IAAI,MAAM,SAAS,CAAA;AAC/B,OAAO,KAAK,IAAI,MAAM,MAAM,CAAA;AAE5B,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAA;AAC1C,OAAO,EAAE,8BAA8B,EAAE,MAAM,kBAAkB,CAAA;AAEjE,OAAO,EAAE,SAAS,EAAE,sBAAsB,EAAE,sBAAsB,EAAE,MAAM,uBAAuB,CAAA;AACjG,MAAM,EAAE,KAAK,EAAE,IAAI,EAAE,K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A;gBAChB,CAAC,CAAC,CAAA;YACJ,CAAC;QACH,CAAC;QAED,OAAO,EAAE,IAAI,EAAE,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,SAAS,EAAE,GAAG,EAAE,GAAG,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,SAAS,EAAE,CAAA;IACzG,CAAC;IAEO,uBAAuB,CAAC,KAAsC;QACpE,IAAI,CAAC,KAAK,EAAE,CAAC;YACX,OAAO,KAAK,CAAA;QACd,CAAC;QACD,KAAK,MAAM,IAAI,IAAI,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,EAAE,CAAC;YACxC,IAAI,IAAI,EAAE,SAAS,KAAK,iBAAiB,IAAI,IAAI,CAAC,eAAe,CAAC,KAAK,IAAI,EAAE,CAAC;gBAC5E,OAAO,IAAI,CAAA;YACb,CAAC;QACH,CAAC;QACD,OAAO,KAAK,CAAA;IACd,CAAC;IAED;;OAEG;IACK,qBAAqB,CAAI,KAAoB,EAAE,QAAa;QAClE,MAAM,MAAM,GAAa,EAAE,CAAA;QAC3B,KAAK,MAAM,IAAI,IAAI,KAAK,IAAI,EAAE,EAAE,CAAC;YAC/B,IAAI,OAAO,IAAI,KAAK,QAAQ,IAAI,IAAI,KAAK,SAAS,EAAE,CAAC;gBACnD,MAAM,CAAC,IAAI,CAAC,GAAG,QAAQ,CAAC,CAAA;YAC1B,CAAC;iBAAM,CAAC;gBACN,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;YACnB,CAAC;QACH,CAAC;QACD,OAAO,MAAM,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,SAAS,CAAA;IAC/C,CAAC;CACF","sourcesContent":["import { Arch, archFromString, copyDir, InvalidConfigurationError, log, removeNullish, toLinuxArchString } from \"builder-util\"\n\nimport { deepAssign, isValidKey, Nullish } from \"builder-util-runtime\"\nimport _fsExtra from \"fs-extra\"\nimport * as yaml from \"js-yaml\"\nimport * as path from \"path\"\nimport { PlugDescriptor, SlotDescriptor, SnapOptions24 } from \"../../../options/SnapOptions.js\"\nimport { SnapCore } from \"./SnapTarget.js\"\nimport { buildSnapCommandLauncherScript } from \"./snapCommand.js\"\nimport { App, Part, SnapcraftYAML } from \"./snapcraft.js\"\nimport { buildSnap, DEFAULT_STAGE_PACKAGES, SNAPCRAFT_YAML_OPTIONS } from \"./snapcraftBuilder.js\"\nconst { chmod, copy, mkdir, readdir, remove, writeFile } = _fsExtra\n\n// Electron's setuid sandbox helper. Removed from the staged app when the snap runs with\n// `--no-sandbox` (snap confinement supplies its own sandbox via the browser-support interface).\nconst CHROME_SANDBOX = \"chrome-sandbox\"\n// Launcher script name used when the app command cannot be expressed inline (see resolveSnapCommand).\nconst SNAP_COMMAND_LAUNCHER = \"command.sh\"\n\n/** Snap build strategy for core24 — generates a native snapcraft.yaml and invokes the snapcraft CLI. */\nexport class SnapCore24 extends SnapCore<SnapOptions24> {\n // browser-support is intentionally absent here; it is auto-injected in mapSnapOptionsToSnapcraftYAML\n // when the user has not provided custom plugs, so it always lands in both root plugs and app plugs.\n defaultPlugs = [\"desktop\", \"desktop-legacy\", \"home\", \"x11\", \"wayland\", \"unity7\", \"network\", \"gsettings\", \"audio-playback\", \"pulseaudio\", \"opengl\"]\n\n // Snap file hierarchy:\n // - snap/gui/ gets automatically copied to meta/gui/ in the final snap\n // - Desktop files in meta/gui/ are used for menu integration\n readonly configRelativePath = \"snap\"\n readonly guiRelativePath = path.join(this.configRelativePath, \"gui\")\n\n // Computed in createDescriptor (mapSnapOptionsToSnapcraftYAML) and consumed in buildSnap.\n // getSnapCore() returns a fresh SnapCore24 per arch build, so this per-instance state is\n // never shared across builds.\n private removeChromeSandbox = false\n // Args embedded into the generated launcher script (executableArgs + forceX11/no-sandbox flags).\n private commandArgs: string[] = []\n\n async createDescriptor(arch: Arch): Promise<SnapcraftYAML> {\n return await this.mapSnapOptionsToSnapcraftYAML(arch)\n }\n\n private isHostMode(): boolean {\n return this.options.useDestructiveMode === true\n }\n\n /** Writes the snapcraft.yaml, stages app files, then invokes `buildSnap()` to run the actual snapcraft build. */\n async buildSnap(params: { snap: SnapcraftYAML; appOutDir: string; stageDir: string; snapArch: Arch; artifactPath: string }): Promise<string[]> {\n const { snap, appOutDir, stageDir, artifactPath } = params\n\n const snapDirResolved = path.resolve(stageDir, this.configRelativePath)\n const snapcraftYamlPath = path.join(snapDirResolved, \"snapcraft.yaml\")\n\n // Create snap/gui directory for desktop files and icons\n // Snapcraft will automatically copy snap/gui/ contents to meta/gui/ in the final snap\n const guiOutput = path.resolve(stageDir, this.guiRelativePath)\n await mkdir(guiOutput, { recursive: true })\n\n const yamlContent = yaml.dump(snap, SNAPCRAFT_YAML_OPTIONS)\n await writeFile(snapcraftYamlPath, yamlContent, \"utf8\")\n log.debug(snap, \"generated snapcraft.yaml\")\n\n // Copy icon to snap/gui/ directory\n // Snapcraft will automatically copy this to meta/gui/ in the final snap\n const desktopExtraProps: Record<string, string> = {}\n const icon = this.helper.maxIconPath\n if (icon) {\n const iconFileName = `${snap.name}${path.extname(icon)}`\n await copy(icon, path.join(guiOutput, iconFileName))\n // Icon path will be available at ${SNAP}/meta/gui/<icon-file> after installation\n desktopExtraProps.Icon = `\\${SNAP}/meta/gui/${iconFileName}`\n }\n\n // Create desktop file in snap/gui/ directory\n // Snapcraft will automatically copy this to meta/gui/ in the final snap\n const desktopFilePath = path.join(guiOutput, `${this.helper.getDesktopFileName(snap.name)}.desktop`)\n await this.helper.writeDesktopEntry(this.options, snap.name + \" %U\", desktopFilePath, desktopExtraProps)\n\n // Copy app files to the project root `app` directory so `source: app`\n // in the generated `snapcraft.yaml` (which is under `snap/`) can be\n // resolved by snapcraft running in the build environment.\n const appDir = path.resolve(stageDir, \"app\")\n if (path.resolve(appDir) !== path.resolve(appOutDir)) {\n log.debug({ to: log.filePath(appDir), from: log.filePath(appOutDir) }, \"copying app files to project root app directory\")\n await copyDir(appOutDir, appDir)\n }\n\n // Drop the setuid chrome-sandbox helper before snapcraft stages the app — it is unusable under\n // strict confinement when launching with --no-sandbox (mirrors SnapCoreLegacy).\n if (this.removeChromeSandbox) {\n await remove(path.join(appDir, CHROME_SANDBOX))\n }\n\n // Write the launcher script the command always points at (see SNAP_COMMAND_LAUNCHER).\n // It lands at the snap root ($SNAP/command.sh) — it is intentionally not added to `organize`.\n const launcherPath = path.join(appDir, SNAP_COMMAND_LAUNCHER)\n await writeFile(launcherPath, buildSnapCommandLauncherScript({ execName: this.packager.executableName, args: this.commandArgs }), { mode: 0o755 })\n await chmod(launcherPath, 0o755)\n\n // Auto-generate `organize` mapping for the app part so top-level helper\n // binaries and resources are placed under `app/` inside the snap. Update\n // the already-written `snapcraft.yaml` so the build sees the mapping.\n try {\n const appPart = snap.parts[snap.name]\n if (appPart) {\n const entries = (await readdir(appOutDir)).sort()\n // Null-prototype map: entry names come from the filesystem, so a top-level file named\n // \"__proto__\" / \"constructor\" / \"toString\" must not read inherited keys (which would make\n // the membership check below skip it) or interact with Object.prototype on assignment.\n const organize: Record<string, string> = Object.assign(Object.create(null), appPart.organize)\n for (const entry of entries) {\n if (!entry) {\n continue\n }\n // Skip files no longer present in the staged app dir (e.g. removed chrome-sandbox) so\n // snapcraft doesn't fail trying to organize a missing source.\n if (this.removeChromeSandbox && entry === CHROME_SANDBOX) {\n continue\n }\n // Never organize the launcher under app/. It must stay at the snap root ($SNAP/command.sh)\n // to match apps.<name>.command. This matters when appOutDir === appDir, where readdir\n // would otherwise pick up the launcher we just wrote.\n if (entry === SNAP_COMMAND_LAUNCHER) {\n continue\n }\n if (organize[entry]) {\n continue\n }\n organize[entry] = `app/${entry}`\n }\n appPart.organize = organize\n\n const updatedYaml = yaml.dump(snap, SNAPCRAFT_YAML_OPTIONS)\n await writeFile(snapcraftYamlPath, updatedYaml, \"utf8\")\n log.debug({ organize }, \"updated snapcraft.yaml with organize mapping\")\n }\n } catch (e: any) {\n log.warn({ error: e.message }, \"failed to generate and update organize mapping\")\n }\n\n const buildMode = {\n useLXD: this.options.useLXD === true,\n useMultipass: this.options.useMultipass === true,\n useDestructiveMode: this.options.useDestructiveMode === true,\n remoteBuild: this.options.remoteBuild || undefined,\n }\n\n if (this.packager.packagerOptions.effectiveOptionComputed != null) {\n const shouldSkip = await this.packager.packagerOptions.effectiveOptionComputed({ snap, desktopFile: desktopFilePath, ...buildMode })\n if (shouldSkip) {\n return [artifactPath]\n }\n }\n\n const rootOptions = this.packager.config.snapcraft\n const snaps = await buildSnap({\n snapcraftConfig: snap,\n artifactPath,\n stageDir,\n packager: this.packager,\n cscLink: rootOptions?.cscLink,\n ...buildMode,\n })\n return snaps\n }\n\n /** Converts `SnapOptions24` into a fully resolved `SnapcraftYAML` descriptor for the given architecture. */\n async mapSnapOptionsToSnapcraftYAML(arch: Arch): Promise<SnapcraftYAML> {\n const appInfo = this.packager.appInfo\n const appName = this.packager.executableName.toLowerCase()\n const options = this.options\n\n // Default to [\"gnome\"] in normal builds; no extensions in host/destructive-mode (where the\n // gnome extension is incompatible). Throw if the user explicitly includes \"gnome\" in host mode.\n const hostMode = this.isHostMode()\n const extensionsList: string[] = options.extensions != null ? [...options.extensions] : hostMode ? [] : [\"gnome\"]\n if (hostMode && extensionsList.includes(\"gnome\")) {\n throw new InvalidConfigurationError(\n `The \"gnome\" snapcraft extension is incompatible with host/destructive-mode builds.\\n` +\n `In this mode snapcraft cannot resolve the extension's command-chain source ` +\n `(/usr/share/snapcraft/extensions/desktop/command-chain) and will fail.\\n\\n` +\n `To resolve this, choose one of:\\n` +\n ` 1. Remove \"gnome\" from snapcraft.core24.extensions (or set it to []) and add any\\n` +\n ` required stage-packages manually.\\n` +\n ` 2. Switch to an isolated build environment by setting snapcraft.core24.useLXD: true\\n` +\n ` or snapcraft.core24.useMultipass: true instead of useDestructiveMode.\\n\\n` +\n `See: https://snapcraft.io/docs/gnome-extension`\n )\n }\n const resolvedExtensions = extensionsList.length > 0 ? extensionsList : undefined\n const useGnomeExtension = extensionsList.includes(\"gnome\")\n\n // Snap store review rejects classic-confinement snaps that declare plugs or layout, so skip\n // the generated defaults for classic (mirrors SnapCoreLegacy). Explicitly configured values\n // are kept, but warn that the store is likely to reject them.\n const isClassic = options.confinement === \"classic\"\n if (isClassic && (options.plugs != null || options.layout != null)) {\n log.warn(\n { confinement: \"classic\", plugs: options.plugs != null, layout: options.layout != null },\n \"classic confinement does not support plugs or layout; keeping the explicitly configured values, but the snap store review is likely to reject them\"\n )\n }\n\n // Create the app part\n const appPart: Part = {\n plugin: \"dump\",\n source: \"app\",\n \"build-packages\": options.buildPackages?.length ? options.buildPackages : undefined,\n \"stage-packages\": this.expandDefaultsInArray(options.stagePackages, DEFAULT_STAGE_PACKAGES),\n after: this.expandDefaultsInArray(options.after, []),\n stage: options.appPartStage?.length ? options.appPartStage : undefined,\n }\n\n // Process plugs and slots (see resolvePlugs for the per-build-flavor rules)\n let { root: rootPlugs, app: appPlugs }: { root: Record<string, any> | undefined; app: string[] | undefined } = this.resolvePlugs(\n options,\n isClassic,\n hostMode,\n useGnomeExtension\n )\n\n // Always add browser-support with allow-sandbox so Chromium's internal sandbox\n // can create user namespaces under strict confinement. Without allow-sandbox: true\n // the app crashes immediately with \"FATAL: Permission denied (13)\" in credentials.cc.\n // Skip the injection when the user has explicitly provided their own plugs\n // (they are responsible for including browser-support in that case) and for\n // classic confinement, where plugs must not be declared at all.\n if (!options.plugs && !isClassic) {\n rootPlugs = { ...rootPlugs, \"browser-support\": { interface: \"browser-support\", \"allow-sandbox\": true } }\n if (!appPlugs?.includes(\"browser-support\")) {\n appPlugs = [...(appPlugs ?? []), \"browser-support\"]\n }\n }\n\n const { root: rootSlots, app: appSlots } = options.slots ? this.processPlugOrSlots(options.slots) : { root: undefined, app: undefined }\n\n // Build the effective arg list for the snap command.\n // Start with any user-supplied executableArgs, then conditionally add --no-sandbox\n // if browser-support with allow-sandbox:true is not present in the resolved plugs\n // (mirrors the same logic in SnapCoreLegacy.buildSnap).\n const extraArgs: string[] = [...(this.options.executableArgs ?? [])]\n if (this.options.forceX11 === true) {\n if (!extraArgs.includes(\"--ozone-platform=x11\")) {\n extraArgs.push(\"--ozone-platform=x11\")\n }\n }\n const noSandbox = this.helper.isElectronVersionGreaterOrEqualThan(\"5.0.0\") && !this.isBrowserSandboxAllowed(rootPlugs)\n if (noSandbox && !extraArgs.includes(\"--no-sandbox\")) {\n extraArgs.push(\"--no-sandbox\")\n }\n // With --no-sandbox the setuid chrome-sandbox helper is unused; strip it from the snap.\n this.removeChromeSandbox = noSandbox\n\n // The command always points at a generated launcher script (written in buildSnap). This keeps a\n // single uniform command path and sidesteps snapd's character/word-splitting rules for the\n // command field (e.g. --ozone-platform=x11, --js-flags=\"...\").\n this.commandArgs = extraArgs\n\n // Create the app configuration\n // apps.desktop would add a second entry beside the generated snap/gui file.\n const desktopBaseName = this.helper.getDesktopFileName(appName)\n const app: App = {\n command: SNAP_COMMAND_LAUNCHER,\n \"command-chain\": undefined, // explicitly undefined so removeNullish strips it; extensions supply their own command-chain\n plugs: appPlugs,\n slots: appSlots,\n autostart: options.autoStart ? `${desktopBaseName}.desktop` : undefined,\n extensions: resolvedExtensions,\n }\n\n // Icon path — build-time relative path so snapcraft can find the file in snap/gui/\n await this.helper.icons\n const iconPath = this.helper.maxIconPath != null ? `snap/gui/${appName}${path.extname(this.helper.maxIconPath)}` : undefined\n\n // Process hooks if configured\n const hooksConfig = options.hooks\n const hooks = hooksConfig ? await this.processHooks(hooksConfig) : undefined\n\n // Parts configuration - the extension automatically adds a gnome/sdk part\n // Don't manually add desktop-launch when using the extension\n const parts: Record<string, Part> = {\n [appName]: appPart,\n }\n\n // Note: `organize` will be generated later in `buildSnap` based on the\n // actual contents of the built app directory so helper binaries and\n // resources are automatically moved under `app/` in the snap.\n\n // Build the snapcraft configuration\n const snapcraft: SnapcraftYAML = {\n // Required fields\n name: appName,\n base: \"core24\",\n confinement: options.confinement || \"strict\",\n parts: parts,\n\n // Architecture/Platform — only needed for cross-compilation; snapcraft 8\n // defaults to host arch and snapcraft 7 rejects this field entirely.\n ...(arch !== archFromString(process.arch)\n ? {\n platforms: {\n [toLinuxArchString(arch, \"snap\")]: {\n \"build-for\": toLinuxArchString(arch, \"snap\"),\n \"build-on\": toLinuxArchString(archFromString(process.arch), \"snap\"),\n },\n },\n }\n : {}),\n\n // Metadata - with fallbacks from appInfo\n version: appInfo.version,\n summary: options.summary || appInfo.productName,\n description: this.helper.getDescription(options),\n grade: options.grade || \"stable\",\n title: options.title || appInfo.productName,\n icon: iconPath,\n\n // Build configuration\n compression: options.compression || undefined,\n assumes: this.normalizeAssumesList(options.assumes),\n\n // Environment\n environment: this.buildEnvironment(options),\n\n // Layout (see resolveLayout for the per-build-flavor rules)\n layout: this.resolveLayout(options, isClassic, hostMode, useGnomeExtension),\n\n // Interfaces\n plugs: rootPlugs,\n slots: rootSlots,\n\n // Hooks\n hooks: hooks,\n\n // Apps\n apps: {\n [appName]: app,\n },\n }\n\n return removeNullish(snapcraft)\n }\n\n /**\n * Resolve the root-level plug definitions and the app-level plug references for the build flavor.\n *\n * Explicitly configured plugs always win — they are kept even under classic confinement\n * (with the warning logged in mapSnapOptionsToSnapcraftYAML). Otherwise:\n * - classic confinement: no plugs at all — the snap store review rejects classic snaps that declare plugs\n * - GNOME extension: no defaults — the extension supplies the common plugs and content snaps\n * (gnome-46-2404, gtk-3-themes, icon-themes, sound-themes) itself\n * - host/destructive mode: app-level default plugs only, no content-snap root plugs\n * - default (strict, no extension): manual content-snap root plugs plus the app-level default plugs\n */\n private resolvePlugs(\n options: SnapOptions24,\n isClassic: boolean,\n hostMode: boolean,\n useGnomeExtension: boolean\n ): { root: Record<string, any> | undefined; app: string[] | undefined } {\n if (options.plugs) {\n return this.processPlugOrSlots(options.plugs)\n }\n if (isClassic) {\n return { root: undefined, app: undefined }\n }\n if (useGnomeExtension) {\n return { root: undefined, app: undefined }\n }\n if (hostMode) {\n return { root: undefined, app: this.defaultPlugs }\n }\n return { root: this.buildDefaultRootPlugs(), app: this.defaultPlugs }\n }\n\n /**\n * Default root-level content-snap plugs used without the GNOME extension, wiring up the\n * GNOME platform, theme, and GPU content snaps manually.\n */\n private buildDefaultRootPlugs(): 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 * Resolve the snap-wide layout for the build flavor.\n *\n * An explicitly configured layout always wins — it is kept even under classic confinement\n * (with the warning logged in mapSnapOptionsToSnapcraftYAML). Otherwise:\n * - classic confinement: no layout — the snap store review rejects classic snaps that declare one\n * - GNOME extension or host/destructive mode: no layout needed\n * - default (strict, no extension): content-snap default layout\n */\n private resolveLayout(options: SnapOptions24, isClassic: boolean, hostMode: boolean, useGnomeExtension: boolean): Record<string, any> | undefined {\n if (options.layout != null) {\n return options.layout\n }\n if (isClassic || useGnomeExtension || hostMode) {\n return undefined\n }\n return this.buildDefaultLayout(options)\n }\n\n /**\n * Build environment variables with proper defaults\n */\n private buildEnvironment(options: SnapOptions24): Record<string, string | null> | undefined {\n const env: Record<string, string | null> = {}\n\n // Add default TMPDIR for Electron/Chromium apps\n if (!options.environment?.TMPDIR) {\n env.TMPDIR = \"$XDG_RUNTIME_DIR\"\n }\n\n if (options.environment) {\n deepAssign(env, options.environment)\n }\n\n return Object.keys(env).length > 0 ? env : undefined\n }\n\n /**\n * Build default layout for core24 with GNOME platform content snaps (non-extension mode)\n * This allows the app to access libraries from the gnome-46-2404 and mesa-2404 content snaps\n */\n private buildDefaultLayout(options: SnapOptions24): Record<string, any> | undefined {\n // If user provides custom layout, use that instead\n if (options.layout) {\n return options.layout\n }\n\n // Default layout for core24 Electron apps using GNOME content snaps WITHOUT extension\n return {\n \"/usr/lib/$CRAFT_ARCH_TRIPLET_BUILD_FOR/webkit2gtk-4.0\": {\n bind: \"$SNAP/gnome-platform/usr/lib/$CRAFT_ARCH_TRIPLET_BUILD_FOR/webkit2gtk-4.0\",\n },\n \"/usr/lib/$CRAFT_ARCH_TRIPLET_BUILD_FOR/webkit2gtk-4.1\": {\n bind: \"$SNAP/gnome-platform/usr/lib/$CRAFT_ARCH_TRIPLET_BUILD_FOR/webkit2gtk-4.1\",\n },\n \"/usr/share/xml/iso-codes\": {\n bind: \"$SNAP/gnome-platform/usr/share/xml/iso-codes\",\n },\n \"/usr/share/libdrm\": {\n bind: \"$SNAP/gpu-2404/libdrm\",\n },\n \"/usr/share/drirc.d\": {\n symlink: \"$SNAP/gpu-2404/drirc.d\",\n },\n }\n }\n\n /**\n * Process hooks directory into hook definitions\n */\n private async processHooks(hooksPath: string): Promise<Record<string, any> | undefined> {\n try {\n const buildResourcesDir = this.packager.buildResourcesDir\n const hooksDir = path.resolve(buildResourcesDir, hooksPath)\n if (!hooksDir.startsWith(buildResourcesDir + path.sep) && hooksDir !== buildResourcesDir) {\n throw new InvalidConfigurationError(`snapcraft.core24.hooks must resolve within the build resources directory (got \"${hooksDir}\")`)\n }\n const hookFiles = await readdir(hooksDir)\n\n if (hookFiles.length === 0) {\n return undefined\n }\n\n const hooks: Record<string, any> = {}\n for (const hookFile of hookFiles) {\n const hookName = path.basename(hookFile, path.extname(hookFile))\n if (!isValidKey(hookName)) {\n throw new InvalidConfigurationError(`Invalid hook name: ${hookName}`)\n }\n hooks[hookName] = {\n // Hook definitions will be populated by snapcraft from the files\n // Just register that these hooks exist\n }\n }\n\n return hooks\n } catch (e: any) {\n log.error({ message: e.message }, \"error processing Snap hooks directory\")\n throw e\n }\n }\n\n /**\n * Normalize assumes list (can be string or array)\n */\n normalizeAssumesList(assumes: Array<string> | string | Nullish): string[] | undefined {\n if (!assumes) {\n return undefined\n }\n if (typeof assumes === \"string\") {\n return [assumes]\n }\n return assumes.length > 0 ? assumes : undefined\n }\n\n /**\n * Process plugs or slots into root-level definitions and app-level references\n */\n processPlugOrSlots<T extends Array<string | SlotDescriptor | PlugDescriptor> | SlotDescriptor | PlugDescriptor | null>(\n items: T\n ): {\n root: Record<string, unknown> | undefined\n app: string[] | undefined\n } {\n if (!items || (Array.isArray(items) && items.length === 0)) {\n return { root: undefined, app: undefined }\n }\n const root: Record<string, unknown> = {}\n const app: string[] = []\n\n // Handle single descriptor object\n if (!Array.isArray(items)) {\n Object.entries(items).forEach(([name, config]) => {\n if (!isValidKey(name)) {\n throw new Error(`Invalid plug/slot name: ${name}`)\n }\n root[name] = config\n app.push(name)\n })\n return { root, app }\n }\n\n // Handle array - support \"default\" keyword\n const processedItems = this.expandDefaultsInArray(items, this.defaultPlugs)\n for (const item of processedItems ?? []) {\n if (typeof item === \"string\") {\n // Simple string reference\n app.push(item)\n } else {\n // Descriptor object with configuration\n Object.entries(item).forEach(([name, config]) => {\n if (!isValidKey(name)) {\n throw new Error(`Invalid plug/slot name: ${name}`)\n }\n root[name] = config\n app.push(name)\n })\n }\n }\n\n return { root: Object.keys(root).length > 0 ? root : undefined, app: app.length > 0 ? app : undefined }\n }\n\n private isBrowserSandboxAllowed(plugs: Record<string, any> | undefined): boolean {\n if (!plugs) {\n return false\n }\n for (const plug of Object.values(plugs)) {\n if (plug?.interface === \"browser-support\" && plug[\"allow-sandbox\"] === true) {\n return true\n }\n }\n return false\n }\n\n /**\n * Expand \"default\" keyword in arrays of anything\n */\n private expandDefaultsInArray<T>(items: T[] | Nullish, defaults: T[]): T[] | undefined {\n const result: Array<T> = []\n for (const item of items ?? []) {\n if (typeof item === \"string\" && item === \"default\") {\n result.push(...defaults)\n } else {\n result.push(item)\n }\n }\n return result.length > 0 ? result : undefined\n }\n}\n"]}
1
+ {"version":3,"file":"core24.js","sourceRoot":"","sources":["../../../../src/targets/linux/snap/core24.ts"],"names":[],"mappings":"AAAA,OAAO,EAAQ,cAAc,EAAE,OAAO,EAAE,yBAAyB,EAAE,GAAG,EAAE,qBAAqB,EAAE,aAAa,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAA;AACrJ,OAAO,EAAE,oBAAoB,EAAE,MAAM,uBAAuB,CAAA;AAE5D,OAAO,EAAE,UAAU,EAAE,UAAU,EAAW,MAAM,sBAAsB,CAAA;AACtE,OAAO,QAAQ,MAAM,UAAU,CAAA;AAC/B,OAAO,KAAK,IAAI,MAAM,SAAS,CAAA;AAC/B,OAAO,KAAK,IAAI,MAAM,MAAM,CAAA;AAE5B,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAA;AAC1C,OAAO,EAAE,yBAAyB,EAAE,MAAM,qCAAqC,CAAA;AAC/E,OAAO,EAAE,8BAA8B,EAAE,MAAM,kBAAkB,CAAA;AAEjE,OAAO,EAAE,SAAS,EAAE,sBAAsB,EAAE,sBAAsB,EAAE,MAAM,uBAAuB,CAAA;AACjG,OAAO,EAEL,wBAAwB,EACxB,uBAAuB,EACvB,kBAAkB,EAClB,0BAA0B,EAC1B,oCAAoC,EACpC,+BAA+B,GAChC,MAAM,gBAAgB,CAAA;AACvB,MAAM,EAAE,KAAK,EAAE,IAAI,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,GAAG,QAAQ,CAAA;AAEnE,wFAAwF;AACxF,gGAAgG;AAChG,MAAM,cAAc,GAAG,gBAAgB,CAAA;AACvC,sGAAsG;AACtG,MAAM,qBAAqB,GAAG,YAAY,CAAA;AAE1C,wGAAwG;AACxG,MAAM,OAAO,UAAW,SAAQ,QAAu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OAAO,EAAE,IAAI,EAAE,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,SAAS,EAAE,GAAG,EAAE,GAAG,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,SAAS,EAAE,CAAA;IACzG,CAAC;IAED;;OAEG;IACK,qBAAqB,CAAI,KAAoB,EAAE,QAAa;QAClE,MAAM,MAAM,GAAG,oBAAoB,CAAC,KAAK,IAAI,EAAE,EAAE,QAAQ,CAAC,CAAA;QAC1D,OAAO,MAAM,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,SAAS,CAAA;IAC/C,CAAC;CACF","sourcesContent":["import { Arch, archFromString, copyDir, InvalidConfigurationError, log, prepareFixedNameWrite, removeNullish, toLinuxArchString } from \"builder-util\"\nimport { expandDefaultKeyword } from \"builder-util/internal\"\n\nimport { deepAssign, isValidKey, Nullish } from \"builder-util-runtime\"\nimport _fsExtra from \"fs-extra\"\nimport * as yaml from \"js-yaml\"\nimport * as path from \"path\"\nimport { PlugDescriptor, SlotDescriptor, SnapOptions24 } from \"../../../options/SnapOptions.js\"\nimport { SnapCore } from \"./SnapTarget.js\"\nimport { getStagingCopyLinkOptions } from \"../../../util/trustedSourceRoots.js\"\nimport { buildSnapCommandLauncherScript } from \"./snapCommand.js\"\nimport { App, Part, SnapcraftYAML } from \"./snapcraft.js\"\nimport { buildSnap, DEFAULT_STAGE_PACKAGES, SNAPCRAFT_YAML_OPTIONS } from \"./snapcraftBuilder.js\"\nimport {\n Core24PlugFlavor,\n CORE24_DEFAULT_APP_PLUGS,\n isBrowserSandboxAllowed,\n resolveCore24Plugs,\n warnAboutAllowSandboxPlugs,\n warnAboutCore24DefaultPlugsExpansion,\n warnAboutCore24NoSandboxDefault,\n} from \"./snapPlugs.js\"\nconst { chmod, copy, mkdir, readdir, remove, writeFile } = _fsExtra\n\n// Electron's setuid sandbox helper. Removed from the staged app when the snap runs with\n// `--no-sandbox` (snap confinement supplies its own sandbox via the browser-support interface).\nconst CHROME_SANDBOX = \"chrome-sandbox\"\n// Launcher script name used when the app command cannot be expressed inline (see resolveSnapCommand).\nconst SNAP_COMMAND_LAUNCHER = \"command.sh\"\n\n/** Snap build strategy for core24 — generates a native snapcraft.yaml and invokes the snapcraft CLI. */\nexport class SnapCore24 extends SnapCore<SnapOptions24> {\n // App-level default plugs. browser-support is intentionally absent here; resolveCore24Plugs adds it (without\n // allow-sandbox) to both the root and app plugs whenever the defaults apply.\n defaultPlugs = [...CORE24_DEFAULT_APP_PLUGS]\n\n // Snap file hierarchy:\n // - snap/gui/ gets automatically copied to meta/gui/ in the final snap\n // - Desktop files in meta/gui/ are used for menu integration\n readonly configRelativePath = \"snap\"\n readonly guiRelativePath = path.join(this.configRelativePath, \"gui\")\n\n // Computed in createDescriptor (mapSnapOptionsToSnapcraftYAML) and consumed in buildSnap.\n // getSnapCore() returns a fresh SnapCore24 per arch build, so this per-instance state is\n // never shared across builds.\n private removeChromeSandbox = false\n // Args embedded into the generated launcher script (executableArgs + forceX11/no-sandbox flags).\n private commandArgs: string[] = []\n\n async createDescriptor(arch: Arch): Promise<SnapcraftYAML> {\n return await this.mapSnapOptionsToSnapcraftYAML(arch)\n }\n\n private isHostMode(): boolean {\n return this.options.useDestructiveMode === true\n }\n\n /** Writes the snapcraft.yaml, stages app files, then invokes `buildSnap()` to run the actual snapcraft build. */\n async buildSnap(params: { snap: SnapcraftYAML; appOutDir: string; stageDir: string; snapArch: Arch; artifactPath: string }): Promise<string[]> {\n const { snap, appOutDir, stageDir, artifactPath } = params\n\n const snapDirResolved = path.resolve(stageDir, this.configRelativePath)\n const snapcraftYamlPath = path.join(snapDirResolved, \"snapcraft.yaml\")\n\n // Create snap/gui directory for desktop files and icons\n // Snapcraft will automatically copy snap/gui/ contents to meta/gui/ in the final snap\n const guiOutput = path.resolve(stageDir, this.guiRelativePath)\n await mkdir(guiOutput, { recursive: true })\n\n const yamlContent = yaml.dump(snap, SNAPCRAFT_YAML_OPTIONS)\n await writeFile(snapcraftYamlPath, yamlContent, \"utf8\")\n log.debug(snap, \"generated snapcraft.yaml\")\n\n // Copy icon to snap/gui/ directory\n // Snapcraft will automatically copy this to meta/gui/ in the final snap\n const desktopExtraProps: Record<string, string> = {}\n const icon = this.helper.maxIconPath\n if (icon) {\n const iconFileName = `${snap.name}${path.extname(icon)}`\n await copy(icon, path.join(guiOutput, iconFileName))\n // Icon path will be available at ${SNAP}/meta/gui/<icon-file> after installation\n desktopExtraProps.Icon = `\\${SNAP}/meta/gui/${iconFileName}`\n }\n\n // Create desktop file in snap/gui/ directory\n // Snapcraft will automatically copy this to meta/gui/ in the final snap\n const desktopFilePath = path.join(guiOutput, `${this.helper.getDesktopFileName(snap.name)}.desktop`)\n await this.helper.writeDesktopEntry(this.options, snap.name + \" %U\", desktopFilePath, desktopExtraProps)\n\n // Copy app files to the project root `app` directory so `source: app`\n // in the generated `snapcraft.yaml` (which is under `snap/`) can be\n // resolved by snapcraft running in the build environment.\n const appDir = path.resolve(stageDir, \"app\")\n if (path.resolve(appDir) !== path.resolve(appOutDir)) {\n log.debug({ to: log.filePath(appDir), from: log.filePath(appOutDir) }, \"copying app files to project root app directory\")\n await copyDir(appOutDir, appDir, await getStagingCopyLinkOptions(this.packager))\n }\n\n // Drop the setuid chrome-sandbox helper before snapcraft stages the app — it is unusable under\n // strict confinement when launching with --no-sandbox (mirrors SnapCoreLegacy).\n if (this.removeChromeSandbox) {\n await remove(path.join(appDir, CHROME_SANDBOX))\n }\n\n // Write the launcher script the command always points at (see SNAP_COMMAND_LAUNCHER).\n // It lands at the snap root ($SNAP/command.sh) — it is intentionally not added to `organize`.\n const launcherPath = path.join(appDir, SNAP_COMMAND_LAUNCHER)\n // the app files were just copied there: replace, never follow, a symlink at the name\n await prepareFixedNameWrite(stageDir, launcherPath, \"snap command launcher\")\n await writeFile(launcherPath, buildSnapCommandLauncherScript({ execName: this.packager.executableName, args: this.commandArgs }), { mode: 0o755 })\n await chmod(launcherPath, 0o755)\n\n // Auto-generate `organize` mapping for the app part so top-level helper\n // binaries and resources are placed under `app/` inside the snap. Update\n // the already-written `snapcraft.yaml` so the build sees the mapping.\n try {\n const appPart = snap.parts[snap.name]\n if (appPart) {\n const entries = (await readdir(appOutDir)).sort()\n // Null-prototype map: entry names come from the filesystem, so a top-level file named\n // \"__proto__\" / \"constructor\" / \"toString\" must not read inherited keys (which would make\n // the membership check below skip it) or interact with Object.prototype on assignment.\n const organize: Record<string, string> = Object.assign(Object.create(null), appPart.organize)\n for (const entry of entries) {\n if (!entry) {\n continue\n }\n // Skip files no longer present in the staged app dir (e.g. removed chrome-sandbox) so\n // snapcraft doesn't fail trying to organize a missing source.\n if (this.removeChromeSandbox && entry === CHROME_SANDBOX) {\n continue\n }\n // Never organize the launcher under app/. It must stay at the snap root ($SNAP/command.sh)\n // to match apps.<name>.command. This matters when appOutDir === appDir, where readdir\n // would otherwise pick up the launcher we just wrote.\n if (entry === SNAP_COMMAND_LAUNCHER) {\n continue\n }\n if (organize[entry]) {\n continue\n }\n organize[entry] = `app/${entry}`\n }\n appPart.organize = organize\n\n const updatedYaml = yaml.dump(snap, SNAPCRAFT_YAML_OPTIONS)\n await writeFile(snapcraftYamlPath, updatedYaml, \"utf8\")\n log.debug({ organize }, \"updated snapcraft.yaml with organize mapping\")\n }\n } catch (e: any) {\n log.warn({ error: e.message }, \"failed to generate and update organize mapping\")\n }\n\n const buildMode = {\n useLXD: this.options.useLXD === true,\n useMultipass: this.options.useMultipass === true,\n useDestructiveMode: this.options.useDestructiveMode === true,\n remoteBuild: this.options.remoteBuild || undefined,\n }\n\n if (this.packager.packagerOptions.effectiveOptionComputed != null) {\n const shouldSkip = await this.packager.packagerOptions.effectiveOptionComputed({ snap, desktopFile: desktopFilePath, ...buildMode })\n if (shouldSkip) {\n return [artifactPath]\n }\n }\n\n const rootOptions = this.packager.config.snapcraft\n const snaps = await buildSnap({\n snapcraftConfig: snap,\n artifactPath,\n stageDir,\n packager: this.packager,\n cscLink: rootOptions?.cscLink,\n ...buildMode,\n })\n return snaps\n }\n\n /** Converts `SnapOptions24` into a fully resolved `SnapcraftYAML` descriptor for the given architecture. */\n async mapSnapOptionsToSnapcraftYAML(arch: Arch): Promise<SnapcraftYAML> {\n const appInfo = this.packager.appInfo\n const appName = this.packager.executableName.toLowerCase()\n const options = this.options\n\n // Default to [\"gnome\"] in normal builds; no extensions in host/destructive-mode (where the\n // gnome extension is incompatible). Throw if the user explicitly includes \"gnome\" in host mode.\n const hostMode = this.isHostMode()\n const extensionsList: string[] = options.extensions != null ? [...options.extensions] : hostMode ? [] : [\"gnome\"]\n if (hostMode && extensionsList.includes(\"gnome\")) {\n throw new InvalidConfigurationError(\n `The \"gnome\" snapcraft extension is incompatible with host/destructive-mode builds.\\n` +\n `In this mode snapcraft cannot resolve the extension's command-chain source ` +\n `(/usr/share/snapcraft/extensions/desktop/command-chain) and will fail.\\n\\n` +\n `To resolve this, choose one of:\\n` +\n ` 1. Remove \"gnome\" from snapcraft.core24.extensions (or set it to []) and add any\\n` +\n ` required stage-packages manually.\\n` +\n ` 2. Switch to an isolated build environment by setting snapcraft.core24.useLXD: true\\n` +\n ` or snapcraft.core24.useMultipass: true instead of useDestructiveMode.\\n\\n` +\n `See: https://documentation.ubuntu.com/snapcraft/stable/reference/extensions/gnome-extension/`\n )\n }\n const resolvedExtensions = extensionsList.length > 0 ? extensionsList : undefined\n const useGnomeExtension = extensionsList.includes(\"gnome\")\n\n // Snap store review rejects classic-confinement snaps that declare plugs or layout, so skip\n // the generated defaults for classic (mirrors SnapCoreLegacy). Explicitly configured values\n // are kept, but warn that the store is likely to reject them.\n const isClassic = options.confinement === \"classic\"\n if (isClassic && (options.plugs != null || options.layout != null)) {\n log.warn(\n { confinement: \"classic\", plugs: options.plugs != null, layout: options.layout != null },\n \"classic confinement does not support plugs or layout; keeping the explicitly configured values, but the snap store review is likely to reject them\"\n )\n }\n\n // Create the app part\n const appPart: Part = {\n plugin: \"dump\",\n source: \"app\",\n \"build-packages\": options.buildPackages?.length ? options.buildPackages : undefined,\n \"stage-packages\": this.expandDefaultsInArray(options.stagePackages, DEFAULT_STAGE_PACKAGES),\n after: this.expandDefaultsInArray(options.after, []),\n stage: options.appPartStage?.length ? options.appPartStage : undefined,\n }\n\n // Process plugs and slots (see resolveCore24Plugs for the per-build-flavor rules).\n // The defaults request plain browser-support, never allow-sandbox: the Snap Store reserves that\n // attribute for vetted publishers. Without it the app is launched with --no-sandbox below, which is\n // what keeps Chromium from aborting in credentials.cc under strict confinement (see #9659).\n const plugFlavor: Core24PlugFlavor = isClassic ? \"classic\" : useGnomeExtension ? \"gnome-extension\" : hostMode ? \"host\" : \"strict\"\n const plugResolution = resolveCore24Plugs(options.plugs, plugFlavor, this.defaultPlugs)\n const { root: rootPlugs, app: appPlugs } = plugResolution\n warnAboutAllowSandboxPlugs(rootPlugs, \"snapcraft.core24.plugs\", this.packager)\n if (plugResolution.source === \"merged\") {\n warnAboutCore24DefaultPlugsExpansion(plugResolution.addedByDefaultExpansion, this.packager)\n }\n\n const { root: rootSlots, app: appSlots } = options.slots ? this.processPlugOrSlots(options.slots) : { root: undefined, app: undefined }\n\n // Build the effective arg list for the snap command.\n // Start with any user-supplied executableArgs, then conditionally add --no-sandbox\n // if browser-support with allow-sandbox:true is not present in the resolved plugs\n // (mirrors the same logic in SnapCoreLegacy.buildSnap). Only a user-configured plug can request\n // allow-sandbox; the generated defaults never do.\n const extraArgs: string[] = [...(this.options.executableArgs ?? [])]\n if (this.options.forceX11 === true) {\n if (!extraArgs.includes(\"--ozone-platform=x11\")) {\n extraArgs.push(\"--ozone-platform=x11\")\n }\n }\n const noSandbox = this.helper.isElectronVersionGreaterOrEqualThan(\"5.0.0\") && !isBrowserSandboxAllowed(rootPlugs)\n if (noSandbox && !extraArgs.includes(\"--no-sandbox\")) {\n extraArgs.push(\"--no-sandbox\")\n }\n // electron-builder <= 26 generated browser-support with allow-sandbox, which kept Chromium's sandbox.\n if (noSandbox && plugResolution.source === \"generated\" && plugFlavor !== \"classic\") {\n warnAboutCore24NoSandboxDefault(this.packager)\n }\n // With --no-sandbox the setuid chrome-sandbox helper is unused; strip it from the snap.\n this.removeChromeSandbox = noSandbox\n\n // The command always points at a generated launcher script (written in buildSnap). This keeps a\n // single uniform command path and sidesteps snapd's character/word-splitting rules for the\n // command field (e.g. --ozone-platform=x11, --js-flags=\"...\").\n this.commandArgs = extraArgs\n\n // Create the app configuration\n // apps.desktop would add a second entry beside the generated snap/gui file.\n const desktopBaseName = this.helper.getDesktopFileName(appName)\n const app: App = {\n command: SNAP_COMMAND_LAUNCHER,\n \"command-chain\": undefined, // explicitly undefined so removeNullish strips it; extensions supply their own command-chain\n plugs: appPlugs,\n slots: appSlots,\n autostart: options.autoStart ? `${desktopBaseName}.desktop` : undefined,\n extensions: resolvedExtensions,\n }\n\n // Icon path — build-time relative path so snapcraft can find the file in snap/gui/\n await this.helper.icons\n const iconPath = this.helper.maxIconPath != null ? `snap/gui/${appName}${path.extname(this.helper.maxIconPath)}` : undefined\n\n // Process hooks if configured\n const hooksConfig = options.hooks\n const hooks = hooksConfig ? await this.processHooks(hooksConfig) : undefined\n\n // Parts configuration - the extension automatically adds a gnome/sdk part\n // Don't manually add desktop-launch when using the extension\n const parts: Record<string, Part> = {\n [appName]: appPart,\n }\n\n // Note: `organize` will be generated later in `buildSnap` based on the\n // actual contents of the built app directory so helper binaries and\n // resources are automatically moved under `app/` in the snap.\n\n // Build the snapcraft configuration\n const snapcraft: SnapcraftYAML = {\n // Required fields\n name: appName,\n base: \"core24\",\n confinement: options.confinement || \"strict\",\n parts: parts,\n\n // Architecture/Platform — only needed for cross-compilation; snapcraft 8\n // defaults to host arch and snapcraft 7 rejects this field entirely.\n ...(arch !== archFromString(process.arch)\n ? {\n platforms: {\n [toLinuxArchString(arch, \"snap\")]: {\n \"build-for\": toLinuxArchString(arch, \"snap\"),\n \"build-on\": toLinuxArchString(archFromString(process.arch), \"snap\"),\n },\n },\n }\n : {}),\n\n // Metadata - with fallbacks from appInfo\n version: appInfo.version,\n summary: options.summary || appInfo.productName,\n description: this.helper.getDescription(options),\n grade: options.grade || \"stable\",\n title: options.title || appInfo.productName,\n icon: iconPath,\n\n // Build configuration\n compression: options.compression || undefined,\n assumes: this.normalizeAssumesList(options.assumes),\n\n // Environment\n environment: this.buildEnvironment(options),\n\n // Layout (see resolveLayout for the per-build-flavor rules)\n layout: this.resolveLayout(options, isClassic, hostMode, useGnomeExtension),\n\n // Interfaces\n plugs: rootPlugs,\n slots: rootSlots,\n\n // Hooks\n hooks: hooks,\n\n // Apps\n apps: {\n [appName]: app,\n },\n }\n\n return removeNullish(snapcraft)\n }\n\n /**\n * Resolve the snap-wide layout for the build flavor.\n *\n * An explicitly configured layout always wins — it is kept even under classic confinement\n * (with the warning logged in mapSnapOptionsToSnapcraftYAML). Otherwise:\n * - classic confinement: no layout — the snap store review rejects classic snaps that declare one\n * - GNOME extension or host/destructive mode: no layout needed\n * - default (strict, no extension): content-snap default layout\n */\n private resolveLayout(options: SnapOptions24, isClassic: boolean, hostMode: boolean, useGnomeExtension: boolean): Record<string, any> | undefined {\n if (options.layout != null) {\n return options.layout\n }\n if (isClassic || useGnomeExtension || hostMode) {\n return undefined\n }\n return this.buildDefaultLayout(options)\n }\n\n /**\n * Build environment variables with proper defaults\n */\n private buildEnvironment(options: SnapOptions24): Record<string, string | null> | undefined {\n const env: Record<string, string | null> = {}\n\n // Add default TMPDIR for Electron/Chromium apps\n if (!options.environment?.TMPDIR) {\n env.TMPDIR = \"$XDG_RUNTIME_DIR\"\n }\n\n if (options.environment) {\n deepAssign(env, options.environment)\n }\n\n return Object.keys(env).length > 0 ? env : undefined\n }\n\n /**\n * Build default layout for core24 with GNOME platform content snaps (non-extension mode)\n * This allows the app to access libraries from the gnome-46-2404 and mesa-2404 content snaps\n */\n private buildDefaultLayout(options: SnapOptions24): Record<string, any> | undefined {\n // If user provides custom layout, use that instead\n if (options.layout) {\n return options.layout\n }\n\n // Default layout for core24 Electron apps using GNOME content snaps WITHOUT extension\n return {\n \"/usr/lib/$CRAFT_ARCH_TRIPLET_BUILD_FOR/webkit2gtk-4.0\": {\n bind: \"$SNAP/gnome-platform/usr/lib/$CRAFT_ARCH_TRIPLET_BUILD_FOR/webkit2gtk-4.0\",\n },\n \"/usr/lib/$CRAFT_ARCH_TRIPLET_BUILD_FOR/webkit2gtk-4.1\": {\n bind: \"$SNAP/gnome-platform/usr/lib/$CRAFT_ARCH_TRIPLET_BUILD_FOR/webkit2gtk-4.1\",\n },\n \"/usr/share/xml/iso-codes\": {\n bind: \"$SNAP/gnome-platform/usr/share/xml/iso-codes\",\n },\n \"/usr/share/libdrm\": {\n bind: \"$SNAP/gpu-2404/libdrm\",\n },\n \"/usr/share/drirc.d\": {\n symlink: \"$SNAP/gpu-2404/drirc.d\",\n },\n }\n }\n\n /**\n * Process hooks directory into hook definitions\n */\n private async processHooks(hooksPath: string): Promise<Record<string, any> | undefined> {\n try {\n const buildResourcesDir = this.packager.buildResourcesDir\n const hooksDir = path.resolve(buildResourcesDir, hooksPath)\n if (!hooksDir.startsWith(buildResourcesDir + path.sep) && hooksDir !== buildResourcesDir) {\n throw new InvalidConfigurationError(`snapcraft.core24.hooks must resolve within the build resources directory (got \"${hooksDir}\")`)\n }\n const hookFiles = await readdir(hooksDir)\n\n if (hookFiles.length === 0) {\n return undefined\n }\n\n const hooks: Record<string, any> = {}\n for (const hookFile of hookFiles) {\n const hookName = path.basename(hookFile, path.extname(hookFile))\n if (!isValidKey(hookName)) {\n throw new InvalidConfigurationError(`Invalid hook name: ${hookName}`)\n }\n hooks[hookName] = {\n // Hook definitions will be populated by snapcraft from the files\n // Just register that these hooks exist\n }\n }\n\n return hooks\n } catch (e: any) {\n log.error({ message: e.message }, \"error processing Snap hooks directory\")\n throw e\n }\n }\n\n /**\n * Normalize assumes list (can be string or array)\n */\n normalizeAssumesList(assumes: Array<string> | string | Nullish): string[] | undefined {\n if (!assumes) {\n return undefined\n }\n if (typeof assumes === \"string\") {\n return [assumes]\n }\n return assumes.length > 0 ? assumes : undefined\n }\n\n /**\n * Process plugs or slots into root-level definitions and app-level references\n */\n processPlugOrSlots<T extends Array<string | SlotDescriptor | PlugDescriptor> | SlotDescriptor | PlugDescriptor | null>(\n items: T\n ): {\n root: Record<string, unknown> | undefined\n app: string[] | undefined\n } {\n if (!items || (Array.isArray(items) && items.length === 0)) {\n return { root: undefined, app: undefined }\n }\n const root: Record<string, unknown> = {}\n const app: string[] = []\n\n // Handle single descriptor object\n if (!Array.isArray(items)) {\n Object.entries(items).forEach(([name, config]) => {\n if (!isValidKey(name)) {\n throw new Error(`Invalid plug/slot name: ${name}`)\n }\n root[name] = config\n app.push(name)\n })\n return { root, app }\n }\n\n // Handle array - support \"default\" keyword\n const processedItems = this.expandDefaultsInArray(items, this.defaultPlugs)\n for (const item of processedItems ?? []) {\n if (typeof item === \"string\") {\n // Simple string reference\n app.push(item)\n } else {\n // Descriptor object with configuration\n Object.entries(item).forEach(([name, config]) => {\n if (!isValidKey(name)) {\n throw new Error(`Invalid plug/slot name: ${name}`)\n }\n root[name] = config\n app.push(name)\n })\n }\n }\n\n return { root: Object.keys(root).length > 0 ? root : undefined, app: app.length > 0 ? app : undefined }\n }\n\n /**\n * Expand \"default\" keyword in arrays of anything\n */\n private expandDefaultsInArray<T>(items: T[] | Nullish, defaults: T[]): T[] | undefined {\n const result = expandDefaultKeyword(items ?? [], defaults)\n return result.length > 0 ? result : undefined\n }\n}\n"]}
@@ -1,4 +1,5 @@
1
1
  import { Arch } from "builder-util";
2
+ import { ToolsetConfig } from "../../../configuration.js";
2
3
  import { SnapOptionsLegacy } from "../../../options/SnapOptions.js";
3
4
  import { SnapCore } from "./SnapTarget.js";
4
5
  import { shellQuote } from "./snapCommand.js";
@@ -38,6 +39,12 @@ export declare class SnapCoreLegacy extends SnapCore<SnapOptionsLegacy & {
38
39
  * The only difference between template and no-template is the app executable prefix:
39
40
  * template apps are at $SNAP/<name>; no-template apps are at $SNAP/app/<name>.
40
41
  */
42
+ /**
43
+ * Template snaps are packed with the `mksquashfs` from `toolsets.appimage`. The legacy `"0.0.0"` bundle's
44
+ * `mksquashfs` supports only gzip/xz, so reject `lzo` (explicit, or mapped from `linux.compression: "store"`)
45
+ * up front instead of letting mksquashfs fail with `Compressor "lzo" is not supported`.
46
+ */
47
+ export declare function assertTemplateSnapCompressionSupported(appimageToolset: ToolsetConfig["appimage"], compression: string): void;
41
48
  export declare function buildCommandShContent(opts: {
42
49
  isTemplate: boolean;
43
50
  executableName: string;
@@ -1 +1 @@
1
- {"version":3,"file":"coreLegacy.d.ts","sourceRoot":"","sources":["../../../../src/targets/linux/snap/coreLegacy.ts"],"names":[],"mappings":"AAAA,OAAO,EAAqC,IAAI,EAAmF,MAAM,cAAc,CAAA;AAMvJ,OAAO,EAAkB,iBAAiB,EAAE,MAAM,iCAAiC,CAAA;AAMnF,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAA;AAC1C,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAA;AAC7C,OAAO,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAA;AAK9C,OAAO,EAAE,UAAU,EAAE,CAAA;AAkBrB,qBAAa,cAAe,SAAQ,QAAQ,CAAC,iBAAiB,GAAG;IAAE,IAAI,EAAE,QAAQ,GAAG,QAAQ,GAAG,QAAQ,CAAA;CAAE,CAAC;IACxG,OAAO,CAAC,gBAAgB,CAAQ;IAEhC,YAAY,WAAyJ;IAErK,OAAO,CAAC,cAAc;IAQhB,gBAAgB,CAAC,IAAI,EAAE,IAAI,GAAG,OAAO,CAAC,aAAa,CAAC;IA8IpD,SAAS,CAAC,KAAK,EAAE;QAAE,IAAI,EAAE,GAAG,CAAC;QAAC,SAAS,EAAE,MAAM,CAAC;QAAC,QAAQ,EAAE,MAAM,CAAC;QAAC,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