Skip to content

Commit

Permalink
Merge pull request #380 from Rongronggg9/fix/mkdir-empty
Browse files Browse the repository at this point in the history
Fix crash when installing extension
  • Loading branch information
davidhewitt authored Oct 30, 2023
2 parents d72e9c6 + ce8caa3 commit 2599241
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
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

0 comments on commit 2599241

Please sign in to comment.