Skip to content

Commit ce8caa3

Browse files
committed
Fix crash when installing extension
1 parent d72e9c6 commit ce8caa3

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# Changelog
22

3+
## Unreleased
4+
### Fixed
5+
- Fix regression in `install_extension` crashing since 1.8.0. [#380](https://github.com/PyO3/setuptools-rust/pull/380)
6+
37
## 1.8.0 (2023-10-26)
48
### Packaging
59
- Drop support for Python 3.7. [#357](https://github.com/PyO3/setuptools-rust/pull/357)

setuptools_rust/build.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -372,6 +372,8 @@ def install_extension(
372372
# will install the rust library into the module directory
373373
ext_path = self.get_dylib_ext_path(ext, module_name)
374374

375+
os.makedirs(os.path.dirname(ext_path), exist_ok=True)
376+
375377
# Make filenames relative to cwd where possible, to make logs and
376378
# errors below a little neater
377379

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

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

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

0 commit comments

Comments
 (0)