fix(desktop): check artifact build prerequisites (#8975)

This commit is contained in:
Julius Marminge authored and GitHub committed 2026-09-01 22:37:45 -07:00
1 parent 43bafd4674
commit 082358f9ef
4 files changed
+566 -21

No files matched your search

+5
View File
@@ -1,5 +1,10 @@
# Contributing
## Developer Setup
See the [maintainer scripts guide](docs/internals/scripts.md#first-checkout) for the initial checkout,
development commands, tests, and platform-specific desktop packaging prerequisites.
## Read This First
We are not actively accepting contributions right now.
+73
View File
@@ -74,6 +74,79 @@ authenticated.
- `vp run dist:desktop:win`: Builds a Windows NSIS installer into `./release`. `:arm64` and `:x64`
variants exist.
### Linux AppImage prerequisites
Linux AppImage packaging compiles the Rust resource monitor. Install a Rust toolchain, the standard
C/C++ build tools, and ImageMagick before running `vp run dist:desktop:linux`.
Ubuntu and Debian:
```bash
sudo apt-get update
sudo apt-get install cargo rustc build-essential imagemagick
```
Fedora:
```bash
sudo dnf install rust cargo gcc gcc-c++ make ImageMagick
```
Arch Linux:
```bash
sudo pacman -S rust base-devel imagemagick
```
The artifact script checks these capabilities before starting the web and desktop builds. If
anything is unavailable, it reports every failed check together and prints the Ubuntu/Debian
installation command. The check compiles and links tiny temporary programs, so it also catches
installed runtime X11 libraries that are missing their development headers or linker symlinks.
### macOS DMG prerequisites
Install the Xcode Command Line Tools and Rust before building a DMG:
```bash
xcode-select --install
```
Install Rust from [rustup.rs](https://rustup.rs). The artifact script checks Cargo, Clang, Make,
`sips`, and `iconutil`. Universal builds additionally require `lipo`. It also verifies that Rust
has every requested target; add missing targets with:
```bash
rustup target add aarch64-apple-darwin x86_64-apple-darwin
```
Unsigned local builds need no Apple credentials. Builds using `--signed` additionally require the
certificate, provisioning profile, team ID, and notarization configuration described below.
### Windows installer prerequisites
Install Rust from [rustup.rs](https://rustup.rs), Python 3, and Visual Studio Build Tools. In the
Visual Studio Installer, select **Desktop development with C++** and include:
- MSVC x64/x86 build tools
- A Windows 10 or Windows 11 SDK
- MSVC Spectre-mitigated libraries
ARM64 installers require the corresponding MSVC ARM64 build tools and Spectre-mitigated libraries
instead of the x64/x86 components.
Add the Rust target matching the installer architecture:
```powershell
rustup target add x86_64-pc-windows-msvc
# For an arm64 installer:
rustup target add aarch64-pc-windows-msvc
```
Windows supplies `tar.exe`; it is checked when `--wsl-prebuild` makes the artifact include the WSL
runtime. NSIS is downloaded by electron-builder and does not need a separate installation.
Unsigned local builds need no Azure credentials. Builds using `--signed` additionally require the
Azure Trusted Signing configuration described below.
### Desktop `.dmg` packaging notes
- Default build is unsigned/not notarized for local sharing.
+167 -2
View File
@@ -32,9 +32,14 @@ import {
UnsupportedDesktopBuildArchitectureError,
isMacPasskeySigningConfigurationError,
LinuxIconResizeError,
LinuxDesktopBuildPrerequisitesMissingError,
MacDesktopBuildPrerequisitesMissingError,
MacPasskeySigningConfigurationResolutionError,
MissingMacPasskeyProvisioningProfileError,
packWindowsServerAsar,
preflightLinuxDesktopBuild,
preflightMacDesktopBuild,
preflightWindowsDesktopBuild,
renderMacPasskeyEntitlements,
resolveClerkPasskeyNativeArtifacts,
resolveMacPasskeySigningConfiguration,
@@ -63,6 +68,7 @@ import {
copyDirectoryPreservingSymlinks,
validateWindowsPackagedPayload,
WindowsPrimaryNativeProbeError,
WindowsDesktopBuildPrerequisitesMissingError,
WindowsPackagedPayloadValidationError,
WINDOWS_PACKAGED_PAYLOAD_FILE_LIMIT,
WINDOWS_SERVER_ASAR_IGNORE_GLOBS,
@@ -102,7 +108,8 @@ const stageWslRuntimeTreeFixture = Effect.fn("stageWslRuntimeTreeFixture")(funct
);
});
function mockProcess(exitCode: number) {
function mockProcess(exitCode: number, stdout = "") {
const encodedStdout = new TextEncoder().encode(stdout);
return ChildProcessSpawner.makeHandle({
pid: ChildProcessSpawner.ProcessId(1),
exitCode: Effect.succeed(ChildProcessSpawner.ExitCode(exitCode)),
@@ -110,7 +117,7 @@ function mockProcess(exitCode: number) {
kill: () => Effect.void,
unref: Effect.succeed(Effect.void),
stdin: Sink.drain,
stdout: Stream.empty,
stdout: stdout ? Stream.make(encodedStdout) : Stream.empty,
stderr: Stream.empty,
all: Stream.empty,
getInputFd: () => Sink.drain,
@@ -812,6 +819,164 @@ it.layer(NodeServices.layer)("build-desktop-artifact", (it) => {
),
);
it.effect("reports every missing Linux desktop build prerequisite with an install command", () =>
Effect.scoped(
Effect.gen(function* () {
const commands: Array<{ readonly command: string; readonly args: ReadonlyArray<string> }> =
[];
const spawner = Layer.succeed(
ChildProcessSpawner.ChildProcessSpawner,
ChildProcessSpawner.make((command) => {
const childProcess = command as unknown as {
readonly command: string;
readonly args: ReadonlyArray<string>;
};
commands.push(childProcess);
const fails = childProcess.command === "cargo" || childProcess.command === "rustc";
return Effect.succeed(mockProcess(fails ? 1 : 0));
}),
);
const error = yield* preflightLinuxDesktopBuild("arm64").pipe(
Effect.provide(spawner),
Effect.flip,
);
assert.instanceOf(error, LinuxDesktopBuildPrerequisitesMissingError);
assert.deepStrictEqual(error.missing, ["cargo", "rust-target"]);
assert.include(error.message, "Rust compiler and Cargo (cargo, rustc)");
assert.include(error.message, "Requested Rust standard library");
assert.include(error.message, "sudo apt-get install cargo rustc");
assert.include(error.message, "rustup target add aarch64-unknown-linux-gnu");
assert.isTrue(
commands.some(
(command) =>
command.command === "rustc" && command.args.includes("aarch64-unknown-linux-gnu"),
),
);
}),
),
);
it.effect("reports missing macOS tools and Rust targets before building", () =>
Effect.scoped(
Effect.gen(function* () {
const spawner = Layer.succeed(
ChildProcessSpawner.ChildProcessSpawner,
ChildProcessSpawner.make((command) => {
const childProcess = command as unknown as {
readonly command: string;
readonly args: ReadonlyArray<string>;
};
const fails =
childProcess.command === "rustc" ||
(childProcess.command === "xcrun" && childProcess.args.includes("iconutil"));
return Effect.succeed(mockProcess(fails ? 1 : 0));
}),
);
const error = yield* preflightMacDesktopBuild("universal").pipe(
Effect.provide(spawner),
Effect.flip,
);
assert.instanceOf(error, MacDesktopBuildPrerequisitesMissingError);
assert.deepStrictEqual(error.missing, ["rust", "iconutil"]);
assert.deepStrictEqual(error.rustTargets, ["aarch64-apple-darwin", "x86_64-apple-darwin"]);
assert.include(error.message, "xcode-select --install");
assert.include(error.message, "rustup target add aarch64-apple-darwin x86_64-apple-darwin");
}),
),
);
it.effect("reports missing Windows toolchain capabilities before building", () =>
Effect.scoped(
Effect.gen(function* () {
const fs = yield* FileSystem.FileSystem;
const path = yield* Path.Path;
const tempDir = yield* fs.makeTempDirectoryScoped({ prefix: "t3-windows-preflight-" });
const pythonPath = path.join(tempDir, "python.exe");
yield* fs.writeFileString(pythonPath, "python");
const spawner = Layer.succeed(
ChildProcessSpawner.ChildProcessSpawner,
ChildProcessSpawner.make((command) => {
const childProcess = command as unknown as { readonly command: string };
const fails =
childProcess.command === "rustc" ||
childProcess.command === "powershell.exe" ||
childProcess.command === pythonPath;
return Effect.succeed(mockProcess(fails ? 1 : 0));
}),
);
const error = yield* preflightWindowsDesktopBuild({
arch: "x64",
bundlesWslRuntime: true,
}).pipe(
Effect.provide(
Layer.merge(
spawner,
ConfigProvider.layer(
ConfigProvider.fromEnv({ env: { npm_config_python: pythonPath } }),
),
),
),
Effect.flip,
);
assert.instanceOf(error, WindowsDesktopBuildPrerequisitesMissingError);
assert.deepStrictEqual(error.missing, ["rust", "python", "msvc"]);
assert.equal(error.rustTarget, "x86_64-pc-windows-msvc");
assert.include(error.message, "Visual Studio Build Tools components");
}),
),
);
it.effect("rejects a PATH-discovered Python executable that is not Python 3", () =>
Effect.scoped(
Effect.gen(function* () {
const fs = yield* FileSystem.FileSystem;
const path = yield* Path.Path;
const tempDir = yield* fs.makeTempDirectoryScoped({ prefix: "t3-python2-preflight-" });
const pythonPath = path.join(tempDir, "python");
yield* fs.writeFileString(pythonPath, "python2");
const spawner = Layer.succeed(
ChildProcessSpawner.ChildProcessSpawner,
ChildProcessSpawner.make((command) => {
const childProcess = command as unknown as {
readonly command: string;
readonly args: ReadonlyArray<string>;
};
if (childProcess.command === "python") {
return Effect.succeed(mockProcess(0, `${pythonPath}\n`));
}
if (childProcess.command === pythonPath) {
return Effect.succeed(mockProcess(1));
}
return Effect.succeed(mockProcess(0));
}),
);
const error = yield* preflightWindowsDesktopBuild({
arch: "x64",
bundlesWslRuntime: false,
}).pipe(
Effect.provide(
Layer.merge(
spawner,
ConfigProvider.layer(
ConfigProvider.fromEnv({
env: { T3CODE_DESKTOP_REUSE_RESOURCE_MONITOR: "true" },
}),
),
),
),
Effect.flip,
);
assert.instanceOf(error, WindowsDesktopBuildPrerequisitesMissingError);
assert.deepStrictEqual(error.missing, ["python"]);
}),
),
);
it.effect("validates every ASAR-unpacked native in the packaged Windows payload", () =>
Effect.scoped(
Effect.gen(function* () {
+321 -19
View File
@@ -287,6 +287,125 @@ export class BuildCommandFailedError extends Schema.TaggedErrorClass<BuildComman
}
}
export const LINUX_DESKTOP_BUILD_PREREQUISITES = [
{ id: "cargo", description: "Rust compiler and Cargo", packages: ["cargo", "rustc"] },
{ id: "rust-target", description: "Requested Rust standard library", packages: [] },
{ id: "cc", description: "C/C++ build toolchain", packages: ["build-essential"] },
{ id: "make", description: "Make", packages: ["build-essential"] },
{ id: "imagemagick", description: "ImageMagick", packages: ["imagemagick"] },
] as const;
export class LinuxDesktopBuildPrerequisitesMissingError extends Schema.TaggedErrorClass<LinuxDesktopBuildPrerequisitesMissingError>()(
"LinuxDesktopBuildPrerequisitesMissingError",
{
missing: Schema.Array(Schema.String),
rustTarget: Schema.String,
},
) {
override get message(): string {
const missingRequirements = LINUX_DESKTOP_BUILD_PREREQUISITES.filter((requirement) =>
this.missing.includes(requirement.id),
);
const details = missingRequirements
.map((requirement) =>
requirement.packages.length > 0
? ` - ${requirement.description} (${requirement.packages.join(", ")})`
: ` - ${requirement.description}`,
)
.join("\n");
const packages = [
...new Set(missingRequirements.flatMap((requirement) => requirement.packages)),
];
return [
"Linux desktop build prerequisites are missing:",
details,
"",
...(packages.length > 0
? ["On Ubuntu/Debian, install them with:", ` sudo apt-get install ${packages.join(" ")}`]
: []),
...(this.missing.includes("rust-target")
? ["Add the requested Rust target with:", ` rustup target add ${this.rustTarget}`]
: []),
"",
"For other distributions, see docs/internals/scripts.md#linux-appimage-prerequisites.",
"Then rerun `vp run dist:desktop:linux`.",
].join("\n");
}
}
const MAC_DESKTOP_BUILD_PREREQUISITES = [
{ id: "rust", description: "Rust/Cargo and the requested Rust target" },
{ id: "clang", description: "Xcode Command Line Tools (clang)" },
{ id: "make", description: "Xcode Command Line Tools (make)" },
{ id: "sips", description: "macOS image tool (sips)" },
{ id: "iconutil", description: "macOS icon tool (iconutil)" },
{ id: "lipo", description: "Xcode universal-binary tool (lipo)" },
] as const;
export class MacDesktopBuildPrerequisitesMissingError extends Schema.TaggedErrorClass<MacDesktopBuildPrerequisitesMissingError>()(
"MacDesktopBuildPrerequisitesMissingError",
{
missing: Schema.Array(Schema.String),
rustTargets: Schema.Array(Schema.String),
},
) {
override get message(): string {
const details = MAC_DESKTOP_BUILD_PREREQUISITES.filter((requirement) =>
this.missing.includes(requirement.id),
)
.map((requirement) => ` - ${requirement.description}`)
.join("\n");
return [
"macOS desktop build prerequisites are missing:",
details,
"",
"Install Apple's build tools with:",
" xcode-select --install",
"Install Rust from https://rustup.rs, then add the requested target(s):",
` rustup target add ${this.rustTargets.join(" ")}`,
"",
"Then rerun the desktop artifact command.",
].join("\n");
}
}
const WINDOWS_DESKTOP_BUILD_PREREQUISITES = [
{ id: "rust", description: "Rust/Cargo and the requested MSVC Rust target" },
{ id: "python", description: "Python 3 for node-gyp" },
{
id: "msvc",
description: "Visual Studio Build Tools with C++, Windows SDK, and Spectre libraries",
},
{ id: "tar", description: "tar for the bundled WSL runtime" },
] as const;
export class WindowsDesktopBuildPrerequisitesMissingError extends Schema.TaggedErrorClass<WindowsDesktopBuildPrerequisitesMissingError>()(
"WindowsDesktopBuildPrerequisitesMissingError",
{
missing: Schema.Array(Schema.String),
rustTarget: Schema.String,
},
) {
override get message(): string {
const details = WINDOWS_DESKTOP_BUILD_PREREQUISITES.filter((requirement) =>
this.missing.includes(requirement.id),
)
.map((requirement) => ` - ${requirement.description}`)
.join("\n");
return [
"Windows desktop build prerequisites are missing:",
details,
"",
"Install Rust from https://rustup.rs and add the requested target:",
` rustup target add ${this.rustTarget}`,
"Install Python 3 and the Visual Studio Build Tools components listed in",
"docs/internals/scripts.md#windows-installer-prerequisites.",
"",
"Then rerun the desktop artifact command.",
].join("\n");
}
}
export class ResourceMonitorBuildOutputMissingError extends Schema.TaggedErrorClass<ResourceMonitorBuildOutputMissingError>()(
"ResourceMonitorBuildOutputMissingError",
{
@@ -721,8 +840,18 @@ const resolvePythonForNodeGyp = Effect.fn("resolvePythonForNodeGyp")(function* (
),
localAppData: Config.string("LOCALAPPDATA").pipe(Config.option),
});
const isPython3 = (candidate: string) =>
spawnAndCollectOutput(
ChildProcess.make(candidate, [
"-c",
"import sys; raise SystemExit(0 if sys.version_info.major == 3 else 1)",
]),
).pipe(
Effect.map((result) => result.exitCode === 0),
Effect.orElseSucceed(() => false),
);
const configured = Option.getOrUndefined(env.configuredPython);
if (configured && (yield* fs.exists(configured))) {
if (configured && (yield* fs.exists(configured)) && (yield* isPython3(configured))) {
return configured;
}
@@ -731,7 +860,7 @@ const resolvePythonForNodeGyp = Effect.fn("resolvePythonForNodeGyp")(function* (
if (localAppData) {
for (const version of ["Python313", "Python312", "Python311", "Python310"]) {
const candidate = path.join(localAppData, "Programs", "Python", version, "python.exe");
if (yield* fs.exists(candidate)) {
if ((yield* fs.exists(candidate)) && (yield* isPython3(candidate))) {
return candidate;
}
}
@@ -753,7 +882,7 @@ const resolvePythonForNodeGyp = Effect.fn("resolvePythonForNodeGyp")(function* (
}
const executable = probe.stdout.trim();
if (!executable || !(yield* fs.exists(executable))) {
if (!executable || !(yield* fs.exists(executable)) || !(yield* isPython3(executable))) {
return undefined;
}
@@ -1468,6 +1597,164 @@ const runCommand = Effect.fn("runCommand")(function* (
}
});
const desktopBuildProbeSucceeds = Effect.fn("desktopBuildProbeSucceeds")(function* (
command: ChildProcess.Command,
label: string,
) {
return yield* runCommand(command, { label, verbose: false }).pipe(
Effect.as(true),
Effect.orElseSucceed(() => false),
);
});
const rustTargetIsInstalled = Effect.fn("rustTargetIsInstalled")(function* (target: string) {
const fs = yield* FileSystem.FileSystem;
const result = yield* spawnAndCollectOutput(
ChildProcess.make("rustc", ["--print", "target-libdir", "--target", target]),
).pipe(Effect.orElseSucceed(() => null));
if (result === null || result.exitCode !== 0) return false;
const targetLibDir = result.stdout.trim();
if (targetLibDir === "") return false;
const entries = yield* fs.readDirectory(targetLibDir).pipe(Effect.orElseSucceed(() => []));
return entries.some((entry) => entry.startsWith("libstd-") && entry.endsWith(".rlib"));
});
export const preflightLinuxDesktopBuild = Effect.fn("preflightLinuxDesktopBuild")(function* (
arch: typeof BuildArch.Type = "x64",
) {
const reuseResourceMonitor = yield* Config.boolean("T3CODE_DESKTOP_REUSE_RESOURCE_MONITOR").pipe(
Config.withDefault(false),
);
const rustTarget = resolveResourceMonitorRustTargets("linux", arch)[0]!;
const checks = yield* Effect.all(
{
cargo: reuseResourceMonitor
? Effect.succeed(true)
: desktopBuildProbeSucceeds(ChildProcess.make("cargo", ["--version"]), "cargo"),
"rust-target": reuseResourceMonitor
? Effect.succeed(true)
: rustTargetIsInstalled(rustTarget),
cc: desktopBuildProbeSucceeds(ChildProcess.make("cc", ["--version"]), "cc"),
make: desktopBuildProbeSucceeds(ChildProcess.make("make", ["--version"]), "make"),
imagemagick: Effect.all([
desktopBuildProbeSucceeds(ChildProcess.make("magick", ["-version"]), "magick"),
desktopBuildProbeSucceeds(ChildProcess.make("convert", ["-version"]), "convert"),
]).pipe(Effect.map(([magick, convert]) => magick || convert)),
},
{ concurrency: "unbounded" },
);
const missing = LINUX_DESKTOP_BUILD_PREREQUISITES.filter(
(requirement) => !checks[requirement.id],
).map((requirement) => requirement.id);
if (missing.length > 0) {
return yield* new LinuxDesktopBuildPrerequisitesMissingError({ missing, rustTarget });
}
});
export const preflightMacDesktopBuild = Effect.fn("preflightMacDesktopBuild")(function* (
arch: typeof BuildArch.Type,
) {
const rustTargets = resolveResourceMonitorRustTargets("mac", arch);
const reuseResourceMonitor = yield* Config.boolean("T3CODE_DESKTOP_REUSE_RESOURCE_MONITOR").pipe(
Config.withDefault(false),
);
const checks = yield* Effect.all(
{
rust: reuseResourceMonitor
? Effect.succeed(true)
: Effect.all([
desktopBuildProbeSucceeds(ChildProcess.make("cargo", ["--version"]), "cargo"),
Effect.forEach(rustTargets, rustTargetIsInstalled).pipe(
Effect.map((results) => results.every(Boolean)),
),
]).pipe(Effect.map(([cargo, targets]) => cargo && targets)),
clang: desktopBuildProbeSucceeds(ChildProcess.make("clang", ["--version"]), "clang"),
make: desktopBuildProbeSucceeds(ChildProcess.make("make", ["--version"]), "make"),
sips: desktopBuildProbeSucceeds(ChildProcess.make("sips", ["--help"]), "sips"),
iconutil: desktopBuildProbeSucceeds(
ChildProcess.make("xcrun", ["--find", "iconutil"]),
"iconutil",
),
lipo:
arch === "universal"
? desktopBuildProbeSucceeds(ChildProcess.make("lipo", ["-version"]), "lipo")
: Effect.succeed(true),
},
{ concurrency: "unbounded" },
);
const missing = MAC_DESKTOP_BUILD_PREREQUISITES.filter(
(requirement) => !checks[requirement.id],
).map((requirement) => requirement.id);
if (missing.length > 0) {
return yield* new MacDesktopBuildPrerequisitesMissingError({ missing, rustTargets });
}
});
function windowsVswherePrerequisiteScript(arch: typeof BuildArch.Type): string {
const components =
arch === "arm64"
? [
"Microsoft.VisualStudio.Component.VC.Tools.ARM64",
"Microsoft.VisualStudio.Component.VC.Tools.ARM64.Spectre",
]
: [
"Microsoft.VisualStudio.Component.VC.Tools.x86.x64",
"Microsoft.VisualStudio.Component.VC.Tools.x86.x64.Spectre",
];
return [
"$vswhere = Join-Path ${env:ProgramFiles(x86)} 'Microsoft Visual Studio\\Installer\\vswhere.exe'",
"if (!(Test-Path $vswhere)) { exit 1 }",
`$install = & $vswhere -latest -products * -requires ${components.join(" ")} -property installationPath`,
"if (!$install) { exit 1 }",
"$kitsRoot = Get-ItemPropertyValue 'HKLM:\\SOFTWARE\\Microsoft\\Windows Kits\\Installed Roots' -Name KitsRoot10 -ErrorAction SilentlyContinue",
"if (!$kitsRoot -or !(Test-Path (Join-Path $kitsRoot 'Lib'))) { exit 1 }",
].join("; ");
}
export const preflightWindowsDesktopBuild = Effect.fn("preflightWindowsDesktopBuild")(
function* (input: { readonly arch: typeof BuildArch.Type; readonly bundlesWslRuntime: boolean }) {
const rustTarget = resolveResourceMonitorRustTargets("win", input.arch)[0]!;
const reuseResourceMonitor = yield* Config.boolean(
"T3CODE_DESKTOP_REUSE_RESOURCE_MONITOR",
).pipe(Config.withDefault(false));
const python = yield* resolvePythonForNodeGyp();
const checks = yield* Effect.all(
{
rust: reuseResourceMonitor
? Effect.succeed(true)
: Effect.all([
desktopBuildProbeSucceeds(ChildProcess.make("cargo", ["--version"]), "cargo"),
rustTargetIsInstalled(rustTarget),
]).pipe(Effect.map(([cargo, target]) => cargo && target)),
python: Effect.succeed(python !== undefined),
msvc: desktopBuildProbeSucceeds(
ChildProcess.make("powershell.exe", [
"-NoLogo",
"-NoProfile",
"-NonInteractive",
"-Command",
windowsVswherePrerequisiteScript(input.arch),
]),
"Visual Studio Build Tools",
),
tar: input.bundlesWslRuntime
? desktopBuildProbeSucceeds(ChildProcess.make("tar.exe", ["--version"]), "tar")
: Effect.succeed(true),
},
{ concurrency: "unbounded" },
);
const missing = WINDOWS_DESKTOP_BUILD_PREREQUISITES.filter(
(requirement) => !checks[requirement.id],
).map((requirement) => requirement.id);
if (missing.length > 0) {
return yield* new WindowsDesktopBuildPrerequisitesMissingError({ missing, rustTarget });
}
},
);
/**
* Every `node_modules` directory that would be visible from `startDir`.
*
@@ -1714,22 +2001,22 @@ const verifyPackagedBundleIsSelfContained = Effect.fn("verifyPackagedBundleIsSel
// stdin, a port, a lock) would otherwise hang release CI until the job
// times out with nothing useful in the log.
Effect.timeout(BUNDLE_SELF_CHECK_TIMEOUT),
Effect.catchTag("TimeoutError", () =>
Effect.fail(
new BundleNotSelfContainedError({
exitCode: -1,
output: `The packaged bundle did not print its version within ${Duration.toSeconds(BUNDLE_SELF_CHECK_TIMEOUT)}s; it is hanging rather than failing to resolve.`,
}),
),
),
Effect.catchTag("BuildCommandFailedError", (error) =>
Effect.fail(
new BundleNotSelfContainedError({
exitCode: error.exitCode,
output: `${error.stderrTail ?? ""}${error.stdoutTail ?? ""}`.trim(),
}),
),
),
Effect.catchTags({
TimeoutError: () =>
Effect.fail(
new BundleNotSelfContainedError({
exitCode: -1,
output: `The packaged bundle did not print its version within ${Duration.toSeconds(BUNDLE_SELF_CHECK_TIMEOUT)}s; it is hanging rather than failing to resolve.`,
}),
),
BuildCommandFailedError: (error) =>
Effect.fail(
new BundleNotSelfContainedError({
exitCode: error.exitCode,
output: `${error.stderrTail ?? ""}${error.stdoutTail ?? ""}`.trim(),
}),
),
}),
);
},
);
@@ -2899,6 +3186,21 @@ const buildDesktopArtifact = Effect.fn("buildDesktopArtifact")(function* (
const path = yield* Path.Path;
const fs = yield* FileSystem.FileSystem;
const hostPlatform = yield* HostProcessPlatform;
if (hostPlatform === "linux" && options.platform === "linux") {
yield* preflightLinuxDesktopBuild(options.arch);
}
if (hostPlatform === "darwin" && options.platform === "mac") {
yield* preflightMacDesktopBuild(options.arch);
}
if (hostPlatform === "win32" && options.platform === "win") {
yield* preflightWindowsDesktopBuild({
arch: options.arch,
bundlesWslRuntime: bundlesWslRuntime({
arch: options.arch,
prebuildPath: options.wslPrebuild,
}),
});
}
const workspaceConfig = yield* readWorkspaceConfig();
const workspaceCatalog = workspaceConfig.catalog ?? {};
const workspaceOverrides = workspaceConfig.overrides ?? {};