Skip to content

Allow to pass options to cargo install #23

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

Closed
xduugu opened this issue Mar 7, 2024 · 5 comments
Closed

Allow to pass options to cargo install #23

xduugu opened this issue Mar 7, 2024 · 5 comments
Assignees
Labels
enhancement New feature or request
Milestone

Comments

@xduugu
Copy link

xduugu commented Mar 7, 2024

Description
It is currently not possible to update gitui with cargo-liner, because cargo-liner does not use cargo install's --locked option when installing packages and there is no possibility to set this option without changing the code. Please provide a way to pass options to cargo install to fix this issue.

Preferred solution
The easiest solution probably would be to allow setting cargo install options via environment variable. For example, cargo-update use an environment variable CARGO_INSTALL_OPTS for that.

@xduugu xduugu added the enhancement New feature or request label Mar 7, 2024
@PaulDance
Copy link
Owner

Hi!

Yes, this seems appropriate. I'll look into it some time soon.

I already have the plan to add a good part of cargo install's CLI as dedicated configuration options, so that it can be used the easiest. However, having the possibility to pass extra arguments used after all the others would be useful in order to enable users to breach the gap in the meantime.

I therefore see two complementary things that should be done:

  • Add an extra-arguments optional configuration item that gives the list of arguments to add between the last cargo install option and the following -- that separates the proper fixed arguments.
  • Add an environment configuration key providing a map of environment variables that need to be set for the call to cargo install specific to the current package. Environment variables that should be shared between all calls can simply be set externally.

@PaulDance PaulDance added this to the v0.7.0 milestone May 25, 2024
@PaulDance PaulDance self-assigned this May 25, 2024
PaulDance added a commit that referenced this issue May 25, 2024
PaulDance added a commit that referenced this issue May 25, 2024
As part of #23.

Signed-off-by: Paul Mabileau <[email protected]>
PaulDance added a commit that referenced this issue May 25, 2024
As part of #23.

Signed-off-by: Paul Mabileau <[email protected]>
PaulDance added a commit that referenced this issue May 25, 2024
PaulDance added a commit that referenced this issue May 26, 2024
PaulDance added a commit that referenced this issue May 26, 2024
As part of #23.

Signed-off-by: Paul Mabileau <[email protected]>
PaulDance added a commit that referenced this issue May 26, 2024
Actually closes #23.

Signed-off-by: Paul Mabileau <[email protected]>
@PaulDance
Copy link
Owner

Hey @xduugu, sorry for the delay! I have now implemented both options in the mentioned commits. Does it work for what you wanted?

You can test it by installing the project with cargo install --git .... I will also publish a new release containing the recent changes in just a few moments.

@PaulDance
Copy link
Owner

PaulDance commented May 26, 2024

This is now part of v0.7.0. Feel free to open a new issue in case there is something that does not work as expected.

@xduugu
Copy link
Author

xduugu commented Jun 3, 2024

@PaulDance, thanks a lot! It works as expected.

When testing the new functionality, I noticed that the example configuration in the README is not valid TOML syntax. Apparently, inline tables must not include newlines.

@PaulDance
Copy link
Owner

It works as expected.

Good!

the example configuration in the README is not valid TOML syntax.

Indeed, I did the change while not even thinking about that. I'll change it to be proper TOML. Thanks for the heads-up 🙂

PaulDance added a commit that referenced this issue Jun 4, 2024
As mentioned in #23, the TOML was invalid in multiple ways. It should
now be a bit better.

Signed-off-by: Paul Mabileau <[email protected]>
PaulDance added a commit that referenced this issue Jun 4, 2024
As mentioned in #23, the TOML was invalid in multiple ways. It should
now be a bit better. Same done for the informal spec.

Signed-off-by: Paul Mabileau <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants