|
| 1 | +# Copybara quirks |
| 2 | + |
| 3 | +The purpose of this document is to describe oddities you might see while |
| 4 | +contributing due to the tool that manages copying source back and forth from |
| 5 | +Google's internal repository. This tool is called [Copybara](https://github.com/google/copybara). |
| 6 | + |
| 7 | +## Internal source of truth |
| 8 | + |
| 9 | +Because the source of truth for the code in this repository is Google's internal |
| 10 | +repo, Copybara does transformations to the code whenever the code is imported |
| 11 | +and exported. This means that sometimes seemingly normal changes can break |
| 12 | +internally in surprising ways. |
| 13 | + |
| 14 | +## PR merge status and diff inconsistencies |
| 15 | + |
| 16 | +Since the source of truth is internal, PRs are not merged directly, they are |
| 17 | +imported to the Google internal repo where they undergo additional testing, |
| 18 | +and then that internal change is submitted, and attributed to the PR author. |
| 19 | +Because of the transformations that Copybara applies, there's no guarantee that |
| 20 | +the diff will be identical (for example, Copybara applies formatting on import). |
| 21 | + |
| 22 | +For this reason, Copybara won't mark the PR as merged, it will close the PR and |
| 23 | +separately apply a commit that should map very closely to the PR. |
| 24 | + |
| 25 | +## Dependency on TSL by copy |
| 26 | + |
| 27 | +As implemented currently, to prevent any temporary broken commits, XLA |
| 28 | +depends on TSL not by downloading a copy by using Bazel's `http_archive`, but by |
| 29 | +having Copybara copy TSL into XLA's `third_party` directory. |
0 commit comments