Skip to content

Commit

Permalink
fix: do not do cstring replacement on windows (#589)
Browse files Browse the repository at this point in the history
There is only one form of binary replacement on Windows, and that's for
"pyzzer" entrypoints. I don't think they are widely used though.

I think this might fix the issue described in
prefix-dev/pixi#1096
  • Loading branch information
wolfv authored Apr 2, 2024
1 parent 79774fa commit 3e08f03
Showing 1 changed file with 12 additions and 6 deletions.
18 changes: 12 additions & 6 deletions crates/rattler/src/install/link.rs
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,7 @@ pub fn link_file(
&mut destination_writer,
placeholder,
&target_prefix,
&target_platform,
*file_mode,
)
.map_err(|err| LinkFileError::IoError(String::from("replacing placeholders"), err))?;
Expand Down Expand Up @@ -467,6 +468,7 @@ pub fn copy_and_replace_placeholders(
destination: impl Write,
prefix_placeholder: &str,
target_prefix: &str,
target_platform: &Platform,
file_mode: FileMode,
) -> Result<(), std::io::Error> {
match file_mode {
Expand All @@ -479,12 +481,16 @@ pub fn copy_and_replace_placeholders(
)?;
}
FileMode::Binary => {
copy_and_replace_cstring_placeholder(
source_bytes,
destination,
prefix_placeholder,
target_prefix,
)?;
// conda does not replace the prefix in the binary files on windows
// DLLs are loaded quite differently anyways (there is no rpath, for example).
if !target_platform.is_windows() {
copy_and_replace_cstring_placeholder(
source_bytes,
destination,
prefix_placeholder,
target_prefix,
)?;
}
}
}
Ok(())
Expand Down

0 comments on commit 3e08f03

Please sign in to comment.