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

installers: config to specify unpacking of other archived files #307

Open
Gankra opened this issue Aug 9, 2023 · 1 comment
Open

installers: config to specify unpacking of other archived files #307

Gankra opened this issue Aug 9, 2023 · 1 comment
Labels
feature request New feature or request

Comments

@Gankra
Copy link
Contributor

Gankra commented Aug 9, 2023

Only applies to script installers (shell, powershell).

When install-path = "CARGO_HOME" was the only possible setting it didn't make sense to unpack anything but binaries, but other options like install-path = "~/.my-app" would be very reasonable to allow more verbose unpacking of things like READMEs/LICENSES.

The most simplistic design would just be unpack-all = true, but there's questions about overlaying old files/dirs (for updates) that might be worth being able to elaborate on.

Need someone to chime in with this as a requirement before I try to design the feature.

@Gankra Gankra added the feature request New feature or request label Aug 9, 2023
@thinkmassive
Copy link

thinkmassive commented Jun 21, 2024

I'm using cargo-dist in a project that expects a directory of config files (sample workflow definitions, needed to make the app very useful) to be installed along with the binary. The tarball includes these via include = ["./myapp_files/"], which is great.

I defined install-path = ["$MYAPP_HOME/", "~/.myapp"], expecting the extra dir to be unpacked as ~/.myapp/myapp_files. When that didn't work I discovered this issue, so I figured I'd let you know a real user has the use case described here.

The simplistic design sounds like it would work fine for me. If that would also extract README/LICENSE/etc then even better, I'd go ahead and include the docs/ dir too.

EDIT: Another option could be to define a separate location for these extra files to be extracted. That seems like it would retain compatibility w/CARGO_DIST for binaries, and if install-path is defined then maybe the same dir could also be used for the extra files. For system-wide installs this might make it easy to use /etc/myapp for configs.

Requiring the "extra files" target to be a different location than binaries would also work, in case that simplifies the implementation at all. In that case I would probably use:

include = ["./myapp_files/"]
install-path = ["$MYAPP_HOME/bin", "~/.myapp/bin"]
install-extras-path = ["$MYAPP_HOME/conf", "~/.myapp/conf"]

EDIT 2 (apologies): ...now that I fully grok your concerns about old files, that does apply to my use case. The app is bundled with sample topologies that users are expected to extend. If their changes were lost after an upgrade, that might disappoint someone, although in my case the file location is an input when running the app, so it would be trivial to solve via documentation, and everything above still applies.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants