File tree Expand file tree Collapse file tree 3 files changed +17
-6
lines changed
Expand file tree Collapse file tree 3 files changed +17
-6
lines changed Original file line number Diff line number Diff line change 1+ # Unreleased
2+
3+ - Fix installing from ` leanprover/lean4-pr-releases ` , which are not part of release.lean-lang.org.
4+
15# 4.1.0 - 2025-04-30
26
37- Fetch releases and assets from release.lean-lang.org instead of parsing GitHub HTML. Makes
Original file line number Diff line number Diff line change @@ -13,7 +13,15 @@ use elan_utils::{raw::read_file, utils};
1313use fslock:: LockFile ;
1414
1515pub const DEFAULT_ORIGIN : & str = "leanprover/lean4" ;
16- pub const DEFAULT_ORIGIN_JSON_URL : & str = "https://release.lean-lang.org" ;
16+ const DEFAULT_ORIGIN_JSON_URL : & str = "https://release.lean-lang.org" ;
17+
18+ pub fn get_json_uri_for_releases ( origin : & str ) -> Option < & str > {
19+ if origin == DEFAULT_ORIGIN || origin == DEFAULT_ORIGIN . to_owned ( ) + "-nightly" {
20+ Some ( DEFAULT_ORIGIN_JSON_URL )
21+ } else {
22+ None
23+ }
24+ }
1725
1826#[ derive( Debug ) ]
1927pub struct Manifestation {
@@ -92,8 +100,7 @@ impl Manifestation {
92100 // For historical reasons, the informal target for Linux x64 is a substring of Linux
93101 // aarch64; make sure we don't confuse them
94102 let name_substring = informal_target. clone ( ) + "." ;
95- let url = if origin. starts_with ( DEFAULT_ORIGIN ) {
96- let url = DEFAULT_ORIGIN_JSON_URL ;
103+ let url = if let Some ( url) = get_json_uri_for_releases ( origin) {
97104 let json = fetch_url ( url) ?;
98105 let releases = json:: parse ( & json)
99106 . chain_err ( || format ! ( "failed to parse release data: {}" , url) ) ?;
Original file line number Diff line number Diff line change @@ -6,8 +6,8 @@ use crate::notifications::*;
66use elan_dist:: dist:: ToolchainDesc ;
77use elan_dist:: download:: DownloadCfg ;
88use elan_dist:: manifest:: Component ;
9+ use elan_dist:: manifestation:: get_json_uri_for_releases;
910use elan_dist:: manifestation:: DEFAULT_ORIGIN ;
10- use elan_dist:: manifestation:: DEFAULT_ORIGIN_JSON_URL ;
1111use elan_utils:: utils;
1212use elan_utils:: utils:: fetch_url;
1313use itertools:: Itertools ;
@@ -136,8 +136,8 @@ pub fn resolve_toolchain_desc_ext(
136136 use_cache,
137137 )
138138 } else if release == "stable" || release == "beta" || release == "nightly" {
139- let fetch = if origin . starts_with ( DEFAULT_ORIGIN ) {
140- utils:: fetch_latest_release_json ( DEFAULT_ORIGIN_JSON_URL , release, no_net)
139+ let fetch = if let Some ( uri ) = get_json_uri_for_releases ( origin ) {
140+ utils:: fetch_latest_release_json ( uri , release, no_net)
141141 } else {
142142 if release == "beta" {
143143 return Err ( Error :: from (
You can’t perform that action at this time.
0 commit comments