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

Fix auditwheel with read-only libraries #1292

Merged
merged 1 commit into from
Nov 23, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
* Tighten src-layout detection logic in [#1281](https://github.com/PyO3/maturin/pull/1282)
* Fix generating pep517 sdist for src-layout in [#1288](https://github.com/PyO3/maturin/pull/1288)
* Deprecate `python-source` option in Cargo.toml in [#1291](https://github.com/PyO3/maturin/pull/1291)
* Fix auditwheel with read-only libraries in [#1292](https://github.com/PyO3/maturin/pull/1292)

## [0.14.1] - 2022-11-20

Expand Down
6 changes: 6 additions & 0 deletions src/build_context.rs
Original file line number Diff line number Diff line change
Expand Up @@ -392,6 +392,12 @@ impl BuildContext {
fs::copy(&lib_path, &dest_path)?;
libs_copied.insert(lib_path);

// fs::copy copies permissions as well, and the original
// file may have been read-only
let mut perms = fs::metadata(&dest_path)?.permissions();
perms.set_readonly(false);
fs::set_permissions(&dest_path, perms)?;
vlaci marked this conversation as resolved.
Show resolved Hide resolved

patchelf::set_soname(&dest_path, &new_soname)?;
if !lib.rpath.is_empty() || !lib.runpath.is_empty() {
patchelf::set_rpath(&dest_path, &libs_dir)?;
Expand Down