diff --git a/ofborg/src/acl.rs b/ofborg/src/acl.rs index 69f77d0..62b8efb 100644 --- a/ofborg/src/acl.rs +++ b/ofborg/src/acl.rs @@ -36,10 +36,9 @@ impl ACL { System::X8664Linux, System::Aarch64Linux, ] - } else if self.can_build_restricted(user, repo) { - vec![System::X8664Linux, System::Aarch64Linux] } else { - vec![] + // allow everybody to issue aarch64-linux and x8664-linux builds + vec![System::X8664Linux, System::Aarch64Linux] } } diff --git a/ofborg/src/commentparser.rs b/ofborg/src/commentparser.rs index ea098e6..f7b8896 100644 --- a/ofborg/src/commentparser.rs +++ b/ofborg/src/commentparser.rs @@ -244,5 +244,4 @@ baz", parse("@ofborg build foo bar baz.Baz") ); } - } diff --git a/ofborg/src/notifyworker.rs b/ofborg/src/notifyworker.rs index 801df26..aa125be 100644 --- a/ofborg/src/notifyworker.rs +++ b/ofborg/src/notifyworker.rs @@ -11,7 +11,7 @@ pub struct NotifyWorker { pub trait SimpleNotifyWorker { type J; - fn consumer(&self, job: &Self::J, notifier: &mut NotificationReceiver); + fn consumer(&self, job: &Self::J, notifier: &mut dyn NotificationReceiver); fn msg_to_job( &self, diff --git a/ofborg/src/outpathdiff.rs b/ofborg/src/outpathdiff.rs index 769b79e..668367c 100644 --- a/ofborg/src/outpathdiff.rs +++ b/ofborg/src/outpathdiff.rs @@ -110,7 +110,7 @@ type Package = String; type Architecture = String; type OutPath = String; -pub fn parse_lines(data: &mut BufRead) -> PackageOutPaths { +pub fn parse_lines(data: &mut dyn BufRead) -> PackageOutPaths { data.lines() .filter_map(|line| match line { Ok(line) => Some(line), @@ -191,5 +191,4 @@ gnome3.evolution_data_server.aarch64-linux /nix/ ); assert_eq!(parse_lines(&mut Cursor::new(TEST_LINES)), expect); } - } diff --git a/ofborg/src/systems.rs b/ofborg/src/systems.rs index 140f1bc..f296270 100644 --- a/ofborg/src/systems.rs +++ b/ofborg/src/systems.rs @@ -5,15 +5,17 @@ pub enum System { X8664Darwin, } -impl System { - pub fn to_string(&self) -> String { +impl std::fmt::Display for System { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { match self { - System::X8664Linux => String::from("x86_64-linux"), - System::Aarch64Linux => String::from("aarch64-linux"), - System::X8664Darwin => String::from("x86_64-darwin"), + System::X8664Linux => write!(f, "x86_64-linux"), + System::Aarch64Linux => write!(f, "aarch64-linux"), + System::X8664Darwin => write!(f, "x86_64-darwin"), } } +} +impl System { pub fn as_build_destination(&self) -> (Option, Option) { (None, Some(format!("build-inputs-{}", self.to_string()))) } diff --git a/ofborg/src/tagger.rs b/ofborg/src/tagger.rs index 11535d1..b2d0d2b 100644 --- a/ofborg/src/tagger.rs +++ b/ofborg/src/tagger.rs @@ -340,15 +340,6 @@ mod tests { PackageArchSrc { linux, darwin: 0 } } - pub fn darwin(darwin: usize) -> PackageArchSrc { - PackageArchSrc::linux(0).and_darwin(darwin) - } - - pub fn and_linux(mut self, linux: usize) -> PackageArchSrc { - self.linux = linux; - self - } - pub fn and_darwin(mut self, darwin: usize) -> PackageArchSrc { self.darwin = darwin; self diff --git a/ofborg/src/tasks/build.rs b/ofborg/src/tasks/build.rs index e0499bf..f5ed3d0 100644 --- a/ofborg/src/tasks/build.rs +++ b/ofborg/src/tasks/build.rs @@ -41,7 +41,7 @@ impl BuildWorker { fn actions<'a, 'b>( &self, job: &'b buildjob::BuildJob, - receiver: &'a mut notifyworker::NotificationReceiver, + receiver: &'a mut dyn notifyworker::NotificationReceiver, ) -> JobActions<'a, 'b> { JobActions::new(&self.system, &self.identity, job, receiver) } @@ -50,7 +50,7 @@ impl BuildWorker { pub struct JobActions<'a, 'b> { system: String, identity: String, - receiver: &'a mut notifyworker::NotificationReceiver, + receiver: &'a mut dyn notifyworker::NotificationReceiver, job: &'b buildjob::BuildJob, line_counter: u64, snippet_log: VecDeque, @@ -66,7 +66,7 @@ impl<'a, 'b> JobActions<'a, 'b> { system: &str, identity: &str, job: &'b buildjob::BuildJob, - receiver: &'a mut notifyworker::NotificationReceiver, + receiver: &'a mut dyn notifyworker::NotificationReceiver, ) -> JobActions<'a, 'b> { let (log_exchange, log_routing_key) = job .logs @@ -279,7 +279,7 @@ impl notifyworker::SimpleNotifyWorker for BuildWorker { fn consumer( &self, job: &buildjob::BuildJob, - notifier: &mut notifyworker::NotificationReceiver, + notifier: &mut dyn notifyworker::NotificationReceiver, ) { let mut actions = self.actions(&job, notifier); diff --git a/ofborg/src/tasks/evaluate.rs b/ofborg/src/tasks/evaluate.rs index 941e5ea..61f2bcf 100644 --- a/ofborg/src/tasks/evaluate.rs +++ b/ofborg/src/tasks/evaluate.rs @@ -156,7 +156,7 @@ impl worker::SimpleWorker for EvaluationWorker } }; - let mut evaluation_strategy: Box = if job.is_nixpkgs() { + let mut evaluation_strategy: Box = if job.is_nixpkgs() { Box::new(eval::NixpkgsStrategy::new( &job, &pull,