Skip to content

Commit

Permalink
feat: use known good axoupdater version
Browse files Browse the repository at this point in the history
Instead of always fetching the latest axoupdater, fetch the version that this
version of dist itself uses as a library. That way, we're always fetching
something predictable.
  • Loading branch information
mistydemeo committed Dec 18, 2024
1 parent bbef48f commit 8e820d8
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions cargo-dist/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -251,10 +251,13 @@ fn run_build_step(
Ok(())
}

const AXOUPDATER_ASSET_ROOT: &str =
"https://github.com/axodotdev/axoupdater/releases/latest/download";
const AXOUPDATER_ASSET_ROOT: &str = "https://github.com/axodotdev/axoupdater/releases";
const AXOUPDATER_MINIMUM_VERSION: &str = "0.7.0";

fn axoupdater_asset_root() -> String {
format!("{AXOUPDATER_ASSET_ROOT}/download/v{}", axoupdater::VERSION)
}

/// Fetches an installer executable and installs it in the expected target path.
pub fn fetch_updater(dist_graph: &DistGraph, updater: &UpdaterStep) -> DistResult<()> {
let ext = if updater.target_triple.is_windows() {
Expand All @@ -263,7 +266,8 @@ pub fn fetch_updater(dist_graph: &DistGraph, updater: &UpdaterStep) -> DistResul
".tar.xz"
};
let expected_url = format!(
"{AXOUPDATER_ASSET_ROOT}/axoupdater-cli-{}{ext}",
"{}/axoupdater-cli-{}{ext}",
axoupdater_asset_root(),
updater.target_triple
);

Expand Down

0 comments on commit 8e820d8

Please sign in to comment.