Skip to content
This repository was archived by the owner on Apr 12, 2021. It is now read-only.
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: NixOS/nixpkgs-channels
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 81884ce1b465
Choose a base ref
...
head repository: NixOS/nixpkgs-channels
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: bc7ec9b65187
Choose a head ref
  • 6 commits
  • 4 files changed
  • 3 contributors

Commits on Sep 18, 2018

  1. prometheus-json-exporter: 2016-09-13 -> 2017-10-06

    (cherry picked from commit b712736)
    WilliButz authored and globin committed Sep 18, 2018

    Verified

    This commit was signed with the committer’s verified signature. The key has expired.
    globin Robin Gloster
    Copy the full SHA
    ef7921a View commit details
  2. prometheus-json-exporter: add patch to support bool parsing

    (cherry picked from commit b59cd2b)
    WilliButz authored and globin committed Sep 18, 2018

    Verified

    This commit was signed with the committer’s verified signature. The key has expired.
    globin Robin Gloster
    Copy the full SHA
    6ffa699 View commit details
  3. stdenv: Validate meta.outputsToInstall

    If meta.outputsToInstall is set to include absent outputs, various
    tools break including channel updates and nix-env.
    
        grahamc@Morbo> nix-env -i -f . -A elf-header-real
        installing 'elf-header'
        error: this derivation has bad 'meta.outputsToInstall'
    
    This patch verifies each value in meta.outputsToInstall is a valid
    output. It validates this condition only if checkMeta is true.
    
        grahamc@Morbo> nix-build . -A elf-header-real
        error: Package ‘elf-header’ in /home/grahamc/projects/nixpkgs/pkgs/development/libraries/elf-header/default.nix:36 has invalid meta.outputsToInstall, refusing to evaluate.
    
        The package elf-header has set meta.outputsToInstall to: bin
    
        however elf-header only has the outputs: out
    
        and is missing the following ouputs:
    
          - bin
    
        (use '--show-trace' to show detailed location information)
    
    Note, now the nix-env experience is decidedly worse for users who have
    checkMeta set to true:
    
        grahamc@Morbo> nix-env -i -f . -A elf-header-real; echo $?
        0
    
    though since this is already an issue for unfree, broken, unsupported,
    and insecure validity problems I'm not sure we should do something
    different here.
    
    (cherry picked from commit b80c9ce)
    grahamc committed Sep 18, 2018

    Verified

    This commit was signed with the committer’s verified signature. The key has expired.
    grahamc Graham Christensen
    Copy the full SHA
    da5fd39 View commit details
  4. elf-header-real: fixup outputsToInstall

    (cherry picked from commit 301109a)
    grahamc committed Sep 18, 2018

    Verified

    This commit was signed with the committer’s verified signature. The key has expired.
    grahamc Graham Christensen
    Copy the full SHA
    24ad8ad View commit details
  5. Merge pull request #46838 from grahamc/check-outputs-in-meta-18.09

    stdenv: Validate meta.outputsToInstall
    grahamc authored Sep 18, 2018

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    374d22d View commit details
  6. nixos/release.nix: disable tests.ec2-config (#46830)

    This test doesn't work in a sandbox and never succeeded on Hydra.
    It simulates an EC2 instance reconfiguring itself at runtime,
    which needs network access.
    
    (cherry picked from commit a83d61b)
    xeji committed Sep 18, 2018
    Copy the full SHA
    bc7ec9b View commit details
Showing with 40 additions and 8 deletions.
  1. +2 −1 nixos/release.nix
  2. +1 −0 pkgs/development/libraries/elf-header/default.nix
  3. +12 −7 pkgs/servers/monitoring/prometheus/json-exporter.nix
  4. +25 −0 pkgs/stdenv/generic/check-meta.nix
3 changes: 2 additions & 1 deletion nixos/release.nix
Original file line number Diff line number Diff line change
@@ -284,7 +284,8 @@ in rec {
tests.ecryptfs = callTest tests/ecryptfs.nix {};
tests.etcd = callTestOnMatchingSystems ["x86_64-linux"] tests/etcd.nix {};
tests.ec2-nixops = (callSubTestsOnMatchingSystems ["x86_64-linux"] tests/ec2.nix {}).boot-ec2-nixops or {};
tests.ec2-config = (callSubTestsOnMatchingSystems ["x86_64-linux"] tests/ec2.nix {}).boot-ec2-config or {};
# ec2-config doesn't work in a sandbox as the simulated ec2 instance needs network access
#tests.ec2-config = (callSubTestsOnMatchingSystems ["x86_64-linux"] tests/ec2.nix {}).boot-ec2-config or {};
tests.elk = callSubTestsOnMatchingSystems ["x86_64-linux"] tests/elk.nix {};
tests.env = callTest tests/env.nix {};
tests.ferm = callTest tests/ferm.nix {};
1 change: 1 addition & 0 deletions pkgs/development/libraries/elf-header/default.nix
Original file line number Diff line number Diff line change
@@ -32,6 +32,7 @@ stdenvNoCC.mkDerivation {
'';

meta = libc.meta // {
outputsToInstall = [ "out" ];
description = "The datastructures of ELF according to the target platform's libc";
longDescription = ''
The Executable and Linkable Format (ELF, formerly named Extensible Linking
19 changes: 12 additions & 7 deletions pkgs/servers/monitoring/prometheus/json-exporter.nix
Original file line number Diff line number Diff line change
@@ -1,25 +1,30 @@
# This file was generated by go2nix.
{ buildGoPackage, fetchFromGitHub, lib }:
{ buildGoPackage, fetchFromGitHub, fetchpatch, lib }:

buildGoPackage rec {
name = "prometheus-json-exporter-${version}";
version = "unstable-2016-09-13";
rev = "d45e5ebdb08cb734ad7a8683966032af1d91a76c";
version = "unstable-2017-10-06";

goPackagePath = "github.com/kawamuray/prometheus-json-exporter";

src = fetchFromGitHub {
inherit rev;
owner = "kawamuray";
repo = "prometheus-json-exporter";
sha256 = "0v3as7gakdqpsir97byknsrqxxxkq66hp23j4cscs45hsdb24pi9";
rev = "51e3dc02a30ab818bb73e5c98c3853231c2dbb5f";
sha256 = "1v1p4zcqnb3d3rm55r695ydn61h6gz95f55cpa22hzw18dasahdh";
};

goDeps = ./json-exporter_deps.nix;

meta = {
patches = [(fetchpatch { # adds bool support
url = "https://patch-diff.githubusercontent.com/raw/kawamuray/prometheus-json-exporter/pull/17.patch";
sha256 = "0mc5axhd2bykci41dgswl4r1552d70jsmb17lbih7czhsy6rgmrm";
})];

meta = with lib; {
description = "A prometheus exporter which scrapes remote JSON by JSONPath";
homepage = https://github.com/kawamuray/prometheus-json-exporter;
license = lib.licenses.asl20;
license = licenses.asl20;
maintainers = with maintainers; [ willibutz ];
};
}
25 changes: 25 additions & 0 deletions pkgs/stdenv/generic/check-meta.nix
Original file line number Diff line number Diff line change
@@ -81,6 +81,7 @@ let
unsupported = remediate_whitelist "UnsupportedSystem";
blacklisted = x: "";
insecure = remediate_insecure;
broken-outputs = remediateOutputsToInstall;
unknown-meta = x: "";
};
remediate_whitelist = allow_attr: attrs:
@@ -125,6 +126,20 @@ let
'';

remediateOutputsToInstall = attrs: let
expectedOutputs = attrs.meta.outputsToInstall or [];
actualOutputs = attrs.outputs or [ "out" ];
missingOutputs = builtins.filter (output: ! builtins.elem output actualOutputs) expectedOutputs;
in ''
The package ${attrs.name} has set meta.outputsToInstall to: ${builtins.concatStringsSep ", " expectedOutputs}
however ${attrs.name} only has the outputs: ${builtins.concatStringsSep ", " actualOutputs}
and is missing the following ouputs:
${lib.concatStrings (builtins.map (output: " - ${output}\n") missingOutputs)}
'';

handleEvalIssue = attrs: { reason , errormsg ? "" }:
let
msg = ''
@@ -185,6 +200,14 @@ let
in anyMatch (attrs.meta.platforms or lib.platforms.all) &&
! anyMatch (attrs.meta.badPlatforms or []);

checkOutputsToInstall = attrs: let
expectedOutputs = attrs.meta.outputsToInstall or [];
actualOutputs = attrs.outputs or [ "out" ];
missingOutputs = builtins.filter (output: ! builtins.elem output actualOutputs) expectedOutputs;
in if shouldCheckMeta
then builtins.length missingOutputs > 0
else false;

# Check if a derivation is valid, that is whether it passes checks for
# e.g brokenness or license.
#
@@ -202,6 +225,8 @@ let
{ valid = false; reason = "unsupported"; errormsg = "is not supported on ‘${hostPlatform.config}’"; }
else if !(hasAllowedInsecure attrs) then
{ valid = false; reason = "insecure"; errormsg = "is marked as insecure"; }
else if checkOutputsToInstall attrs then
{ valid = false; reason = "broken-outputs"; errormsg = "has invalid meta.outputsToInstall"; }
else let res = checkMeta (attrs.meta or {}); in if res != [] then
{ valid = false; reason = "unknown-meta"; errormsg = "has an invalid meta attrset:${lib.concatMapStrings (x: "\n\t - " + x) res}"; }
else { valid = true; };