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

Split {format} and allow use of {binary-ext} in pkg-url #95

Merged
merged 1 commit into from
Feb 16, 2022

Conversation

passcod
Copy link
Member

@passcod passcod commented Feb 16, 2022

This from feedback in #19:

wrt. bin-dir and bin-path, this appears to be a typo / should all be called bin-dir

This is only a readme fix afaict, I changed all occurences of bin-path in there to bin-dir.

wrt. format, those are actually two (unfortunately named) different concepts, the first refers to the archive format (eg. .tgz), the second to the binary format (which needs a .exe appended for windows).

This introduces two new substitutions:

  • binary-ext is the old "format in bin-dir"
  • archive-format is the old "format in pkg-url"

Contents are unchanged: binary-ext includes the dot, archive-format doesn't. That makes it easy to upgrade and also personally I slightly prefer it that way.

The old contextual format is still available, "soft deprecated": it will be accepted silently so everything will work, but all documentation will use the new syntax. In the future we could move to a "hard deprecated" model where installing a package that uses format will warn the user / tell them to report that to the maintainer. I don't think we'll ever really be able to remove it but that should be good enough.

A cool new feature is that binary-ext is now usable in pkg-url, which will be useful for raw binary downloads:

pkg_url = "{ repo }/releases/download/v{ version }/{ name }-v{ version }-{ target }{ binary-ext }"

I've also added a bunch of tests to GhCrateMeta around the templating for pkg-url.

@passcod passcod requested a review from ryankurte February 16, 2022 03:06
Copy link
Collaborator

@ryankurte ryankurte left a comment

Choose a reason for hiding this comment

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

looks great!

@passcod passcod merged commit 6dcb1dd into cargo-bins:main Feb 16, 2022
@passcod passcod deleted the split-format branch February 16, 2022 03:18
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