Merge pull request #162 from LnL7/update-nixpkgs
nixpkgs: 2018-02-23 -> 2018-04-11
This commit is contained in:
commit
45c727cbfa
|
@ -2,5 +2,6 @@ language: nix
|
|||
matrix:
|
||||
include:
|
||||
- script:
|
||||
- nix-shell --run 'cd ofborg && cargo test --lib -- --nocapture'
|
||||
- nix-shell --run 'cd ofborg && cargo test --lib -- --nocapture' --arg useNix1 true
|
||||
- nix-shell --run checkPhase
|
||||
- nix-shell --run checkPhase --arg useNix1 true
|
||||
- nix-build -A ofborg.rs
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
{
|
||||
"url": "https://github.com/nixos/nixpkgs-channels.git",
|
||||
"rev": "c2fbd472a4ebaae739257a3df93aef25f19dd04f",
|
||||
"date": "2018-02-23T08:08:30+00:00",
|
||||
"sha256": "07mir6nqb98mbykabppgj4dli66h18qsyi4zqp640x22k6bkp2vp",
|
||||
"rev": "2e855dc6b0cd88767a8a5df2faff9e66e1cd7f18",
|
||||
"date": "2018-04-11T10:16:39+08:00",
|
||||
"sha256": "08s6mfh5a05kd2qs3hmza50ng3pyhd3qha4nanwwk0s8fjzqnv4a",
|
||||
"fetchSubmodules": true
|
||||
}
|
||||
|
|
|
@ -518,24 +518,27 @@ impl MetricCollector {
|
|||
.map(|mtype| {
|
||||
let fields: Vec<String> = mtype.enum_field_names();
|
||||
|
||||
let variant_match: String;
|
||||
if fields.len() > 0 {
|
||||
variant_match = format!("{}({})", &mtype.variant(), fields.join(", "));
|
||||
let variant_match = if fields.len() > 0 {
|
||||
format!("{}({})", &mtype.variant(), fields.join(", "))
|
||||
} 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!("
|
||||
Event::{} => {{
|
||||
let mut accum_table = self.{}
|
||||
.lock()
|
||||
.expect(\"Failed to unwrap metric mutex for {}\");
|
||||
let accum = accum_table
|
||||
.entry(({}))
|
||||
.entry({})
|
||||
.or_insert(0);
|
||||
*accum += {};
|
||||
}}
|
||||
|
@ -543,7 +546,7 @@ impl MetricCollector {
|
|||
variant_match,
|
||||
&mtype.metric_name(),
|
||||
&mtype.metric_name(),
|
||||
index_fields.join(", "),
|
||||
index_fields,
|
||||
&mtype.record_value(),
|
||||
)
|
||||
}).collect();
|
||||
|
|
12
shell.nix
12
shell.nix
|
@ -15,7 +15,7 @@ let
|
|||
curl
|
||||
bash
|
||||
]
|
||||
++ stdenv.lib.optional useNix1 nix;
|
||||
++ stdenv.lib.optional useNix1 nix1;
|
||||
|
||||
# HISTFILE = "${src}/.bash_hist";
|
||||
};
|
||||
|
@ -32,10 +32,18 @@ let
|
|||
pkgconfig
|
||||
git
|
||||
]
|
||||
++ stdenv.lib.optional useNix1 nix
|
||||
++ stdenv.lib.optional useNix1 nix1
|
||||
++ stdenv.lib.optional stdenv.isDarwin pkgs.darwin.Security;
|
||||
|
||||
postHook = ''
|
||||
checkPhase() {
|
||||
( cd "${builtins.toString ./.}/ofborg" && cargo test --lib )
|
||||
}
|
||||
'';
|
||||
|
||||
HISTFILE = "${toString ./.}/.bash_hist";
|
||||
RUSTFLAGS = "-D warnings";
|
||||
|
||||
passthru.phpEnv = phpEnv;
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in a new issue