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

feat: allow specifying binary aliases / links #964

Merged
merged 2 commits into from
May 1, 2024

Conversation

mistydemeo
Copy link
Contributor

This adds support for binary aliases. Developers whose package installs a binary under one name can specify one or more aliases for any of their binaries, and those aliases will be produced by the installers alongside the actual binary. On Linux and macOS, this uses symbolic links; the shell installer simply runs ln -s, while the Homebrew installer uses Homebrew's native "symlink under another name" syntax. On Windows, we use hardlinks due limitations with symlinks discussed in #961.

The syntax used for this in Cargo.toml is broadly similar to what we use for runners:

[workspace.metadata.dist.aliases]
akextract = ["akextract-link"]
akmetadata = ["akmetadata-link1", "akmetadata-link2"]

Fixes #961.

@mistydemeo mistydemeo requested a review from Gankra April 25, 2024 22:07
@mistydemeo mistydemeo force-pushed the binary-aliases-installers branch 2 times, most recently from ccd9e66 to 135865d Compare April 25, 2024 22:51
@mistydemeo
Copy link
Contributor Author

Tested in my cargodisttest repo: https://github.com/mistydemeo/cargodisttest/releases/tag/v0.2.122

I've tested with shell, Homebrew, and powershell installers.

Copy link
Contributor

@Gankra Gankra left a comment

Choose a reason for hiding this comment

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

Wants a bit more logic up in rust land, I think.

@@ -838,6 +838,123 @@ libcue = "2.3.0"
})
}

#[test]
fn axolotlsay_alias() -> Result<(), miette::Report> {
Copy link
Contributor

Choose a reason for hiding this comment

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

As discussed last week, we should probably prioritize folding these kinds of things into more existing tests rather than adding more and more (both because it makes the diff actually useful, and because these take forever to run).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah, I agree. Can we do that in a followup, though? I'd like reorganizing our tests to be fairly intentional, which means we can think directly about which tests contain which groups of features instead of it being a byproduct of this PR.

Copy link
Member

Choose a reason for hiding this comment

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

@mistydemeo a follow up seems good to me- can you file an issue?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done: #979

@mistydemeo mistydemeo force-pushed the binary-aliases-installers branch 7 times, most recently from 0939ac2 to 12e7441 Compare April 30, 2024 16:49
@mistydemeo mistydemeo force-pushed the binary-aliases-installers branch 2 times, most recently from 454ac28 to 22a085e Compare May 1, 2024 21:52
@ashleygwilliams ashleygwilliams mentioned this pull request May 1, 2024
mistydemeo added 2 commits May 1, 2024 15:57
This adds a new feature allowing any binary in an app to be installed under one or
more aliases. These aliases will be symbolic links (shell installer, Homebrew) or
hardlinks (Windows).
@mistydemeo mistydemeo force-pushed the binary-aliases-installers branch from 22a085e to 2cf9702 Compare May 1, 2024 22:57
@Gankra Gankra merged commit 25cfecb into main May 1, 2024
15 checks passed
@Gankra Gankra deleted the binary-aliases-installers branch May 1, 2024 23:21
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.

support for binary aliases in archive
3 participants