Skip to content

Commit 8380c9e

Browse files
authored
fix: only strip Release and MinSizeRel builds by default (#898)
Fix #875. Signed-off-by: Henry Schreiner <[email protected]>
1 parent ef43b65 commit 8380c9e

File tree

4 files changed

+9
-4
lines changed

4 files changed

+9
-4
lines changed

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -282,7 +282,8 @@ build.verbose = false
282282
# The components to install. If empty, all default components are installed.
283283
install.components = []
284284

285-
# Whether to strip the binaries. True for scikit-build-core 0.5+.
285+
# Whether to strip the binaries. True for release builds on scikit-build-core
286+
# 0.5+ (0.5-0.10.5 also incorrectly set this for debug builds).
286287
install.strip = true
287288

288289
# The path (relative to platlib) for the file to generate.

src/scikit_build_core/resources/scikit-build.schema.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -303,7 +303,7 @@
303303
},
304304
"strip": {
305305
"type": "boolean",
306-
"description": "Whether to strip the binaries. True for scikit-build-core 0.5+."
306+
"description": "Whether to strip the binaries. True for release builds on scikit-build-core 0.5+ (0.5-0.10.5 also incorrectly set this for debug builds)."
307307
}
308308
}
309309
},

src/scikit_build_core/settings/skbuild_model.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -264,7 +264,8 @@ class InstallSettings:
264264

265265
strip: Optional[bool] = None
266266
"""
267-
Whether to strip the binaries. True for scikit-build-core 0.5+.
267+
Whether to strip the binaries. True for release builds on scikit-build-core
268+
0.5+ (0.5-0.10.5 also incorrectly set this for debug builds).
268269
"""
269270

270271

src/scikit_build_core/settings/skbuild_read_settings.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,10 @@ def __init__(
228228
or self.settings.minimum_version >= Version("0.5")
229229
)
230230
if self.settings.install.strip is None:
231-
self.settings.install.strip = install_policy
231+
self.settings.install.strip = (
232+
install_policy
233+
and self.settings.cmake.build_type in {"Release", "MinSizeRel"}
234+
)
232235

233236
# If we noted earlier that auto-cmake was requested, handle it now
234237
if (

0 commit comments

Comments
 (0)