Skip to content

Commit

Permalink
fix: use correct platform to decide the windows launcher (conda#608)
Browse files Browse the repository at this point in the history
  • Loading branch information
wolfv authored Apr 18, 2024
1 parent e47528f commit 6418a49
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
3 changes: 2 additions & 1 deletion crates/rattler/src/install/entry_point.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ pub fn create_windows_python_entry_point(
target_prefix: &str,
entry_point: &EntryPoint,
python_info: &PythonInfo,
target_platform: &Platform,
) -> Result<[PathsEntry; 2], std::io::Error> {
// Construct the path to where we will be creating the python entry point script.
let relative_path_script_py = python_info
Expand All @@ -60,7 +61,7 @@ pub fn create_windows_python_entry_point(
.join(format!("{}.exe", &entry_point.command));

// Include the bytes of the launcher directly in the binary so we can write it to disk.
let launcher_bytes = get_windows_launcher(&Platform::current());
let launcher_bytes = get_windows_launcher(target_platform);
std::fs::write(target_dir.join(&relative_path_script_exe), launcher_bytes)?;

let fixed_launcher_digest = rattler_digest::parse_digest_from_hex::<rattler_digest::Sha256>(
Expand Down
1 change: 1 addition & 0 deletions crates/rattler/src/install/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -384,6 +384,7 @@ pub async fn link_package(
&target_prefix,
&entry_point,
&python_info,
&platform,
) {
Ok([a, b]) => {
let _ = tx.blocking_send(Ok((number_of_paths_entries, a)));
Expand Down

0 comments on commit 6418a49

Please sign in to comment.