diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 450b2cd024..0f24c9c690 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -197,9 +197,9 @@ jobs: unzip -d $env:USERPROFILE dist\mise-v$version-windows-x64.zip Add-Content $env:GITHUB_PATH "$env:USERPROFILE/mise/bin" - run: mise install - continue-on-error: ${{matrix.os == 'windows-latest' && true || false}} + continue-on-error: ${{matrix.os == 'windows-latest' }} - run: mise test-tool --all - continue-on-error: ${{matrix.os == 'windows-latest' && true || false}} + continue-on-error: ${{matrix.os == 'windows-latest' }} rpm: runs-on: ubuntu-latest needs: [build-tarball] diff --git a/build.rs b/build.rs index 5b9dce2312..b5638b01e8 100644 --- a/build.rs +++ b/build.rs @@ -20,8 +20,7 @@ fn codegen_registry() { let out_dir = env::var_os("OUT_DIR").unwrap(); let dest_path = Path::new(&out_dir).join("registry.rs"); let mut lines = vec![r#" -#[allow(clippy::type_complexity)] -const _REGISTRY: &[(&str, &[&str], &[&str], Option<(&str, &str)>, &[&str])] = &["# +pub static FULL_REGISTRY: Lazy> = Lazy::new(|| ["# .to_string()]; let registry: toml::Table = fs::read_to_string("registry.toml") @@ -80,8 +79,8 @@ const _REGISTRY: &[(&str, &[&str], &[&str], Option<(&str, &str)>, &[&str])] = &[ }) .unwrap_or_default(); lines.push(format!( - r#" ("{short}", &["{fulls}"], &[{aliases}], {test}, &[{os}]),"#, - fulls = fulls.join("\", \""), + r#" ("{short}", RegistryTool{{backends: vec!["{backends}"], aliases: &[{aliases}], test: &{test}, os: &[{os}]}}),"#, + backends = fulls.join("\", \""), aliases = aliases .iter() .map(|a| format!("\"{a}\"")) @@ -97,7 +96,7 @@ const _REGISTRY: &[(&str, &[&str], &[&str], Option<(&str, &str)>, &[&str])] = &[ .join(", "), )); } - lines.push(r#"];"#.to_string()); + lines.push(r#"].into());"#.to_string()); fs::write(&dest_path, lines.join("\n")).unwrap(); } diff --git a/registry.toml b/registry.toml index 22837ea8e3..55314bad25 100644 --- a/registry.toml +++ b/registry.toml @@ -658,6 +658,7 @@ serverless.backends = ["asdf:pdemagny/asdf-serverless"] setup-envtest.backends = ["asdf:pmalek/mise-setup-envtest"] shell2http.backends = ["aqua:msoap/shell2http", "asdf:ORCID/asdf-shell2http"] shellcheck.backends = ["ubi:koalaman/shellcheck", "asdf:luizm/asdf-shellcheck"] +shellcheck.os = ["linux", "macos"] shellspec.backends = ["aqua:shellspec/shellspec", "asdf:poikilotherm/asdf-shellspec"] shfmt.backends = ["asdf:luizm/asdf-shfmt"] shfmt.os = ["linux", "macos"] diff --git a/src/aqua/aqua_registry.rs b/src/aqua/aqua_registry.rs index 504ff69666..5234ccd480 100644 --- a/src/aqua/aqua_registry.rs +++ b/src/aqua/aqua_registry.rs @@ -224,6 +224,11 @@ impl AquaPackage { let mut ctx = HashMap::default(); ctx.insert("ARCH".to_string(), "arm64".to_string()); strs.insert(self.parse_aqua_str(&self.asset, v, &ctx)); + } else if cfg!(windows) { + strs.insert(format!( + "{}.exe", + self.parse_aqua_str(&self.asset, v, &Default::default()) + )); } strs } diff --git a/src/registry.rs b/src/registry.rs index 112a244ceb..a03278da5c 100644 --- a/src/registry.rs +++ b/src/registry.rs @@ -19,20 +19,6 @@ pub struct RegistryTool { pub os: &'static [&'static str], } -pub static FULL_REGISTRY: Lazy> = Lazy::new(|| { - _REGISTRY - .iter() - .map(|(short, backends, aliases, test, os)| { - let tool = RegistryTool { - backends: backends.to_vec(), - aliases, - test, - os, - }; - (*short, tool) - }) - .collect() -}); // a rust representation of registry.toml pub static REGISTRY: Lazy> = Lazy::new(|| { let mut backend_types = BackendType::iter() @@ -64,7 +50,7 @@ pub static REGISTRY: Lazy> = Lazy::new(|| { .collect(); (*short, tr) }) - .filter(|(_, tool)| !tool.backends.is_empty()) + .filter(|(_, tr)| !tr.backends.is_empty()) .collect(); let aliased = registry