diff options
author | Jordan R Abrahams-Whitehead <ajordanr@google.com> | 2024-04-10 22:00:49 +0000 |
---|---|---|
committer | Chromeos LUCI <chromeos-scoped@luci-project-accounts.iam.gserviceaccount.com> | 2024-04-10 23:12:41 +0000 |
commit | 6523933c1ac1f97652a6872ca0ed5b8c9ed74c3f (patch) | |
tree | b8cc0e8afa05f6524f4789c9a0e1497bc37dd1c1 | |
parent | e72432d7e9e2b3a731a9dcdc80555d3bd5efa9f9 (diff) | |
download | toolchain-utils-6523933c1ac1f97652a6872ca0ed5b8c9ed74c3f.tar.gz |
patch_sync: Fix android patch filtering.
Previously, we were filtering patches *from android to chromiumos*
using the android revision number, but what we _actually_ want to do
is filter patches *from chromiumos to android* using the android
revision number. This is confusing, but it's a very quick fix.
Additionally, add slightly more logging so that we're easily
able to catch such version range changes as before.
BUG=b:333741962
TEST=Ran on chrotomation2 successfully
Change-Id: Icb85c3c6fa42cc924295e6d49131b834a8899ea6
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/5444000
Commit-Queue: Jordan Abrahams-Whitehead <ajordanr@google.com>
Tested-by: Jordan Abrahams-Whitehead <ajordanr@google.com>
Reviewed-by: George Burgess <gbiv@chromium.org>
-rw-r--r-- | llvm_tools/patch_sync/src/main.rs | 10 | ||||
-rw-r--r-- | llvm_tools/patch_sync/src/patch_parsing.rs | 18 |
2 files changed, 22 insertions, 6 deletions
diff --git a/llvm_tools/patch_sync/src/main.rs b/llvm_tools/patch_sync/src/main.rs index 5f9b9708..e3fa4820 100644 --- a/llvm_tools/patch_sync/src/main.rs +++ b/llvm_tools/patch_sync/src/main.rs @@ -180,14 +180,16 @@ fn transpose_subcmd(args: TransposeOpt) -> Result<()> { ) })? }; - let new_android_patches = new_android_patches.filter_patches(|p| { - match (p.get_from_version(), p.get_until_version()) { + if args.verbose { + println!("Android LLVM version: r{}", android_llvm_version); + } + let new_cros_patches = + new_cros_patches.filter_patches(|p| match (p.get_from_version(), p.get_until_version()) { (Some(start), Some(end)) => start <= android_llvm_version && android_llvm_version < end, (Some(start), None) => start <= android_llvm_version, (None, Some(end)) => android_llvm_version < end, (None, None) => true, - } - }); + }); // Need to filter version updates to only existing patches to the other platform. let cros_version_updates = diff --git a/llvm_tools/patch_sync/src/patch_parsing.rs b/llvm_tools/patch_sync/src/patch_parsing.rs index b9d0319b..193c7fb6 100644 --- a/llvm_tools/patch_sync/src/patch_parsing.rs +++ b/llvm_tools/patch_sync/src/patch_parsing.rs @@ -313,11 +313,25 @@ impl std::fmt::Display for PatchCollection { .and_then(serde_json::Value::as_str) .unwrap_or("[No Title]"); let path = self.workdir.join(&p.rel_patch_path); + let from = p.get_from_version(); + let until = p.get_until_version(); writeln!(f, "* {}", title)?; if i == self.patches.len() - 1 { - write!(f, " {}", path.display())?; + write!( + f, + " {}\n r{}-r{}", + path.display(), + from.map_or("None".to_string(), |x| x.to_string()), + until.map_or("None".to_string(), |x| x.to_string()) + )?; } else { - writeln!(f, " {}", path.display())?; + writeln!( + f, + " {}\n r{}-r{}", + path.display(), + from.map_or("None".to_string(), |x| x.to_string()), + until.map_or("None".to_string(), |x| x.to_string()) + )?; } } Ok(()) |