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 crash when installing extension #380

Merged
merged 1 commit into from
Oct 30, 2023
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Changelog

## Unreleased
### Fixed
- Fix regression in `install_extension` crashing since 1.8.0. [#380](https://github.com/PyO3/setuptools-rust/pull/380)

## 1.8.0 (2023-10-26)
### Packaging
- Drop support for Python 3.7. [#357](https://github.com/PyO3/setuptools-rust/pull/357)
Expand Down
3 changes: 2 additions & 1 deletion setuptools_rust/build.py
Original file line number Diff line number Diff line change
Expand Up @@ -372,6 +372,8 @@ def install_extension(
# will install the rust library into the module directory
ext_path = self.get_dylib_ext_path(ext, module_name)

os.makedirs(os.path.dirname(ext_path), exist_ok=True)

# Make filenames relative to cwd where possible, to make logs and
# errors below a little neater

Expand All @@ -381,7 +383,6 @@ def install_extension(
if ext_path.startswith(cwd):
ext_path = os.path.relpath(ext_path, cwd)

os.makedirs(os.path.dirname(ext_path), exist_ok=True)
logger.info("Copying rust artifact from %s to %s", dylib_path, ext_path)

# We want to atomically replace any existing library file. We can't
Expand Down