Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add cargo binstall support #1012

Merged
merged 4 commits into from
Nov 20, 2023
Merged

Add cargo binstall support #1012

merged 4 commits into from
Nov 20, 2023

Conversation

sharkAndshark
Copy link
Collaborator

@sharkAndshark sharkAndshark commented Nov 18, 2023

Try to fix #1005

  • Add cargo binstall support
  • Update links
  • Update home-brew by another PR
  • To check is there anything to do for mbtiles

@nyurik
Copy link
Member

nyurik commented Nov 19, 2023

This is exactly what i was looking for, thank you!!! Let me know when ready to merge. Although one thing: we will need to merge this right before the release, or else we will have incorrect documentation links for a while, and that wouldn't be good.

@sharkAndshark
Copy link
Collaborator Author

sharkAndshark commented Nov 19, 2023

As there is no convenient way to verify this PR works, I explain it here.

To install packages, binstall will download package from pkg-url and find bin-dir in it .

  • pkg-url specifies the package download URL for a given target/version, templated
  • pkg-fmt overrides the package format for download/extraction (defaults to: tgz)
  • bin is the name of a specific binary, inferred from the crate configuration
  • bin-dir specifies the binary path within the package, templated (with an .exe suffix on windows)
  • binary-ext is the string .exe if the target is for Windows, or the empty string otherwise

The default pkg-url template in this PR

The default pkg-url template in this PR is { repo }/releases/download/v{ version }/{ name }-{ target }{ archive-suffix }

For archive-suffix, tgz, eg the .tar.gz, is the default. As binstall will try various archive suffix one by one, so i didn't add [package.metadata.binstall.overrides.x86_64-pc-windows-msvc] for overriding windows.

cargo binstall martin --version 0.10.0 -v
...
DEBUG Checking for package at: 'https://github.com/maplibre/martin/releases/download/0.10.0/martin-x86_64-unknown-linux-gnu-v0.10.0.tar'
...
DEBUG Checking for package at: 'https://github.com/maplibre/martin/releases/download/0.10.0/martin-x86_64-unknown-linux-gnu-v0.10.0.tar.bz2'
...
DEBUG Checking for package at: 'https://github.com/maplibre/martin/releases/download/0.10.0/martin-x86_64-unknown-linux-gnu-v0.10.0.tar.gz'
..
DEBUG Checking for package at: 'https://github.com/maplibre/martin/releases/download/v0.10.0/martin-x86_64-unknown-linux-gnu-v0.10.0.zip'
...
DEBUG Checking for package at: 'https://github.com/maplibre/martin/releases/download/0.10.0/martin-x86_64-unknown-linux-musl-v0.10.0.zip'
...

So update the package names in this PR.

bin and bin-dir in this PR

bin bin-dir(windows) bin-dir(linux) bin-dir(macos)
martin martin martin.exe martin martin
mbtiles mbtiles mbtiles.exe mbtiles mbtiles

So keep file names still in this PR.

@sharkAndshark sharkAndshark marked this pull request as ready for review November 19, 2023 15:43
sharkAndshark added a commit to maplibre/homebrew-martin that referenced this pull request Nov 19, 2023
Update martin download links. See these issue and PR either.
* [Standardize release filenames and add cargo binstall support](maplibre/martin#1005) 
* [Add cargo binstall](maplibre/martin#1012)
@sharkAndshark sharkAndshark requested a review from nyurik November 20, 2023 01:13
@nyurik
Copy link
Member

nyurik commented Nov 20, 2023

I have merged the CI part of this PR directly into the main branch, and will release it as a pre-release. Once all works and checks out, I will merge this PR as well. Thanks!

Copy link
Member

@nyurik nyurik left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks once again!

@nyurik nyurik merged commit 0f13fb6 into maplibre:main Nov 20, 2023
18 checks passed
@sharkAndshark sharkAndshark deleted the binstall branch November 21, 2023 01:03
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.

Standardize release filenames and add cargo binstall support
2 participants