fix(pipstar): correctly handle platlib and purelib in .data by aignas · Pull Request #3501 · bazel-contrib/rules_python

@aignas

Some packages like use `platlib` in the data to put the main files. This
PR is implementing correct handling of such packages by recursively
merging two trees. If we have any collisions, we will print an error
and stop. That is unlikely but better to be safe. Users can patch the
failure to be a warning if necessary.

In order to make this more testable, move the functions to a separate
file.

Fixes bazel-contrib#3500

gemini-code-assist[bot]

@aignas

@aignas

rickeylev

rickeylev pushed a commit that referenced this pull request

Jan 10, 2026
Some packages like use `platlib` in the data to put the main files. This
PR is implementing correct handling of such packages by recursively
merging two trees. If we have any collisions, we will print an error
and stop. That is unlikely but better to be safe. Users can patch the
failure to be a warning if necessary.

In order to make this more testable, move the functions to a separate
file.

Fixes #3500
Fixes #2949
To be cherry-picked as part of #3466

(cherry picked from commit 62acad6)