aboutsummaryrefslogtreecommitdiff
path: root/llvm_tools/README.md
diff options
context:
space:
mode:
authorandroid-build-team Robot <android-build-team-robot@google.com>2021-06-19 12:04:54 +0000
committerandroid-build-team Robot <android-build-team-robot@google.com>2021-06-19 12:04:54 +0000
commit4ac7ca7c4f6d13380afa6b0d52313f0f18765038 (patch)
tree73936aba47fe1dc71e9cc05af9747036e935608c /llvm_tools/README.md
parentb75f321fc8978b92ce3db6886ccb966768f0c7a8 (diff)
parent4e4201457e5f51a132101c611c79ccff9f713c8b (diff)
downloadtoolchain-utils-4ac7ca7c4f6d13380afa6b0d52313f0f18765038.tar.gz
Change-Id: I2fe70a8ca191c683886391da7cc959d8659fac4c
Diffstat (limited to 'llvm_tools/README.md')
-rw-r--r--llvm_tools/README.md168
1 files changed, 145 insertions, 23 deletions
diff --git a/llvm_tools/README.md b/llvm_tools/README.md
index 52bc263f..783ec22d 100644
--- a/llvm_tools/README.md
+++ b/llvm_tools/README.md
@@ -14,13 +14,15 @@ version.
**NOTE: sudo must be permissive (i.e. **`cros_sdk`** should NOT prompt for a
password)**
-## `update_packages_and_run_tryjobs.py`
+## `update_packages_and_run_tests.py`
### Usage
-This script is used for updating a package's `LLVM_NEXT_HASH` (sys-devel/llvm,
+This script is used for updating a package's LLVM hash (sys-devel/llvm,
sys-libs/compiler-rt, sys-libs/libcxx, sys-libs/libcxxabi, and
-sys-libs/llvm-libunwind) and then run tryjobs after updating the git hash.
+sys-libs/llvm-libunwind) and then run tests after updating the git hash.
+There are three ways to test the change, including starting tryjobs,
+recipe builders or using cq+1.
An example when this script should be run is when certain boards would like
to be tested with the updated `LLVM_NEXT_HASH`.
@@ -28,8 +30,10 @@ to be tested with the updated `LLVM_NEXT_HASH`.
For example:
```
-$ ./update_packages_and_run_tryjobs.py \
+$ ./update_packages_and_run_tests.py \
+ --is_llvm_next \
--llvm_version tot \
+ tryjobs \
--options nochromesdk latest-toolchain \
--builders kevin-release-tryjob nocturne-release-tryjob
```
@@ -41,34 +45,35 @@ in 'nochromesdk' and 'latest-toolchain' for each tryjob.
For help with the command line arguments of the script, run:
```
-$ ./update_packages_and_run_tryjobs.py --help
+$ ./update_packages_and_run_tests.py --help
```
-Similarly as the previous example, but for updating `LLVM_NEXT_HASH` to
-google3:
+Similarly as the previous example, but for updating `LLVM_HASH` to
+google3 and test with cq+1:
```
-$ ./update_packages_and_run_tryjobs.py \
+$ ./update_packages_and_run_tests.py \
--llvm_version google3 \
- --options nochromesdk latest-toolchain \
- --builders kevin-release-tryjob nocturne-release-tryjob
+ cq
```
Similarly as the previous example, but for updating `LLVM_NEXT_HASH` to
-the git hash of revision 367622:
+the git hash of revision 367622 and test with recipe builders:
```
-$ ./update_packages_and_run_tryjobs.py \
+$ ./update_packages_and_run_tests.py \
+ --is_llvm_next \
--llvm_version 367622 \
- --options nochromesdk latest-toolchain \
- --builders kevin-release-tryjob nocturne-release-tryjob
+ recipe \
+ --options -nocanary \
+ --builders chromeos/toolchain/kevin-llvm chromeos/toolchain/nocturne-llvm
```
-## `update_chromeos_llvm_next_hash.py`
+## `update_chromeos_llvm_hash.py`
### Usage
-This script is used for updating a package's/packages' `LLVM_NEXT_HASH` and
+This script is used for updating a package's/packages' LLVM hashes and
creating a change list of those changes which will uploaded for review. For
example, some changes that would be included in the change list are
the updated ebuilds, changes made to the patches of the updated packages such
@@ -81,13 +86,14 @@ have their `LLVM_NEXT_HASH` updated.
For example:
```
-$ ./update_chromeos_llvm_next_hash.py \
+$ ./update_chromeos_llvm_hash.py \
--update_packages sys-devel/llvm sys-libs/compiler-rt \
+ --is_llvm_next \
--llvm_version google3 \
--failure_mode disable_patches
```
-The example above would update sys-devel/llvm and sys-libs/compiler-rt
+The example above would update sys-devel/llvm and sys-libs/compiler-rt's
`LLVM_NEXT_HASH` to the latest google3's git hash of LLVM. And the change list
may include patches that were disabled for either sys-devel/llvm or
sys-libs/compiler-rt.
@@ -95,23 +101,24 @@ sys-libs/compiler-rt.
For help with the command line arguments of the script, run:
```
-$ ./update_chromeos_llvm_next.py --help
+$ ./update_chromeos_llvm_hash.py --help
```
-For example, to update `LLVM_NEXT_HASH` to top of trunk of LLVM:
+For example, to update `LLVM_HASH` to top of trunk of LLVM:
```
-$ ./update_chromeos_llvm_next_hash.py \
+$ ./update_chromeos_llvm_hash.py \
--update_packages sys-devel/llvm sys-libs/compiler-rt \
--llvm_version tot \
--failure_mode disable_patches
```
-For example, to update `LLVM_NEXT_HASH` to the git hash of revision 367622:
+For example, to create a roll CL to the git hash of revision 367622:
```
-$ ./update_chromeos_llvm_next_hash.py \
+$ ./update_chromeos_llvm_hash.py \
--update_packages sys-devel/llvm sys-libs/compiler-rt \
+ sys-libs/libcxx sys-libs/libcxxabi sys-libs/llvm-libunwind \
--llvm_version 367622 \
--failure_mode disable_patches
```
@@ -271,6 +278,7 @@ $ ./auto_llvm_bisection.py --start_rev 369410 --end_rev 369420 \
--last_tested /abs/path/to/last_tested_file.json \
--extra_change_lists 513590 1394249 \
--options latest-toolchain nochromesdk \
+ --chroot_path /path/to/chromeos/chroot \
--builder eve-release-tryjob
```
@@ -470,3 +478,117 @@ from get_llvm_hash import GetGoogle3LLVMVersion
GetGoogle3LLVMVersion(stable=True)
```
+
+### `git_llvm_rev.py`
+
+This script is meant to synthesize LLVM revision numbers, and translate between
+these synthesized numbers and git SHAs. Usage should be straightforward:
+
+```
+~> ./git_llvm_rev.py --llvm_dir llvm-project-copy/ --rev r380000
+6f635f90929da9545dd696071a829a1a42f84b30
+~> ./git_llvm_rev.py --llvm_dir llvm-project-copy/ --sha 6f635f90929da9545dd696071a829a1a42f84b30
+r380000
+~> ./git_llvm_rev.py --llvm_dir llvm-project-copy/ --sha origin/some-branch
+r387778
+```
+
+**Tip**: if you put a symlink called `git-llvm-rev` to this script somewhere on
+your `$PATH`, you can also use it as `git llvm-rev`.
+
+### `cherrypick_cl.py`
+
+#### Usage
+
+This script updates the proper ChromeOS packages with an LLVM cherrypick of your choosing, and
+copies the cherrypick into patch folders of the packages.
+
+Usage:
+
+```
+./cherrypick_cl.py --chroot_path /abs/path/to/chroot --start_sha llvm
+--sha 174c3eb69f19ff2d6a3eeae31d04afe77e62c021 --sha 174c3eb69f19ff2d6a3eeae31d04afe77e62c021
+```
+
+It tries to autodetect a lot of things (e.g., packages changed by each sha,
+their ebuild paths, the "start"/"end" revisions to set, etc.) By default the
+script creates a local patch. Use --create_cl option to create a CL instead. For
+more information, please see the `--help`
+
+### `revert_checker.py`
+
+This script reports reverts which happen 'across' a certain LLVM commit.
+
+To clarify the meaning of 'across' with an example, if we had the following
+commit history (where `a -> b` notes that `b` is a direct child of `a`):
+
+123abc -> 223abc -> 323abc -> 423abc -> 523abc
+
+And where 423abc is a revert of 223abc, this revert is considered to be 'across'
+323abc. More generally, a revert A of a parent commit B is considered to be
+'across' a commit C if C is a parent of A and B is a parent of C.
+
+Usage example:
+
+```
+./revert_checker.py -C llvm-project-copy 123abc 223abc 323abc
+```
+
+In the above example, the tool will scan all commits between 123abc and 223abc,
+and all commits between 123abc and 323abc for reverts of commits which are
+parents of 123abc.
+
+### `nightly_revert_checker.py`
+
+This is an automated wrapper around `revert_checker.py`. It checks to see if any
+new reverts happened across toolchains that we're trying to ship since it was
+last run. If so, it sends emails to appropriate groups.
+
+Usage example:
+```
+PYTHONPATH=../ ./nightly_revert_checker.py \
+ --state_file state.json \
+ --llvm_dir llvm-project-copy \
+ --chromeos_dir ../../../../
+```
+
+### `bisect_clang_crashes.py`
+
+This script downloads clang crash diagnoses from
+gs://chromeos-toolchain-artifacts/clang-crash-diagnoses and sends them to 4c for
+bisection.
+
+Usage example:
+
+```
+$ ./bisect_clang_crashes.py --4c 4c-cli --state_file ./output/state.json
+```
+
+The above command downloads the artifacts of clang crash diagnoses and send them
+to 4c server for bisection. The summary of submitted jobs will be saved in
+output/state.json under the current path. The output directory will be created
+automatically if it does not exist yet. To get more information of the submitted
+jobs, please refer to go/4c-cli.
+
+### `upload_lexan_crashes_to_forcey.py`
+
+This script downloads clang crash diagnoses from Lexan's bucket and sends them
+to 4c for bisection.
+
+Usage example:
+
+```
+$ ./upload_lexan_crashes_to_forcey.py --4c 4c-cli \
+ --state_file ./output/state.json
+```
+
+The above command downloads the artifacts of clang crash diagnoses and send them
+to 4c server for bisection. The summary of submitted jobs will be saved in
+output/state.json under the current path. The output directory will be created
+automatically if it does not exist yet. To get more information of the submitted
+jobs, please refer to go/4c-cli.
+
+Note that it's recommended to 'seed' the state file with a most recent upload
+date. This can be done by running this tool *once* with a `--last_date` flag.
+This flag has the script override whatever's in the state file (if anything) and
+start submitting all crashes uploaded starting at the given day.