aboutsummaryrefslogtreecommitdiff
path: root/rust_tools/rust_uprev.py
AgeCommit message (Collapse)Author
2024-02-01rust_uprev: don't update rust-bootstrapBob Haarman
rust_uprev.py contains code that updates the rust-bootstrap ebuild. This was previously necessary, because, without it, the version of rust-bootstrap needed to build the other rust packages would not be available. However, this is no longer true: We now update rust-bootstrap to the same version as dev-lang/rust and the others, which means that when we advance the non-bootstrap version, it will only be one step ahead of rust-bootstrap and therefore work. auto_update_rust_bootstrap.py will then take care of updating rust-bootstrap. As a result, we don't need logic for that in rust_uprev.py anymore, and this change removes it. Some code that refers to rust-bootstrap is still preserved, namely the code updates the bootstrap version encoded in cros-rustc.eclass and the code that verifies that rust-bootstrap sources and prebuilts are available on the mirror. BUG=None TEST=presubmit Change-Id: I0959bfc6d442467622b0403e6cb975d5b579aad4 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/5259526 Reviewed-by: George Burgess <gbiv@chromium.org> Commit-Queue: Bob Haarman <inglorion@chromium.org> Tested-by: Bob Haarman <inglorion@chromium.org>
2024-02-01rust_uprev: refactor repetitive routines regarding rusty revisionsBob Haarman
rust_uprev handles several ebuilds: dev-lang/rust, dev-lang/rust-artifacts, dev-lang/rust-host, and dev-lang/rust-bootstrap. Excepting the last, the script generally needs to process all of them the same way. Previously, this was done by repeating code snippets for each package. This change instead puts designators for the packages to process in a list, then iterates over that list and runs the same code on each. This makes it easier to ensure that all packages are indeed processed the same way, instead of, say, adding code that creates a new ebuild for a package, but not adding code that removes the old version. BUG=b:322348600 TEST=presubmit, create a rust uprev with it Change-Id: Ide5b2dab00e88633c8e5b80c1ee465adee14917b Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/5255518 Tested-by: Bob Haarman <inglorion@chromium.org> Commit-Queue: Bob Haarman <inglorion@chromium.org> Reviewed-by: George Burgess <gbiv@chromium.org>
2024-02-01rust_uprev: refactor create_ebuild() to take strings instead of a pathBob Haarman
create_ebuild() used to take a path to an ebuild file to copy and a pkgatom which it would split and use to compute the new ebuild path from. This change refactors create_ebuild() to take the ebuild's category and name as separate strings (to avoid having to split strings), and computes both the path to the source ebuild and the path to the ebuild to be created (to avoid the inconsistency of computing one but requiring the other to be passed in). This refactor will be built upon by an upcoming refactor of create_rust_uprev(), for which it is convenient not to have to compute the source ebuild path before calling create_ebuild(). BUG=b:322348600 TEST=presubmit Change-Id: I000e45423e7e33b110d60bd04a59c9f2863597b2 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/5255378 Reviewed-by: George Burgess <gbiv@chromium.org> Tested-by: Bob Haarman <inglorion@chromium.org> Commit-Queue: Bob Haarman <inglorion@chromium.org>
2024-02-01rust_uprev: use stdout=PIPE instead of capture_outputBob Haarman
When running equery fails, we currently don't get an error message, because it is swallowed by subprocess.run. This change makes it so that the error message is shown on standard error instead. BUG=None TEST=made it fail, saw error message Change-Id: Ib057f3215505d5824593d387c22df5f95b163921 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/5259297 Commit-Queue: Bob Haarman <inglorion@chromium.org> Tested-by: Bob Haarman <inglorion@chromium.org> Reviewed-by: George Burgess <gbiv@chromium.org>
2024-02-01rust_uprev: remove update_manifest()Bob Haarman
update_manifest() takes a path, which we then translate to a package name, which we then look up in the filesystem to get the path to the ebuild file. This change removes a level of indirection by calling ebuild_actions() with the package name directly. BUG=None TEST=Create a rust uprev Change-Id: I1b1651cc7d1fc735c353b55fa28c5766015e4829 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/5255377 Tested-by: Bob Haarman <inglorion@chromium.org> Reviewed-by: George Burgess <gbiv@chromium.org> Commit-Queue: Bob Haarman <inglorion@chromium.org>
2024-01-25rust_uprev: make find_ebuild_for_rust_version() call find_ebuild_path()Bob Haarman
Previously, find_ebuild_for_rust_version() enumerated all versions of dev-lang/rust, then filtered them to only those that match the specified version. Instead, call find_ebuild_path(), which finds the requested version directly and also contains an implementation of the logic that tests only one version exists and properly accounts for symlinks. BUG=b:318424456 TEST=presubmit, use the new code to create a rust uprev Change-Id: Id7a058cb58a94cfa8a208d92ba6fc24b6344a683 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/5233111 Reviewed-by: George Burgess <gbiv@chromium.org> Commit-Queue: Bob Haarman <inglorion@chromium.org> Tested-by: Bob Haarman <inglorion@chromium.org> Reviewed-by: Jordan Abrahams-Whitehead <ajordanr@google.com>
2024-01-25rust_uprev: only return base ebuilds from find_rust_versions()Bob Haarman
find_rust_versions() previously returned values for both rust-x.y.z.ebuild and rust-x.y.z-rn.ebuild if both existed. We commonly have x.y.z-rn.ebuild be a symlink to x.y.z.ebuild, and the code that calls find_rust_versions() actually needs only the base file and will not work correctly if both are returned. This change makes find_rust_versions() only return non-symlinks and adds documentation and a test. BUG=b:318424456 TEST=./rust_tools/rust_uprev_test.py Change-Id: I18b0795fb93c9a9d5a81424ebaf07ba43476ba3f Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/5233610 Tested-by: Bob Haarman <inglorion@chromium.org> Reviewed-by: George Burgess <gbiv@chromium.org> Commit-Queue: Bob Haarman <inglorion@chromium.org>
2024-01-25rust_uprev: rewrite find_rust_versions() to use Path instead of os.*Bob Haarman
This is a small refactor ahead of a change to the logic. The rewritten find_rust_versions() returns a list of tuples of (RustVersion, Path) instead of (RustVersion, str) as before, and updates the call sites and test to match. BUG=b:318424456 TEST=presubmit type checks and tests Change-Id: If5e26ee3c40265031c43fe68d921d43405a44e3a Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/5233609 Reviewed-by: George Burgess <gbiv@chromium.org> Commit-Queue: Bob Haarman <inglorion@chromium.org> Tested-by: Bob Haarman <inglorion@chromium.org>
2023-10-16rust_uprev: cache sudo credentialsBob Haarman
rust_uprev runs a number of long-running processes and a couple of processes that run sudo. Cached sudo credentials may expire during the long-running processes, after which sudo may require user interaction, and the whole process sits idle until the necessary action is taken. To avoid such delays, this CL causes cached sudo credentials to periodically be refreshed while the script is running, up to some maximum time limit. This way, rust_uprev will ask for authentication once, and then run non-interactively until it completes. BUG=None TEST=Run rust_uprev, see that it only prompts for authentication once Change-Id: I41645a04a100731772a8695c0b080c072db75c3a Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/4942250 Commit-Queue: Bob Haarman <inglorion@chromium.org> Tested-by: Bob Haarman <inglorion@chromium.org> Reviewed-by: George Burgess <gbiv@chromium.org>
2023-09-14llvm_tools: update_chromeos_llvm_hash no_delete_branchJordan R Abrahams-Whitehead
This adds two flags to `update_chromeos_llvm_hash`: - --no_delete_branch: Don't delete the branch when we're done. - --no_upload_changes: Don't upload things to gerrit. Then updates the users of git.py so that these changes don't break anything. BUG=None TEST=run_tests_for.py llvm_tools/* TEST=./update_chromeos_llvm_hash.py \ --no_delete_branch \ --no_upload_changes \ --failure_mode=disable_patches \ --llvm_version 498229 Change-Id: Ibce18f79ebfb1bf5de99175faf33225e68d5435b Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/4867272 Commit-Queue: Jordan Abrahams-Whitehead <ajordanr@google.com> Tested-by: Jordan Abrahams-Whitehead <ajordanr@google.com> Reviewed-by: George Burgess <gbiv@chromium.org>
2023-08-25rust_uprev: avoid serialization error after PGO_RUST invocationsBob Haarman
run_in_chroot returns a subprocess.CompletedProcess value, which cannot be serialized to JSON. This change uses the result_to_json keyword parameter to have the affected steps return None instead of CompletedProcess, avoiding JSON serialization errors. BUG=None TEST=Ran the code, see the JSON serialization error no longer happens Change-Id: I92bc5d1fca88467834ed8db4cd13d004a5ee97cb Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/4811995 Reviewed-by: George Burgess <gbiv@chromium.org> Reviewed-by: Jordan Abrahams-Whitehead <ajordanr@google.com> Tested-by: Bob Haarman <inglorion@chromium.org> Commit-Queue: Bob Haarman <inglorion@chromium.org>
2023-08-24rust_uprev.py: run outside the chrootBob Haarman
This modifies rust_uprev.py to run outside the chroot instead of inside the chroot. This change is necessary, because repo is no longer available inside the chroot. This also refactors the code a little bit: template_version is now determined before prepare_uprev() instead of inside prepare_uprev(). This is done so that build_cross_compiler() does not do its own separate determination of which rust ebuild to process. BUG=b:296186356 TEST=use with --restart and --continue to verify it works Change-Id: I015140f745a3a4dff2d1ead46142c8fd090ae29c Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/4786827 Commit-Queue: Bob Haarman <inglorion@chromium.org> Reviewed-by: George Burgess <gbiv@chromium.org> Tested-by: Bob Haarman <inglorion@chromium.org> Reviewed-by: Jordan Abrahams-Whitehead <ajordanr@google.com>
2023-08-16rust_uprev: remove obsolete step "remove patches"Bob Haarman
Previously, patches had the version number they apply to encoded in their filename. Because of this, patches corresponding to Rust versions whose ebuilds were being removed also needed to be removed. Nowadays, we don't include the Rust version in the patch filename anymore and we want to keep the patches from version to version. Thus, we don't need this step anymore. BUG=b:294547321 TEST=Upgrade Rust with the new script Change-Id: I95cf45a7fb2c0a6aa44999040ff5e3263d85cc74 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/4775781 Reviewed-by: George Burgess <gbiv@chromium.org> Tested-by: Bob Haarman <inglorion@chromium.org> Commit-Queue: Bob Haarman <inglorion@chromium.org>
2023-08-16rust_uprev: generate profile dataBob Haarman
This change modifies rust_uprev so that it automatically generates profile data for new Rust versions as part of the upgrade process. Specifically, it performs the following steps: 1. Edit cros-rustc.eclass so that profile data is not listed in SRC_URI. 2. Generate manifests for the new rust and rust-host ebuilds, including the new sources, but not yet the profile data (which does not exist yet). 3. Invoke pgo_rust to generate and upload profile data. 4. Undo the previous change to cros-rustc.eclass so that SRC_URI includes profile data again. 5. Generate new manifests for the rust and rust-host ebuilds, this time including the new profile data. BUG=b:271017864 TEST=rust_uprev_test, perform a Rust upgrade with the new script Change-Id: I1672b8d62e148503bfcf6ab7bdde83b08f529fe0 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/4775780 Tested-by: Bob Haarman <inglorion@chromium.org> Commit-Queue: Bob Haarman <inglorion@chromium.org> Reviewed-by: George Burgess <gbiv@chromium.org>
2023-08-14rust_uprev: fetch Rust sources from upstream if not present on local mirrorBob Haarman
Previously, fetching sources from upstream, verifying their integrity, and uploading them to the local mirror was a manual process. With this change, this happens automatically. The integrity of the sources is verified using GPG, which checks that the sources have the expected checksum, that the checksum information was signed by the signing key used by the Rust project, and that the key and signature are current (that is, the key has not been revoked and the key and signature have not expired). The expected key is hardcoded in the script so that if we ever encounter sources signed by a different key, the verification will fail and we will have to manually verify that the new key is legitimate. BUG=b:271016462 TEST=unittest, use new script to create rust 1.71.1 uprev Change-Id: I9b2129ed82ca7de9f9aadfd275683f49cb72561a Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/4767736 Reviewed-by: George Burgess <gbiv@chromium.org> Tested-by: Bob Haarman <inglorion@chromium.org> Commit-Queue: Bob Haarman <inglorion@chromium.org>
2023-08-14rust_uprev: use Path.{read,write}_text instead of open().{read,write}Bob Haarman
This replaces open(...).read(...) with Path(...).read_text() and open(...).write(...) with Path(...).write_text(...). This avoids cros lint complaining about wanting to wrap the code in a with statement. BUG=None TEST=cros lint; run rust_uprev_test.py Change-Id: Ic3763c09e5f84470aeb36377d0aed92480279a4d Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/4775699 Reviewed-by: George Burgess <gbiv@chromium.org> Tested-by: Bob Haarman <inglorion@chromium.org> Commit-Queue: Bob Haarman <inglorion@chromium.org>
2023-08-14rust_uprev: Fix type information so that mypy runs successfullyBob Haarman
BUG=None TEST=mypy rust_tools/rust_uprev.py && ./run_tests_for rust_tools/rust_uprev.py Change-Id: Ifdb515aae078b2d35145b80084ecd4f59f498471 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/4760606 Reviewed-by: George Burgess <gbiv@chromium.org> Commit-Queue: Bob Haarman <inglorion@chromium.org> Tested-by: Bob Haarman <inglorion@chromium.org>
2023-03-01rust_uprev: remove the `copy patches` stepGeorge Burgess IV
Patches no longer have rust's version in them, so we can safely skip this step now. BUG=b:266817148 TEST=Unittests Change-Id: Ib54b2607f25eed5808cd6c544acc5ca3ce3a12f4 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/4295527 Tested-by: George Burgess <gbiv@chromium.org> Commit-Queue: George Burgess <gbiv@chromium.org> Reviewed-by: Bob Haarman <inglorion@chromium.org>
2022-09-27rust_uprev: Ensure that packages can be builtBob Haarman
Although rust_uprev emerges rust, this does not ensure that all affected packages (rust, rust-bootstrap, rust-host) can be built from the new sources. For example, it is possible to build and install rust-host, then make changes to it, and re-running rust_uprev will then not rebuild it, because it is already installed at the requested version. This CL changes rust_uprev so that it first removes rust, rust-host, and rust-bootstrap if they are installed, so that unbuildable packages will be detected by rust_uprev. BUG=b:232833366 TEST=Run with installed rust-host package that is unbuildable, see error Change-Id: I7aeb7d1ac01e737e322bf005a31f1d678e52e042 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/3653197 Tested-by: Bob Haarman <inglorion@chromium.org> Reviewed-by: George Burgess <gbiv@chromium.org> Commit-Queue: Bob Haarman <inglorion@chromium.org>
2022-09-26rust_uprev: Support links to base ebuild filesBob Haarman
Previously, rust_uprev required that there be exactly one ebuild file for a given rust{,-bootstrap,-uprev} version. This breaks when using the common idiom of having a rust-1.2.3.ebuild and a symlink to it with an -r version. This change adds support for that by excluding such symlinks from the count, and removing both the base files and the symlinks when removing ebuild versions. BUG=b:227370760 TEST=Example uprev created by this script: crrev.com/c/3919575 Change-Id: I901ac8208c6bc48670860644ae91ee408e5f155d Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/3651375 Commit-Queue: Bob Haarman <inglorion@chromium.org> Tested-by: Bob Haarman <inglorion@chromium.org> Reviewed-by: George Burgess <gbiv@chromium.org>
2022-09-26rust_uprev: support new rust-host packageBob Haarman
dev-lang/rust is being forked into a new dev-lang/rust-host package. As a result, Rust uprevs now need to update that package, too. This adds the necessary support for that to rust_uprev.py. BUG=b:227370760 TEST=Used the script to create a rust-1.61.0 to 1.62.1 uprev Change-Id: I99733db7a799f1c234b628b035557ac429d9e470 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/3590914 Commit-Queue: Bob Haarman <inglorion@chromium.org> Reviewed-by: George Burgess <gbiv@chromium.org> Tested-by: Bob Haarman <inglorion@chromium.org>
2022-09-13Update license boilerplate text in source code filesMike Frysinger
Normally we don't do this, but enough changes have accumulated that we're doing a tree-wide one-off update of the name & style. BUG=chromium:1098010 TEST=`repo upload` works Change-Id: Icb42e5012a87920c2cd13b666fb3e55e7e4fb3b8 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/3891080 Auto-Submit: Mike Frysinger <vapier@chromium.org> Tested-by: Mike Frysinger <vapier@chromium.org> Commit-Queue: George Burgess <gbiv@chromium.org> Reviewed-by: George Burgess <gbiv@chromium.org>
2022-09-07Autoformat all Python codeGeorge Burgess IV
This autoformats all Python code with our new Python formatter, `black`. BUG=b:244644217 TEST=None Change-Id: I15ee49233d98fb6295c0c53c129bbf8e78e0d9ff Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/3877337 Tested-by: George Burgess <gbiv@chromium.org> Reviewed-by: Jordan Abrahams-Whitehead <ajordanr@google.com> Commit-Queue: George Burgess <gbiv@chromium.org>
2022-07-28rust_uprev: Remove flip_mirror_in_ebuildBob Haarman
Previously, we temporarily switched on RESTRICT="mirror" for an ebuild before updating the manifest. This allows us to fetch distfiles from their original locations (rather than the default, which is to require them to be fetched from mirrors). We don't actually need this, so this change removes the code that does this. BUG=None TEST=unit tests, also tested on rust-1.60.0 uprev Change-Id: I5f29ffad83a5826dbe523db4657d9ea17c43bcff Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/3594132 Commit-Queue: Bob Haarman <inglorion@chromium.org> Reviewed-by: George Burgess <gbiv@chromium.org> Tested-by: Bob Haarman <inglorion@chromium.org>
2022-07-27rust_uprev: yapf and isortBob Haarman
When making some changes, I got some complaints from the formatters. Fixing the formatting first, before making edits. BUG=None TEST=./run_tests_for.py rust_tools/rust_uprev.py Change-Id: I4802b40dfeb3348cf2c060737992250b75136e0e Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/3788604 Commit-Queue: Bob Haarman <inglorion@chromium.org> Reviewed-by: Michael Benfield <mbenfield@google.com> Tested-by: Bob Haarman <inglorion@chromium.org>
2022-04-21toolchain_utils: s/Cr OS/CrOS/gGeorge Burgess IV
Result of running `sed -ri 's/Chrom(ium|e) OS/Chrom\1OS/g' $(find -type f)`. BUG=None TEST=None Change-Id: I59be92537aa19bc989f52b585e307e76dbde401b Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/3600147 Reviewed-by: Manoj Gupta <manojgupta@chromium.org> Commit-Queue: George Burgess <gbiv@chromium.org> Tested-by: George Burgess <gbiv@chromium.org>
2021-10-05rust_uprev: fetch distfiles from local mirrorBob Haarman
This adds a few extra steps to rust_uprev where rust sources and rust-bootstrap prebuilts are fetched from the local mirror. This ensures that these files exist and are readable, and that the local versions (that will be used to compute the digests for the manifest) match the ones on the mirror. BUG=None TEST=Ran the script with existing and non-existing rust versions Change-Id: I9868b027356cf14fc10d9e56665c74ad26555345 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/3182632 Tested-by: Bob Haarman <inglorion@chromium.org> Reviewed-by: George Burgess <gbiv@chromium.org> Commit-Queue: Bob Haarman <inglorion@chromium.org>
2021-09-25rust_uprev_test: mock equery w commandsBob Haarman
rust_uprev uses `equery w` to find the ebuild file for a package. This depends on filesystem state and so should not affect the test. This change mocks these calls so that they return specified values instead of actually running commands and accessing the filesystem. BUG=None TEST=Ran the tests outside the chroot, where equery does not exist Change-Id: Id48a0e063f9bf112888d378d549420f008fdcb4f Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/3182629 Tested-by: Bob Haarman <inglorion@chromium.org> Reviewed-by: George Burgess <gbiv@chromium.org> Reviewed-by: Michael Benfield <mbenfield@google.com> Commit-Queue: Bob Haarman <inglorion@chromium.org>
2021-09-16rust_uprev: changes for rust-1.55ChromeOS Developer
Updating to rust-1.55.0 required a few changes to rust_uprev: - patches for rust-bootstrap no longer need to be renamed and removed. - the version sequence is now RUST_RAW_FULL_BOOTSTRAP_SEQUENCE BUG=None TEST=created uprev for rust-1.55 Change-Id: I56a64d5fd7902e01ee2ca3c13dcfc3eee52d6fc6 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/3162670 Tested-by: Bob Haarman <inglorion@chromium.org> Commit-Queue: Bob Haarman <inglorion@chromium.org> Reviewed-by: George Burgess <gbiv@chromium.org>
2021-01-06rust_uprev: also uprev rust-bootstrapBob Haarman
Since crrev.com/c/2436432, dev-lang/rust requires dev-lang/rust-bootstrap to build. Because of this, rust uprevs now require that rust-bootstrap be uprevved, too. This CL changes the rust_uprev script to do so. BUG=chromium:1159066 TEST=python3 ./rust_tools/rust_uprev_test.py Change-Id: I48482e780d9ebbc012142687f2edfcc8f83e9d56 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/2597493 Commit-Queue: Bob Haarman <inglorion@chromium.org> Tested-by: Bob Haarman <inglorion@chromium.org> Reviewed-by: George Burgess <gbiv@chromium.org>
2020-12-16rust_uprev: accept -r* in virtual/rust version numbersBob Haarman
The ebuilds in virtual/rust can have patch (-r123) version numbers, which currently cause rust_uprev to fail. This CL updates rust_uprev to handle those. BUG=chromium:1159066 TEST=python3 ./rust_tools/rust_uprev_test.py Change-Id: I76ccaf553ea192db57e17ff3df9b02eee4105010 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/2593514 Commit-Queue: Bob Haarman <inglorion@chromium.org> Tested-by: Bob Haarman <inglorion@chromium.org> Reviewed-by: George Burgess <gbiv@chromium.org> Reviewed-by: Tiancong Wang <tcwang@google.com>
2020-10-09rust_uprev: emerge rust instead of ebuilding itGeorge Burgess IV
if `ebuild merge` fails, the build directory might not be in a great state where we can skip recompilation when we try again. emerge'ing is probably what we actually want to do here, since that's representative of what builders and users are going to do when they get the new rust uprev. BUG=chromium:1136579, chromium:1112551 TEST=Ran the script Change-Id: I84f12769e32fada3f858a2889f0ead7555b58256 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/2462928 Reviewed-by: Tiancong Wang <tcwang@google.com> Tested-by: George Burgess <gbiv@chromium.org>
2020-10-09rust_uprev: emerge arm-none-eabi-gcc & do it in parallelGeorge Burgess IV
arm-none-eabi-gcc isn't mentioned in the list of RUSTC_TARGET_TRIPLES, though it's necessary (we check for it in the ebuild) While I'm in the area, if we're unconditionally emerge'ing all of these anyway, do it in parallel. Doing so makes installation take 1/4 as long. BUG=chromium:1136579, chromium:1112551 TEST=Ran the script Change-Id: I49063487b2e2b2c83e2ef30dd8f8904b13c59f38 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/2462927 Reviewed-by: Tiancong Wang <tcwang@google.com> Tested-by: George Burgess <gbiv@chromium.org>
2020-10-09rust_uprev: check for files in gs:// before downloading themGeorge Burgess IV
I had to `--reset` a few times; downloading these files just to not upload them took a bit, and wasn't useful. This CL adds a check so we don't do that in the future. BUG=chromium:1136579, chromium:1112551 TEST=Ran the script Change-Id: I03f9f21cc07a7b16b540a5be5b4b08e105fc81a5 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/2462926 Reviewed-by: Tiancong Wang <tcwang@google.com> Tested-by: George Burgess <gbiv@chromium.org>
2020-10-09rust_uprev: support -rN ebuildsGeorge Burgess IV
rust_uprev currently doesn't fully support ebuilds with -r123 after Rust's version number. This CL aims to help us support those better. BUG=chromium:1136579, chromium:1112551 TEST=Ran the script Change-Id: I22a09ec3f5d074be547783e4cb9b702d4aad0bd2 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/2462925 Reviewed-by: Tiancong Wang <tcwang@google.com> Tested-by: George Burgess <gbiv@chromium.org>
2020-10-08rust_tools: Fix the tool using real Rust uprev experiences.Tiancong Wang
Changes include bugs fixes, support running clean before compile with ebuild command, and upload all tarballs (not just rustc). BUG=chromium:1112551 TEST=unittest Change-Id: I83a6845ba01590ea1319c90ebb427fb48c3da773 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/2462042 Reviewed-by: Bob Haarman <inglorion@chromium.org> Reviewed-by: George Burgess <gbiv@chromium.org> Commit-Queue: Tiancong Wang <tcwang@google.com> Tested-by: Tiancong Wang <tcwang@google.com>
2020-08-14rust_tools: Provide a big hammer to do everything to uprev RustTiancong Wang
Create a new subcommand that can call both `create` and `remove`, as well as preparing the repo and uploading the CLs. Also update the steps to match the latest changes in UPGRADE.md. BUG=chromium:1112551 TEST=unittest; create an example CL Change-Id: I225d07d3e765daabd6ce8fc29309a5f11ef9cbae Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/2355193 Commit-Queue: Tiancong Wang <tcwang@google.com> Tested-by: Tiancong Wang <tcwang@google.com> Reviewed-by: George Burgess <gbiv@chromium.org>
2020-08-12rust_tools: Refactor to create and remove Rust versions independentlyTiancong Wang
With this change, a user can run `./rust_uprev.py create` or `./rust_uprev.py remove` to create a new Rust uprev or remove old Rust version independently. Both supports using a state file to save the progress. BUG=chromium:1112551 TEST=unittest;generated a CL locally Change-Id: I8aa629cb56fb6fb79a50c08e11304d0c88515e7f Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/2350441 Commit-Queue: Tiancong Wang <tcwang@google.com> Tested-by: Tiancong Wang <tcwang@google.com> Reviewed-by: George Burgess <gbiv@chromium.org>
2020-08-10rust_tools: Add a tool to automatically generate a Rust uprevTiancong Wang
This is the first pass to add a tool to convert rust upgrade process into a program that can generate CLs autoamatically. The tool is resumable, so when patches fail to apply, the user can fix the patch, resume the tool until no problems exist. The current tool only supports uprev from the earlier Rust ebuild in chroot and will need future passes to add more features. BUG=chromium:1112551 TEST=unittest;generated a CL locally Change-Id: I77fccd14c69548824a8b235d756357aee0c42ef2 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/2339593 Commit-Queue: Tiancong Wang <tcwang@google.com> Tested-by: Tiancong Wang <tcwang@google.com> Reviewed-by: Bob Haarman <inglorion@chromium.org> Reviewed-by: George Burgess <gbiv@chromium.org>