This PR is part of a broader work to get the WASM build to use the build tools it is expected to use: the ones provided as part of the Chromium sync, the ones provided as hermetic if any, and the ones in the rust wasm toolchain. This change adds `llvm-lib.exe` to the rust wasm toolchain packaging, so we can have a proper librarian on Windows, which will make the build gn source simpler than if we use `lld-link.exe` as the AR. Bug: https://github.com/brave/brave-browser/issues/55812
tools/cr
Python tooling maintained by the Chromium Rebase team to support upgrading
brave-core to new Chromium versions and to manage the patches and shadow
files that live on top of upstream.
All scripts here are intended to run via vpython3; the .vpython3 spec in
this directory pulls in rich, requests, and the other wheels they need.
Most scripts accept --verbose to switch logging to DEBUG.
Important
Before adding or editing Python in this directory, read Python dos and donts.
Entry points
These are the user-facing scripts in this directory:
- 🚀Brockit — End-to-end rebase orchestration. Updates the Chromium version, regenerates patches and strings, and walks the rebase forward.
- 🩹Plaster — Applies and regenerates "plaster" files: semantic patches against upstream Chromium sources.
post_presubmit.py— Posts and refreshes GitHub PR comments from anpm run presubmitJSON dump.find_rebase_commits.py— Resolves a Chromium rebase tag (e.g.cr148) to anoldest..newestgit commit range.prune_test_filters.py— Detects and (optionally) removes obsolete entries from the current platform's test-filter files.
Library modules
Shared abstractions used by the entry points and tests:
repository.py—Repositoryinstances (repository.brave,repository.chromium) for paths and for running git commands at any repo.terminal.py— Rich console, baseline logging config, and subprocess utilities.vpython_utils.py— Providesvpython3path.patchfile.py— Patch file abstraction handling patches that failed to apply.git_status.py— Parser forgit status --porcelainoutput.versioning.py— Chromium version number parsing.vscode.py— IPC for opening files in VS Code in the integrated terminal.
Subdirectories
alias/—git crgit-alias subcommands (commit,mv,follow-renames, ...). Seealias/README.md.test/— Shared test fixtures, includingFakeChromiumRepo.toolchain/— Scripts to build platform-specific toolchains when rebasing Chromium.
Tests
Every module of interest ships a *_test.py next to it. Tests should always
have a vpython3 shebang line, and +x mode, so they can be run as their own
utilities from the repo root.
Tests should keep mock use to a minimum. Make sure to always use
FakeChromiumRepo to provide a test enviroment. Scripts tested with
FakeChromiumRepo should rely always on relative paths derived from
Repository.brave.root to permit tests to be run in integration with the
repository sandbox provided with FakeChromiumRepo.