Skip to content

Commit eb63d4a

Browse files
Add config option and allow override in pip_library rule (#62)
1 parent 423cca4 commit eb63d4a

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

.plzconfig

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,11 @@ ConfigKey = DisableVendorFlags
7474
DefaultValue = false
7575
Inherit = true
7676

77+
[PluginConfig "pip_compile_flags"]
78+
ConfigKey = PipCompileFlags
79+
Optional = true
80+
Inherit = true
81+
7782
[PluginConfig "wheel_repo"]
7883
ConfigKey = WheelRepo
7984
Optional = true

build_defs/python.build_defs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -403,8 +403,9 @@ def pip_library(name:str, version:str, hashes:list=None, package_name:str=None,
403403

404404
pip_tool = "$TOOLS_PIP" if CONFIG.PYTHON.PIP_TOOL else '$TOOLS_PYTHON -m pip'
405405

406-
# Unset these compiler and linker flags as macOS doesn't have all these options.
407-
pip_compile_flags = 'CFLAGS=" -Wl,--build-id=none -g0 " LDFLAGS=" -Wl,--build-id=none"' if CONFIG.HOSTOS != 'darwin' else 'CFLAGS=" -g0"'
406+
# Set pip compile flags and allow override with config option.
407+
pip_compile_flags = 'CFLAGS=" -Wl,--build-id=none -g0 " LDFLAGS=" -Wl,--build-id=none"' if CONFIG.HOSTOS == 'linux' else 'CFLAGS=" -g0"'
408+
pip_compile_flags = CONFIG.PYTHON.PIP_COMPILE_FLAGS or pip_compile_flags
408409

409410
pip_cmd = (
410411
f'mkdir {pip_target_dir} && '

0 commit comments

Comments
 (0)