style(cc): move comments above select entries and remove os:osx alias Why: - Remove redundant @platforms//os:osx alias in select block. - Place platform-specific link flag comments directly above their respective select entries for clarity. How: - Move macOS comment above @platforms//os:macos entry in select. - Move Windows comment above @platforms//os:windows entry in select. - Remove @platforms//os:osx entry.
diff --git a/python/private/cc/py_extension_macro.bzl b/python/private/cc/py_extension_macro.bzl index 7514b3f..749e928 100644 --- a/python/private/cc/py_extension_macro.bzl +++ b/python/private/cc/py_extension_macro.bzl
@@ -136,15 +136,13 @@ # does not re-export CPython runtime symbols. csl_kwargs["exports_filter"] = exports_filter if exports_filter != None else final_csl_deps - # Platform-specific link flags: - # - On macOS, Apple's ld64 linker requires '-undefined dynamic_lookup' so CPython - # C-API symbols (e.g. PyModule_Create) remain unresolved at link time and are - # dynamically resolved at runtime when CPython loads the shared library (.so). - # - On Windows, link.exe receives the CPython import library (.lib) passed via - # current_py_cc_libs. effective_user_link_flags = (user_link_flags or linkopts or []) + select({ + # On macOS, Apple's ld64 linker requires '-undefined dynamic_lookup' so CPython + # C-API symbols (e.g. PyModule_Create) remain unresolved at link time and are + # dynamically resolved at runtime when CPython loads the shared library (.so). "@platforms//os:macos": ["-undefined", "dynamic_lookup"], - "@platforms//os:osx": ["-undefined", "dynamic_lookup"], + # On Windows, link.exe receives the CPython import library (.lib) passed via + # current_py_cc_libs. "@platforms//os:windows": ["$(locations @rules_python//python/cc:current_py_cc_libs)"], "//conditions:default": [], })