diff --git a/python/python_wheel.bzl b/python/python_wheel.bzl index cb7bb1580..f94dc6371 100644 --- a/python/python_wheel.bzl +++ b/python/python_wheel.bzl @@ -152,6 +152,7 @@ def _impl(ctx: AnalysisContext) -> list[Provider]: opts = link_options( links = [ LinkArgs(flags = python_toolchain.extension_linker_flags), + LinkArgs(flags = python_toolchain.wheel_linker_flags), LinkArgs(infos = inputs), ], category_suffix = "native_extension", diff --git a/python/toolchain.bzl b/python/toolchain.bzl index 6c8c05653..3a0e4260b 100644 --- a/python/toolchain.bzl +++ b/python/toolchain.bzl @@ -57,6 +57,7 @@ PythonToolchainInfo = provider( "linker_flags": provider_field(typing.Any, default = None), "binary_linker_flags": provider_field(typing.Any, default = None), "extension_linker_flags": provider_field(typing.Any, default = None), + "wheel_linker_flags": provider_field(list[typing.Any], default = []), "generate_static_extension_info": provider_field(typing.Any, default = None), "parse_imports": provider_field(typing.Any, default = None), "traverse_dep_manifest": provider_field(typing.Any, default = None),