feat: add linux-musl (Alpine) builds for x64 and arm64 (#784)
* feat: add linux-musl (Alpine) builds for x64 and arm64 Add x86_64-unknown-linux-musl and aarch64-unknown-linux-musl targets to the release workflow using cargo-zigbuild. Update the JS wrapper and postinstall script to detect musl libc and select the correct binary. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * fix: simplify isMusl() and add musl targets to build script Address PR #784 review feedback: - Remove redundant first try block in isMusl() (ldd --version always throws on musl, so only the `|| true` variant works) - Add x86_64-unknown-linux-musl and aarch64-unknown-linux-musl targets to build-all-platforms.sh to stay in sync with the release workflow Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 4.6
parent
c4a40033e0
commit
388f19e1bb
+13
-1
@@ -20,8 +20,20 @@ const __dirname = dirname(fileURLToPath(import.meta.url));
|
||||
const projectRoot = join(__dirname, '..');
|
||||
const binDir = join(projectRoot, 'bin');
|
||||
|
||||
// Detect if the system uses musl libc (e.g. Alpine Linux)
|
||||
function isMusl() {
|
||||
if (platform() !== 'linux') return false;
|
||||
try {
|
||||
const result = execSync('ldd --version 2>&1 || true', { encoding: 'utf8' });
|
||||
return result.toLowerCase().includes('musl');
|
||||
} catch {
|
||||
return existsSync('/lib/ld-musl-x86_64.so.1') || existsSync('/lib/ld-musl-aarch64.so.1');
|
||||
}
|
||||
}
|
||||
|
||||
// Platform detection
|
||||
const platformKey = `${platform()}-${arch()}`;
|
||||
const osKey = platform() === 'linux' && isMusl() ? 'linux-musl' : platform();
|
||||
const platformKey = `${osKey}-${arch()}`;
|
||||
const ext = platform() === 'win32' ? '.exe' : '';
|
||||
const binaryName = `agent-browser-${platformKey}${ext}`;
|
||||
const binaryPath = join(binDir, binaryName);
|
||||
|
||||
Reference in New Issue
Block a user