Skip to content

Commit e1e0d97

Browse files
Docs: Add changelog entry for local_runtime_repo include dir fix
References issue #3043.
1 parent d31b245 commit e1e0d97

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,9 @@ END_UNRELEASED_TEMPLATE
6969
* (pypi) Wheels with BUILD.bazel (or other special Bazel files) no longer
7070
result in missing files at runtime
7171
([#2782](https://github.com/bazel-contrib/rules_python/issues/2782)).
72+
* (toolchains) `local_runtime_repo` now checks if the include directory exists
73+
before attempting to watch it, fixing issues on macOS with system Python
74+
({gh-issue}`3043`).
7275

7376
{#v0-0-0-added}
7477
### Added

python/private/local_runtime_repo.bzl

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -100,13 +100,12 @@ def _local_runtime_repo_impl(rctx):
100100

101101
# NOTE: Keep in sync with recursive glob in define_local_runtime_toolchain_impl
102102
include_path = rctx.path(info["include"])
103-
104-
# The reported include path may not exist, and watching a non-existant
105-
# path is an error. Silently skip, since includes are only necessary
106-
# if C extensions are built.
107103
if include_path.exists and include_path.is_dir:
108104
repo_utils.watch_tree(rctx, include_path)
109105
else:
106+
# If the path doesn't exist or is not a directory, do not watch it.
107+
# This handles the case where the include path specified in Python metadata
108+
# is invalid or points to a file.
110109
pass
111110

112111
# The cc_library.includes values have to be non-absolute paths, otherwise

0 commit comments

Comments
 (0)