| commit | e05cf00465763d0798c9a2cae116dbadcc13c701 | [log] [tgz] |
|---|---|---|
| author | Richard Levasseur <richardlev@gmail.com> | Sun Dec 14 12:29:35 2025 -0800 |
| committer | GitHub <noreply@github.com> | Sun Dec 14 20:29:35 2025 +0000 |
| tree | 35819173edb6086d3f074bc5144a027f144397c3 | |
| parent | 0816a1ff1e425f5177d10433a50fc756ca79ccb1 [diff] |
fix: correctly merge conflicting paths when files (instead of dirs) are being linked (#3458) When a file (instead of directory) was duplicated, it was incorrectly be treated as a directory. The conflicting path was turned into a directory and all the files were made child paths of it. In practice, this usually worked out OK still because the conflicting file was an `__init__.py` file for a pkgutil-style namespace package, which effectively converted it to an implicit namespace package. I think this was introduced by https://github.com/bazel-contrib/rules_python/pull/3448, but am not 100% sure. To fix, first check for exact path equality when merging conflicting paths. If the candidate file has the same link_to_path as the grouping, then just link to that file and skip any remaining files in the group. The rest of the group's files are skipped because none of them can contribute links anymore: * If they have the same path, then they are ignored (first set wins) * If they are a sub-path, then it violates the preconditions of the group (all files in the group should be exact matches or sub-paths of a common prefix) * If they aren't under the common prefix, then it violates the preconditions of the group and are skipped. --------- Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
This repository is the home of the core Python rules -- py_library, py_binary, py_test, py_proto_library, and related symbols that provide the basis for Python support in Bazel. It also contains package installation rules for integrating with PyPI and other indices.
Documentation for rules_python is at https://rules-python.readthedocs.io and in the Bazel Build Encyclopedia.
Examples live in the examples directory.
The core rules are stable. Their implementation is subject to Bazel's backward compatibility policy. This repository aims to follow semantic versioning.
The Bazel community maintains this repository. Neither Google nor the Bazel team provides support for the code. However, this repository is part of the test suite used to vet new Bazel releases. See How to contribute page for information on our development workflow.
For detailed documentation, see https://rules-python.readthedocs.io
See Bzlmod support for more details.