diff --git a/ofborg/src/tagger.rs b/ofborg/src/tagger.rs index 2a9e2f56..96222356 100644 --- a/ofborg/src/tagger.rs +++ b/ofborg/src/tagger.rs @@ -13,8 +13,10 @@ impl Default for StdenvTagger { fn default() -> StdenvTagger { let mut t = StdenvTagger { possible: vec![ - String::from("10.rebuild-linux-stdenv"), - String::from("10.rebuild-darwin-stdenv"), + String::from("10.rebuild-x86_64-linux-stdenv"), + String::from("10.rebuild-aarch64-linux-stdenv"), + String::from("10.rebuild-x86_64-darwin-stdenv"), + String::from("10.rebuild-aarch64-darwin-stdenv"), ], selected: vec![], }; @@ -33,10 +35,20 @@ impl StdenvTagger { for system in systems { match system { tasks::eval::stdenvs::System::X8664Darwin => { - self.selected.push(String::from("10.rebuild-darwin-stdenv")); + self.selected + .push(String::from("10.rebuild-x86_64-darwin-stdenv")); + } + tasks::eval::stdenvs::System::AArch64Darwin => { + self.selected + .push(String::from("10.rebuild-aarch64-darwin-stdenv")); } tasks::eval::stdenvs::System::X8664Linux => { - self.selected.push(String::from("10.rebuild-linux-stdenv")); + self.selected + .push(String::from("10.rebuild-x86_64-linux-stdenv")); + } + tasks::eval::stdenvs::System::AArch64Linux => { + self.selected + .push(String::from("10.rebuild-aarch64-linux-stdenv")); } } } @@ -120,26 +132,46 @@ impl Default for RebuildTagger { fn default() -> RebuildTagger { RebuildTagger { possible: vec![ - String::from("10.rebuild-darwin: 0"), - String::from("10.rebuild-darwin: 1"), - String::from("10.rebuild-darwin: 1-10"), - String::from("10.rebuild-darwin: 11-100"), - String::from("10.rebuild-darwin: 101-500"), - String::from("10.rebuild-darwin: 501+"), - String::from("10.rebuild-darwin: 501-1000"), - String::from("10.rebuild-darwin: 1001-2500"), - String::from("10.rebuild-darwin: 2501-5000"), - String::from("10.rebuild-darwin: 5001+"), - String::from("10.rebuild-linux: 0"), - String::from("10.rebuild-linux: 1"), - String::from("10.rebuild-linux: 1-10"), - String::from("10.rebuild-linux: 11-100"), - String::from("10.rebuild-linux: 101-500"), - String::from("10.rebuild-linux: 501+"), - String::from("10.rebuild-linux: 501-1000"), - String::from("10.rebuild-linux: 1001-2500"), - String::from("10.rebuild-linux: 2501-5000"), - String::from("10.rebuild-linux: 5001+"), + String::from("10.rebuild-x86_64-darwin: 0"), + String::from("10.rebuild-x86_64-darwin: 1"), + String::from("10.rebuild-x86_64-darwin: 1-10"), + String::from("10.rebuild-x86_64-darwin: 11-100"), + String::from("10.rebuild-x86_64-darwin: 101-500"), + String::from("10.rebuild-x86_64-darwin: 501+"), + String::from("10.rebuild-x86_64-darwin: 501-1000"), + String::from("10.rebuild-x86_64-darwin: 1001-2500"), + String::from("10.rebuild-x86_64-darwin: 2501-5000"), + String::from("10.rebuild-x86_64-darwin: 5001+"), + String::from("10.rebuild-aarch64-darwin: 0"), + String::from("10.rebuild-aarch64-darwin: 1"), + String::from("10.rebuild-aarch64-darwin: 1-10"), + String::from("10.rebuild-aarch64-darwin: 11-100"), + String::from("10.rebuild-aarch64-darwin: 101-500"), + String::from("10.rebuild-aarch64-darwin: 501+"), + String::from("10.rebuild-aarch64-darwin: 501-1000"), + String::from("10.rebuild-aarch64-darwin: 1001-2500"), + String::from("10.rebuild-aarch64-darwin: 2501-5000"), + String::from("10.rebuild-aarch64-darwin: 5001+"), + String::from("10.rebuild-x86_64-linux: 0"), + String::from("10.rebuild-x86_64-linux: 1"), + String::from("10.rebuild-x86_64-linux: 1-10"), + String::from("10.rebuild-x86_64-linux: 11-100"), + String::from("10.rebuild-x86_64-linux: 101-500"), + String::from("10.rebuild-x86_64-linux: 501+"), + String::from("10.rebuild-x86_64-linux: 501-1000"), + String::from("10.rebuild-x86_64-linux: 1001-2500"), + String::from("10.rebuild-x86_64-linux: 2501-5000"), + String::from("10.rebuild-x86_64-linux: 5001+"), + String::from("10.rebuild-aarch64-linux: 0"), + String::from("10.rebuild-aarch64-linux: 1"), + String::from("10.rebuild-aarch64-linux: 1-10"), + String::from("10.rebuild-aarch64-linux: 11-100"), + String::from("10.rebuild-aarch64-linux: 101-500"), + String::from("10.rebuild-aarch64-linux: 501+"), + String::from("10.rebuild-aarch64-linux: 501-1000"), + String::from("10.rebuild-aarch64-linux: 1001-2500"), + String::from("10.rebuild-aarch64-linux: 2501-5000"), + String::from("10.rebuild-aarch64-linux: 5001+"), ], selected: vec![], } @@ -152,19 +184,25 @@ impl RebuildTagger { } pub fn parse_attrs(&mut self, attrs: Vec) { - let mut counter_darwin = 0; - let mut counter_linux = 0; + let mut counter_x86_64_darwin = 0; + let mut counter_aarch64_darwin = 0; + let mut counter_x86_64_linux = 0; + let mut counter_aarch64_linux = 0; for attr in attrs { match attr.architecture.as_ref() { "x86_64-darwin" => { - counter_darwin += 1; + counter_x86_64_darwin += 1; + } + "aarch64-darwin" => { + counter_aarch64_darwin += 1; } - "aarch64-darwin" => {} "x86_64-linux" => { - counter_linux += 1; + counter_x86_64_linux += 1; + } + "aarch64-linux" => { + counter_aarch64_linux += 1; } - "aarch64-linux" => {} "i686-linux" => {} arch => { info!("Unknown arch: {:?}", arch); @@ -174,16 +212,27 @@ impl RebuildTagger { self.selected = vec![]; self.selected.extend( - RebuildTagger::bucket(counter_darwin) + RebuildTagger::bucket(counter_x86_64_darwin) .iter() - .map(|bucket| format!("10.rebuild-darwin: {}", bucket)) + .map(|bucket| format!("10.rebuild-x86_64-darwin: {}", bucket)) + .collect::>(), + ); + self.selected.extend( + RebuildTagger::bucket(counter_aarch64_darwin) + .iter() + .map(|bucket| format!("10.rebuild-aarch64-darwin: {}", bucket)) + .collect::>(), + ); + self.selected.extend( + RebuildTagger::bucket(counter_x86_64_linux) + .iter() + .map(|bucket| format!("10.rebuild-x86_64-linux: {}", bucket)) .collect::>(), ); - self.selected.extend( - RebuildTagger::bucket(counter_linux) + RebuildTagger::bucket(counter_aarch64_linux) .iter() - .map(|bucket| format!("10.rebuild-linux: {}", bucket)) + .map(|bucket| format!("10.rebuild-aarch64-linux: {}", bucket)) .collect::>(), ); @@ -296,40 +345,81 @@ mod tests { use super::*; struct PackageArchSrc { - linux: usize, - darwin: usize, + x86_64_linux: usize, + aarch64_linux: usize, + x86_64_darwin: usize, + aarch64_darwin: usize, } impl PackageArchSrc { - pub fn linux(linux: usize) -> PackageArchSrc { - PackageArchSrc { linux, darwin: 0 } + pub fn x86_64_linux(x86_64_linux: usize) -> PackageArchSrc { + PackageArchSrc { + x86_64_linux, + aarch64_linux: 0, + x86_64_darwin: 0, + aarch64_darwin: 0, + } } - pub fn and_darwin(mut self, darwin: usize) -> PackageArchSrc { - self.darwin = darwin; + pub fn and_aarch64_linux(mut self, aarch64_linux: usize) -> PackageArchSrc { + self.aarch64_linux = aarch64_linux; self } + + pub fn and_x86_64_darwin(mut self, x86_64_darwin: usize) -> PackageArchSrc { + self.x86_64_darwin = x86_64_darwin; + self + } + + pub fn and_aarch64_darwin(mut self, aarch64_darwin: usize) -> PackageArchSrc { + self.aarch64_darwin = aarch64_darwin; + self + } + + pub fn linux(linux: usize) -> PackageArchSrc { + PackageArchSrc::x86_64_linux(linux).and_aarch64_linux(linux) + } + + pub fn and_darwin(self, darwin: usize) -> PackageArchSrc { + self.and_x86_64_darwin(darwin).and_aarch64_darwin(darwin) + } } impl From for Vec { fn from(src: PackageArchSrc) -> Vec { - let darwin: Vec = (0..src.darwin) + let x86_64_darwin: Vec = (0..src.x86_64_darwin) .into_iter() .map(|_| PackageArch { package: String::from("bogus :)"), architecture: String::from("x86_64-darwin"), }) .collect(); - let linux: Vec = (0..src.linux) + let aarch64_darwin: Vec = (0..src.aarch64_darwin) + .into_iter() + .map(|_| PackageArch { + package: String::from("bogus :)"), + architecture: String::from("aarch64-darwin"), + }) + .collect(); + let x86_64_linux: Vec = (0..src.x86_64_linux) .into_iter() .map(|_| PackageArch { package: String::from("bogus :)"), architecture: String::from("x86_64-linux"), }) .collect(); + let aarch64_linux: Vec = (0..src.aarch64_linux) + .into_iter() + .map(|_| PackageArch { + package: String::from("bogus :)"), + architecture: String::from("aarch64-linux"), + }) + .collect(); - let mut combined = darwin; - combined.extend(linux); + let mut combined = x86_64_darwin; + combined.extend(aarch64_darwin); + combined.extend(x86_64_linux); + combined.extend(aarch64_linux); combined } } @@ -337,66 +427,277 @@ mod tests { #[test] pub fn test_packages_changed() { let mut tagger = RebuildTagger::new(); - tagger.parse_attrs(PackageArchSrc::linux(0).and_darwin(0).into()); + tagger.parse_attrs( + PackageArchSrc::x86_64_linux(0) + .and_aarch64_linux(0) + .and_x86_64_darwin(0) + .and_aarch64_darwin(0) + .into(), + ); + assert_eq!( + tagger.tags_to_add(), + vec![ + "10.rebuild-x86_64-darwin: 0", + "10.rebuild-aarch64-darwin: 0", + "10.rebuild-x86_64-linux: 0", + "10.rebuild-aarch64-linux: 0" + ] + ); + assert_eq!( + tagger.tags_to_remove(), + vec![ + "10.rebuild-x86_64-darwin: 1", + "10.rebuild-x86_64-darwin: 1-10", + "10.rebuild-x86_64-darwin: 11-100", + "10.rebuild-x86_64-darwin: 101-500", + "10.rebuild-x86_64-darwin: 501+", + "10.rebuild-x86_64-darwin: 501-1000", + "10.rebuild-x86_64-darwin: 1001-2500", + "10.rebuild-x86_64-darwin: 2501-5000", + "10.rebuild-x86_64-darwin: 5001+", + "10.rebuild-aarch64-darwin: 1", + "10.rebuild-aarch64-darwin: 1-10", + "10.rebuild-aarch64-darwin: 11-100", + "10.rebuild-aarch64-darwin: 101-500", + "10.rebuild-aarch64-darwin: 501+", + "10.rebuild-aarch64-darwin: 501-1000", + "10.rebuild-aarch64-darwin: 1001-2500", + "10.rebuild-aarch64-darwin: 2501-5000", + "10.rebuild-aarch64-darwin: 5001+", + "10.rebuild-x86_64-linux: 1", + "10.rebuild-x86_64-linux: 1-10", + "10.rebuild-x86_64-linux: 11-100", + "10.rebuild-x86_64-linux: 101-500", + "10.rebuild-x86_64-linux: 501+", + "10.rebuild-x86_64-linux: 501-1000", + "10.rebuild-x86_64-linux: 1001-2500", + "10.rebuild-x86_64-linux: 2501-5000", + "10.rebuild-x86_64-linux: 5001+", + "10.rebuild-aarch64-linux: 1", + "10.rebuild-aarch64-linux: 1-10", + "10.rebuild-aarch64-linux: 11-100", + "10.rebuild-aarch64-linux: 101-500", + "10.rebuild-aarch64-linux: 501+", + "10.rebuild-aarch64-linux: 501-1000", + "10.rebuild-aarch64-linux: 1001-2500", + "10.rebuild-aarch64-linux: 2501-5000", + "10.rebuild-aarch64-linux: 5001+", + ] + ); + + let mut tagger = RebuildTagger::new(); + tagger.parse_attrs(PackageArchSrc::x86_64_linux(1).into()); + + assert_eq!( + tagger.tags_to_add(), + vec![ + "10.rebuild-x86_64-darwin: 0", + "10.rebuild-aarch64-darwin: 0", + "10.rebuild-x86_64-linux: 1", + "10.rebuild-x86_64-linux: 1-10", + "10.rebuild-aarch64-linux: 0", + ] + ); + assert_eq!( + tagger.tags_to_remove(), + vec![ + "10.rebuild-x86_64-darwin: 1", + "10.rebuild-x86_64-darwin: 1-10", + "10.rebuild-x86_64-darwin: 11-100", + "10.rebuild-x86_64-darwin: 101-500", + "10.rebuild-x86_64-darwin: 501+", + "10.rebuild-x86_64-darwin: 501-1000", + "10.rebuild-x86_64-darwin: 1001-2500", + "10.rebuild-x86_64-darwin: 2501-5000", + "10.rebuild-x86_64-darwin: 5001+", + "10.rebuild-aarch64-darwin: 1", + "10.rebuild-aarch64-darwin: 1-10", + "10.rebuild-aarch64-darwin: 11-100", + "10.rebuild-aarch64-darwin: 101-500", + "10.rebuild-aarch64-darwin: 501+", + "10.rebuild-aarch64-darwin: 501-1000", + "10.rebuild-aarch64-darwin: 1001-2500", + "10.rebuild-aarch64-darwin: 2501-5000", + "10.rebuild-aarch64-darwin: 5001+", + "10.rebuild-x86_64-linux: 0", + "10.rebuild-x86_64-linux: 11-100", + "10.rebuild-x86_64-linux: 101-500", + "10.rebuild-x86_64-linux: 501+", + "10.rebuild-x86_64-linux: 501-1000", + "10.rebuild-x86_64-linux: 1001-2500", + "10.rebuild-x86_64-linux: 2501-5000", + "10.rebuild-x86_64-linux: 5001+", + "10.rebuild-aarch64-linux: 1", + "10.rebuild-aarch64-linux: 1-10", + "10.rebuild-aarch64-linux: 11-100", + "10.rebuild-aarch64-linux: 101-500", + "10.rebuild-aarch64-linux: 501+", + "10.rebuild-aarch64-linux: 501-1000", + "10.rebuild-aarch64-linux: 1001-2500", + "10.rebuild-aarch64-linux: 2501-5000", + "10.rebuild-aarch64-linux: 5001+", + ] + ); + + let mut tagger = RebuildTagger::new(); + tagger.parse_attrs(PackageArchSrc::x86_64_linux(0).and_aarch64_linux(1).into()); + + assert_eq!( + tagger.tags_to_add(), + vec![ + "10.rebuild-x86_64-darwin: 0", + "10.rebuild-aarch64-darwin: 0", + "10.rebuild-x86_64-linux: 0", + "10.rebuild-aarch64-linux: 1", + "10.rebuild-aarch64-linux: 1-10", + ] + ); + assert_eq!( + tagger.tags_to_remove(), + vec![ + "10.rebuild-x86_64-darwin: 1", + "10.rebuild-x86_64-darwin: 1-10", + "10.rebuild-x86_64-darwin: 11-100", + "10.rebuild-x86_64-darwin: 101-500", + "10.rebuild-x86_64-darwin: 501+", + "10.rebuild-x86_64-darwin: 501-1000", + "10.rebuild-x86_64-darwin: 1001-2500", + "10.rebuild-x86_64-darwin: 2501-5000", + "10.rebuild-x86_64-darwin: 5001+", + "10.rebuild-aarch64-darwin: 1", + "10.rebuild-aarch64-darwin: 1-10", + "10.rebuild-aarch64-darwin: 11-100", + "10.rebuild-aarch64-darwin: 101-500", + "10.rebuild-aarch64-darwin: 501+", + "10.rebuild-aarch64-darwin: 501-1000", + "10.rebuild-aarch64-darwin: 1001-2500", + "10.rebuild-aarch64-darwin: 2501-5000", + "10.rebuild-aarch64-darwin: 5001+", + "10.rebuild-x86_64-linux: 1", + "10.rebuild-x86_64-linux: 1-10", + "10.rebuild-x86_64-linux: 11-100", + "10.rebuild-x86_64-linux: 101-500", + "10.rebuild-x86_64-linux: 501+", + "10.rebuild-x86_64-linux: 501-1000", + "10.rebuild-x86_64-linux: 1001-2500", + "10.rebuild-x86_64-linux: 2501-5000", + "10.rebuild-x86_64-linux: 5001+", + "10.rebuild-aarch64-linux: 0", + "10.rebuild-aarch64-linux: 11-100", + "10.rebuild-aarch64-linux: 101-500", + "10.rebuild-aarch64-linux: 501+", + "10.rebuild-aarch64-linux: 501-1000", + "10.rebuild-aarch64-linux: 1001-2500", + "10.rebuild-aarch64-linux: 2501-5000", + "10.rebuild-aarch64-linux: 5001+", + ] + ); + + let mut tagger = RebuildTagger::new(); + tagger.parse_attrs(PackageArchSrc::linux(0).and_x86_64_darwin(1).into()); + assert_eq!( tagger.tags_to_add(), - vec!["10.rebuild-darwin: 0", "10.rebuild-linux: 0",] + vec![ + "10.rebuild-x86_64-darwin: 1", + "10.rebuild-x86_64-darwin: 1-10", + "10.rebuild-aarch64-darwin: 0", + "10.rebuild-x86_64-linux: 0", + "10.rebuild-aarch64-linux: 0", + ] ); assert_eq!( tagger.tags_to_remove(), vec![ - "10.rebuild-darwin: 1", - "10.rebuild-darwin: 1-10", - "10.rebuild-darwin: 11-100", - "10.rebuild-darwin: 101-500", - "10.rebuild-darwin: 501+", - "10.rebuild-darwin: 501-1000", - "10.rebuild-darwin: 1001-2500", - "10.rebuild-darwin: 2501-5000", - "10.rebuild-darwin: 5001+", - "10.rebuild-linux: 1", - "10.rebuild-linux: 1-10", - "10.rebuild-linux: 11-100", - "10.rebuild-linux: 101-500", - "10.rebuild-linux: 501+", - "10.rebuild-linux: 501-1000", - "10.rebuild-linux: 1001-2500", - "10.rebuild-linux: 2501-5000", - "10.rebuild-linux: 5001+", + "10.rebuild-x86_64-darwin: 0", + "10.rebuild-x86_64-darwin: 11-100", + "10.rebuild-x86_64-darwin: 101-500", + "10.rebuild-x86_64-darwin: 501+", + "10.rebuild-x86_64-darwin: 501-1000", + "10.rebuild-x86_64-darwin: 1001-2500", + "10.rebuild-x86_64-darwin: 2501-5000", + "10.rebuild-x86_64-darwin: 5001+", + "10.rebuild-aarch64-darwin: 1", + "10.rebuild-aarch64-darwin: 1-10", + "10.rebuild-aarch64-darwin: 11-100", + "10.rebuild-aarch64-darwin: 101-500", + "10.rebuild-aarch64-darwin: 501+", + "10.rebuild-aarch64-darwin: 501-1000", + "10.rebuild-aarch64-darwin: 1001-2500", + "10.rebuild-aarch64-darwin: 2501-5000", + "10.rebuild-aarch64-darwin: 5001+", + "10.rebuild-x86_64-linux: 1", + "10.rebuild-x86_64-linux: 1-10", + "10.rebuild-x86_64-linux: 11-100", + "10.rebuild-x86_64-linux: 101-500", + "10.rebuild-x86_64-linux: 501+", + "10.rebuild-x86_64-linux: 501-1000", + "10.rebuild-x86_64-linux: 1001-2500", + "10.rebuild-x86_64-linux: 2501-5000", + "10.rebuild-x86_64-linux: 5001+", + "10.rebuild-aarch64-linux: 1", + "10.rebuild-aarch64-linux: 1-10", + "10.rebuild-aarch64-linux: 11-100", + "10.rebuild-aarch64-linux: 101-500", + "10.rebuild-aarch64-linux: 501+", + "10.rebuild-aarch64-linux: 501-1000", + "10.rebuild-aarch64-linux: 1001-2500", + "10.rebuild-aarch64-linux: 2501-5000", + "10.rebuild-aarch64-linux: 5001+", ] ); let mut tagger = RebuildTagger::new(); - tagger.parse_attrs(PackageArchSrc::linux(1).into()); + tagger.parse_attrs(PackageArchSrc::linux(0).and_aarch64_darwin(1).into()); assert_eq!( tagger.tags_to_add(), vec![ - "10.rebuild-darwin: 0", - "10.rebuild-linux: 1", - "10.rebuild-linux: 1-10", + "10.rebuild-x86_64-darwin: 0", + "10.rebuild-aarch64-darwin: 1", + "10.rebuild-aarch64-darwin: 1-10", + "10.rebuild-x86_64-linux: 0", + "10.rebuild-aarch64-linux: 0", ] ); assert_eq!( tagger.tags_to_remove(), vec![ - "10.rebuild-darwin: 1", - "10.rebuild-darwin: 1-10", - "10.rebuild-darwin: 11-100", - "10.rebuild-darwin: 101-500", - "10.rebuild-darwin: 501+", - "10.rebuild-darwin: 501-1000", - "10.rebuild-darwin: 1001-2500", - "10.rebuild-darwin: 2501-5000", - "10.rebuild-darwin: 5001+", - "10.rebuild-linux: 0", - "10.rebuild-linux: 11-100", - "10.rebuild-linux: 101-500", - "10.rebuild-linux: 501+", - "10.rebuild-linux: 501-1000", - "10.rebuild-linux: 1001-2500", - "10.rebuild-linux: 2501-5000", - "10.rebuild-linux: 5001+" + "10.rebuild-x86_64-darwin: 1", + "10.rebuild-x86_64-darwin: 1-10", + "10.rebuild-x86_64-darwin: 11-100", + "10.rebuild-x86_64-darwin: 101-500", + "10.rebuild-x86_64-darwin: 501+", + "10.rebuild-x86_64-darwin: 501-1000", + "10.rebuild-x86_64-darwin: 1001-2500", + "10.rebuild-x86_64-darwin: 2501-5000", + "10.rebuild-x86_64-darwin: 5001+", + "10.rebuild-aarch64-darwin: 0", + "10.rebuild-aarch64-darwin: 11-100", + "10.rebuild-aarch64-darwin: 101-500", + "10.rebuild-aarch64-darwin: 501+", + "10.rebuild-aarch64-darwin: 501-1000", + "10.rebuild-aarch64-darwin: 1001-2500", + "10.rebuild-aarch64-darwin: 2501-5000", + "10.rebuild-aarch64-darwin: 5001+", + "10.rebuild-x86_64-linux: 1", + "10.rebuild-x86_64-linux: 1-10", + "10.rebuild-x86_64-linux: 11-100", + "10.rebuild-x86_64-linux: 101-500", + "10.rebuild-x86_64-linux: 501+", + "10.rebuild-x86_64-linux: 501-1000", + "10.rebuild-x86_64-linux: 1001-2500", + "10.rebuild-x86_64-linux: 2501-5000", + "10.rebuild-x86_64-linux: 5001+", + "10.rebuild-aarch64-linux: 1", + "10.rebuild-aarch64-linux: 1-10", + "10.rebuild-aarch64-linux: 11-100", + "10.rebuild-aarch64-linux: 101-500", + "10.rebuild-aarch64-linux: 501+", + "10.rebuild-aarch64-linux: 501-1000", + "10.rebuild-aarch64-linux: 1001-2500", + "10.rebuild-aarch64-linux: 2501-5000", + "10.rebuild-aarch64-linux: 5001+", ] ); @@ -405,31 +706,51 @@ mod tests { assert_eq!( tagger.tags_to_add(), vec![ - "10.rebuild-darwin: 1", - "10.rebuild-darwin: 1-10", - "10.rebuild-linux: 1", - "10.rebuild-linux: 1-10", + "10.rebuild-x86_64-darwin: 1", + "10.rebuild-x86_64-darwin: 1-10", + "10.rebuild-aarch64-darwin: 1", + "10.rebuild-aarch64-darwin: 1-10", + "10.rebuild-x86_64-linux: 1", + "10.rebuild-x86_64-linux: 1-10", + "10.rebuild-aarch64-linux: 1", + "10.rebuild-aarch64-linux: 1-10", ] ); assert_eq!( tagger.tags_to_remove(), vec![ - "10.rebuild-darwin: 0", - "10.rebuild-darwin: 11-100", - "10.rebuild-darwin: 101-500", - "10.rebuild-darwin: 501+", - "10.rebuild-darwin: 501-1000", - "10.rebuild-darwin: 1001-2500", - "10.rebuild-darwin: 2501-5000", - "10.rebuild-darwin: 5001+", - "10.rebuild-linux: 0", - "10.rebuild-linux: 11-100", - "10.rebuild-linux: 101-500", - "10.rebuild-linux: 501+", - "10.rebuild-linux: 501-1000", - "10.rebuild-linux: 1001-2500", - "10.rebuild-linux: 2501-5000", - "10.rebuild-linux: 5001+" + "10.rebuild-x86_64-darwin: 0", + "10.rebuild-x86_64-darwin: 11-100", + "10.rebuild-x86_64-darwin: 101-500", + "10.rebuild-x86_64-darwin: 501+", + "10.rebuild-x86_64-darwin: 501-1000", + "10.rebuild-x86_64-darwin: 1001-2500", + "10.rebuild-x86_64-darwin: 2501-5000", + "10.rebuild-x86_64-darwin: 5001+", + "10.rebuild-aarch64-darwin: 0", + "10.rebuild-aarch64-darwin: 11-100", + "10.rebuild-aarch64-darwin: 101-500", + "10.rebuild-aarch64-darwin: 501+", + "10.rebuild-aarch64-darwin: 501-1000", + "10.rebuild-aarch64-darwin: 1001-2500", + "10.rebuild-aarch64-darwin: 2501-5000", + "10.rebuild-aarch64-darwin: 5001+", + "10.rebuild-x86_64-linux: 0", + "10.rebuild-x86_64-linux: 11-100", + "10.rebuild-x86_64-linux: 101-500", + "10.rebuild-x86_64-linux: 501+", + "10.rebuild-x86_64-linux: 501-1000", + "10.rebuild-x86_64-linux: 1001-2500", + "10.rebuild-x86_64-linux: 2501-5000", + "10.rebuild-x86_64-linux: 5001+", + "10.rebuild-aarch64-linux: 0", + "10.rebuild-aarch64-linux: 11-100", + "10.rebuild-aarch64-linux: 101-500", + "10.rebuild-aarch64-linux: 501+", + "10.rebuild-aarch64-linux: 501-1000", + "10.rebuild-aarch64-linux: 1001-2500", + "10.rebuild-aarch64-linux: 2501-5000", + "10.rebuild-aarch64-linux: 5001+", ] ); @@ -437,29 +758,52 @@ mod tests { tagger.parse_attrs(PackageArchSrc::linux(10).and_darwin(10).into()); assert_eq!( tagger.tags_to_add(), - vec!["10.rebuild-darwin: 1-10", "10.rebuild-linux: 1-10",] + vec![ + "10.rebuild-x86_64-darwin: 1-10", + "10.rebuild-aarch64-darwin: 1-10", + "10.rebuild-x86_64-linux: 1-10", + "10.rebuild-aarch64-linux: 1-10" + ] ); assert_eq!( tagger.tags_to_remove(), vec![ - "10.rebuild-darwin: 0", - "10.rebuild-darwin: 1", - "10.rebuild-darwin: 11-100", - "10.rebuild-darwin: 101-500", - "10.rebuild-darwin: 501+", - "10.rebuild-darwin: 501-1000", - "10.rebuild-darwin: 1001-2500", - "10.rebuild-darwin: 2501-5000", - "10.rebuild-darwin: 5001+", - "10.rebuild-linux: 0", - "10.rebuild-linux: 1", - "10.rebuild-linux: 11-100", - "10.rebuild-linux: 101-500", - "10.rebuild-linux: 501+", - "10.rebuild-linux: 501-1000", - "10.rebuild-linux: 1001-2500", - "10.rebuild-linux: 2501-5000", - "10.rebuild-linux: 5001+" + "10.rebuild-x86_64-darwin: 0", + "10.rebuild-x86_64-darwin: 1", + "10.rebuild-x86_64-darwin: 11-100", + "10.rebuild-x86_64-darwin: 101-500", + "10.rebuild-x86_64-darwin: 501+", + "10.rebuild-x86_64-darwin: 501-1000", + "10.rebuild-x86_64-darwin: 1001-2500", + "10.rebuild-x86_64-darwin: 2501-5000", + "10.rebuild-x86_64-darwin: 5001+", + "10.rebuild-aarch64-darwin: 0", + "10.rebuild-aarch64-darwin: 1", + "10.rebuild-aarch64-darwin: 11-100", + "10.rebuild-aarch64-darwin: 101-500", + "10.rebuild-aarch64-darwin: 501+", + "10.rebuild-aarch64-darwin: 501-1000", + "10.rebuild-aarch64-darwin: 1001-2500", + "10.rebuild-aarch64-darwin: 2501-5000", + "10.rebuild-aarch64-darwin: 5001+", + "10.rebuild-x86_64-linux: 0", + "10.rebuild-x86_64-linux: 1", + "10.rebuild-x86_64-linux: 11-100", + "10.rebuild-x86_64-linux: 101-500", + "10.rebuild-x86_64-linux: 501+", + "10.rebuild-x86_64-linux: 501-1000", + "10.rebuild-x86_64-linux: 1001-2500", + "10.rebuild-x86_64-linux: 2501-5000", + "10.rebuild-x86_64-linux: 5001+", + "10.rebuild-aarch64-linux: 0", + "10.rebuild-aarch64-linux: 1", + "10.rebuild-aarch64-linux: 11-100", + "10.rebuild-aarch64-linux: 101-500", + "10.rebuild-aarch64-linux: 501+", + "10.rebuild-aarch64-linux: 501-1000", + "10.rebuild-aarch64-linux: 1001-2500", + "10.rebuild-aarch64-linux: 2501-5000", + "10.rebuild-aarch64-linux: 5001+", ] ); @@ -467,29 +811,52 @@ mod tests { tagger.parse_attrs(PackageArchSrc::linux(11).and_darwin(11).into()); assert_eq!( tagger.tags_to_add(), - vec!["10.rebuild-darwin: 11-100", "10.rebuild-linux: 11-100",] + vec![ + "10.rebuild-x86_64-darwin: 11-100", + "10.rebuild-aarch64-darwin: 11-100", + "10.rebuild-x86_64-linux: 11-100", + "10.rebuild-aarch64-linux: 11-100", + ] ); assert_eq!( tagger.tags_to_remove(), vec![ - "10.rebuild-darwin: 0", - "10.rebuild-darwin: 1", - "10.rebuild-darwin: 1-10", - "10.rebuild-darwin: 101-500", - "10.rebuild-darwin: 501+", - "10.rebuild-darwin: 501-1000", - "10.rebuild-darwin: 1001-2500", - "10.rebuild-darwin: 2501-5000", - "10.rebuild-darwin: 5001+", - "10.rebuild-linux: 0", - "10.rebuild-linux: 1", - "10.rebuild-linux: 1-10", - "10.rebuild-linux: 101-500", - "10.rebuild-linux: 501+", - "10.rebuild-linux: 501-1000", - "10.rebuild-linux: 1001-2500", - "10.rebuild-linux: 2501-5000", - "10.rebuild-linux: 5001+" + "10.rebuild-x86_64-darwin: 0", + "10.rebuild-x86_64-darwin: 1", + "10.rebuild-x86_64-darwin: 1-10", + "10.rebuild-x86_64-darwin: 101-500", + "10.rebuild-x86_64-darwin: 501+", + "10.rebuild-x86_64-darwin: 501-1000", + "10.rebuild-x86_64-darwin: 1001-2500", + "10.rebuild-x86_64-darwin: 2501-5000", + "10.rebuild-x86_64-darwin: 5001+", + "10.rebuild-aarch64-darwin: 0", + "10.rebuild-aarch64-darwin: 1", + "10.rebuild-aarch64-darwin: 1-10", + "10.rebuild-aarch64-darwin: 101-500", + "10.rebuild-aarch64-darwin: 501+", + "10.rebuild-aarch64-darwin: 501-1000", + "10.rebuild-aarch64-darwin: 1001-2500", + "10.rebuild-aarch64-darwin: 2501-5000", + "10.rebuild-aarch64-darwin: 5001+", + "10.rebuild-x86_64-linux: 0", + "10.rebuild-x86_64-linux: 1", + "10.rebuild-x86_64-linux: 1-10", + "10.rebuild-x86_64-linux: 101-500", + "10.rebuild-x86_64-linux: 501+", + "10.rebuild-x86_64-linux: 501-1000", + "10.rebuild-x86_64-linux: 1001-2500", + "10.rebuild-x86_64-linux: 2501-5000", + "10.rebuild-x86_64-linux: 5001+", + "10.rebuild-aarch64-linux: 0", + "10.rebuild-aarch64-linux: 1", + "10.rebuild-aarch64-linux: 1-10", + "10.rebuild-aarch64-linux: 101-500", + "10.rebuild-aarch64-linux: 501+", + "10.rebuild-aarch64-linux: 501-1000", + "10.rebuild-aarch64-linux: 1001-2500", + "10.rebuild-aarch64-linux: 2501-5000", + "10.rebuild-aarch64-linux: 5001+", ] ); @@ -497,29 +864,52 @@ mod tests { tagger.parse_attrs(PackageArchSrc::linux(100).and_darwin(100).into()); assert_eq!( tagger.tags_to_add(), - vec!["10.rebuild-darwin: 11-100", "10.rebuild-linux: 11-100",] + vec![ + "10.rebuild-x86_64-darwin: 11-100", + "10.rebuild-aarch64-darwin: 11-100", + "10.rebuild-x86_64-linux: 11-100", + "10.rebuild-aarch64-linux: 11-100", + ] ); assert_eq!( tagger.tags_to_remove(), vec![ - "10.rebuild-darwin: 0", - "10.rebuild-darwin: 1", - "10.rebuild-darwin: 1-10", - "10.rebuild-darwin: 101-500", - "10.rebuild-darwin: 501+", - "10.rebuild-darwin: 501-1000", - "10.rebuild-darwin: 1001-2500", - "10.rebuild-darwin: 2501-5000", - "10.rebuild-darwin: 5001+", - "10.rebuild-linux: 0", - "10.rebuild-linux: 1", - "10.rebuild-linux: 1-10", - "10.rebuild-linux: 101-500", - "10.rebuild-linux: 501+", - "10.rebuild-linux: 501-1000", - "10.rebuild-linux: 1001-2500", - "10.rebuild-linux: 2501-5000", - "10.rebuild-linux: 5001+" + "10.rebuild-x86_64-darwin: 0", + "10.rebuild-x86_64-darwin: 1", + "10.rebuild-x86_64-darwin: 1-10", + "10.rebuild-x86_64-darwin: 101-500", + "10.rebuild-x86_64-darwin: 501+", + "10.rebuild-x86_64-darwin: 501-1000", + "10.rebuild-x86_64-darwin: 1001-2500", + "10.rebuild-x86_64-darwin: 2501-5000", + "10.rebuild-x86_64-darwin: 5001+", + "10.rebuild-aarch64-darwin: 0", + "10.rebuild-aarch64-darwin: 1", + "10.rebuild-aarch64-darwin: 1-10", + "10.rebuild-aarch64-darwin: 101-500", + "10.rebuild-aarch64-darwin: 501+", + "10.rebuild-aarch64-darwin: 501-1000", + "10.rebuild-aarch64-darwin: 1001-2500", + "10.rebuild-aarch64-darwin: 2501-5000", + "10.rebuild-aarch64-darwin: 5001+", + "10.rebuild-x86_64-linux: 0", + "10.rebuild-x86_64-linux: 1", + "10.rebuild-x86_64-linux: 1-10", + "10.rebuild-x86_64-linux: 101-500", + "10.rebuild-x86_64-linux: 501+", + "10.rebuild-x86_64-linux: 501-1000", + "10.rebuild-x86_64-linux: 1001-2500", + "10.rebuild-x86_64-linux: 2501-5000", + "10.rebuild-x86_64-linux: 5001+", + "10.rebuild-aarch64-linux: 0", + "10.rebuild-aarch64-linux: 1", + "10.rebuild-aarch64-linux: 1-10", + "10.rebuild-aarch64-linux: 101-500", + "10.rebuild-aarch64-linux: 501+", + "10.rebuild-aarch64-linux: 501-1000", + "10.rebuild-aarch64-linux: 1001-2500", + "10.rebuild-aarch64-linux: 2501-5000", + "10.rebuild-aarch64-linux: 5001+", ] ); @@ -527,29 +917,52 @@ mod tests { tagger.parse_attrs(PackageArchSrc::linux(101).and_darwin(101).into()); assert_eq!( tagger.tags_to_add(), - vec!["10.rebuild-darwin: 101-500", "10.rebuild-linux: 101-500",] + vec![ + "10.rebuild-x86_64-darwin: 101-500", + "10.rebuild-aarch64-darwin: 101-500", + "10.rebuild-x86_64-linux: 101-500", + "10.rebuild-aarch64-linux: 101-500", + ] ); assert_eq!( tagger.tags_to_remove(), vec![ - "10.rebuild-darwin: 0", - "10.rebuild-darwin: 1", - "10.rebuild-darwin: 1-10", - "10.rebuild-darwin: 11-100", - "10.rebuild-darwin: 501+", - "10.rebuild-darwin: 501-1000", - "10.rebuild-darwin: 1001-2500", - "10.rebuild-darwin: 2501-5000", - "10.rebuild-darwin: 5001+", - "10.rebuild-linux: 0", - "10.rebuild-linux: 1", - "10.rebuild-linux: 1-10", - "10.rebuild-linux: 11-100", - "10.rebuild-linux: 501+", - "10.rebuild-linux: 501-1000", - "10.rebuild-linux: 1001-2500", - "10.rebuild-linux: 2501-5000", - "10.rebuild-linux: 5001+" + "10.rebuild-x86_64-darwin: 0", + "10.rebuild-x86_64-darwin: 1", + "10.rebuild-x86_64-darwin: 1-10", + "10.rebuild-x86_64-darwin: 11-100", + "10.rebuild-x86_64-darwin: 501+", + "10.rebuild-x86_64-darwin: 501-1000", + "10.rebuild-x86_64-darwin: 1001-2500", + "10.rebuild-x86_64-darwin: 2501-5000", + "10.rebuild-x86_64-darwin: 5001+", + "10.rebuild-aarch64-darwin: 0", + "10.rebuild-aarch64-darwin: 1", + "10.rebuild-aarch64-darwin: 1-10", + "10.rebuild-aarch64-darwin: 11-100", + "10.rebuild-aarch64-darwin: 501+", + "10.rebuild-aarch64-darwin: 501-1000", + "10.rebuild-aarch64-darwin: 1001-2500", + "10.rebuild-aarch64-darwin: 2501-5000", + "10.rebuild-aarch64-darwin: 5001+", + "10.rebuild-x86_64-linux: 0", + "10.rebuild-x86_64-linux: 1", + "10.rebuild-x86_64-linux: 1-10", + "10.rebuild-x86_64-linux: 11-100", + "10.rebuild-x86_64-linux: 501+", + "10.rebuild-x86_64-linux: 501-1000", + "10.rebuild-x86_64-linux: 1001-2500", + "10.rebuild-x86_64-linux: 2501-5000", + "10.rebuild-x86_64-linux: 5001+", + "10.rebuild-aarch64-linux: 0", + "10.rebuild-aarch64-linux: 1", + "10.rebuild-aarch64-linux: 1-10", + "10.rebuild-aarch64-linux: 11-100", + "10.rebuild-aarch64-linux: 501+", + "10.rebuild-aarch64-linux: 501-1000", + "10.rebuild-aarch64-linux: 1001-2500", + "10.rebuild-aarch64-linux: 2501-5000", + "10.rebuild-aarch64-linux: 5001+", ] ); @@ -557,29 +970,52 @@ mod tests { tagger.parse_attrs(PackageArchSrc::linux(500).and_darwin(500).into()); assert_eq!( tagger.tags_to_add(), - vec!["10.rebuild-darwin: 101-500", "10.rebuild-linux: 101-500",] + vec![ + "10.rebuild-x86_64-darwin: 101-500", + "10.rebuild-aarch64-darwin: 101-500", + "10.rebuild-x86_64-linux: 101-500", + "10.rebuild-aarch64-linux: 101-500", + ] ); assert_eq!( tagger.tags_to_remove(), vec![ - "10.rebuild-darwin: 0", - "10.rebuild-darwin: 1", - "10.rebuild-darwin: 1-10", - "10.rebuild-darwin: 11-100", - "10.rebuild-darwin: 501+", - "10.rebuild-darwin: 501-1000", - "10.rebuild-darwin: 1001-2500", - "10.rebuild-darwin: 2501-5000", - "10.rebuild-darwin: 5001+", - "10.rebuild-linux: 0", - "10.rebuild-linux: 1", - "10.rebuild-linux: 1-10", - "10.rebuild-linux: 11-100", - "10.rebuild-linux: 501+", - "10.rebuild-linux: 501-1000", - "10.rebuild-linux: 1001-2500", - "10.rebuild-linux: 2501-5000", - "10.rebuild-linux: 5001+" + "10.rebuild-x86_64-darwin: 0", + "10.rebuild-x86_64-darwin: 1", + "10.rebuild-x86_64-darwin: 1-10", + "10.rebuild-x86_64-darwin: 11-100", + "10.rebuild-x86_64-darwin: 501+", + "10.rebuild-x86_64-darwin: 501-1000", + "10.rebuild-x86_64-darwin: 1001-2500", + "10.rebuild-x86_64-darwin: 2501-5000", + "10.rebuild-x86_64-darwin: 5001+", + "10.rebuild-aarch64-darwin: 0", + "10.rebuild-aarch64-darwin: 1", + "10.rebuild-aarch64-darwin: 1-10", + "10.rebuild-aarch64-darwin: 11-100", + "10.rebuild-aarch64-darwin: 501+", + "10.rebuild-aarch64-darwin: 501-1000", + "10.rebuild-aarch64-darwin: 1001-2500", + "10.rebuild-aarch64-darwin: 2501-5000", + "10.rebuild-aarch64-darwin: 5001+", + "10.rebuild-x86_64-linux: 0", + "10.rebuild-x86_64-linux: 1", + "10.rebuild-x86_64-linux: 1-10", + "10.rebuild-x86_64-linux: 11-100", + "10.rebuild-x86_64-linux: 501+", + "10.rebuild-x86_64-linux: 501-1000", + "10.rebuild-x86_64-linux: 1001-2500", + "10.rebuild-x86_64-linux: 2501-5000", + "10.rebuild-x86_64-linux: 5001+", + "10.rebuild-aarch64-linux: 0", + "10.rebuild-aarch64-linux: 1", + "10.rebuild-aarch64-linux: 1-10", + "10.rebuild-aarch64-linux: 11-100", + "10.rebuild-aarch64-linux: 501+", + "10.rebuild-aarch64-linux: 501-1000", + "10.rebuild-aarch64-linux: 1001-2500", + "10.rebuild-aarch64-linux: 2501-5000", + "10.rebuild-aarch64-linux: 5001+", ] ); @@ -588,31 +1024,51 @@ mod tests { assert_eq!( tagger.tags_to_add(), vec![ - "10.rebuild-darwin: 501+", - "10.rebuild-darwin: 501-1000", - "10.rebuild-linux: 501+", - "10.rebuild-linux: 501-1000", + "10.rebuild-x86_64-darwin: 501+", + "10.rebuild-x86_64-darwin: 501-1000", + "10.rebuild-aarch64-darwin: 501+", + "10.rebuild-aarch64-darwin: 501-1000", + "10.rebuild-x86_64-linux: 501+", + "10.rebuild-x86_64-linux: 501-1000", + "10.rebuild-aarch64-linux: 501+", + "10.rebuild-aarch64-linux: 501-1000", ] ); assert_eq!( tagger.tags_to_remove(), vec![ - "10.rebuild-darwin: 0", - "10.rebuild-darwin: 1", - "10.rebuild-darwin: 1-10", - "10.rebuild-darwin: 11-100", - "10.rebuild-darwin: 101-500", - "10.rebuild-darwin: 1001-2500", - "10.rebuild-darwin: 2501-5000", - "10.rebuild-darwin: 5001+", - "10.rebuild-linux: 0", - "10.rebuild-linux: 1", - "10.rebuild-linux: 1-10", - "10.rebuild-linux: 11-100", - "10.rebuild-linux: 101-500", - "10.rebuild-linux: 1001-2500", - "10.rebuild-linux: 2501-5000", - "10.rebuild-linux: 5001+" + "10.rebuild-x86_64-darwin: 0", + "10.rebuild-x86_64-darwin: 1", + "10.rebuild-x86_64-darwin: 1-10", + "10.rebuild-x86_64-darwin: 11-100", + "10.rebuild-x86_64-darwin: 101-500", + "10.rebuild-x86_64-darwin: 1001-2500", + "10.rebuild-x86_64-darwin: 2501-5000", + "10.rebuild-x86_64-darwin: 5001+", + "10.rebuild-aarch64-darwin: 0", + "10.rebuild-aarch64-darwin: 1", + "10.rebuild-aarch64-darwin: 1-10", + "10.rebuild-aarch64-darwin: 11-100", + "10.rebuild-aarch64-darwin: 101-500", + "10.rebuild-aarch64-darwin: 1001-2500", + "10.rebuild-aarch64-darwin: 2501-5000", + "10.rebuild-aarch64-darwin: 5001+", + "10.rebuild-x86_64-linux: 0", + "10.rebuild-x86_64-linux: 1", + "10.rebuild-x86_64-linux: 1-10", + "10.rebuild-x86_64-linux: 11-100", + "10.rebuild-x86_64-linux: 101-500", + "10.rebuild-x86_64-linux: 1001-2500", + "10.rebuild-x86_64-linux: 2501-5000", + "10.rebuild-x86_64-linux: 5001+", + "10.rebuild-aarch64-linux: 0", + "10.rebuild-aarch64-linux: 1", + "10.rebuild-aarch64-linux: 1-10", + "10.rebuild-aarch64-linux: 11-100", + "10.rebuild-aarch64-linux: 101-500", + "10.rebuild-aarch64-linux: 1001-2500", + "10.rebuild-aarch64-linux: 2501-5000", + "10.rebuild-aarch64-linux: 5001+", ] ); @@ -621,31 +1077,51 @@ mod tests { assert_eq!( tagger.tags_to_add(), vec![ - "10.rebuild-darwin: 501+", - "10.rebuild-darwin: 501-1000", - "10.rebuild-linux: 501+", - "10.rebuild-linux: 501-1000", + "10.rebuild-x86_64-darwin: 501+", + "10.rebuild-x86_64-darwin: 501-1000", + "10.rebuild-aarch64-darwin: 501+", + "10.rebuild-aarch64-darwin: 501-1000", + "10.rebuild-x86_64-linux: 501+", + "10.rebuild-x86_64-linux: 501-1000", + "10.rebuild-aarch64-linux: 501+", + "10.rebuild-aarch64-linux: 501-1000", ] ); assert_eq!( tagger.tags_to_remove(), vec![ - "10.rebuild-darwin: 0", - "10.rebuild-darwin: 1", - "10.rebuild-darwin: 1-10", - "10.rebuild-darwin: 11-100", - "10.rebuild-darwin: 101-500", - "10.rebuild-darwin: 1001-2500", - "10.rebuild-darwin: 2501-5000", - "10.rebuild-darwin: 5001+", - "10.rebuild-linux: 0", - "10.rebuild-linux: 1", - "10.rebuild-linux: 1-10", - "10.rebuild-linux: 11-100", - "10.rebuild-linux: 101-500", - "10.rebuild-linux: 1001-2500", - "10.rebuild-linux: 2501-5000", - "10.rebuild-linux: 5001+" + "10.rebuild-x86_64-darwin: 0", + "10.rebuild-x86_64-darwin: 1", + "10.rebuild-x86_64-darwin: 1-10", + "10.rebuild-x86_64-darwin: 11-100", + "10.rebuild-x86_64-darwin: 101-500", + "10.rebuild-x86_64-darwin: 1001-2500", + "10.rebuild-x86_64-darwin: 2501-5000", + "10.rebuild-x86_64-darwin: 5001+", + "10.rebuild-aarch64-darwin: 0", + "10.rebuild-aarch64-darwin: 1", + "10.rebuild-aarch64-darwin: 1-10", + "10.rebuild-aarch64-darwin: 11-100", + "10.rebuild-aarch64-darwin: 101-500", + "10.rebuild-aarch64-darwin: 1001-2500", + "10.rebuild-aarch64-darwin: 2501-5000", + "10.rebuild-aarch64-darwin: 5001+", + "10.rebuild-x86_64-linux: 0", + "10.rebuild-x86_64-linux: 1", + "10.rebuild-x86_64-linux: 1-10", + "10.rebuild-x86_64-linux: 11-100", + "10.rebuild-x86_64-linux: 101-500", + "10.rebuild-x86_64-linux: 1001-2500", + "10.rebuild-x86_64-linux: 2501-5000", + "10.rebuild-x86_64-linux: 5001+", + "10.rebuild-aarch64-linux: 0", + "10.rebuild-aarch64-linux: 1", + "10.rebuild-aarch64-linux: 1-10", + "10.rebuild-aarch64-linux: 11-100", + "10.rebuild-aarch64-linux: 101-500", + "10.rebuild-aarch64-linux: 1001-2500", + "10.rebuild-aarch64-linux: 2501-5000", + "10.rebuild-aarch64-linux: 5001+", ] ); @@ -654,31 +1130,51 @@ mod tests { assert_eq!( tagger.tags_to_add(), vec![ - "10.rebuild-darwin: 501+", - "10.rebuild-darwin: 1001-2500", - "10.rebuild-linux: 501+", - "10.rebuild-linux: 1001-2500" + "10.rebuild-x86_64-darwin: 501+", + "10.rebuild-x86_64-darwin: 1001-2500", + "10.rebuild-aarch64-darwin: 501+", + "10.rebuild-aarch64-darwin: 1001-2500", + "10.rebuild-x86_64-linux: 501+", + "10.rebuild-x86_64-linux: 1001-2500", + "10.rebuild-aarch64-linux: 501+", + "10.rebuild-aarch64-linux: 1001-2500", ] ); assert_eq!( tagger.tags_to_remove(), vec![ - "10.rebuild-darwin: 0", - "10.rebuild-darwin: 1", - "10.rebuild-darwin: 1-10", - "10.rebuild-darwin: 11-100", - "10.rebuild-darwin: 101-500", - "10.rebuild-darwin: 501-1000", - "10.rebuild-darwin: 2501-5000", - "10.rebuild-darwin: 5001+", - "10.rebuild-linux: 0", - "10.rebuild-linux: 1", - "10.rebuild-linux: 1-10", - "10.rebuild-linux: 11-100", - "10.rebuild-linux: 101-500", - "10.rebuild-linux: 501-1000", - "10.rebuild-linux: 2501-5000", - "10.rebuild-linux: 5001+" + "10.rebuild-x86_64-darwin: 0", + "10.rebuild-x86_64-darwin: 1", + "10.rebuild-x86_64-darwin: 1-10", + "10.rebuild-x86_64-darwin: 11-100", + "10.rebuild-x86_64-darwin: 101-500", + "10.rebuild-x86_64-darwin: 501-1000", + "10.rebuild-x86_64-darwin: 2501-5000", + "10.rebuild-x86_64-darwin: 5001+", + "10.rebuild-aarch64-darwin: 0", + "10.rebuild-aarch64-darwin: 1", + "10.rebuild-aarch64-darwin: 1-10", + "10.rebuild-aarch64-darwin: 11-100", + "10.rebuild-aarch64-darwin: 101-500", + "10.rebuild-aarch64-darwin: 501-1000", + "10.rebuild-aarch64-darwin: 2501-5000", + "10.rebuild-aarch64-darwin: 5001+", + "10.rebuild-x86_64-linux: 0", + "10.rebuild-x86_64-linux: 1", + "10.rebuild-x86_64-linux: 1-10", + "10.rebuild-x86_64-linux: 11-100", + "10.rebuild-x86_64-linux: 101-500", + "10.rebuild-x86_64-linux: 501-1000", + "10.rebuild-x86_64-linux: 2501-5000", + "10.rebuild-x86_64-linux: 5001+", + "10.rebuild-aarch64-linux: 0", + "10.rebuild-aarch64-linux: 1", + "10.rebuild-aarch64-linux: 1-10", + "10.rebuild-aarch64-linux: 11-100", + "10.rebuild-aarch64-linux: 101-500", + "10.rebuild-aarch64-linux: 501-1000", + "10.rebuild-aarch64-linux: 2501-5000", + "10.rebuild-aarch64-linux: 5001+", ] ); @@ -687,31 +1183,51 @@ mod tests { assert_eq!( tagger.tags_to_add(), vec![ - "10.rebuild-darwin: 501+", - "10.rebuild-darwin: 1001-2500", - "10.rebuild-linux: 501+", - "10.rebuild-linux: 1001-2500" + "10.rebuild-x86_64-darwin: 501+", + "10.rebuild-x86_64-darwin: 1001-2500", + "10.rebuild-aarch64-darwin: 501+", + "10.rebuild-aarch64-darwin: 1001-2500", + "10.rebuild-x86_64-linux: 501+", + "10.rebuild-x86_64-linux: 1001-2500", + "10.rebuild-aarch64-linux: 501+", + "10.rebuild-aarch64-linux: 1001-2500", ] ); assert_eq!( tagger.tags_to_remove(), vec![ - "10.rebuild-darwin: 0", - "10.rebuild-darwin: 1", - "10.rebuild-darwin: 1-10", - "10.rebuild-darwin: 11-100", - "10.rebuild-darwin: 101-500", - "10.rebuild-darwin: 501-1000", - "10.rebuild-darwin: 2501-5000", - "10.rebuild-darwin: 5001+", - "10.rebuild-linux: 0", - "10.rebuild-linux: 1", - "10.rebuild-linux: 1-10", - "10.rebuild-linux: 11-100", - "10.rebuild-linux: 101-500", - "10.rebuild-linux: 501-1000", - "10.rebuild-linux: 2501-5000", - "10.rebuild-linux: 5001+" + "10.rebuild-x86_64-darwin: 0", + "10.rebuild-x86_64-darwin: 1", + "10.rebuild-x86_64-darwin: 1-10", + "10.rebuild-x86_64-darwin: 11-100", + "10.rebuild-x86_64-darwin: 101-500", + "10.rebuild-x86_64-darwin: 501-1000", + "10.rebuild-x86_64-darwin: 2501-5000", + "10.rebuild-x86_64-darwin: 5001+", + "10.rebuild-aarch64-darwin: 0", + "10.rebuild-aarch64-darwin: 1", + "10.rebuild-aarch64-darwin: 1-10", + "10.rebuild-aarch64-darwin: 11-100", + "10.rebuild-aarch64-darwin: 101-500", + "10.rebuild-aarch64-darwin: 501-1000", + "10.rebuild-aarch64-darwin: 2501-5000", + "10.rebuild-aarch64-darwin: 5001+", + "10.rebuild-x86_64-linux: 0", + "10.rebuild-x86_64-linux: 1", + "10.rebuild-x86_64-linux: 1-10", + "10.rebuild-x86_64-linux: 11-100", + "10.rebuild-x86_64-linux: 101-500", + "10.rebuild-x86_64-linux: 501-1000", + "10.rebuild-x86_64-linux: 2501-5000", + "10.rebuild-x86_64-linux: 5001+", + "10.rebuild-aarch64-linux: 0", + "10.rebuild-aarch64-linux: 1", + "10.rebuild-aarch64-linux: 1-10", + "10.rebuild-aarch64-linux: 11-100", + "10.rebuild-aarch64-linux: 101-500", + "10.rebuild-aarch64-linux: 501-1000", + "10.rebuild-aarch64-linux: 2501-5000", + "10.rebuild-aarch64-linux: 5001+", ] ); @@ -720,31 +1236,51 @@ mod tests { assert_eq!( tagger.tags_to_add(), vec![ - "10.rebuild-darwin: 501+", - "10.rebuild-darwin: 2501-5000", - "10.rebuild-linux: 501+", - "10.rebuild-linux: 2501-5000" + "10.rebuild-x86_64-darwin: 501+", + "10.rebuild-x86_64-darwin: 2501-5000", + "10.rebuild-aarch64-darwin: 501+", + "10.rebuild-aarch64-darwin: 2501-5000", + "10.rebuild-x86_64-linux: 501+", + "10.rebuild-x86_64-linux: 2501-5000", + "10.rebuild-aarch64-linux: 501+", + "10.rebuild-aarch64-linux: 2501-5000", ] ); assert_eq!( tagger.tags_to_remove(), vec![ - "10.rebuild-darwin: 0", - "10.rebuild-darwin: 1", - "10.rebuild-darwin: 1-10", - "10.rebuild-darwin: 11-100", - "10.rebuild-darwin: 101-500", - "10.rebuild-darwin: 501-1000", - "10.rebuild-darwin: 1001-2500", - "10.rebuild-darwin: 5001+", - "10.rebuild-linux: 0", - "10.rebuild-linux: 1", - "10.rebuild-linux: 1-10", - "10.rebuild-linux: 11-100", - "10.rebuild-linux: 101-500", - "10.rebuild-linux: 501-1000", - "10.rebuild-linux: 1001-2500", - "10.rebuild-linux: 5001+" + "10.rebuild-x86_64-darwin: 0", + "10.rebuild-x86_64-darwin: 1", + "10.rebuild-x86_64-darwin: 1-10", + "10.rebuild-x86_64-darwin: 11-100", + "10.rebuild-x86_64-darwin: 101-500", + "10.rebuild-x86_64-darwin: 501-1000", + "10.rebuild-x86_64-darwin: 1001-2500", + "10.rebuild-x86_64-darwin: 5001+", + "10.rebuild-aarch64-darwin: 0", + "10.rebuild-aarch64-darwin: 1", + "10.rebuild-aarch64-darwin: 1-10", + "10.rebuild-aarch64-darwin: 11-100", + "10.rebuild-aarch64-darwin: 101-500", + "10.rebuild-aarch64-darwin: 501-1000", + "10.rebuild-aarch64-darwin: 1001-2500", + "10.rebuild-aarch64-darwin: 5001+", + "10.rebuild-x86_64-linux: 0", + "10.rebuild-x86_64-linux: 1", + "10.rebuild-x86_64-linux: 1-10", + "10.rebuild-x86_64-linux: 11-100", + "10.rebuild-x86_64-linux: 101-500", + "10.rebuild-x86_64-linux: 501-1000", + "10.rebuild-x86_64-linux: 1001-2500", + "10.rebuild-x86_64-linux: 5001+", + "10.rebuild-aarch64-linux: 0", + "10.rebuild-aarch64-linux: 1", + "10.rebuild-aarch64-linux: 1-10", + "10.rebuild-aarch64-linux: 11-100", + "10.rebuild-aarch64-linux: 101-500", + "10.rebuild-aarch64-linux: 501-1000", + "10.rebuild-aarch64-linux: 1001-2500", + "10.rebuild-aarch64-linux: 5001+", ] ); @@ -753,31 +1289,51 @@ mod tests { assert_eq!( tagger.tags_to_add(), vec![ - "10.rebuild-darwin: 501+", - "10.rebuild-darwin: 2501-5000", - "10.rebuild-linux: 501+", - "10.rebuild-linux: 2501-5000" + "10.rebuild-x86_64-darwin: 501+", + "10.rebuild-x86_64-darwin: 2501-5000", + "10.rebuild-aarch64-darwin: 501+", + "10.rebuild-aarch64-darwin: 2501-5000", + "10.rebuild-x86_64-linux: 501+", + "10.rebuild-x86_64-linux: 2501-5000", + "10.rebuild-aarch64-linux: 501+", + "10.rebuild-aarch64-linux: 2501-5000", ] ); assert_eq!( tagger.tags_to_remove(), vec![ - "10.rebuild-darwin: 0", - "10.rebuild-darwin: 1", - "10.rebuild-darwin: 1-10", - "10.rebuild-darwin: 11-100", - "10.rebuild-darwin: 101-500", - "10.rebuild-darwin: 501-1000", - "10.rebuild-darwin: 1001-2500", - "10.rebuild-darwin: 5001+", - "10.rebuild-linux: 0", - "10.rebuild-linux: 1", - "10.rebuild-linux: 1-10", - "10.rebuild-linux: 11-100", - "10.rebuild-linux: 101-500", - "10.rebuild-linux: 501-1000", - "10.rebuild-linux: 1001-2500", - "10.rebuild-linux: 5001+" + "10.rebuild-x86_64-darwin: 0", + "10.rebuild-x86_64-darwin: 1", + "10.rebuild-x86_64-darwin: 1-10", + "10.rebuild-x86_64-darwin: 11-100", + "10.rebuild-x86_64-darwin: 101-500", + "10.rebuild-x86_64-darwin: 501-1000", + "10.rebuild-x86_64-darwin: 1001-2500", + "10.rebuild-x86_64-darwin: 5001+", + "10.rebuild-aarch64-darwin: 0", + "10.rebuild-aarch64-darwin: 1", + "10.rebuild-aarch64-darwin: 1-10", + "10.rebuild-aarch64-darwin: 11-100", + "10.rebuild-aarch64-darwin: 101-500", + "10.rebuild-aarch64-darwin: 501-1000", + "10.rebuild-aarch64-darwin: 1001-2500", + "10.rebuild-aarch64-darwin: 5001+", + "10.rebuild-x86_64-linux: 0", + "10.rebuild-x86_64-linux: 1", + "10.rebuild-x86_64-linux: 1-10", + "10.rebuild-x86_64-linux: 11-100", + "10.rebuild-x86_64-linux: 101-500", + "10.rebuild-x86_64-linux: 501-1000", + "10.rebuild-x86_64-linux: 1001-2500", + "10.rebuild-x86_64-linux: 5001+", + "10.rebuild-aarch64-linux: 0", + "10.rebuild-aarch64-linux: 1", + "10.rebuild-aarch64-linux: 1-10", + "10.rebuild-aarch64-linux: 11-100", + "10.rebuild-aarch64-linux: 101-500", + "10.rebuild-aarch64-linux: 501-1000", + "10.rebuild-aarch64-linux: 1001-2500", + "10.rebuild-aarch64-linux: 5001+", ] ); @@ -786,31 +1342,51 @@ mod tests { assert_eq!( tagger.tags_to_add(), vec![ - "10.rebuild-darwin: 501+", - "10.rebuild-darwin: 5001+", - "10.rebuild-linux: 501+", - "10.rebuild-linux: 5001+" + "10.rebuild-x86_64-darwin: 501+", + "10.rebuild-x86_64-darwin: 5001+", + "10.rebuild-aarch64-darwin: 501+", + "10.rebuild-aarch64-darwin: 5001+", + "10.rebuild-x86_64-linux: 501+", + "10.rebuild-x86_64-linux: 5001+", + "10.rebuild-aarch64-linux: 501+", + "10.rebuild-aarch64-linux: 5001+", ] ); assert_eq!( tagger.tags_to_remove(), vec![ - "10.rebuild-darwin: 0", - "10.rebuild-darwin: 1", - "10.rebuild-darwin: 1-10", - "10.rebuild-darwin: 11-100", - "10.rebuild-darwin: 101-500", - "10.rebuild-darwin: 501-1000", - "10.rebuild-darwin: 1001-2500", - "10.rebuild-darwin: 2501-5000", - "10.rebuild-linux: 0", - "10.rebuild-linux: 1", - "10.rebuild-linux: 1-10", - "10.rebuild-linux: 11-100", - "10.rebuild-linux: 101-500", - "10.rebuild-linux: 501-1000", - "10.rebuild-linux: 1001-2500", - "10.rebuild-linux: 2501-5000", + "10.rebuild-x86_64-darwin: 0", + "10.rebuild-x86_64-darwin: 1", + "10.rebuild-x86_64-darwin: 1-10", + "10.rebuild-x86_64-darwin: 11-100", + "10.rebuild-x86_64-darwin: 101-500", + "10.rebuild-x86_64-darwin: 501-1000", + "10.rebuild-x86_64-darwin: 1001-2500", + "10.rebuild-x86_64-darwin: 2501-5000", + "10.rebuild-aarch64-darwin: 0", + "10.rebuild-aarch64-darwin: 1", + "10.rebuild-aarch64-darwin: 1-10", + "10.rebuild-aarch64-darwin: 11-100", + "10.rebuild-aarch64-darwin: 101-500", + "10.rebuild-aarch64-darwin: 501-1000", + "10.rebuild-aarch64-darwin: 1001-2500", + "10.rebuild-aarch64-darwin: 2501-5000", + "10.rebuild-x86_64-linux: 0", + "10.rebuild-x86_64-linux: 1", + "10.rebuild-x86_64-linux: 1-10", + "10.rebuild-x86_64-linux: 11-100", + "10.rebuild-x86_64-linux: 101-500", + "10.rebuild-x86_64-linux: 501-1000", + "10.rebuild-x86_64-linux: 1001-2500", + "10.rebuild-x86_64-linux: 2501-5000", + "10.rebuild-aarch64-linux: 0", + "10.rebuild-aarch64-linux: 1", + "10.rebuild-aarch64-linux: 1-10", + "10.rebuild-aarch64-linux: 11-100", + "10.rebuild-aarch64-linux: 101-500", + "10.rebuild-aarch64-linux: 501-1000", + "10.rebuild-aarch64-linux: 1001-2500", + "10.rebuild-aarch64-linux: 2501-5000", ] ); } diff --git a/ofborg/src/tasks/eval/stdenvs.rs b/ofborg/src/tasks/eval/stdenvs.rs index 01703ec6..f7bf62b8 100644 --- a/ofborg/src/tasks/eval/stdenvs.rs +++ b/ofborg/src/tasks/eval/stdenvs.rs @@ -13,7 +13,9 @@ enum StdenvFrom { #[derive(Debug)] pub enum System { X8664Darwin, + AArch64Darwin, X8664Linux, + AArch64Linux, } #[derive(Debug, PartialEq, Eq)] @@ -21,11 +23,15 @@ pub struct Stdenvs { nix: nix::Nix, co: PathBuf, - linux_stdenv_before: Option, - linux_stdenv_after: Option, + x86_64_linux_stdenv_before: Option, + x86_64_linux_stdenv_after: Option, + aarch64_linux_stdenv_before: Option, + aarch64_linux_stdenv_after: Option, - darwin_stdenv_before: Option, - darwin_stdenv_after: Option, + x86_64_darwin_stdenv_before: Option, + x86_64_darwin_stdenv_after: Option, + aarch64_darwin_stdenv_before: Option, + aarch64_darwin_stdenv_after: Option, } impl Stdenvs { @@ -34,22 +40,32 @@ impl Stdenvs { nix, co, - linux_stdenv_before: None, - linux_stdenv_after: None, + x86_64_linux_stdenv_before: None, + x86_64_linux_stdenv_after: None, - darwin_stdenv_before: None, - darwin_stdenv_after: None, + aarch64_linux_stdenv_before: None, + aarch64_linux_stdenv_after: None, + + x86_64_darwin_stdenv_before: None, + x86_64_darwin_stdenv_after: None, + + aarch64_darwin_stdenv_before: None, + aarch64_darwin_stdenv_after: None, } } pub fn identify_before(&mut self) { self.identify(System::X8664Linux, StdenvFrom::Before); + self.identify(System::AArch64Linux, StdenvFrom::Before); self.identify(System::X8664Darwin, StdenvFrom::Before); + self.identify(System::AArch64Darwin, StdenvFrom::Before); } pub fn identify_after(&mut self) { self.identify(System::X8664Linux, StdenvFrom::After); + self.identify(System::AArch64Linux, StdenvFrom::After); self.identify(System::X8664Darwin, StdenvFrom::After); + self.identify(System::AArch64Darwin, StdenvFrom::After); } pub fn are_same(&self) -> bool { @@ -59,11 +75,19 @@ impl Stdenvs { pub fn changed(&self) -> Vec { let mut changed: Vec = vec![]; - if self.linux_stdenv_before != self.linux_stdenv_after { + if self.x86_64_linux_stdenv_before != self.x86_64_linux_stdenv_after { changed.push(System::X8664Linux); } - if self.darwin_stdenv_before != self.darwin_stdenv_after { + if self.aarch64_linux_stdenv_before != self.aarch64_linux_stdenv_after { + changed.push(System::X8664Linux); + } + + if self.x86_64_darwin_stdenv_before != self.x86_64_darwin_stdenv_after { + changed.push(System::X8664Darwin); + } + + if self.aarch64_darwin_stdenv_before != self.aarch64_darwin_stdenv_after { changed.push(System::X8664Darwin); } @@ -73,17 +97,31 @@ impl Stdenvs { fn identify(&mut self, system: System, from: StdenvFrom) { match (system, from) { (System::X8664Linux, StdenvFrom::Before) => { - self.linux_stdenv_before = self.evalstdenv("x86_64-linux"); + self.x86_64_linux_stdenv_before = self.evalstdenv("x86_64-linux"); } (System::X8664Linux, StdenvFrom::After) => { - self.linux_stdenv_after = self.evalstdenv("x86_64-linux"); + self.x86_64_linux_stdenv_after = self.evalstdenv("x86_64-linux"); + } + + (System::AArch64Linux, StdenvFrom::Before) => { + self.aarch64_linux_stdenv_before = self.evalstdenv("aarch64-linux"); + } + (System::AArch64Linux, StdenvFrom::After) => { + self.aarch64_linux_stdenv_after = self.evalstdenv("aarch64-linux"); } (System::X8664Darwin, StdenvFrom::Before) => { - self.darwin_stdenv_before = self.evalstdenv("x86_64-darwin"); + self.x86_64_darwin_stdenv_before = self.evalstdenv("x86_64-darwin"); } (System::X8664Darwin, StdenvFrom::After) => { - self.darwin_stdenv_after = self.evalstdenv("x86_64-darwin"); + self.x86_64_darwin_stdenv_after = self.evalstdenv("x86_64-darwin"); + } + + (System::AArch64Darwin, StdenvFrom::Before) => { + self.aarch64_darwin_stdenv_before = self.evalstdenv("aarch64-darwin"); + } + (System::AArch64Darwin, StdenvFrom::After) => { + self.aarch64_darwin_stdenv_after = self.evalstdenv("aarch64-darwin"); } } } @@ -134,10 +172,14 @@ mod tests { let nix = nix::Nix::new(String::from("x86_64-linux"), remote, 1200, None); let mut stdenv = Stdenvs::new(nix, PathBuf::from(nixpkgs.trim_end())); stdenv.identify(System::X8664Linux, StdenvFrom::Before); + stdenv.identify(System::AArch64Linux, StdenvFrom::Before); stdenv.identify(System::X8664Darwin, StdenvFrom::Before); + stdenv.identify(System::AArch64Darwin, StdenvFrom::Before); stdenv.identify(System::X8664Linux, StdenvFrom::After); + stdenv.identify(System::AArch64Linux, StdenvFrom::After); stdenv.identify(System::X8664Darwin, StdenvFrom::After); + stdenv.identify(System::AArch64Darwin, StdenvFrom::After); assert!(stdenv.are_same()); }