diff --git a/CHANGELOG.md b/CHANGELOG.md index 5e839d3103..554723fd29 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -48,6 +48,17 @@ END_UNRELEASED_TEMPLATE --> +{#1-4-2} +## [1.4.2] - 2025-08-13 + +[1.4.2]: https://github.com/bazel-contrib/rules_python/releases/tag/1.4.2 + +### Fixed +* (toolchains) `local_runtime_repo` now checks if the include directory exists + before attempting to watch it, fixing issues on macOS with system Python + ([#3043](https://github.com/bazel-contrib/rules_python/issues/3043)). + + {#1-4-1} ## [1.4.1] - 2025-05-08 diff --git a/python/private/local_runtime_repo.bzl b/python/private/local_runtime_repo.bzl index fb1a8e29ac..6f1e20aa4b 100644 --- a/python/private/local_runtime_repo.bzl +++ b/python/private/local_runtime_repo.bzl @@ -85,7 +85,15 @@ def _local_runtime_repo_impl(rctx): logger.info(lambda: _format_get_info_result(info)) # NOTE: Keep in sync with recursive glob in define_local_runtime_toolchain_impl - repo_utils.watch_tree(rctx, rctx.path(info["include"])) + include_path = rctx.path(info["include"]) + + # The reported include path may not exist, and watching a non-existant + # path is an error. Silently skip, since includes are only necessary + # if C extensions are built. + if include_path.exists and include_path.is_dir: + repo_utils.watch_tree(rctx, include_path) + else: + pass # The cc_library.includes values have to be non-absolute paths, otherwise # the toolchain will give an error. Work around this error by making them