Skip to content

Commit 4b3d0c2

Browse files
committed
fix handling of unset --debug flag
1 parent 7b0dd24 commit 4b3d0c2

File tree

2 files changed

+7
-6
lines changed

2 files changed

+7
-6
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+
5+
- Fix regression in 1.10.0 where editable builds would be built in release mode
6+
37
## 1.10.0 (2024-07-01)
48
### Packaging
59
- Extend macOS build flags to iOS, tvOS and watchOS. [#436](https://github.com/PyO3/setuptools-rust/pull/436)

setuptools_rust/build.py

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -329,10 +329,7 @@ def build_extension(
329329
def install_extension(
330330
self, ext: RustExtension, dylib_paths: List["_BuiltModule"]
331331
) -> None:
332-
debug_build = ext.debug if ext.debug is not None else self.inplace
333-
debug_build = self.debug if self.debug is not None else debug_build
334-
if self.release:
335-
debug_build = False
332+
debug_build = self._is_debug_build(ext)
336333

337334
# Ask build_ext where the shared library would go if it had built it,
338335
# then copy it there.
@@ -502,8 +499,8 @@ def _detect_rust_target(
502499
def _is_debug_build(self, ext: RustExtension) -> bool:
503500
if self.release:
504501
return False
505-
elif self.debug is not None:
506-
return self.debug
502+
elif self.debug:
503+
return True
507504
elif ext.debug is not None:
508505
return ext.debug
509506
else:

0 commit comments

Comments
 (0)