Merge pull request #162 from LnL7/update-nixpkgs

nixpkgs: 2018-02-23 -> 2018-04-11
This commit is contained in:
Graham Christensen 2018-05-03 21:49:33 -04:00 committed by GitHub
commit 45c727cbfa
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 29 additions and 17 deletions

View file

@ -2,5 +2,6 @@ language: nix
matrix: matrix:
include: include:
- script: - script:
- nix-shell --run 'cd ofborg && cargo test --lib -- --nocapture' - nix-shell --run checkPhase
- nix-shell --run 'cd ofborg && cargo test --lib -- --nocapture' --arg useNix1 true - nix-shell --run checkPhase --arg useNix1 true
- nix-build -A ofborg.rs

View file

@ -1,7 +1,7 @@
{ {
"url": "https://github.com/nixos/nixpkgs-channels.git", "url": "https://github.com/nixos/nixpkgs-channels.git",
"rev": "c2fbd472a4ebaae739257a3df93aef25f19dd04f", "rev": "2e855dc6b0cd88767a8a5df2faff9e66e1cd7f18",
"date": "2018-02-23T08:08:30+00:00", "date": "2018-04-11T10:16:39+08:00",
"sha256": "07mir6nqb98mbykabppgj4dli66h18qsyi4zqp640x22k6bkp2vp", "sha256": "08s6mfh5a05kd2qs3hmza50ng3pyhd3qha4nanwwk0s8fjzqnv4a",
"fetchSubmodules": true "fetchSubmodules": true
} }

View file

@ -518,24 +518,27 @@ impl MetricCollector {
.map(|mtype| { .map(|mtype| {
let fields: Vec<String> = mtype.enum_field_names(); let fields: Vec<String> = mtype.enum_field_names();
let variant_match: String; let variant_match = if fields.len() > 0 {
if fields.len() > 0 { format!("{}({})", &mtype.variant(), fields.join(", "))
variant_match = format!("{}({})", &mtype.variant(), fields.join(", "));
} else { } else {
variant_match = format!("{}", &mtype.variant()); format!("{}", &mtype.variant())
};
let mut index_names: Vec<String> = mtype.enum_index_names();
index_names.push("instance".to_owned());
let mut index_fields = index_names.join(", ");
if index_names.len() > 1 {
index_fields = format!("({})", index_fields);
} }
let mut index_fields: Vec<String> = mtype.enum_index_names();
index_fields.push("instance".to_owned());
format!(" format!("
Event::{} => {{ Event::{} => {{
let mut accum_table = self.{} let mut accum_table = self.{}
.lock() .lock()
.expect(\"Failed to unwrap metric mutex for {}\"); .expect(\"Failed to unwrap metric mutex for {}\");
let accum = accum_table let accum = accum_table
.entry(({})) .entry({})
.or_insert(0); .or_insert(0);
*accum += {}; *accum += {};
}} }}
@ -543,7 +546,7 @@ impl MetricCollector {
variant_match, variant_match,
&mtype.metric_name(), &mtype.metric_name(),
&mtype.metric_name(), &mtype.metric_name(),
index_fields.join(", "), index_fields,
&mtype.record_value(), &mtype.record_value(),
) )
}).collect(); }).collect();

View file

@ -15,7 +15,7 @@ let
curl curl
bash bash
] ]
++ stdenv.lib.optional useNix1 nix; ++ stdenv.lib.optional useNix1 nix1;
# HISTFILE = "${src}/.bash_hist"; # HISTFILE = "${src}/.bash_hist";
}; };
@ -32,10 +32,18 @@ let
pkgconfig pkgconfig
git git
] ]
++ stdenv.lib.optional useNix1 nix ++ stdenv.lib.optional useNix1 nix1
++ stdenv.lib.optional stdenv.isDarwin pkgs.darwin.Security; ++ stdenv.lib.optional stdenv.isDarwin pkgs.darwin.Security;
postHook = ''
checkPhase() {
( cd "${builtins.toString ./.}/ofborg" && cargo test --lib )
}
'';
HISTFILE = "${toString ./.}/.bash_hist"; HISTFILE = "${toString ./.}/.bash_hist";
RUSTFLAGS = "-D warnings";
passthru.phpEnv = phpEnv; passthru.phpEnv = phpEnv;
}; };