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

New trampoline #609

Closed
wants to merge 2 commits into from
Closed

New trampoline #609

wants to merge 2 commits into from

Conversation

wolfv
Copy link
Contributor

@wolfv wolfv commented Apr 18, 2024

This fixes a bug I encountered with white spaces in the path to the prefix on Windows, and gives us win-arm64 support. I briefly tried to build the trampoline for win-32 as well, but didn't work out because I am missing dlltool.exe.

This does not create 2 files anymore, but just a single .exe file. For some reason, the script is stored as a zip encoded file (not sure if I would have done it that way, but whatever). IMO it could be just the text file with offsets stored somewhere.

If we decide to use it we should add some more attribution :)

Copy link
Collaborator

@baszalmstra baszalmstra left a comment

Choose a reason for hiding this comment

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

If this works as expected then this looks good to me!

.join(".prefix")
});
// First create the target prefix if it doesn't exist yet.
fs::create_dir_all(&target_prefix).expect("could not create target prefix");
Copy link
Collaborator

Choose a reason for hiding this comment

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

I think this should result in a user error instead of an expect.

The canonicalize could be an expect because we already created the directory.

.parent()
.expect("since we joined with target_dir there must be a parent"),
)?;
) -> Result<[PathsEntry; 1], std::io::Error> {
Copy link
Collaborator

Choose a reason for hiding this comment

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

This doesnt have to be an array anymore.

launcher.extend_from_slice(&LAUNCHER_MAGIC_NUMBER);

let target_location = target_dir.join(&relative_path_script_exe);
fs::create_dir_all(target_location.parent().unwrap())?;
Copy link
Collaborator

Choose a reason for hiding this comment

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

Unwrap.

@baszalmstra
Copy link
Collaborator

Did you build the binaries yourself? I am a little hesitant to include binaries without a proper reference to the source. I have no way to verify that this binary isnt mallicious.

@wolfv
Copy link
Contributor Author

wolfv commented Apr 18, 2024

Nope, I copied them from UVs git repo :) but could be cool to build ourselves and make the magic number "pixi" instead of "uvuv", haha

@baszalmstra
Copy link
Collaborator

Shall we close this in favor of #639 ?

@wolfv
Copy link
Contributor Author

wolfv commented May 6, 2024

yeah, let's close this one :)

@wolfv wolfv closed this May 6, 2024
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.

2 participants