From b8aa0ee164d6b97af6a342c6d80c55d602df179d Mon Sep 17 00:00:00 2001 From: Richard Smith Date: Tue, 23 Jun 2026 10:18:47 -0700 Subject: [PATCH] Use plain Apache 2.0 license for mirrors. (#7407) Our mirror repositories contain vim scripts and textmate grammars, neither of which have any need for the LLVM exception, so we can use the base Apache 2.0 license there with no loss of relevant permissions. This is a compatible license, so providing these repositories under these license terms is valid. Other than removing the LLVM exception, the new license file has one other change compared to LICENSE: the amount of whitespace on some lines is reduced from four spaces to three. This makes the new license *exactly* match the Apache 2.0 license, byte-for-byte. This is important because the license checking done by GitHub's linguist project doesn't recognize Apache-2.0-with-LLVM-exception as an acceptable license, but does allow plain Apache-2.0. --- .pre-commit-config.yaml | 1 + scripts/sync_repos.sh | 5 ++++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index a1c23898820c..6ab44640b47e 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -232,6 +232,7 @@ repos: .bazelversion| .github/pull_request_template.md| .python-version| + LICENSE.*| compile_flags.txt| github_tools/requirements.txt| third_party/.*| diff --git a/scripts/sync_repos.sh b/scripts/sync_repos.sh index 20c125c8d517..dbceb23d5371 100755 --- a/scripts/sync_repos.sh +++ b/scripts/sync_repos.sh @@ -44,10 +44,13 @@ for dir in "${!MIRRORS[@]}"; do git rm --ignore-unmatch -r . git status + # Restore the license file. The mirrors use the Apache 2.0 license, which is + # compatible with our license but excludes the LLVM exception. + git checkout HEAD LICENSE + # Copy the basic framework from the origin repository. cp "$ORIGIN_DIR/.gitignore" \ "$ORIGIN_DIR/CODE_OF_CONDUCT.md" \ - "$ORIGIN_DIR/LICENSE" \ . # Copy the mirrored directory. We use `rsync` to get a more reliable way of