Skip to content

Commit ada9cac

Browse files
lgeigerdevelar
authored andcommitted
fix(rebuild): Log stdout and stderr (#1450)
This logs the output of the rebuild process to help debug build failures like #1415
1 parent 5b83860 commit ada9cac

File tree

1 file changed

+11
-2
lines changed
  • packages/electron-builder/src

1 file changed

+11
-2
lines changed

packages/electron-builder/src/yarn.ts

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@ function installDependencies(appDir: string, frameworkInfo: DesktopFrameworkInfo
7171
return spawn(execPath, execArgs, {
7272
cwd: appDir,
7373
env: getGypEnv(frameworkInfo, platform, arch, buildFromSource),
74+
stdio: ["pipe", process.stdout, process.stderr]
7475
})
7576
}
7677

@@ -114,7 +115,11 @@ export async function rebuild(appDir: string, frameworkInfo: DesktopFrameworkInf
114115
execArgs.push(...additionalArgs)
115116
await BluebirdPromise.each(nativeDeps, dep => {
116117
log(`Rebuilding native dependency ${dep.name}`)
117-
return spawn(execPath, execArgs, {cwd: dep.path, env: env})
118+
return spawn(execPath, execArgs, {
119+
cwd: dep.path,
120+
env: env,
121+
stdio: ["pipe", process.stdout, process.stderr]
122+
})
118123
.catch(error => {
119124
if (dep.optional) {
120125
warn(`Cannot build optional native dep ${dep.name}`)
@@ -129,6 +134,10 @@ export async function rebuild(appDir: string, frameworkInfo: DesktopFrameworkInf
129134
execArgs.push("rebuild")
130135
execArgs.push(...additionalArgs)
131136
execArgs.push(...nativeDeps.map(it => it.name))
132-
await spawn(execPath, execArgs, {cwd: appDir, env: env})
137+
await spawn(execPath, execArgs, {
138+
cwd: appDir,
139+
env: env,
140+
stdio: ["pipe", process.stdout, process.stderr]
141+
})
133142
}
134143
}

0 commit comments

Comments
 (0)