Skip to content

Commit

Permalink
Fix rpath when module-name contains . (#2219)
Browse files Browse the repository at this point in the history
  • Loading branch information
mscroggs committed Sep 11, 2024
1 parent 873ba31 commit 1cd1140
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/build_context.rs
Original file line number Diff line number Diff line change
Expand Up @@ -480,12 +480,12 @@ impl BuildContext {
}

// Currently artifact .so file always resides at ${module_name}/${module_name}.so
let artifact_dir = Path::new(&self.module_name);
let artifact_dir = self.module_name.split(".").collect::<PathBuf>();
for artifact in artifacts {
let mut new_rpaths = patchelf::get_rpath(&artifact.path)?;
// TODO: clean existing rpath entries if it's not pointed to a location within the wheel
// See https://github.com/pypa/auditwheel/blob/353c24250d66951d5ac7e60b97471a6da76c123f/src/auditwheel/repair.py#L160
let new_rpath = Path::new("$ORIGIN").join(relpath(&libs_dir, artifact_dir));
let new_rpath = Path::new("$ORIGIN").join(relpath(&libs_dir, &artifact_dir));
new_rpaths.push(new_rpath.to_str().unwrap().to_string());
let new_rpath = new_rpaths.join(":");
patchelf::set_rpath(&artifact.path, &new_rpath)?;
Expand Down

0 comments on commit 1cd1140

Please sign in to comment.