Skip to content

Commit a8d614e

Browse files
committed
Continue to optimize appimage packaging
1 parent d12efb5 commit a8d614e

File tree

4 files changed

+44
-10
lines changed

4 files changed

+44
-10
lines changed

โ€Žbin/builders/BaseBuilder.tsโ€Ž

Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -123,14 +123,12 @@ export default abstract class BaseBuilder {
123123
`cd "${npmDirectory}" && ${packageManager} install${registryOption}${peerDepsOption}`,
124124
timeout,
125125
buildEnv,
126-
this.options.debug,
127126
);
128127
} else {
129128
await shellExec(
130129
`cd "${npmDirectory}" && ${packageManager} install${peerDepsOption}`,
131130
timeout,
132131
buildEnv,
133-
this.options.debug,
134132
);
135133
}
136134
spinner.succeed(chalk.green('Package installed!'));
@@ -169,11 +167,24 @@ export default abstract class BaseBuilder {
169167
...(process.env.NO_STRIP && { NO_STRIP: process.env.NO_STRIP }),
170168
};
171169

170+
// Warn users about potential AppImage build failures on modern Linux systems.
171+
// The linuxdeploy tool bundled in Tauri uses an older strip tool that doesn't
172+
// recognize the .relr.dyn section introduced in glibc 2.38+.
173+
if (process.platform === 'linux' && this.options.targets === 'appimage') {
174+
if (!buildEnv.NO_STRIP) {
175+
logger.warn(
176+
'โš  Building AppImage on Linux may fail due to strip incompatibility with glibc 2.38+',
177+
);
178+
logger.warn(
179+
'โš  If build fails, retry with: NO_STRIP=1 pake <url> --targets appimage',
180+
);
181+
}
182+
}
183+
172184
await shellExec(
173185
`cd "${npmDirectory}" && ${this.getBuildCommand(packageManager)}`,
174186
this.getBuildTimeout(),
175187
buildEnv,
176-
this.options.debug,
177188
);
178189

179190
// Copy app
@@ -280,6 +291,12 @@ export default abstract class BaseBuilder {
280291
fullCommand += ` --target ${target}`;
281292
}
282293

294+
// Enable verbose output in debug mode to help diagnose build issues.
295+
// This provides detailed logs from Tauri CLI and bundler tools.
296+
if (this.options.debug) {
297+
fullCommand += ' --verbose';
298+
}
299+
283300
return fullCommand;
284301
}
285302

โ€Žbin/builders/LinuxBuilder.tsโ€Ž

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,13 @@ export default class LinuxBuilder extends BaseBuilder {
7878
fullCommand += ` --features ${features.join(',')}`;
7979
}
8080

81+
// Enable verbose output for AppImage builds when debugging or PAKE_VERBOSE is set.
82+
// AppImage builds often fail with minimal error messages from linuxdeploy,
83+
// so verbose mode helps diagnose issues like strip failures and missing dependencies.
84+
if (this.options.targets === 'appimage' && (this.options.debug || process.env.PAKE_VERBOSE)) {
85+
fullCommand += ' --verbose';
86+
}
87+
8188
return fullCommand;
8289
}
8390

โ€Žbin/helpers/rust.tsโ€Ž

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,6 @@ export async function installRust() {
8383
IS_WIN ? rustInstallScriptForWindows : rustInstallScriptForMac,
8484
300000,
8585
undefined,
86-
true,
8786
);
8887
spinner.succeed(chalk.green('โœ” Rust installed successfully!'));
8988
ensureRustEnv();

โ€Žbin/utils/shell.tsโ€Ž

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,13 @@ export async function shellExec(
55
command: string,
66
timeout: number = 300000,
77
env?: Record<string, string>,
8-
showOutput: boolean = false,
98
) {
109
try {
1110
const { exitCode } = await execa(command, {
1211
cwd: npmDirectory,
13-
stdio: showOutput ? 'inherit' : ['inherit', 'pipe', 'inherit'],
12+
// Use 'inherit' to show all output directly to user in real-time.
13+
// This ensures linuxdeploy and other tool outputs are visible during builds.
14+
stdio: 'inherit',
1415
shell: true,
1516
timeout,
1617
env: env ? { ...process.env, ...env } : process.env,
@@ -28,17 +29,27 @@ export async function shellExec(
2829

2930
let errorMsg = `Error occurred while executing command "${command}". Exit code: ${exitCode}. Details: ${errorMessage}`;
3031

32+
// Provide helpful guidance for common Linux AppImage build failures
33+
// caused by strip tool incompatibility with modern glibc (2.38+)
3134
if (
3235
process.platform === 'linux' &&
3336
(errorMessage.includes('linuxdeploy') ||
3437
errorMessage.includes('appimage') ||
3538
errorMessage.includes('strip'))
3639
) {
3740
errorMsg +=
38-
'\n\nLinux AppImage build error. Try one of these solutions:\n' +
39-
' 1. Run with: NO_STRIP=true pake <url> --targets appimage\n' +
40-
' 2. Use DEB format instead: pake <url> --targets deb\n' +
41-
' 3. See detailed solutions: https://github.com/tw93/Pake/blob/main/docs/faq.md';
41+
'\n\nโ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”\n' +
42+
'Linux AppImage Build Failed\n' +
43+
'โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”\n\n' +
44+
'Cause: Strip tool incompatibility with glibc 2.38+\n' +
45+
' (affects Debian Trixie, Arch Linux, and other modern distros)\n\n' +
46+
'Quick fix:\n' +
47+
' NO_STRIP=1 pake <url> --targets appimage --debug\n\n' +
48+
'Alternatives:\n' +
49+
' โ€ข Use DEB format: pake <url> --targets deb\n' +
50+
' โ€ข Update binutils: sudo apt install binutils (or pacman -S binutils)\n' +
51+
' โ€ข Detailed guide: https://github.com/tw93/Pake/blob/main/docs/faq.md\n' +
52+
'โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”';
4253
}
4354

4455
throw new Error(errorMsg);

0 commit comments

Comments
ย (0)