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

fix: check if files are same in self-update #2132

Merged
merged 7 commits into from
Sep 30, 2024

Conversation

apoorvkh
Copy link
Contributor

self-update checks if the Pixi binary matches the default filepath. Instead of checking if paths are equal, we should check if files are same in self-update.

This should resolve this issue:

  × pixi is not installed in the default location:
  │ 
  │ - Default pixi location: /users/apoorvkh/.pixi/bin/pixi
  │ - Pixi location detected: /nfs/home/apoorvkh/.pixi/bin/pixi

which could be caused by using symlinks or case-insensitivity in Windows, etc.

Fixes #1171 and maybe #2059

@apoorvkh apoorvkh changed the title Check if files are same in self-update fix: check if files are same in self-update Sep 24, 2024
@ruben-arts
Copy link
Contributor

Thank you this looks good to me! What makes this a Draft PR?

@apoorvkh
Copy link
Contributor Author

Draft PR because I just wanted to run the CI! I haven't yet manually tested it for the case in #1171 .

@apoorvkh
Copy link
Contributor Author

apoorvkh commented Sep 25, 2024

Okay did some testing. I think this implies the fix in my PR works!


When I use (the official) pixi=0.30.0, I get the same error as before.

❯ pixi self-update
  × pixi is not installed in the default location:
...

But when I do pixi self-update --force, I get an error:

❯ pixi self-update --force
thread 'main' panicked at /home/runner/.cargo/registry/src/index.crates.io-6f17d22bba15001f/reqwest-0.12.5/src/async_impl/client.rs:1901:38:
Client::new(): reqwest::Error { kind: Builder, source: Os { code: 13, kind: PermissionDenied, message: "Permission denied" } }
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

(This error does not occur when I use e.g. pixi=0.25.0.)


When I run pixi self-update from this PR's binary, I get that PermissionDenied error directly.
Since we don't see the "not installed in the default location" error message, I think our patch was successful.

I have no idea why there is a PermissionDenied error (my pixi binary has rwx r-x r-x permissions), but I think that is outside the scope of this immediate PR.

@apoorvkh apoorvkh marked this pull request as ready for review September 25, 2024 15:23
Copy link
Contributor

@ruben-arts ruben-arts left a comment

Choose a reason for hiding this comment

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

Thank you @apoorvkh !

@ruben-arts ruben-arts merged commit 1040b1f into prefix-dev:main Sep 30, 2024
41 checks passed
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.

pixi self-update fails on symlink-ed home directory
3 participants