aboutsummaryrefslogtreecommitdiff
path: root/llvm_tools/get_llvm_hash.py
AgeCommit message (Collapse)Author
2020-12-07llvm_tools: update upstream branch names to point to `main`George Burgess IV
LLVM recently renamed their `master` branch to `main` upstream. This changes our tooling to search for the latter name instead. BUG=None TEST=Unittests; ran `git llvm-rev --sha HEAD` in an up-to-date llvm repo. Change-Id: Icdc6dac48fda7697d18d0d77935e46670273bf84 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/2577643 Reviewed-by: Manoj Gupta <manojgupta@chromium.org> Tested-by: George Burgess <gbiv@chromium.org>
2020-07-29llvm_tools: clarify that syncing all of llvm is only done onceGeorge Burgess IV
There was some confusion about the intended frequency of LLVM syncs. Adding a bit to the "syncing" message should hopefully clear that up. BUG=None TEST=None Change-Id: I2454267602d9eaab79073882b172d61b3cb98daa Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/2321565 Reviewed-by: Luis Lozano <llozano@chromium.org> Tested-by: Luis Lozano <llozano@chromium.org>
2020-06-24llvm_tools: fix up namingGeorge Burgess IV
This replaces `master` with `main` where possible, per the linked bug. Since upstream LLVM has a `master` branch, and there appears to be general support in FOSS for swapping to a different naming convention (`main`), this also makes LLVM's upstream branch name into a constant that we can easily flip if needed. BUG=chromium:1099035 TEST=Unittests Change-Id: I0844cfb4fec00f761e39b0443299daa918fa37ab Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/2265047 Reviewed-by: Manoj Gupta <manojgupta@chromium.org> Tested-by: George Burgess <gbiv@chromium.org>
2020-01-27llvm_tools: remove unused importGeorge Burgess IV
`requests` is an artifact of an old way of doing things, and breaks things on Android bots. Best to just remove it. This also fixes other misc lints in that file BUG=b:147699825 TEST=unittests Change-Id: I3f465f9a129679b104e328ab8307298af1df651b Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/2023775 Reviewed-by: Manoj Gupta <manojgupta@chromium.org> Reviewed-by: Pirama Arumuga Nainar <pirama@google.com> Tested-by: George Burgess <gbiv@chromium.org>
2019-12-09Remove trailing newline from sha/git hash.Caroline Tice
Currently there is a trailing newline no the git has that is causing git rev-parse to fail. This CL removes the trailing newline. BUG=None TEST=None Change-Id: I509871fda6bc7ec77bf088d54490b68d3b58e268 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/1957891 Reviewed-by: George Burgess <gbiv@chromium.org> Commit-Queue: Caroline Tice <cmtice@chromium.org> Tested-by: Caroline Tice <cmtice@chromium.org>
2019-12-07LLVM tools: sync python scriptsJian Cai
Sync python scripts from sys-devel/llvm/files/patch_manager that fixed broken LLVM roll builders. BUG=chromium:1027950 TEST=local builds. Change-Id: I0f1c7147e937d59dfe859d36aa8cfcfcbfd1fdb9 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/1949693 Reviewed-by: George Burgess <gbiv@chromium.org> Commit-Queue: Jian Cai <jiancai@google.com> Tested-by: Jian Cai <jiancai@google.com>
2019-11-24toolchain-utils: use LLVM git hashes to track version numbers.Jian Cai
LLVM has stopped issuing SVN version numbers in its commits. This patch adds a way to track SVN-style version number based on a LLVM git hash. BUG=Chromium:1027950 TEST=local tests. Change-Id: Idd8055ea7deb3bcd17c18ab5b642ce8b389e446a Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/1915373 Tested-by: Jian Cai <jiancai@google.com> Reviewed-by: Manoj Gupta <manojgupta@chromium.org>
2019-09-30llvm_tools: Fix error in getting a fixed SVN version.Manoj Gupta
llvm_hash was not initialized when using a fixed SVN version. Fixes the error: UnboundLocalError: local variable 'llvm_hash' referenced before assignment BUG=None TEST=Unit tests pass Change-Id: I83d68908801325c7827b090e6bb472bc54bb3d75 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/1831791 Reviewed-by: George Burgess <gbiv@chromium.org> Tested-by: Manoj Gupta <manojgupta@chromium.org>
2019-09-10llvm_tools: teach patch updating logic about google3-unstableGeorge Burgess IV
This CL lets us use the new google3-unstable option from update_chromeos_llvm_next_hash.py. It also includes some formatting changes forced by `yapf`. BUG=chromium:914081 TEST=Unittests have no new failures; ran the script with google3-unstable, and it appeared to parse. Change-Id: Ib70e238b383e91dfa7c7df04d716e7127402f68a Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/1793907 Reviewed-by: Manoj Gupta <manojgupta@chromium.org> Tested-by: George Burgess <gbiv@chromium.org>
2019-09-10llvm_tools: support grabbing google3's unstable LLVMGeorge Burgess IV
Google3 integrates LLVM pretty often -- using that as a foundation for testing might be a good idea. This CL enables us to pull the revision of their unstable LLVM. As an added bonus, this will also have us print a message to stderr when we're syncing LLVM for the first time. Otherwise, it may seem to a user that our script got hung up on something while that first clone happens. :) BUG=chromium:914081 TEST=Unittests. Ran the new get_llvm_hash functionality. Change-Id: I3a7088c25dbd7169ca31373daf0c46fb28f46a68 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/1793906 Reviewed-by: Manoj Gupta <manojgupta@chromium.org> Tested-by: George Burgess <gbiv@chromium.org>
2019-09-09LLVM tools: Migrated all scripts to python3Salud Lemus
This CL includes changes such as replacements of `\'` with `"` and adding extra debugging output to some scripts. Currently, the scripts are in python2, so migrating them to python3 so they are more maintainable. BUG=None TEST=Ran each script by itself with various input (e.g. different google3, tot, etc.). Change-Id: Ib72b7744c6f7c13711c2db427f6524ff3cbc6205 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/1787738 Tested-by: Salud Lemus <saludlemus@google.com> Reviewed-by: Manoj Gupta <manojgupta@chromium.org>
2019-09-06llvm_tools: fix get_llvm_hash_unittestGeorge Burgess IV
It was broken when I tried to run it. This fixes it, and removes tests that no longer test anything meaningful (e.g. migration to `subprocess` made a lot of our "if ${command} failed, ...") logic go away. BUG=None TEST=./get_llvm_hash_unittest.py Change-Id: Id631e54f1d5af7c08e86f4fec9f97de79de4081d Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/1788665 Reviewed-by: Manoj Gupta <manojgupta@chromium.org> Tested-by: George Burgess <gbiv@chromium.org>
2019-08-28LLVM tools: Fixed unreferenced errorSalud Lemus
BUG=None TEST=Ran 'update_packages_and_run_tryjobs.py' with google3 option. Change-Id: I200b53239c9a557f59e94be7b2b4d0ee8e6cffb3 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/1775022 Reviewed-by: Manoj Gupta <manojgupta@chromium.org> Tested-by: Manoj Gupta <manojgupta@chromium.org>
2019-08-28LLVM tools: Added support for 'skip' and executing a custom scriptSalud Lemus
If a tryjob's status is set to 'skip', then that tryjob will not be considered when bisecting LLVM. And for executing a custom script, the exit code will be used by a mapping that sets the 'status' to the equivalent value of the exit code. BUG=None TEST=Ran the 'update_tryjob_status.py' with the 'skip' option and successfully set the tryjob's status to 'skip'. Also, created a testing script to serve as the custom script. Successfully set the 'status' value based off of the custom script's exit code. Change-Id: I0ae3a9b53467b13ff5ce26aeff46b31563cfc7e0 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/1772472 Reviewed-by: George Burgess <gbiv@chromium.org> Reviewed-by: Manoj Gupta <manojgupta@chromium.org> Tested-by: Salud Lemus <saludlemus@google.com>
2019-08-26LLVM tools: Maintain up-to-date LLVM repo in 'llvm_tools'Salud Lemus
Keeps an up-to-date LLVM source tree in 'llvm_tools' directory. Previously, the LLVM repo would be cloned once and then be forgotten. BUG=None TEST=Ran the 'llvm_bisection.py' script on a previously created JSON file (the script created it before). Successfully created tryjobs that were not in the 'jobs' list. Also, successfully kept the LLVM repo up-to-date in 'llvm_tools'. Change-Id: If9038da788eb0fe0fe258274c1942f1d687868b4 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/1769483 Reviewed-by: Manoj Gupta <manojgupta@chromium.org> Reviewed-by: George Burgess <gbiv@chromium.org> Tested-by: Salud Lemus <saludlemus@google.com>
2019-08-16LLVM tools: Moved function that retrieves latest g3 LLVM versionSalud Lemus
BUG=None TEST=Ran the script that creates tryjobs for both 'tot' and 'google3' Change-Id: I1be3971ab8858cb21d9d95b63b1bf60a98d3c7b9 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/1758728 Reviewed-by: Manoj Gupta <manojgupta@chromium.org> Tested-by: Salud Lemus <saludlemus@google.com>
2019-08-16LLVM tools: Added support for bisection of patchesSalud Lemus
Changed 'get_google3_llvm_version.py' and 'get_llvm_hash.py' to use the subprocess module instead of the command executer because the patch manager script uses some methods for bisection (retrieving the good and bad hash). They were also changed because the ebuilds will not have access to the command executer when invoking the patch manager script. BUG=None TEST=Ran the script on SVN version of 367622 without continuing bisection and successfully bisected the failed patch and terminated the script. Then moved HEAD of source tree to the bisected SVN version and applied the patch manually to test correctness and also moved HEAD to the SVN version one above it and one below it and also manually applied the patch. Change-Id: I2367b76e9bb4d0c95d651ec7b3f66e582155d2c7 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/1752526 Tested-by: Salud Lemus <saludlemus@google.com> Reviewed-by: Manoj Gupta <manojgupta@chromium.org>
2019-08-12LLVM tools: Assert that the scripts are not run inside the chrootSalud Lemus
BUG=None TEST=Scripts terminated when ran inside the chroot Change-Id: Id7060ca6554a05f158160e73759763663dec1ce9 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/1742544 Reviewed-by: Manoj Gupta <manojgupta@chromium.org> Reviewed-by: George Burgess <gbiv@chromium.org> Tested-by: Salud Lemus <saludlemus@google.com>
2019-08-10llvm-tools: Use the chromium mirror for gettting tot hash.Manoj Gupta
We were querying github to get the tot git hash. However, the ebuilds use the chromium mirror for llvm sources. As the mirror can be behind github, it caused a version skew where the sources could not be checked out to the desired tot hash. BUG=None TEST=update_packages script. Change-Id: I6510213f8de2ea29b26f46741a5da7b4c81f59e0 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/1747167 Reviewed-by: George Burgess <gbiv@chromium.org> Tested-by: Manoj Gupta <manojgupta@chromium.org>
2019-08-06LLVM tools: Added script that runs tryjobs after updating the packagesSalud Lemus
BUG=None TEST=Ran the script and a CL was generated for ToT correctly and two trybots were created, one for kevin and one for nocturne Change-Id: I856c23d4368f5e45d9837e6f4341ae1f97f8f136 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/1733650 Reviewed-by: Manoj Gupta <manojgupta@chromium.org> Reviewed-by: George Burgess <gbiv@chromium.org> Tested-by: Manoj Gupta <manojgupta@chromium.org>
2019-08-02LLVM tools: Moved parsing 'llvm-svn' of a commit message to another functionSalud Lemus
BUG=None TEST='./get_llvm_hash_unittest.py' passes Change-Id: I7cbb34a9e7924104aaa5934ca2156f547f421450 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/1731735 Tested-by: Salud Lemus <saludlemus@google.com> Reviewed-by: Manoj Gupta <manojgupta@chromium.org>
2019-08-01LLVM tools: Gets the latest git hash from ToT of LLVMSalud Lemus
BUG=None TEST='./get_llvm_hash_unittest.py' passes Change-Id: I6c5a58b82811f2d3abe8d377651f0036fa1bc491 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/1724419 Reviewed-by: George Burgess <gbiv@chromium.org> Reviewed-by: Manoj Gupta <manojgupta@chromium.org> Tested-by: Salud Lemus <saludlemus@google.com>
2019-07-08LLVM tools: Unittests for get_llvm_hash.pySalud Lemus
BUG=None TEST='./get_llvm_hash_unittest.py' passes Change-Id: I421e58dda744c6df6ae37a2fbc6559b98bcab2a8 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/1687777 Reviewed-by: George Burgess <gbiv@chromium.org> Reviewed-by: Manoj Gupta <manojgupta@chromium.org> Tested-by: Salud Lemus <saludlemus@google.com>
2019-07-02LLVM tools: get hashes from google3Salud Lemus
BUG=None TEST=Ran the script and returned expected results Change-Id: I360884c2dc4088a7875e88f2115460c5aa75ab27 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/1676593 Reviewed-by: George Burgess <gbiv@chromium.org> Tested-by: Salud Lemus <saludlemus@google.com>