-
Notifications
You must be signed in to change notification settings - Fork 740
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
Allow relative Python executable paths in Windows trampoline #3717
Conversation
crates/uv-trampoline/src/bounce.rs
Outdated
@@ -275,7 +275,26 @@ fn find_python_exe(executable_name: &CStr) -> CString { | |||
String::from("Failed to close file handle") | |||
}); | |||
|
|||
path | |||
if !path.as_bytes().starts_with(b"..") { |
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.
Is there no has_root
or similar that we can use here? There are lots of relative paths that won't necessarily start with this.
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've never done work without the standard library so I'm not sure what is possible.
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.
Can you share the bigger picture on how you plan to use or integrate this?
Sure, basically the script I put in the description I will use to finalize an entire Python installation until the mentioned feature request is implemented and I can install packages with that flag instead of running that script as a postprocessing step. |
Thanks. I want to play around with the code a bit before merging to see if it can be generalized at all. |
I will try to get to it tonight though. |
I tried to invert the condition to make it a bit more general (e.g., shouldn't |
Just tried locally, it still works! |
|
I think I have to rebuild them as part of the PR. |
How do you rebuild them, locally? |
I followed the cross compilation instructions in the |
I'm having trouble verifying them locally though. (I can't get them to fail.) |
Fail how? |
I just want to make sure they're actually being used. So I tried (e.g.) overwriting the x86 trampolies with the ARM trampolines but my commands are still working which seems wrong. |
Are you testing it with this package? https://github.com/astral-sh/uv/blob/0.1.45/crates/install-wheel-rs/src/wheel.rs#L26-L40 |
Yeah, although I think I'm getting it to fail as expected now. |
For future reference: changing just the trampolines doesn't trigger a rebuild (with |
Thank you very much! |
Thanks Ofek! |
Improved the README a bit: #3731 |
Summary
This is a prerequisite for #3669
Test Plan
Download one of the standalone distributions on Windows then use its Python to run the following script and then run the scripts it creates (only pip):