Skip to content

Commit 8698889

Browse files
StiensWoutclaude
andcommitted
chore(release): declare the macOS 13 floor in updater manifests
Electron 44 cannot launch on macOS 12, but electron-builder only writes a minimum system version into Info.plist, never into latest-mac.yml. Without it, electron-updater on Monterey would install a build that refuses to open. The desktop artifact build now sets mac.minimumSystemVersion to 13.0 and stamps minimumSystemVersion: '22.0.0' into every <channel>-mac.yml it emits. electron-updater compares that field against os.release(), which is the Darwin kernel version (Ventura is Darwin 22), so the manifest carries the Darwin form while the plist keeps the product version. The manifest merge step already carries the key through. Co-Authored-By: Claude Fable 5.1 <[email protected]>
1 parent 77ad60e commit 8698889

3 files changed

Lines changed: 74 additions & 1 deletion

File tree

‎docs/operations/release.md‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -215,6 +215,7 @@ available.
215215
- macOS metadata note:
216216
- `electron-updater` reads `latest-mac.yml` on stable and `nightly-mac.yml` on nightly, for both Intel and Apple Silicon.
217217
- The workflow merges the per-arch mac manifests into one channel-specific mac manifest before publishing the GitHub Release.
218+
- The desktop artifact build stamps `minimumSystemVersion: '22.0.0'` (Darwin 22, macOS 13 Ventura) into every mac manifest. `electron-updater` compares that field against `os.release()`, which reports the Darwin kernel version rather than the macOS product version, and skips the update on older systems instead of installing an app that cannot launch there.
218219

219220
### Windows payload topology and update validation
220221

‎scripts/build-desktop-artifact.test.ts‎

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@ import {
2121
createStageWorkspaceConfig,
2222
createStagePatchedDependencies,
2323
createBuildConfig,
24+
isMacUpdateManifestName,
25+
stampMacUpdateManifest,
2426
DESKTOP_ELECTRON_LANGUAGES,
2527
DESKTOP_FILE_EXCLUSIONS,
2628
DESKTOP_EXTRA_RESOURCES,
@@ -563,6 +565,43 @@ it.layer(NodeServices.layer)("build-desktop-artifact", (it) => {
563565
]);
564566
});
565567

568+
it("stamps the macOS floor into updater manifests", () => {
569+
const stamped = stampMacUpdateManifest(
570+
`version: 1.2.3
571+
files:
572+
- url: T3-Code-1.2.3-arm64.zip
573+
sha512: zipsha
574+
size: 1
575+
- url: T3-Code-1.2.3-arm64.dmg
576+
sha512: dmgsha
577+
size: 2
578+
path: T3-Code-1.2.3-arm64.zip
579+
sha512: zipsha
580+
releaseDate: '2026-09-03T10:00:00.000Z'
581+
`,
582+
"latest-mac.yml",
583+
);
584+
585+
assert.equal(
586+
stamped,
587+
`version: '1.2.3'
588+
files:
589+
- url: T3-Code-1.2.3-arm64.zip
590+
sha512: zipsha
591+
size: 1
592+
- url: T3-Code-1.2.3-arm64.dmg
593+
sha512: dmgsha
594+
size: 2
595+
minimumSystemVersion: '22.0.0'
596+
releaseDate: '2026-09-03T10:00:00.000Z'
597+
`,
598+
);
599+
assert.isTrue(isMacUpdateManifestName("latest-mac.yml"));
600+
assert.isTrue(isMacUpdateManifestName("nightly-mac.yml"));
601+
assert.isFalse(isMacUpdateManifestName("builder-debug.yml"));
602+
assert.isFalse(isMacUpdateManifestName("latest.yml"));
603+
});
604+
566605
it.effect("applies platform-specific packaging to the build config", () =>
567606
Effect.gen(function* () {
568607
const mac = yield* createBuildConfig(
@@ -610,6 +649,7 @@ it.layer(NodeServices.layer)("build-desktop-artifact", (it) => {
610649
assert.notProperty(mac, "asarUnpack");
611650
assert.notProperty(linux, "asarUnpack");
612651
assert.notProperty(win, "asarUnpack");
652+
assert.nestedPropertyVal(mac, "mac.minimumSystemVersion", "13.0");
613653
assert.deepStrictEqual(win.extraResources, [
614654
{
615655
from: "apps/desktop/prod-resources/resource-monitor",

‎scripts/build-desktop-artifact.ts‎

Lines changed: 33 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ import {
3434
} from "./lib/cli-external-packages.ts";
3535
import { loadRepoEnv } from "./lib/public-config.ts";
3636
import { resolveCatalogDependencies } from "./lib/resolve-catalog.ts";
37+
import { parseUpdateManifest, serializeUpdateManifest } from "./lib/update-manifest.ts";
3738

3839
import * as NodeRuntime from "@effect/platform-node/NodeRuntime";
3940
import * as NodeServices from "@effect/platform-node/NodeServices";
@@ -2422,6 +2423,32 @@ export function resolveDesktopProductName(version: string): string {
24222423
: (desktopPackageJson.productName ?? "T3 Code");
24232424
}
24242425

2426+
// Electron 44 dropped macOS 12, so the app cannot launch below Ventura. The
2427+
// product version lands in Info.plist as LSMinimumSystemVersion. The updater
2428+
// manifests need the same floor as a Darwin kernel version, because
2429+
// electron-updater compares `minimumSystemVersion` against `os.release()`
2430+
// (Ventura is Darwin 22) and skips the update instead of installing a build the
2431+
// OS cannot run.
2432+
export const MAC_MINIMUM_SYSTEM_VERSION = "13.0";
2433+
export const MAC_MINIMUM_DARWIN_VERSION = "22.0.0";
2434+
2435+
// electron-builder names the channel manifests `<channel>-mac.yml`; the
2436+
// builder-debug.yml it drops next to them is not an updater manifest.
2437+
export function isMacUpdateManifestName(fileName: string): boolean {
2438+
return /^[A-Za-z]+-mac\.yml$/.test(fileName);
2439+
}
2440+
2441+
export function stampMacUpdateManifest(raw: string, sourcePath: string): string {
2442+
const manifest = parseUpdateManifest(raw, sourcePath, "macOS");
2443+
return serializeUpdateManifest(
2444+
{
2445+
...manifest,
2446+
extras: { ...manifest.extras, minimumSystemVersion: MAC_MINIMUM_DARWIN_VERSION },
2447+
},
2448+
{ platformLabel: "macOS" },
2449+
);
2450+
}
2451+
24252452
export const createBuildConfig = Effect.fn("createBuildConfig")(function* (
24262453
platform: typeof BuildPlatform.Type,
24272454
target: string,
@@ -2485,6 +2512,7 @@ export const createBuildConfig = Effect.fn("createBuildConfig")(function* (
24852512
target: target === "dmg" ? [target, "zip"] : [target],
24862513
icon: "icon.icns",
24872514
category: "public.app-category.developer-tools",
2515+
minimumSystemVersion: MAC_MINIMUM_SYSTEM_VERSION,
24882516
protocols: [
24892517
{
24902518
name: "T3 Code",
@@ -3694,7 +3722,11 @@ const buildDesktopArtifact = Effect.fn("buildDesktopArtifact")(function* (
36943722
if (!stat || stat.type !== "File") continue;
36953723

36963724
const to = path.join(options.outputDir, entry);
3697-
yield* fs.copyFile(from, to);
3725+
if (options.platform === "mac" && isMacUpdateManifestName(entry)) {
3726+
yield* fs.writeFileString(to, stampMacUpdateManifest(yield* fs.readFileString(from), from));
3727+
} else {
3728+
yield* fs.copyFile(from, to);
3729+
}
36983730
copiedArtifacts.push(to);
36993731
}
37003732

0 commit comments

Comments
 (0)