Skip to content

Commit

Permalink
fix: only strip Release and MinSizeRel builds by default (#898)
Browse files Browse the repository at this point in the history
Fix #875.

Signed-off-by: Henry Schreiner <[email protected]>
  • Loading branch information
henryiii authored Sep 11, 2024
1 parent ef43b65 commit 8380c9e
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 4 deletions.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,8 @@ build.verbose = false
# The components to install. If empty, all default components are installed.
install.components = []

# Whether to strip the binaries. True for scikit-build-core 0.5+.
# 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).
install.strip = true

# The path (relative to platlib) for the file to generate.
Expand Down
2 changes: 1 addition & 1 deletion src/scikit_build_core/resources/scikit-build.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -303,7 +303,7 @@
},
"strip": {
"type": "boolean",
"description": "Whether to strip the binaries. True for scikit-build-core 0.5+."
"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)."
}
}
},
Expand Down
3 changes: 2 additions & 1 deletion src/scikit_build_core/settings/skbuild_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,8 @@ class InstallSettings:

strip: Optional[bool] = None
"""
Whether to strip the binaries. True for scikit-build-core 0.5+.
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).
"""


Expand Down
5 changes: 4 additions & 1 deletion src/scikit_build_core/settings/skbuild_read_settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,10 @@ def __init__(
or self.settings.minimum_version >= Version("0.5")
)
if self.settings.install.strip is None:
self.settings.install.strip = install_policy
self.settings.install.strip = (
install_policy
and self.settings.cmake.build_type in {"Release", "MinSizeRel"}
)

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

0 comments on commit 8380c9e

Please sign in to comment.