Skip to content

Commit dd68707

Browse files
jdxclaude
andcommitted
fix(node): compare resolved mirror_url to honor NODE_BUILD_MIRROR_URL
The previous check `node.mirror_url.is_none()` ignored the `NODE_BUILD_MIRROR_URL` env var that `mirror_url()` itself reads as a fallback, so a user with that env var set would still get rerouted to unofficial-builds for musl filenames. Compare against the resolved Url instead so any user-provided override (settings field or env var) is preserved. Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
1 parent df253a1 commit dd68707

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

src/plugins/core/node.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -857,10 +857,11 @@ impl BuildOpts {
857857
const UNOFFICIAL_NODE_MIRROR_URL: &str = "https://unofficial-builds.nodejs.org/download/release/";
858858

859859
fn mirror_url_for(node: &crate::config::settings::SettingsNode, filename: &str) -> Url {
860-
if node.mirror_url.is_none() && filename.contains("-musl") {
860+
let mirror = node.mirror_url();
861+
if filename.contains("-musl") && mirror.as_str() == DEFAULT_NODE_MIRROR_URL {
861862
return Url::parse(UNOFFICIAL_NODE_MIRROR_URL).unwrap();
862863
}
863-
node.mirror_url()
864+
mirror
864865
}
865866

866867
fn os() -> &'static str {

0 commit comments

Comments
 (0)