-
Notifications
You must be signed in to change notification settings - Fork 180
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
refactor: Make self-update a compile time feature #2213
Conversation
Currently pixi refuses to self-update if it is not installed at its default location. This can be overridden using the `--force` flag. This is not ideal for two reasons: Some people might intentionally install pixi to a non-default location, such as `~/.local/bin/pixi`, while not using a package manager. On the other hand, passing `--force` still allows pixi installations installed by a package manager to be broken. A better solution would be disabling the self-update functionallity at compile time. This PR adds a compile-time feature called `self_update`, which is not enabled by default. This PR also enables this feature in the CI build so releases produced by CI can still be self-updated. Because the feature is not enabled by default, other distributions of pixi, such as when built by other package managers, will not support self-update. Instead of completely removing the self-update sub-command, disabling this feature only replaces it with a stub command that outputs an error message. This is to prevent user-confusion, when users read about self-update in documentation, only to find the sub-command missing in their installation. With this implemented the default location check and `--force` flag will not be needed anymore.
d5ee170
to
b905b39
Compare
1df8786
to
b905b39
Compare
585994b
to
a717571
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey @freundTech, thanks for your contribution. I haven't tested it yet, but the spirit of this PR looks good to me.
7a2b4ab
to
db0d922
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I checked out the docs
Co-authored-by: Hofer-Julian <30049909+Hofer-Julian@users.noreply.github.com>
The top level header is inserted automatically
af5ac9e
to
19817e4
Compare
Thanks for this PR, I think it should be ready. I'll wait with the merge for a little bit as we're dealing with some nasty Rust 1.81 issues and I don't want to mix this PR into to Rust issues. |
Currently pixi refuses to self-update if it is not installed at its default location. This can be overridden using the
--force
flag.This is not ideal for two reasons: Some people might intentionally install pixi to a non-default location, such as
~/.local/bin/pixi
, while not using a package manager. On the other hand, passing--force
still allows pixi installations installed by a package manager to be broken.A better solution would be disabling the self-update functionallity at compile time. This PR adds a compile-time feature called
self_update
, which is not enabled by default.This PR also enables this feature in the CI build so releases produced by CI can still be self-updated. Because the feature is not enabled by default, other distributions of pixi, such as when built by other package managers, will not support self-update.
Instead of completely removing the self-update sub-command, disabling this feature only replaces it with a stub command that outputs an error message. This is to prevent user-confusion, when users read about self-update in documentation, only to find the sub-command missing in their installation.
With this implemented the default location check and
--force
flag will not be needed anymore.