From 789986a1a0841f1c75d747a2d31f091456d19909 Mon Sep 17 00:00:00 2001 From: Graham Christensen Date: Sun, 18 Mar 2018 16:03:38 -0400 Subject: [PATCH 01/10] Require full logs everywhere --- ofborg/src/bin/builder.rs | 18 ++++++++---------- ofborg/src/config.rs | 2 +- ofborg/src/tasks/build.rs | 10 +--------- 3 files changed, 10 insertions(+), 20 deletions(-) diff --git a/ofborg/src/bin/builder.rs b/ofborg/src/bin/builder.rs index 7c2475f..016c66b 100644 --- a/ofborg/src/bin/builder.rs +++ b/ofborg/src/bin/builder.rs @@ -25,18 +25,16 @@ fn main() { let cloner = checkout::cached_cloner(Path::new(&cfg.checkout.root)); let nix = cfg.nix(); - let full_logs: bool = match &cfg.feedback { - &Some(ref feedback) => feedback.full_logs, - &None => { - warn!("Please define feedback.full_logs in your configuration to true or false!"); - warn!("feedback.full_logs when true will cause the full build log to be sent back"); - warn!("to the server, and be viewable by everyone."); - warn!("I strongly encourage everybody turn this on!"); - false - } + if &cfg.feedback.full_logs != Some(true) { + warn!("Please define feedback.full_logs in your configuration to true!"); + warn!("feedback.full_logs when true will cause the full build log to be sent back"); + warn!("to the server, and be viewable by everyone."); + warn!(""); + warn!("Builders are no longer allowed to operate with this off"); + warn!("so your builder will no longer start."); + panic!(); }; - let mut session = easyamqp::session_from_config(&cfg.rabbitmq).unwrap(); let mut channel = session.open_channel(1).unwrap(); channel.basic_prefetch(1).unwrap(); diff --git a/ofborg/src/config.rs b/ofborg/src/config.rs index 2b81fdd..60613d0 100644 --- a/ofborg/src/config.rs +++ b/ofborg/src/config.rs @@ -15,7 +15,7 @@ use ofborg::acl; #[derive(Serialize, Deserialize, Debug)] pub struct Config { pub runner: RunnerConfig, - pub feedback: Option, + pub feedback: FeedbackConfig, pub checkout: CheckoutConfig, pub nix: NixConfig, pub rabbitmq: RabbitMQConfig, diff --git a/ofborg/src/tasks/build.rs b/ofborg/src/tasks/build.rs index dff6c82..2a96337 100644 --- a/ofborg/src/tasks/build.rs +++ b/ofborg/src/tasks/build.rs @@ -23,7 +23,6 @@ pub struct BuildWorker { nix: nix::Nix, system: String, identity: String, - full_logs: bool, } impl BuildWorker { @@ -32,14 +31,12 @@ impl BuildWorker { nix: nix::Nix, system: String, identity: String, - full_logs: bool, ) -> BuildWorker { return BuildWorker { cloner: cloner, nix: nix, system: system, identity: identity, - full_logs: full_logs, }; } @@ -346,20 +343,15 @@ impl notifyworker::SimpleNotifyWorker for BuildWorker { let mut snippet_log = VecDeque::with_capacity(10); - if !self.full_logs { - actions.log_line("Full logs are disabled on this builder."); - } for line in spawned.lines().iter() { - if self.full_logs { - actions.log_line(&line); - } if snippet_log.len() >= 10 { snippet_log.pop_front(); } snippet_log.push_back(line.to_owned()); + actions.log_line(&line); } let success = match spawned.wait() { From cfa9547434ea9b7f8666f6f140fc342f73741da9 Mon Sep 17 00:00:00 2001 From: Graham Christensen Date: Sun, 18 Mar 2018 16:05:14 -0400 Subject: [PATCH 02/10] Merge the snippet log in to the standard job action logger --- ofborg/src/tasks/build.rs | 36 ++++++++++++++++++++++++------------ 1 file changed, 24 insertions(+), 12 deletions(-) diff --git a/ofborg/src/tasks/build.rs b/ofborg/src/tasks/build.rs index 2a96337..d8784de 100644 --- a/ofborg/src/tasks/build.rs +++ b/ofborg/src/tasks/build.rs @@ -55,6 +55,7 @@ pub struct JobActions<'a, 'b> { receiver: &'a mut notifyworker::NotificationReceiver, job: &'b buildjob::BuildJob, line_counter: u64, + snippet_log: VecDeque, attempt_id: String, log_exchange: Option, log_routing_key: Option, @@ -86,6 +87,7 @@ impl<'a, 'b> JobActions<'a, 'b> { receiver: receiver, job: job, line_counter: 0, + snippet_log: VecDeque::with_capacity(10), attempt_id: format!("{}", Uuid::new_v4()), log_exchange: log_exchange, log_routing_key: log_routing_key, @@ -94,6 +96,10 @@ impl<'a, 'b> JobActions<'a, 'b> { }; } + pub fn log_snippet(&self) -> VecDeque { + self.snippet_log.clone() + } + pub fn commit_missing(&mut self) { self.tell(worker::Action::Ack); } @@ -149,9 +155,25 @@ impl<'a, 'b> JobActions<'a, 'b> { )); } + pub fn log_instantiation_errors(&mut self, cannot_build: Vec<(String, Vec)>) { + for (attr, log) in cannot_build { + self.log_line(&format!("Cannot nix-instantiate `{}' because:", &attr)); + + for line in log { + self.log_line(&line); + } + self.log_line(""); + } + } + pub fn log_line(&mut self, line: &str) { self.line_counter += 1; + if self.snippet_log.len() >= 10 { + self.snippet_log.pop_front(); + } + self.snippet_log.push_back(line.to_owned()); + let msg = buildlogmsg::BuildLogMsg { identity: self.identity.clone(), system: self.system.clone(), @@ -340,17 +362,7 @@ impl notifyworker::SimpleNotifyWorker for BuildWorker { let acmd = AsyncCmd::new(cmd); let mut spawned = acmd.spawn(); - let mut snippet_log = VecDeque::with_capacity(10); - - - for line in spawned.lines().iter() { - - if snippet_log.len() >= 10 { - snippet_log.pop_front(); - } - - snippet_log.push_back(line.to_owned()); actions.log_line(&line); } @@ -364,10 +376,10 @@ impl notifyworker::SimpleNotifyWorker for BuildWorker { println!("ok built ({:?}), building", success); println!("Lines:\n-----8<-----"); - snippet_log.iter().inspect(|x| println!("{}", x)).last(); + actions.log_snippet().iter().inspect(|x| println!("{}", x)).last(); println!("----->8-----"); - let last10lines: Vec = snippet_log.into_iter().collect::>(); + let last10lines: Vec = actions.log_snippet().into_iter().collect::>(); actions.build_finished(success, last10lines.clone(), can_build, cannot_build); println!("Done!"); From bebe1976438ba9f81818e8d9e48da39eb40bb09a Mon Sep 17 00:00:00 2001 From: Graham Christensen Date: Sun, 18 Mar 2018 16:06:24 -0400 Subject: [PATCH 03/10] fixup: full logs --- ofborg/src/bin/builder.rs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/ofborg/src/bin/builder.rs b/ofborg/src/bin/builder.rs index 016c66b..1979a4e 100644 --- a/ofborg/src/bin/builder.rs +++ b/ofborg/src/bin/builder.rs @@ -25,7 +25,7 @@ fn main() { let cloner = checkout::cached_cloner(Path::new(&cfg.checkout.root)); let nix = cfg.nix(); - if &cfg.feedback.full_logs != Some(true) { + if cfg.feedback.full_logs != true { warn!("Please define feedback.full_logs in your configuration to true!"); warn!("feedback.full_logs when true will cause the full build log to be sent back"); warn!("to the server, and be viewable by everyone."); @@ -80,7 +80,6 @@ fn main() { nix, cfg.nix.system.clone(), cfg.runner.identity.clone(), - full_logs, )), easyamqp::ConsumeConfig { queue: format!("build-inputs-{}", cfg.nix.system.clone()), From f971b7b22d68cd445ac7ffb44f124c57bff0ddac Mon Sep 17 00:00:00 2001 From: Graham Christensen Date: Sun, 18 Mar 2018 16:10:12 -0400 Subject: [PATCH 04/10] Add an option for dev time: always build all jobs --- ofborg/src/bin/builder.rs | 44 +++++++++++++++++++++++++++------------ ofborg/src/config.rs | 8 +++++++ 2 files changed, 39 insertions(+), 13 deletions(-) diff --git a/ofborg/src/bin/builder.rs b/ofborg/src/bin/builder.rs index 1979a4e..f18d6d7 100644 --- a/ofborg/src/bin/builder.rs +++ b/ofborg/src/bin/builder.rs @@ -51,21 +51,38 @@ fn main() { }) .unwrap(); - channel - .declare_queue(easyamqp::QueueConfig { - queue: format!("build-inputs-{}", cfg.nix.system.clone()), - passive: false, - durable: true, - exclusive: false, - auto_delete: false, - no_wait: false, - arguments: None, - }) - .unwrap(); + let queue_name: String; + if cfg.runner.build_all_jobs != Some(true) { + queue_name = channel + .declare_queue(easyamqp::QueueConfig { + queue: format!("build-inputs-{}", cfg.nix.system.clone()), + passive: false, + durable: true, + exclusive: false, + auto_delete: false, + no_wait: false, + arguments: None, + }) + .unwrap().queue; + } else { + warn!("Building all jobs, please don't use this unless you're"); + warn!("developing and have Graham's permission!"); + queue_name = channel + .declare_queue(easyamqp::QueueConfig { + queue: "".to_owned(), + passive: false, + durable: false, + exclusive: true, + auto_delete: true, + no_wait: false, + arguments: None, + }) + .unwrap().queue; + } channel .bind_queue(easyamqp::BindQueueConfig { - queue: format!("build-inputs-{}", cfg.nix.system.clone()), + queue: queue_name.clone(), exchange: "build-jobs".to_owned(), routing_key: None, no_wait: false, @@ -82,7 +99,7 @@ fn main() { cfg.runner.identity.clone(), )), easyamqp::ConsumeConfig { - queue: format!("build-inputs-{}", cfg.nix.system.clone()), + queue: queue_name.clone(), consumer_tag: format!("{}-builder", cfg.whoami()), no_local: false, no_ack: false, @@ -93,6 +110,7 @@ fn main() { ) .unwrap(); + println!("Fetching jobs from {}", &queue_name); channel.start_consuming(); channel.close(200, "Bye").unwrap(); println!("Closed the channel"); diff --git a/ofborg/src/config.rs b/ofborg/src/config.rs index 60613d0..799b3a6 100644 --- a/ofborg/src/config.rs +++ b/ofborg/src/config.rs @@ -62,6 +62,14 @@ pub struct RunnerConfig { pub repos: Option>, pub trusted_users: Option>, pub known_users: Option>, + + /// If true, will create its own queue attached to the build job + /// exchange. This means that builders with this enabled will + /// trigger duplicate replies to the request for this + /// architecture. + /// + /// This should only be turned on for development. + pub build_all_jobs: Option } #[derive(Serialize, Deserialize, Debug)] From 69502ec69ad6e6cabdf81b9ee7294b9ebb9db6c1 Mon Sep 17 00:00:00 2001 From: Graham Christensen Date: Sun, 18 Mar 2018 16:15:05 -0400 Subject: [PATCH 05/10] Log the reasons things can't be instantiated --- ofborg/src/nix.rs | 68 ++++++++++++++++++++++++++------------- ofborg/src/tasks/build.rs | 19 ++++++++--- 2 files changed, 61 insertions(+), 26 deletions(-) diff --git a/ofborg/src/nix.rs b/ofborg/src/nix.rs index 32b7520..4f2d8cb 100644 --- a/ofborg/src/nix.rs +++ b/ofborg/src/nix.rs @@ -6,6 +6,8 @@ use std::io::SeekFrom; use std::path::Path; use std::process::{Command, Stdio}; use tempfile::tempfile; +use std::io::BufReader; +use std::io::BufRead; #[derive(Clone, Debug)] pub enum Operation { @@ -102,16 +104,35 @@ impl Nix { nixpkgs: &Path, file: &str, attrs: Vec, - ) -> (Vec, Vec) { - attrs + ) -> (Vec, Vec<(String,Vec)>) { + let attr_instantiations: Vec)>> = + attrs .into_iter() - .partition(|attr| { - self.safely_instantiate_attrs( - nixpkgs, - file, - vec![attr.clone()] - ).is_ok() - }) + .map(|attr| + match self.safely_instantiate_attrs( + nixpkgs, + file, + vec![attr.clone()] + ) { + Ok(_) => Ok(attr.clone()), + Err(f) => Err((attr.clone(), lines_from_file(f))) + } + ) + .collect(); + + let (ok, err): ( + Vec)>>, + Vec)>>) = attr_instantiations + .into_iter() + .partition(|x| x.is_ok()); + + let ok_ret: Vec = ok.into_iter().map(|x| x.unwrap()).collect(); + let err_ret: Vec<(String, Vec)> = err.into_iter().map(|x| x.unwrap_err()).collect(); + + return ( + ok_ret, + err_ret + ) } pub fn safely_instantiate_attrs( @@ -253,6 +274,15 @@ impl Nix { } } +fn lines_from_file(file: File) -> Vec { + BufReader::new(file) + .lines() + .into_iter() + .filter(|line| line.is_ok()) + .map(|line| line.unwrap()) + .collect() +} + #[cfg(test)] mod tests { fn nix() -> Nix { @@ -291,15 +321,6 @@ mod tests { Fail, } - fn lines_from_file(file: File) -> Vec { - BufReader::new(file) - .lines() - .into_iter() - .filter(|line| line.is_ok()) - .map(|line| line.unwrap()) - .collect() - } - fn assert_run(res: Result, expected: Expect, require: Vec<&str>) { let expectation_held: bool = match expected { Expect::Pass => res.is_ok(), @@ -378,8 +399,6 @@ mod tests { } use super::*; - use std::io::BufReader; - use std::io::BufRead; use std::path::PathBuf; use std::env; @@ -567,7 +586,7 @@ mod tests { fn partition_instantiable_attributes() { let nix = nix(); - let ret: (Vec, Vec) = nix.safely_partition_instantiable_attrs( + let ret: (Vec, Vec<(String, Vec)>) = nix.safely_partition_instantiable_attrs( individual_eval_path().as_path(), "default.nix", vec![ @@ -578,7 +597,12 @@ mod tests { ); assert_eq!(ret.0, vec!["passes-instantiation"]); - assert_eq!(ret.1, vec!["fails-instantiation", "missing-attr"]); + + assert_eq!(ret.1[0].0, "fails-instantiation"); + assert_eq!(ret.1[0].1[0], "trace: You just can\'t frooble the frozz on this particular system."); + + assert_eq!(ret.1[1].0, "missing-attr"); + assert_eq!(ret.1[1].1[0], "error: attribute ‘missing-attr’ in selection path ‘missing-attr’ not found"); } #[test] diff --git a/ofborg/src/tasks/build.rs b/ofborg/src/tasks/build.rs index d8784de..0d9a6c9 100644 --- a/ofborg/src/tasks/build.rs +++ b/ofborg/src/tasks/build.rs @@ -342,12 +342,22 @@ impl notifyworker::SimpleNotifyWorker for BuildWorker { job.attrs.clone(), ); + let cannot_build_attrs: Vec = cannot_build + .clone() + .into_iter() + .map(|(attr,_)| attr) + .collect(); + println!("Can build: '{}', Cannot build: '{}'", can_build.join(", "), - cannot_build.join(", ")); + cannot_build_attrs.join(", ")); + + + actions.log_started(can_build.clone(), cannot_build_attrs.clone()); + actions.log_instantiation_errors(cannot_build); if can_build.len() == 0 { - actions.build_not_attempted(cannot_build); + actions.build_not_attempted(cannot_build_attrs); return; } @@ -358,7 +368,6 @@ impl notifyworker::SimpleNotifyWorker for BuildWorker { ); println!("About to execute {:?}", cmd); - actions.log_started(can_build.clone(), cannot_build.clone()); let acmd = AsyncCmd::new(cmd); let mut spawned = acmd.spawn(); @@ -381,7 +390,7 @@ impl notifyworker::SimpleNotifyWorker for BuildWorker { let last10lines: Vec = actions.log_snippet().into_iter().collect::>(); - actions.build_finished(success, last10lines.clone(), can_build, cannot_build); + actions.build_finished(success, last10lines.clone(), can_build, cannot_build_attrs); println!("Done!"); } } @@ -541,6 +550,8 @@ mod tests { println!("Total actions: {:?}", dummyreceiver.actions.len()); let mut actions = dummyreceiver.actions.into_iter(); + assert_contains_job(&mut actions, "\"line_number\":1,\"output\":\"Cannot nix-instantiate `not-real\' because:\""); + assert_contains_job(&mut actions, "\"line_number\":2,\"output\":\"error: attribute ‘not-real’ in selection path ‘not-real’ not found\"}"); assert_contains_job(&mut actions, "skipped_attrs\":[\"not-real"); // First one to the github poster assert_contains_job(&mut actions, "skipped_attrs\":[\"not-real"); // This one to the logs assert_eq!(actions.next(), Some(worker::Action::Ack)); From d64eb491b906207fe073ac0973dccbb60a24108a Mon Sep 17 00:00:00 2001 From: Graham Christensen Date: Sun, 18 Mar 2018 16:18:49 -0400 Subject: [PATCH 06/10] fixup tests --- ofborg/src/tasks/build.rs | 1 - 1 file changed, 1 deletion(-) diff --git a/ofborg/src/tasks/build.rs b/ofborg/src/tasks/build.rs index 0d9a6c9..377b129 100644 --- a/ofborg/src/tasks/build.rs +++ b/ofborg/src/tasks/build.rs @@ -422,7 +422,6 @@ mod tests { nix, "x86_64-linux".to_owned(), "cargo-test-build".to_owned(), - true, ); return worker; From df100542d453edfaa57a21368d0bafb4da07a455 Mon Sep 17 00:00:00 2001 From: Graham Christensen Date: Sun, 18 Mar 2018 16:25:02 -0400 Subject: [PATCH 07/10] Link to the full log if there are any log lines --- ofborg/src/tasks/githubcommentposter.rs | 48 ++++++++++++++++++++++--- 1 file changed, 44 insertions(+), 4 deletions(-) diff --git a/ofborg/src/tasks/githubcommentposter.rs b/ofborg/src/tasks/githubcommentposter.rs index 306c2c4..ef50b67 100644 --- a/ofborg/src/tasks/githubcommentposter.rs +++ b/ofborg/src/tasks/githubcommentposter.rs @@ -74,15 +74,16 @@ impl worker::SimpleWorker for GitHubCommentPoster { fn result_to_comment(result: &BuildResult) -> String { let mut reply: Vec = vec![]; - let log_link = match result.success { - Some(_) => format!( + let log_link = if result.output.len() > 0 { + format!( " [(full log)](https://logs.nix.ci/?key={}/{}.{}&attempt_id={})", &result.repo.owner.to_lowercase(), &result.repo.name.to_lowercase(), result.pr.number, result.attempt_id, - ), - None => "".to_owned() + ) + } else { + "".to_owned() }; reply.push(format!( @@ -390,6 +391,45 @@ patching script interpreter paths in /nix/store/pcja75y9isdvgz5i00pkrpif9rxzxc29 #[test] pub fn test_no_attempt() { + let result = BuildResult { + repo: Repo { + clone_url: "https://github.com/nixos/nixpkgs.git".to_owned(), + full_name: "NixOS/nixpkgs".to_owned(), + owner: "NixOS".to_owned(), + name: "nixpkgs".to_owned(), + }, + pr: Pr { + head_sha: "abc123".to_owned(), + number: 2345, + target_branch: Some("master".to_owned()), + }, + output: vec!["foo".to_owned()], + attempt_id: "foo".to_owned(), + system: "x86_64-linux".to_owned(), + attempted_attrs: None, + skipped_attrs: Some(vec!["not-attempted".to_owned()]), + success: None, + }; + + assert_eq!( + &result_to_comment(&result), + "No attempt on x86_64-linux [(full log)](https://logs.nix.ci/?key=nixos/nixpkgs.2345&attempt_id=foo) + +The following builds were skipped because they don't evaluate on x86_64-linux: not-attempted + +
Partial log (click to expand)

+ +``` +foo +``` +

+ +" + ); + } + + #[test] + pub fn test_no_attempt_no_log() { let result = BuildResult { repo: Repo { clone_url: "https://github.com/nixos/nixpkgs.git".to_owned(), From ec75dba4da7c144c9435f02d211b6d7e03f55141 Mon Sep 17 00:00:00 2001 From: Graham Christensen Date: Sun, 18 Mar 2018 18:31:57 -0400 Subject: [PATCH 08/10] Pass the last 10 lines to the build-result in all cases --- ofborg/src/tasks/build.rs | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/ofborg/src/tasks/build.rs b/ofborg/src/tasks/build.rs index 377b129..b8f2c38 100644 --- a/ofborg/src/tasks/build.rs +++ b/ofborg/src/tasks/build.rs @@ -96,8 +96,11 @@ impl<'a, 'b> JobActions<'a, 'b> { }; } - pub fn log_snippet(&self) -> VecDeque { - self.snippet_log.clone() + pub fn log_snippet(&self) -> Vec { + self.snippet_log + .clone() + .into_iter() + .collect::>() } pub fn commit_missing(&mut self) { @@ -199,7 +202,7 @@ impl<'a, 'b> JobActions<'a, 'b> { repo: self.job.repo.clone(), pr: self.job.pr.clone(), system: self.system.clone(), - output: vec![], + output: self.log_snippet(), attempt_id: self.attempt_id.clone(), skipped_attrs: Some(not_attempted_attrs), attempted_attrs: None, @@ -225,7 +228,7 @@ impl<'a, 'b> JobActions<'a, 'b> { self.tell(worker::Action::Ack); } - pub fn build_finished(&mut self, success: bool, lines: Vec, + pub fn build_finished(&mut self, success: bool, attempted_attrs: Vec, not_attempted_attrs: Vec, @@ -234,7 +237,7 @@ impl<'a, 'b> JobActions<'a, 'b> { repo: self.job.repo.clone(), pr: self.job.pr.clone(), system: self.system.clone(), - output: lines, + output: self.log_snippet(), attempt_id: self.attempt_id.clone(), success: Some(success), attempted_attrs: Some(attempted_attrs), @@ -388,9 +391,8 @@ impl notifyworker::SimpleNotifyWorker for BuildWorker { actions.log_snippet().iter().inspect(|x| println!("{}", x)).last(); println!("----->8-----"); - let last10lines: Vec = actions.log_snippet().into_iter().collect::>(); - actions.build_finished(success, last10lines.clone(), can_build, cannot_build_attrs); + actions.build_finished(success, can_build, cannot_build_attrs); println!("Done!"); } } From a0e336bc02022197a7538adca4031952beb176d3 Mon Sep 17 00:00:00 2001 From: Graham Christensen Date: Sun, 18 Mar 2018 18:41:46 -0400 Subject: [PATCH 09/10] Clean up result partition --- ofborg/src/lib.rs | 13 +++++++++++++ ofborg/src/nix.rs | 15 ++------------- 2 files changed, 15 insertions(+), 13 deletions(-) diff --git a/ofborg/src/lib.rs b/ofborg/src/lib.rs index da6fd36..1d8a20c 100644 --- a/ofborg/src/lib.rs +++ b/ofborg/src/lib.rs @@ -70,6 +70,19 @@ pub mod ofborg { pub use easyamqp; pub const VERSION: &'static str = env!("CARGO_PKG_VERSION"); + + pub fn partition_result(results: Vec>) -> (Vec, Vec) { + let mut ok = Vec::new(); + let mut err = Vec::new(); + for result in results.into_iter() { + match result { + Ok(x) => { ok.push(x); } + Err(x) => { err.push(x); } + } + } + + (ok, err) + } } pub fn setup_log() { diff --git a/ofborg/src/nix.rs b/ofborg/src/nix.rs index 4f2d8cb..91b78a2 100644 --- a/ofborg/src/nix.rs +++ b/ofborg/src/nix.rs @@ -8,6 +8,7 @@ use std::process::{Command, Stdio}; use tempfile::tempfile; use std::io::BufReader; use std::io::BufRead; +use ofborg::partition_result; #[derive(Clone, Debug)] pub enum Operation { @@ -120,19 +121,7 @@ impl Nix { ) .collect(); - let (ok, err): ( - Vec)>>, - Vec)>>) = attr_instantiations - .into_iter() - .partition(|x| x.is_ok()); - - let ok_ret: Vec = ok.into_iter().map(|x| x.unwrap()).collect(); - let err_ret: Vec<(String, Vec)> = err.into_iter().map(|x| x.unwrap_err()).collect(); - - return ( - ok_ret, - err_ret - ) + partition_result(attr_instantiations) } pub fn safely_instantiate_attrs( From 38c48da6e2c23d10089689215934c3284550e600 Mon Sep 17 00:00:00 2001 From: Graham Christensen Date: Sun, 18 Mar 2018 18:42:58 -0400 Subject: [PATCH 10/10] Bump version: 0.1.4 --- nix/ofborg-carnix.nix | 12 ++++++------ ofborg/Cargo.lock | 2 +- ofborg/Cargo.toml | 2 +- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/nix/ofborg-carnix.nix b/nix/ofborg-carnix.nix index b9fc6ee..a7c3e57 100644 --- a/nix/ofborg-carnix.nix +++ b/nix/ofborg-carnix.nix @@ -45,7 +45,7 @@ let kernel = buildPlatform.parsed.kernel.name; ) [] (builtins.attrNames feat); in rec { - ofborg = f: ofborg_0_1_3 { features = ofborg_0_1_3_features { ofborg_0_1_3 = f; }; }; + ofborg = f: ofborg_0_1_4 { features = ofborg_0_1_4_features { ofborg_0_1_4 = f; }; }; aho_corasick_0_5_3_ = { dependencies?[], buildDependencies?[], features?[] }: buildRustCrate { crateName = "aho-corasick"; version = "0.5.3"; @@ -413,9 +413,9 @@ rec { sha256 = "1y6qnd9r8ga6y8mvlabdrr73nc8cshjjlzbvnanzyj9b8zzkfwk2"; inherit dependencies buildDependencies features; }; - ofborg_0_1_3_ = { dependencies?[], buildDependencies?[], features?[] }: buildRustCrate { + ofborg_0_1_4_ = { dependencies?[], buildDependencies?[], features?[] }: buildRustCrate { crateName = "ofborg"; - version = "0.1.3"; + version = "0.1.4"; authors = [ "Graham Christensen " ]; src = include [ "Cargo.toml" "Cargo.lock" "src" "test-srcs" "build.rs" ] ./../ofborg; build = "build.rs"; @@ -1342,10 +1342,10 @@ rec { libc_0_2_36.default = true; num_cpus_1_8_0.default = (f.num_cpus_1_8_0.default or true); }) [ libc_0_2_36_features ]; - ofborg_0_1_3 = { features?(ofborg_0_1_3_features {}) }: ofborg_0_1_3_ { + ofborg_0_1_4 = { features?(ofborg_0_1_4_features {}) }: ofborg_0_1_4_ { dependencies = mapFeatures features ([ amqp_0_1_0 either_1_4_0 env_logger_0_4_3 fs2_0_4_3 hubcaps_0_3_16 hyper_0_10_13 hyper_native_tls_0_2_4 log_0_3_8 lru_cache_0_1_1 md5_0_3_6 serde_1_0_27 serde_derive_1_0_27 serde_json_1_0_9 tempfile_2_2_0 uuid_0_4_0 ]); }; - ofborg_0_1_3_features = f: updateFeatures f (rec { + ofborg_0_1_4_features = f: updateFeatures f (rec { amqp_0_1_0.default = true; either_1_4_0.default = true; env_logger_0_4_3.default = true; @@ -1356,7 +1356,7 @@ rec { log_0_3_8.default = true; lru_cache_0_1_1.default = true; md5_0_3_6.default = true; - ofborg_0_1_3.default = (f.ofborg_0_1_3.default or true); + ofborg_0_1_4.default = (f.ofborg_0_1_4.default or true); serde_1_0_27.default = true; serde_derive_1_0_27.default = true; serde_json_1_0_9.default = true; diff --git a/ofborg/Cargo.lock b/ofborg/Cargo.lock index 8d8e92d..dc6f1ed 100644 --- a/ofborg/Cargo.lock +++ b/ofborg/Cargo.lock @@ -379,7 +379,7 @@ dependencies = [ [[package]] name = "ofborg" -version = "0.1.2" +version = "0.1.4" dependencies = [ "amqp 0.1.0 (git+https://github.com/grahamc/rust-amqp.git)", "either 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", diff --git a/ofborg/Cargo.toml b/ofborg/Cargo.toml index 19aa7b3..628219f 100644 --- a/ofborg/Cargo.toml +++ b/ofborg/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "ofborg" -version = "0.1.3" +version = "0.1.4" authors = ["Graham Christensen "] include = ["Cargo.toml", "Cargo.lock", "src", "test-srcs", "build.rs"] build = "build.rs"