File tree Expand file tree Collapse file tree 3 files changed +15
-1
lines changed
examples/build_file_generation Expand file tree Collapse file tree 3 files changed +15
-1
lines changed Original file line number Diff line number Diff line change @@ -28,6 +28,9 @@ modules_mapping(
2828 "^_|(\\ ._)+" , # This is the default.
2929 "(\\ .tests)+" , # Add a custom one to get rid of the psutil tests.
3030 ],
31+ # Uncomment the next line to enable hermetic builds across platforms
32+ # by ignoring platform-specific native libraries (useful for opencv-python-headless, etc.)
33+ # ignore_native_libs = True,
3134 wheels = all_whl_requirements ,
3235)
3336
Original file line number Diff line number Diff line change @@ -96,6 +96,14 @@ modules_mapping(
9696 # for tools like type checkers and IDEs, improving the development experience and
9797 # reducing manual overhead in managing separate stub packages.
9898 include_stub_packages = True ,
99+
100+ # ignore_native_libs: bool (default: False)
101+ # If set to True, this flag ignores platform-specific native libraries (.so files)
102+ # when generating the modules mapping. This ensures hermetic builds across different
103+ # platforms (Linux, macOS, etc.) by producing identical manifests regardless of
104+ # platform-specific wheel contents. Useful for packages like opencv-python-headless
105+ # that include different native libraries on different platforms.
106+ # ignore_native_libs = True,
99107)
100108
101109# Gazelle python extension needs a manifest file mapping from
Original file line number Diff line number Diff line change @@ -68,7 +68,10 @@ modules_mapping = rule(
6868 ),
6969 "ignore_native_libs" : attr .bool (
7070 default = False ,
71- doc = "Whether to ignore native libraries (*.so files) for platform-independent mappings." ,
71+ doc = "Whether to ignore platform-specific native libraries (*.so files) when generating mappings. " +
72+ "When True, ensures hermetic builds across different platforms by excluding native library " +
73+ "mappings that vary between Linux, macOS, etc. Useful for packages like opencv-python-headless " +
74+ "that bundle different native libraries on different platforms." ,
7275 mandatory = False ,
7376 ),
7477 "modules_mapping_name" : attr .string (
You can’t perform that action at this time.
0 commit comments