Skip to content

Commit 02bba67

Browse files
committed
Update docs
1 parent b5339a2 commit 02bba67

File tree

3 files changed

+15
-1
lines changed

3 files changed

+15
-1
lines changed

examples/build_file_generation/BUILD.bazel

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff 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

gazelle/docs/installation_and_usage.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff 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

gazelle/modules_mapping/def.bzl

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff 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(

0 commit comments

Comments
 (0)