Continue to optimize appimage packaging
This commit is contained in:
23
bin/builders/BaseBuilder.ts
vendored
23
bin/builders/BaseBuilder.ts
vendored
@@ -123,14 +123,12 @@ export default abstract class BaseBuilder {
|
||||
`cd "${npmDirectory}" && ${packageManager} install${registryOption}${peerDepsOption}`,
|
||||
timeout,
|
||||
buildEnv,
|
||||
this.options.debug,
|
||||
);
|
||||
} else {
|
||||
await shellExec(
|
||||
`cd "${npmDirectory}" && ${packageManager} install${peerDepsOption}`,
|
||||
timeout,
|
||||
buildEnv,
|
||||
this.options.debug,
|
||||
);
|
||||
}
|
||||
spinner.succeed(chalk.green('Package installed!'));
|
||||
@@ -169,11 +167,24 @@ export default abstract class BaseBuilder {
|
||||
...(process.env.NO_STRIP && { NO_STRIP: process.env.NO_STRIP }),
|
||||
};
|
||||
|
||||
// Warn users about potential AppImage build failures on modern Linux systems.
|
||||
// The linuxdeploy tool bundled in Tauri uses an older strip tool that doesn't
|
||||
// recognize the .relr.dyn section introduced in glibc 2.38+.
|
||||
if (process.platform === 'linux' && this.options.targets === 'appimage') {
|
||||
if (!buildEnv.NO_STRIP) {
|
||||
logger.warn(
|
||||
'⚠ Building AppImage on Linux may fail due to strip incompatibility with glibc 2.38+',
|
||||
);
|
||||
logger.warn(
|
||||
'⚠ If build fails, retry with: NO_STRIP=1 pake <url> --targets appimage',
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
await shellExec(
|
||||
`cd "${npmDirectory}" && ${this.getBuildCommand(packageManager)}`,
|
||||
this.getBuildTimeout(),
|
||||
buildEnv,
|
||||
this.options.debug,
|
||||
);
|
||||
|
||||
// Copy app
|
||||
@@ -280,6 +291,12 @@ export default abstract class BaseBuilder {
|
||||
fullCommand += ` --target ${target}`;
|
||||
}
|
||||
|
||||
// Enable verbose output in debug mode to help diagnose build issues.
|
||||
// This provides detailed logs from Tauri CLI and bundler tools.
|
||||
if (this.options.debug) {
|
||||
fullCommand += ' --verbose';
|
||||
}
|
||||
|
||||
return fullCommand;
|
||||
}
|
||||
|
||||
|
||||
7
bin/builders/LinuxBuilder.ts
vendored
7
bin/builders/LinuxBuilder.ts
vendored
@@ -78,6 +78,13 @@ export default class LinuxBuilder extends BaseBuilder {
|
||||
fullCommand += ` --features ${features.join(',')}`;
|
||||
}
|
||||
|
||||
// Enable verbose output for AppImage builds when debugging or PAKE_VERBOSE is set.
|
||||
// AppImage builds often fail with minimal error messages from linuxdeploy,
|
||||
// so verbose mode helps diagnose issues like strip failures and missing dependencies.
|
||||
if (this.options.targets === 'appimage' && (this.options.debug || process.env.PAKE_VERBOSE)) {
|
||||
fullCommand += ' --verbose';
|
||||
}
|
||||
|
||||
return fullCommand;
|
||||
}
|
||||
|
||||
|
||||
1
bin/helpers/rust.ts
vendored
1
bin/helpers/rust.ts
vendored
@@ -83,7 +83,6 @@ export async function installRust() {
|
||||
IS_WIN ? rustInstallScriptForWindows : rustInstallScriptForMac,
|
||||
300000,
|
||||
undefined,
|
||||
true,
|
||||
);
|
||||
spinner.succeed(chalk.green('✔ Rust installed successfully!'));
|
||||
ensureRustEnv();
|
||||
|
||||
23
bin/utils/shell.ts
vendored
23
bin/utils/shell.ts
vendored
@@ -5,12 +5,13 @@ export async function shellExec(
|
||||
command: string,
|
||||
timeout: number = 300000,
|
||||
env?: Record<string, string>,
|
||||
showOutput: boolean = false,
|
||||
) {
|
||||
try {
|
||||
const { exitCode } = await execa(command, {
|
||||
cwd: npmDirectory,
|
||||
stdio: showOutput ? 'inherit' : ['inherit', 'pipe', 'inherit'],
|
||||
// Use 'inherit' to show all output directly to user in real-time.
|
||||
// This ensures linuxdeploy and other tool outputs are visible during builds.
|
||||
stdio: 'inherit',
|
||||
shell: true,
|
||||
timeout,
|
||||
env: env ? { ...process.env, ...env } : process.env,
|
||||
@@ -28,6 +29,8 @@ export async function shellExec(
|
||||
|
||||
let errorMsg = `Error occurred while executing command "${command}". Exit code: ${exitCode}. Details: ${errorMessage}`;
|
||||
|
||||
// Provide helpful guidance for common Linux AppImage build failures
|
||||
// caused by strip tool incompatibility with modern glibc (2.38+)
|
||||
if (
|
||||
process.platform === 'linux' &&
|
||||
(errorMessage.includes('linuxdeploy') ||
|
||||
@@ -35,10 +38,18 @@ export async function shellExec(
|
||||
errorMessage.includes('strip'))
|
||||
) {
|
||||
errorMsg +=
|
||||
'\n\nLinux AppImage build error. Try one of these solutions:\n' +
|
||||
' 1. Run with: NO_STRIP=true pake <url> --targets appimage\n' +
|
||||
' 2. Use DEB format instead: pake <url> --targets deb\n' +
|
||||
' 3. See detailed solutions: https://github.com/tw93/Pake/blob/main/docs/faq.md';
|
||||
'\n\n━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\n' +
|
||||
'Linux AppImage Build Failed\n' +
|
||||
'━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\n\n' +
|
||||
'Cause: Strip tool incompatibility with glibc 2.38+\n' +
|
||||
' (affects Debian Trixie, Arch Linux, and other modern distros)\n\n' +
|
||||
'Quick fix:\n' +
|
||||
' NO_STRIP=1 pake <url> --targets appimage --debug\n\n' +
|
||||
'Alternatives:\n' +
|
||||
' • Use DEB format: pake <url> --targets deb\n' +
|
||||
' • Update binutils: sudo apt install binutils (or pacman -S binutils)\n' +
|
||||
' • Detailed guide: https://github.com/tw93/Pake/blob/main/docs/faq.md\n' +
|
||||
'━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━';
|
||||
}
|
||||
|
||||
throw new Error(errorMsg);
|
||||
|
||||
Reference in New Issue
Block a user