Skip to content

Binstall release metadata#861

Open
LittleBoxOfSunshine wants to merge 2 commits intotamasfe:masterfrom
LittleBoxOfSunshine:chhenk/binstall
Open

Binstall release metadata#861
LittleBoxOfSunshine wants to merge 2 commits intotamasfe:masterfrom
LittleBoxOfSunshine:chhenk/binstall

Conversation

@LittleBoxOfSunshine
Copy link
Copy Markdown

@LittleBoxOfSunshine LittleBoxOfSunshine commented Apr 14, 2026

Binstall support can be added via metadata that explains what the naming pattern(s) are for the github releases.

This change adds that, which partially addresses #827 by enabling binstall support on windows:

PS C:\Users\chhenk\git\taplo> cargo binstall taplo-cli --manifest-path C:\Users\chhenk\git\taplo\crates\taplo-cli\Cargo.toml --locked --force
 INFO resolve: Resolving package: 'taplo-cli'
 WARN resolve: Error while downloading and extracting from fetcher QuickInstall: Failed to download from remote: could not GET https://github.com/cargo-bins/cargo-quickinstall/releases/download/taplo-cli-0.10.0/taplo-cli-0.10.0-aarch64-pc-windows-msvc.tar.gz: HTTP status client error (404 Not Found) for url (https://github.com/cargo-bins/cargo-quickinstall/releases/download/taplo-cli-0.10.0/taplo-cli-0.10.0-aarch64-pc-windows-msvc.tar.gz)
 WARN resolve: Error while downloading and extracting from fetcher QuickInstall: Failed to download from remote: could not GET https://github.com/cargo-bins/cargo-quickinstall/releases/download/taplo-cli-0.10.0/taplo-cli-0.10.0-x86_64-pc-windows-msvc.tar.gz: HTTP status client error (404 Not Found) for url (https://github.com/cargo-bins/cargo-quickinstall/releases/download/taplo-cli-0.10.0/taplo-cli-0.10.0-x86_64-pc-windows-msvc.tar.gz)
 WARN The package taplo-cli v0.10.0 (aarch64-pc-windows-msvc) has been downloaded from github.com
 INFO This will install the following binaries:
 INFO   - taplo.exe => C:\Users\chhenk\.cargo\bin\taplo.exe
Do you wish to continue? [yes]/no yes
 INFO Installing binaries...
 INFO Done in 7.33080425s

On Linux, the naming pattern is correct but binstall doesn't support the gz format, so this will continue to fall back to installing from source like it already does today. Since this support may come in the future, I went with adding this unconditionally so that support would be automatic / retroactive.

chhenk@CPC-chhen-Z1E46:~/$ cargo binstall taplo-cli --manifest-path ./taplo/Cargo.toml --locked
 INFO resolve: Resolving package: 'taplo-cli'
 WARN resolve: Error while downloading and extracting from fetcher QuickInstall: Failed to download from remote: could not GET https://github.com/cargo-bins/cargo-quickinstall/releases/download/taplo-cli-0.10.0/taplo-cli-0.10.0-x86_64-unknown-linux-gnu.tar.gz: HTTP status client error (404 Not Found) for url (https://github.com/cargo-bins/cargo-quickinstall/releases/download/taplo-cli-0.10.0/taplo-cli-0.10.0-x86_64-unknown-linux-gnu.tar.gz)
 WARN resolve: Error while downloading and extracting from fetcher QuickInstall: Failed to download from remote: could not GET https://github.com/cargo-bins/cargo-quickinstall/releases/download/taplo-cli-0.10.0/taplo-cli-0.10.0-x86_64-unknown-linux-musl.tar.gz: HTTP status client error (404 Not Found) for url (https://github.com/cargo-bins/cargo-quickinstall/releases/download/taplo-cli-0.10.0/taplo-cli-0.10.0-x86_64-unknown-linux-musl.tar.gz)
 WARN The package taplo-cli v0.10.0 will be installed from source (with cargo)
Do you wish to continue? [yes]/no yes
    Updating crates.io index
  Downloaded taplo-cli v0.10.0
  Downloaded 1 crate (29.8KiB) in 0.15s
  Installing taplo-cli v0.10.0
    Updating crates.io index
...
...
   Compiling lsp-async-stub v0.7.0
   Compiling taplo-lsp v0.8.0
   Compiling taplo-cli v0.10.0
    Finished `release` profile [optimized] target(s) in 1m 24s
  Installing /home/chhenk/.cargo/bin/taplo
   Installed package `taplo-cli v0.10.0` (executable `taplo`)
 INFO Cargo finished successfully
 INFO Done in 92.194836119s

If that isn't desired, it could be gated like so:

[package.metadata.binstall.overrides.'cfg(target_os = "windows")']

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants