Skip to content

Commit

Permalink
Update autopacking to canonicalize paths before packing dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
kylewlacy committed Sep 9, 2024
1 parent 57a426e commit 1c00a33
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions crates/brioche-autopack/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -424,7 +424,10 @@ fn autopack_dynamic_binary(
})?;

// Autopack the interpreter if it's pending
if let Some(interpreter_path_config) = pending_paths.remove(&interpreter_path) {
let canonical_interpreter_path = interpreter_path
.canonicalize()
.with_context(|| format!("failed to canonicalize interpreter path {interpreter_path:?}"))?;
if let Some(interpreter_path_config) = pending_paths.remove(&canonical_interpreter_path) {
autopack_path(
ctx,
&interpreter_path,
Expand Down Expand Up @@ -854,7 +857,10 @@ fn collect_all_library_dirs(
};

// Autopack the library if it's pending
if let Some(library_path_config) = pending_paths.remove(&library_path) {
let canonical_library_path = library_path
.canonicalize()
.with_context(|| format!("failed to canonicalize library path {library_path:?}"))?;
if let Some(library_path_config) = pending_paths.remove(&canonical_library_path) {
autopack_path(ctx, &library_path, &library_path_config, pending_paths)?;
}

Expand Down

0 comments on commit 1c00a33

Please sign in to comment.