diff --git a/bin/railway.js b/bin/railway.js index f98ab7949..04165a813 100644 --- a/bin/railway.js +++ b/bin/railway.js @@ -12,5 +12,10 @@ try { stdio: "inherit", }); } catch (e) { - exit(1); + if (e.signal) { + console.error( + `The railway binary crashed with ${e.signal}. Please report this at https://github.com/railwayapp/cli/issues`, + ); + } + exit(typeof e.status === "number" ? e.status : 1); } diff --git a/npm-install/postinstall.js b/npm-install/postinstall.js index 2e6389a2e..9ad4b12dc 100644 --- a/npm-install/postinstall.js +++ b/npm-install/postinstall.js @@ -19,9 +19,20 @@ async function install() { // Fetch Static Config let { name: binName, path: binPath, url } = CONFIG; - let triple = triples.platformArchTriples[process.platform][process.arch][0]; - - url = url.replace(/{{triple}}/g, triple.raw); + // Linux: statically linked musl builds, same policy as install.sh (the gnu + // build crashes on some hosts, see #998; arm/arm64 only publish musl). + const linuxTargets = { + x64: "x86_64-unknown-linux-musl", + arm64: "aarch64-unknown-linux-musl", + ia32: "i686-unknown-linux-musl", + arm: "arm-unknown-linux-musleabihf", + }; + const triple = + process.platform === "linux" + ? linuxTargets[process.arch] + : triples.platformArchTriples[process.platform][process.arch][0].raw; + + url = url.replace(/{{triple}}/g, triple); url = url.replace(/{{version}}/g, version); url = url.replace(/{{bin_name}}/g, binName); console.log(url);