mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-05-12 21:03:05 -07:00
improve: enhance error reporting in build_binaries.js
- Check stderr, stdout, and message for comprehensive error info - Format multi-line errors with proper indentation - Ensures all error details are visible for debugging CI failures
This commit is contained in:
+22
-11
@@ -49,14 +49,18 @@ for (const { name, target } of targets) {
|
|||||||
console.log(`Building ${name}...`);
|
console.log(`Building ${name}...`);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
execFileSync('bun', [
|
execFileSync(
|
||||||
'build',
|
'bun',
|
||||||
'--compile',
|
[
|
||||||
`--target=${target}`,
|
'build',
|
||||||
bundleJs,
|
'--compile',
|
||||||
'--outfile',
|
`--target=${target}`,
|
||||||
outputPath
|
bundleJs,
|
||||||
], { stdio: ['pipe', 'pipe', 'pipe'] });
|
'--outfile',
|
||||||
|
outputPath,
|
||||||
|
],
|
||||||
|
{ stdio: ['pipe', 'pipe', 'pipe'] },
|
||||||
|
);
|
||||||
|
|
||||||
if (fs.existsSync(outputPath)) {
|
if (fs.existsSync(outputPath)) {
|
||||||
const stats = fs.statSync(outputPath);
|
const stats = fs.statSync(outputPath);
|
||||||
@@ -68,9 +72,16 @@ for (const { name, target } of targets) {
|
|||||||
}
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error(` ✗ Failed to build ${name}`);
|
console.error(` ✗ Failed to build ${name}`);
|
||||||
console.error(` ${error.message}`);
|
const errorDetails =
|
||||||
if (error.stderr) {
|
error.stderr || error.stdout || error.message || 'Unknown error';
|
||||||
console.error(` ${error.stderr.toString()}`);
|
const errorString = errorDetails.toString().trim();
|
||||||
|
if (errorString) {
|
||||||
|
console.error(
|
||||||
|
errorString
|
||||||
|
.split('\n')
|
||||||
|
.map((line) => ` ${line}`)
|
||||||
|
.join('\n'),
|
||||||
|
);
|
||||||
}
|
}
|
||||||
failedTargets.push(name);
|
failedTargets.push(name);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user