Skip to content

Commit a5f3c4d

Browse files
authored
fix: skip windows exe patching in ci mode to avoid wine dependency (#645)
The server release CI workflow fails on ubuntu-latest because patch-windows-exe.ts requires Wine to run rcedit. Thread the existing --ci flag through compileServerBinaries so Windows PE metadata patching is skipped in CI mode with a warning log.
1 parent e5a852d commit a5f3c4d

2 files changed

Lines changed: 15 additions & 6 deletions

File tree

packages/browseros-agent/scripts/build/server/compile.ts

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import { mkdirSync, rmSync } from 'node:fs'
22
import { join } from 'node:path'
33

4+
import { log } from '../log'
45
import { wasmBinaryPlugin } from '../plugins/wasm-binary'
56
import { runCommand } from './command'
67
import type { BuildTarget, CompiledServerBinary } from './types'
@@ -52,6 +53,7 @@ async function bundleServer(
5253
async function compileTarget(
5354
target: BuildTarget,
5455
env: NodeJS.ProcessEnv,
56+
ci: boolean,
5557
): Promise<string> {
5658
const binaryPath = compiledBinaryPath(target)
5759
const args = [
@@ -66,11 +68,15 @@ async function compileTarget(
6668
await runCommand('bun', args, env)
6769

6870
if (target.os === 'windows') {
69-
await runCommand(
70-
'bun',
71-
['scripts/patch-windows-exe.ts', binaryPath],
72-
process.env,
73-
)
71+
if (ci) {
72+
log.warn('Skipping Windows exe metadata patching in CI mode')
73+
} else {
74+
await runCommand(
75+
'bun',
76+
['scripts/patch-windows-exe.ts', binaryPath],
77+
process.env,
78+
)
79+
}
7480
}
7581

7682
return binaryPath
@@ -81,14 +87,16 @@ export async function compileServerBinaries(
8187
envVars: Record<string, string>,
8288
processEnv: NodeJS.ProcessEnv,
8389
version: string,
90+
options?: { ci?: boolean },
8491
): Promise<CompiledServerBinary[]> {
92+
const ci = options?.ci ?? false
8593
rmSync(TMP_ROOT, { recursive: true, force: true })
8694
mkdirSync(BINARIES_DIR, { recursive: true })
8795
await bundleServer(envVars, version)
8896

8997
const compiled: CompiledServerBinary[] = []
9098
for (const target of targets) {
91-
const binaryPath = await compileTarget(target, processEnv)
99+
const binaryPath = await compileTarget(target, processEnv, ci)
92100
compiled.push({ target, binaryPath })
93101
}
94102

packages/browseros-agent/scripts/build/server/orchestrator.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ export async function runProdResourceBuild(argv: string[]): Promise<void> {
3737
buildConfig.envVars,
3838
buildConfig.processEnv,
3939
buildConfig.version,
40+
{ ci: args.ci },
4041
)
4142

4243
if (args.ci) {

0 commit comments

Comments
 (0)