-
-
Notifications
You must be signed in to change notification settings - Fork 26k
BLD Reduces size of wheels by stripping symbols #25123
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
4f62f3a
173af77
4aaa016
66b5507
0b9a92a
49b9465
ff2dc70
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -509,6 +509,16 @@ def configure_extension_modules(): | |
default_extra_compile_args = [f"/{optimization_level}"] | ||
default_libraries = [] | ||
|
||
build_with_debug_symbols = ( | ||
os.environ.get("SKLEARN_BUILD_ENABLE_DEBUG_SYMBOLS", "0") != "0" | ||
) | ||
if os.name == "posix": | ||
if build_with_debug_symbols: | ||
default_extra_compile_args.append("-g") | ||
Comment on lines
+516
to
+517
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. is it not already set by default ? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. On macOS+clang and Windows+MSCV, the debug symbols are stripped by default, which resulted in the ~9MB wheels on PyPI. With the new environment variable, I can enable debug symbols without changing the source on my local macOS machine. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ah yes, right |
||
else: | ||
# Setting -g0 will strip symbols, reducing the binary size of extensions | ||
default_extra_compile_args.append("-g0") | ||
|
||
cython_exts = [] | ||
for submodule, extensions in extension_config.items(): | ||
submodule_parts = submodule.split(".") | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this doesn't really belong to
parallelism.rst
though.Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Although this file is named
parallelism.rst
, the title is "Parallelism, resource management, and configuration". I'm guessing all the environment variables listed here fall under "configuration", which this PR adds onto.Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As for discoverability, searching for "configuration" places the
parallelism.rst
page as second. I'm open to figuring out a better location for all the configuration options, but I do not think it is a blocker for this PR.