Merge branch 'master' into staging

This commit is contained in:
Vladimír Čunát 2017-10-30 22:30:14 +01:00
commit 687943763c
No known key found for this signature in database
GPG Key ID: E747DF1F9575A3AA
34 changed files with 605 additions and 202 deletions

4
.github/CODEOWNERS vendored
View File

@ -34,6 +34,10 @@ pkgs/development/haskell-modules/hoogle.nix @peti
pkgs/applications/science/math/R @peti
pkgs/development/r-modules @peti
# Ruby
pkgs/development/interpreters/ruby/* @zimbatm
pkgs/development/ruby-modules/* @zimbatm
# Darwin-related
/pkgs/stdenv/darwin/ @org/darwin-maintainers
/pkgs/os-specific/darwin/ @org/darwin-maintainers

View File

@ -288,8 +288,17 @@ rec {
}).config;
getSubOptions = prefix: (evalModules
{ modules = opts'; inherit prefix;
# FIXME: hack to get shit to evaluate.
args = { name = ""; }; }).options;
# This is a work-around due to the fact that some sub-modules,
# such as the one included in an attribute set, expects a "args"
# attribute to be given to the sub-module. As the option
# evaluation does not have any specific attribute name, we
# provide a default one for the documentation.
#
# This is mandatory as some option declaration might use the
# "name" attribute given as argument of the submodule and use it
# as the default of option declarations.
args.name = "<name>";
}).options;
getSubModules = opts';
substSubModules = m: submodule m;
functor = (defaultFunctor name) // {

View File

@ -89,8 +89,5 @@ services.nginx = {
};
}
</programlisting>
<para>At the moment you still have to restart Nginx after the ACME
certs arrive.</para>
</section>
</chapter>

View File

@ -572,7 +572,7 @@ in {
rm -rf ${cfg.statePath}/config ${cfg.statePath}/shell/hooks
mkdir -p ${cfg.statePath}/config
tr -dc A-Za-z0-9 < /dev/urandom | head -c 32 > ${cfg.statePath}/config/gitlab_shell_secret
${pkgs.openssl}/bin/openssl rand -hex 32 > ${cfg.statePath}/config/gitlab_shell_secret
# The uploads directory is hardcoded somewhere deep in rails. It is
# symlinked in the gitlab package to /run/gitlab/uploads to make it
@ -619,7 +619,7 @@ in {
fi
# enable required pg_trgm extension for gitlab
${pkgs.sudo}/bin/sudo -u ${pgSuperUser} psql gitlab -c "CREATE EXTENSION IF NOT EXISTS pg_trgm"
${pkgs.sudo}/bin/sudo -u ${pgSuperUser} psql ${cfg.databaseName} -c "CREATE EXTENSION IF NOT EXISTS pg_trgm"
# Always do the db migrations just to be sure the database is up-to-date
${gitlab-rake}/bin/gitlab-rake db:migrate RAILS_ENV=production
@ -634,7 +634,7 @@ in {
# The gitlab:shell:create_hooks task seems broken for fixing links
# so we instead delete all the hooks and create them anew
rm ${cfg.statePath}/repositories/**/*.git/hooks
rm -f ${cfg.statePath}/repositories/**/*.git/hooks
${gitlab-rake}/bin/gitlab-rake gitlab:shell:create_hooks RAILS_ENV=production
# Change permissions in the last step because some of the

View File

@ -125,6 +125,8 @@ in
"getty@tty1.service"
];
systemd.services."getty@tty1".enable = false;
systemd.services.display-manager.conflicts = [ "getty@tty1.service" ];
systemd.services.display-manager.serviceConfig = {
# Restart = "always"; - already defined in xserver.nix
KillMode = "mixed";

View File

@ -93,6 +93,7 @@ let
after = [ "network-pre.target" "systemd-udevd.service" "systemd-sysctl.service" ];
before = [ "network.target" "shutdown.target" ];
wants = [ "network.target" ];
partOf = map (i: "network-addresses-${i.name}.service") interfaces;
conflicts = [ "shutdown.target" ];
wantedBy = [ "multi-user.target" ] ++ optional hasDefaultGatewaySet "network-online.target";
@ -171,8 +172,6 @@ let
"network-link-${i.name}.service"
"network.target"
];
# propagate stop and reload from network-setup
partOf = [ "network-setup.service" ];
# order before network-setup because the routes that are configured
# there may need ip addresses configured
before = [ "network-setup.service" ];

View File

@ -23,6 +23,11 @@ stdenv.mkDerivation rec {
buildInputs = [ libX11 imlib2 giflib libexif ];
postInstall = ''
mkdir -p $out/share/applications/
cp -v sxiv.desktop $out/share/applications/
'';
meta = {
description = "Simple X Image Viewer";
homepage = https://github.com/muennich/sxiv;

View File

@ -54,6 +54,7 @@ stdenv.mkDerivation rec {
'';
meta = with stdenv.lib; {
broken = true;
description = "An extensible Twitter client";
homepage = https://mikutter.hachune.net;
maintainers = with maintainers; [ midchildan ];

View File

@ -14,12 +14,21 @@ stdenv.mkDerivation rec {
buildInputs = [ gmp readline libX11 libpthreadstubs tex perl ];
configureScript = "./Configure";
configureFlags =
"--mt=pthread" +
"--with-gmp=${gmp.dev} " +
"--with-readline=${readline.dev}";
configureFlags = [
"--mt=pthread"
"--with-gmp=${gmp.dev}"
"--with-readline=${readline.dev}"
] ++ stdenv.lib.optional stdenv.isDarwin "--host=x86_64-darwin";
makeFlags = "all";
preConfigure = ''
export LD=$CC
'';
postConfigure = stdenv.lib.optionalString stdenv.isDarwin ''
echo 'echo x86_64-darwin' > config/arch-osname
'';
makeFlags = [ "all" ];
meta = with stdenv.lib; {
description = "Computer algebra system for high-performance number theory computations";
@ -36,12 +45,12 @@ stdenv.mkDerivation rec {
Bordeaux I, France), PARI is now under the GPL and maintained by Karim
Belabas with the help of many volunteer contributors.
- PARI is a C library, allowing fast computations.
- PARI is a C library, allowing fast computations.
- gp is an easy-to-use interactive shell giving access to the
PARI functions.
- GP is the name of gp's scripting language.
- gp2c, the GP-to-C compiler, combines the best of both worlds
by compiling GP scripts to the C language and transparently loading
- gp2c, the GP-to-C compiler, combines the best of both worlds
by compiling GP scripts to the C language and transparently loading
the resulting functions into gp. (gp2c-compiled scripts will typically
run 3 or 4 times faster.) gp2c currently only understands a subset
of the GP language.
@ -50,7 +59,7 @@ stdenv.mkDerivation rec {
downloadPage = "http://pari.math.u-bordeaux.fr/download.html";
license = licenses.gpl2Plus;
maintainers = with maintainers; [ ertes raskin AndersonTorres ];
platforms = platforms.linux;
platforms = platforms.linux ++ platforms.darwin;
updateWalker = true;
};
}

View File

@ -58,6 +58,8 @@ rec {
# support for bugzilla
git-bz = callPackage ./git-bz { };
git-codeowners = callPackage ./git-codeowners { };
git-cola = callPackage ./git-cola { };
git-crypt = callPackage ./git-crypt { };

View File

@ -0,0 +1,21 @@
{ lib, rustPlatform, fetchFromGitHub }:
rustPlatform.buildRustPackage rec {
name = "git-codeowners-${version}";
version = "0.1.1";
src = fetchFromGitHub {
owner = "softprops";
repo = "git-codeowners";
rev = "v${version}";
sha256 = "0imxbi6y1165bi2rik0n98v79fkgp8alb615qh41idg1p2krzyy5";
};
cargoSha256 = "0h831rf5vlvpzfm4sr3fvwlc0ys776fqis90y414mczphkxvz437";
meta = with lib; {
homepage = "https://github.com/softprops/git-codeowners";
description = "a git extension to work with CODEOWNERS files";
license = licenses.mit;
maintainers = with maintainers; [ zimbatm ];
};
}

View File

@ -1,7 +0,0 @@
source $stdenv/setup
loginpage=`curl --insecure -s -L -b cookies.txt "$url"`
[[ $loginpage =~ form[^\>]+action=\"([^\"]+)\" ]] && loginurl=${BASH_REMATCH[1]}
curl --insecure -s --output "$out" -L -b cookies.txt --data "appleId=${adc_user}&accountPassword=${adc_pass}" "https://idmsa.apple.com/IDMSWebAuth/${loginurl}"

View File

@ -1,36 +0,0 @@
{ stdenv, curl, adc_user, adc_pass }:
{ # Path to fetch.
path
# Hash of the downloaded file
, sha256
, # Additional curl options needed for the download to succeed.
curlOpts ? ""
, # Name of the file. If empty, use the basename of `path'.
name ? ""
}:
stdenv.mkDerivation {
url = "https://developer.apple.com/downloads/download.action?path=${path}";
name = if name != "" then name else baseNameOf path;
builder = ./builder.sh;
buildInputs = [ curl ];
meta = {
# Password-guarded files from ADC are certainly unfree, as far as we're concerned!
license = stdenv.lib.licenses.unfree;
};
outputHashAlgo = "sha256";
outputHash = sha256;
outputHashMode = "flat";
inherit curlOpts adc_user adc_pass;
preferLocalBuild = true;
}

View File

@ -4,13 +4,13 @@ let
let
components = lib.splitString "#" version;
hash = lib.last components;
ver = if builtins.length components == 1 then version else hash;
ver = if builtins.length components == 1 then (cleanName version) else hash;
in ver;
bowerName = name: lib.replaceStrings ["/"] ["-"] name;
cleanName = name: lib.replaceStrings ["/" ":"] ["-" "-"] name;
fetchbower = name: version: target: outputHash: stdenv.mkDerivation {
name = "${bowerName name}-${bowerVersion version}";
name = "${cleanName name}-${bowerVersion version}";
SSL_CERT_FILE = "${cacert}/etc/ssl/certs/ca-bundle.crt";
buildCommand = ''
fetch-bower --quiet --out=$PWD/out "${name}" "${target}" "${version}"

View File

@ -1,10 +0,0 @@
runCommand: git: repository: branch:
import (runCommand "head-revision"
{ buildInputs = [ git ];
dummy = builtins.currentTime;
}
''
rev=$(git ls-remote ${repository} | grep "refs/${branch}$" | awk '{ print $1 }')
echo "[ \"$rev\" ]" > $out
echo Latest revision in ${branch} is $rev
'')

View File

@ -10,7 +10,7 @@
installIdrisLib () {
if [ -d $1/lib/${idris.name} ]; then
ln -sv $1/lib/${idris.name}/* $out/lib/${idris.name}
ln -fsv $1/lib/${idris.name}/* $out/lib/${idris.name}
fi
}
@ -34,7 +34,7 @@
'';
buildPhase = ''
gcc -O3 -o idris idris.c
$CC -O3 -o idris idris.c
'';
installPhase = ''

View File

@ -326,17 +326,17 @@ let
in {
php56 = generic {
version = "5.6.31";
sha256 = "03xixkvfp64bqp97p8vlj3hp63bpjw7hc16b7fgm7w35rdlp2fcg";
version = "5.6.32";
sha256 = "0lfbmdkvijkm6xc4p9sykv66y8xwhws0vsmka8v5cax4bxx4xr1y";
};
php70 = generic {
version = "7.0.24";
sha256 = "06fgpljz6xpxxkpf4cv9rqz8g504l9ikbw5aq0hqh5sgd611kycv";
version = "7.0.25";
sha256 = "09fc2lj447phprvilvq2sb6n0r1snj142f8faphrd896s6b4v8lm";
};
php71 = generic {
version = "7.1.9";
sha256 = "1blvzm2js8mrdbmwks0v6nlb5wj4789ixzmlxm1l8z6xvw8cqk9i";
version = "7.1.11";
sha256 = "0ww5493w8w3jlks0xqlfm3v6mm53vpnv5vjy63inkj8zf3gdfikn";
};
}

View File

@ -1,4 +1,4 @@
{pkgs, system, nodejs}:
{pkgs, system, nodejs, stdenv}:
let
nodePackages = import ./composition-v4.nix {
@ -43,7 +43,7 @@ nodePackages // {
buildInputs = oldAttrs.buildInputs ++ [ pkgs.makeWrapper ];
postInstall = ''
for prog in bower2nix fetch-bower; do
wrapProgram "$out/bin/$prog" --prefix PATH : "${pkgs.git}/bin"
wrapProgram "$out/bin/$prog" --prefix PATH : ${stdenv.lib.makeBinPath [ pkgs.git pkgs.nix ]}
done
'';
});

View File

@ -1,4 +1,4 @@
{pkgs, system, nodejs}:
{pkgs, system, nodejs, stdenv}:
let
nodePackages = import ./composition-v6.nix {
@ -41,7 +41,7 @@ nodePackages // {
buildInputs = oldAttrs.buildInputs ++ [ pkgs.makeWrapper ];
postInstall = ''
for prog in bower2nix fetch-bower; do
wrapProgram "$out/bin/$prog" --prefix PATH : "${pkgs.git}/bin"
wrapProgram "$out/bin/$prog" --prefix PATH : ${stdenv.lib.makeBinPath [ pkgs.git pkgs.nix ]}
done
'';
});

View File

@ -8,6 +8,7 @@
, cython
, dateutil
, scipy
, moto
, numexpr
, pytz
, xlrd
@ -27,12 +28,12 @@ let
inherit (stdenv) isDarwin;
in buildPythonPackage rec {
pname = "pandas";
version = "0.20.3";
version = "0.21.0";
name = "${pname}-${version}";
src = fetchPypi {
inherit pname version;
sha256 = "a777e07633d83d546c55706420179551c8e01075b53c497dcf8ae4036766bc66";
sha256 = "0nf50ls2cnlsd2635nyji7l70xc91dw81qg5y01g5sifwwqcpmaw";
};
LC_ALL = "en_US.UTF-8";
@ -64,6 +65,7 @@ in buildPythonPackage rec {
"['pandas/src/klib', 'pandas/src', '$cpp_sdk']"
'';
checkInputs = [ moto ];
checkPhase = ''
runHook preCheck
''

View File

@ -52,12 +52,12 @@ rec {
};
gradle_latest = gradleGen rec {
name = "gradle-4.2.1";
name = "gradle-4.3";
nativeVersion = "0.14";
src = fetchurl {
url = "http://services.gradle.org/distributions/${name}-bin.zip";
sha256 = "1h7v133rm81jf0bgv9mgvydl7rgh4430dnsfs66wflfay82cqldm";
sha256 = "0k358y18pp2809kn5il4kv3qvlqrbwmy276bbm3mnmwjxx7g9jwd";
};
};

View File

@ -2,11 +2,11 @@
stdenv.mkDerivation rec {
name = "jenkins-${version}";
version = "2.86";
version = "2.87";
src = fetchurl {
url = "http://mirrors.jenkins-ci.org/war/${version}/jenkins.war";
sha256 = "198fcj2wkz8qxawk3mq29kwl51pxlbd7ivndcpvdvg42g0caqyi0";
sha256 = "1nzs9nn1nr2jav59v1xj39rzmrh1zmwaqnpaiqsll8kixkr9rb8f";
};
buildCommand = ''

View File

@ -6,11 +6,11 @@ in
stdenv.mkDerivation {
name = "camlp5${if transitional then "_transitional" else ""}-7.02";
name = "camlp5${if transitional then "_transitional" else ""}-7.03";
src = fetchzip {
url = https://github.com/camlp5/camlp5/archive/rel702.tar.gz;
sha256 = "1m2d55zrgllidhgslvzgmr27f56qzdahz2sv56bvjs3bg7grmhnc";
url = https://github.com/camlp5/camlp5/archive/rel703.tar.gz;
sha256 = "0bwzhp4qjypfa0x8drp8w434dfixm1nzrm6pcy9s5akpmqvb50a8";
};
buildInputs = [ ocaml ];

View File

@ -0,0 +1,54 @@
From c21cc756b69a5f33c8a7758b746a816f40f55932 Mon Sep 17 00:00:00 2001
From: Leon Isenberg <ljli@users.noreply.github.com>
Date: Sat, 28 Oct 2017 17:58:17 +0200
Subject: [PATCH] nix customization: patchelf installed binaries
---
src/rustup-dist/src/component/package.rs | 24 +++++++++++++++++++++++-
1 file changed, 23 insertions(+), 1 deletion(-)
diff --git a/src/rustup-dist/src/component/package.rs b/src/rustup-dist/src/component/package.rs
index 8aa63db9..4d219826 100644
--- a/src/rustup-dist/src/component/package.rs
+++ b/src/rustup-dist/src/component/package.rs
@@ -99,7 +99,13 @@ impl Package for DirectoryPackage {
let src_path = root.join(&path);
match &*part.0 {
- "file" => try!(builder.copy_file(path.clone(), &src_path)),
+ "file" => {
+ try!(builder.copy_file(path.clone(), &src_path));
+ nix_patchelf_if_needed(
+ &target.prefix().path().join(path.clone()),
+ &src_path,
+ )
+ }
"dir" => try!(builder.copy_dir(path.clone(), &src_path)),
_ => return Err(ErrorKind::CorruptComponent(name.to_owned()).into()),
}
@@ -117,6 +123,22 @@ impl Package for DirectoryPackage {
}
}
+fn nix_patchelf_if_needed(dest_path: &Path, src_path: &Path) {
+ let is_bin = if let Some(p) = src_path.parent() {
+ p.ends_with("bin")
+ } else {
+ false
+ };
+
+ if is_bin {
+ let _ = ::std::process::Command::new("@patchelf@/bin/patchelf")
+ .arg("--set-interpreter")
+ .arg("@dynamicLinker@")
+ .arg(dest_path)
+ .output();
+ }
+}
+
// On Unix we need to set up the file permissions correctly so
// binaries are executable and directories readable. This shouldn't be
// necessary: the source files *should* have the right permissions,
--
2.14.1

View File

@ -1,75 +0,0 @@
From 36c053f37670c6003f9e8dc001741f7c49e9526a Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?J=C3=B6rg=20Thalheim?= <joerg@thalheim.io>
Date: Sat, 15 Apr 2017 20:42:10 +0200
Subject: [PATCH] use hardcoded dynamic-linker
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Signed-off-by: Jörg Thalheim <joerg@thalheim.io>
---
src/rustup-cli/common.rs | 3 ++-
src/rustup/toolchain.rs | 22 ++++++++++++++++++++--
2 files changed, 22 insertions(+), 3 deletions(-)
diff --git a/src/rustup-cli/common.rs b/src/rustup-cli/common.rs
index 1abf345..21096e7 100644
--- a/src/rustup-cli/common.rs
+++ b/src/rustup-cli/common.rs
@@ -220,7 +220,8 @@ pub fn rustc_version(toolchain: &Toolchain) -> String {
if toolchain.exists() {
let rustc_path = toolchain.binary_file("rustc");
if utils::is_file(&rustc_path) {
- let mut cmd = Command::new(&rustc_path);
+ let mut cmd = Command::new("@dynamicLinker@");
+ cmd.arg(&rustc_path);
cmd.arg("--version");
toolchain.set_ldpath(&mut cmd);
diff --git a/src/rustup/toolchain.rs b/src/rustup/toolchain.rs
index dc29c32..212a4ab 100644
--- a/src/rustup/toolchain.rs
+++ b/src/rustup/toolchain.rs
@@ -315,7 +315,7 @@ impl<'a> Toolchain<'a> {
}
Path::new(&binary)
};
- let mut cmd = Command::new(&path);
+ let mut cmd = wrap_elf_interpreter(&path);
self.set_env(&mut cmd);
Ok(cmd)
}
@@ -363,7 +363,7 @@ impl<'a> Toolchain<'a> {
} else {
src_file
};
- let mut cmd = Command::new(exe_path);
+ let mut cmd = wrap_elf_interpreter(exe_path);
self.set_env(&mut cmd);
cmd.env("RUSTUP_TOOLCHAIN", &primary_toolchain.name);
Ok(cmd)
@@ -648,3 +648,21 @@ impl<'a> Toolchain<'a> {
path
}
}
+
+fn wrap_elf_interpreter<S: AsRef<OsStr>>(p: S) -> Command {
+ use std::fs::File;
+ use std::io::Read;
+ let path = Path::new(&p);
+ let is_elf = File::open(path).map(|mut f| {
+ let mut buf = [0; 4];
+ let _ = f.read(&mut buf);
+ buf == b"\x7fELF"[..]
+ }).unwrap_or(false);
+ if is_elf {
+ let mut cmd = Command::new("@dynamicLinker@");
+ cmd.arg(&path);
+ cmd
+ } else {
+ Command::new(&path)
+ }
+}
--
2.12.2

View File

@ -1,18 +1,18 @@
{ stdenv, lib, runCommand
{ stdenv, lib, runCommand, patchelf
, fetchFromGitHub, rustPlatform
, pkgconfig, curl, Security }:
rustPlatform.buildRustPackage rec {
name = "rustup-${version}";
version = "1.3.0";
version = "2017-10-29";
cargoSha256 = "1yd7k0jpx78p5bp6iyzgbyj7pjz8vyjg9g7fmf1bl60jsbdpgv3g";
cargoSha256 = "1xwxv8y9xjgdmm92ldrn9m9fml2zb5h7qqm7dhw63j6psb3ajqrw";
src = fetchFromGitHub {
owner = "rust-lang-nursery";
repo = "rustup.rs";
rev = version;
sha256 = "199jlqqidzak7nxmv2nzjzv7zfzy9z7hw6h8d8wf1rbfdwd9l6hs";
rev = "13c8092507bf646f3ef6a621fe2c5a68212e800f";
sha256 = "1qd01rjk9qpfzgqs35f5nxrcf00kmf76zwmgj3yzdig9zymjwndg";
};
nativeBuildInputs = [ pkgconfig ];
@ -24,9 +24,11 @@ rustPlatform.buildRustPackage rec {
cargoBuildFlags = [ "--features no-self-update" ];
patches = lib.optionals stdenv.isLinux [
(runCommand "0001-use-hardcoded-dynamic-linker.patch" { CC=stdenv.cc; } ''
(runCommand "0001-dynamically-patchelf-binaries.patch" { CC=stdenv.cc; patchelf = patchelf; } ''
export dynamicLinker=$(cat $CC/nix-support/dynamic-linker)
substituteAll ${./0001-use-hardcoded-dynamic-linker.patch} $out
substitute ${./0001-dynamically-patchelf-binaries.patch} $out \
--subst-var patchelf \
--subst-var dynamicLinker
'')
];

View File

@ -0,0 +1,407 @@
commit e7cae741f6d645ac68fe8823ca6ef45dbbf6891b
Author: Tejun Heo <tj@kernel.org>
Date: Fri Mar 11 07:31:23 2016 -0500
sched: Misc preps for cgroup unified hierarchy interface
Make the following changes in preparation for the cpu controller
interface implementation for the unified hierarchy. This patch
doesn't cause any functional differences.
* s/cpu_stats_show()/cpu_cfs_stats_show()/
* s/cpu_files/cpu_legacy_files/
* Separate out cpuacct_stats_read() from cpuacct_stats_show(). While
at it, remove pointless cpuacct_stat_desc[] array.
Signed-off-by: Tejun Heo <tj@kernel.org>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Li Zefan <lizefan@huawei.com>
Cc: Johannes Weiner <hannes@cmpxchg.org>
diff --git a/kernel/sched/core.c b/kernel/sched/core.c
index 732e993..77f3ddd 100644
--- a/kernel/sched/core.c
+++ b/kernel/sched/core.c
@@ -8512,7 +8512,7 @@ static int __cfs_schedulable(struct task_group *tg, u64 period, u64 quota)
return ret;
}
-static int cpu_stats_show(struct seq_file *sf, void *v)
+static int cpu_cfs_stats_show(struct seq_file *sf, void *v)
{
struct task_group *tg = css_tg(seq_css(sf));
struct cfs_bandwidth *cfs_b = &tg->cfs_bandwidth;
@@ -8552,7 +8552,7 @@ static u64 cpu_rt_period_read_uint(struct cgroup_subsys_state *css,
}
#endif /* CONFIG_RT_GROUP_SCHED */
-static struct cftype cpu_files[] = {
+static struct cftype cpu_legacy_files[] = {
#ifdef CONFIG_FAIR_GROUP_SCHED
{
.name = "shares",
@@ -8573,7 +8573,7 @@ static struct cftype cpu_files[] = {
},
{
.name = "stat",
- .seq_show = cpu_stats_show,
+ .seq_show = cpu_cfs_stats_show,
},
#endif
#ifdef CONFIG_RT_GROUP_SCHED
@@ -8599,7 +8599,7 @@ struct cgroup_subsys cpu_cgrp_subsys = {
.fork = cpu_cgroup_fork,
.can_attach = cpu_cgroup_can_attach,
.attach = cpu_cgroup_attach,
- .legacy_cftypes = cpu_files,
+ .legacy_cftypes = cpu_legacy_files,
.early_init = 1,
};
diff --git a/kernel/sched/cpuacct.c b/kernel/sched/cpuacct.c
index dd7cbb5..42b2dd5 100644
--- a/kernel/sched/cpuacct.c
+++ b/kernel/sched/cpuacct.c
@@ -177,36 +177,33 @@ static int cpuacct_percpu_seq_show(struct seq_file *m, void *V)
return 0;
}
-static const char * const cpuacct_stat_desc[] = {
- [CPUACCT_STAT_USER] = "user",
- [CPUACCT_STAT_SYSTEM] = "system",
-};
-
-static int cpuacct_stats_show(struct seq_file *sf, void *v)
+static void cpuacct_stats_read(struct cpuacct *ca, u64 *userp, u64 *sysp)
{
- struct cpuacct *ca = css_ca(seq_css(sf));
int cpu;
- s64 val = 0;
+ *userp = 0;
for_each_online_cpu(cpu) {
struct kernel_cpustat *kcpustat = per_cpu_ptr(ca->cpustat, cpu);
- val += kcpustat->cpustat[CPUTIME_USER];
- val += kcpustat->cpustat[CPUTIME_NICE];
+ *userp += kcpustat->cpustat[CPUTIME_USER];
+ *userp += kcpustat->cpustat[CPUTIME_NICE];
}
- val = cputime64_to_clock_t(val);
- seq_printf(sf, "%s %lld\n", cpuacct_stat_desc[CPUACCT_STAT_USER], val);
- val = 0;
+ *sysp = 0;
for_each_online_cpu(cpu) {
struct kernel_cpustat *kcpustat = per_cpu_ptr(ca->cpustat, cpu);
- val += kcpustat->cpustat[CPUTIME_SYSTEM];
- val += kcpustat->cpustat[CPUTIME_IRQ];
- val += kcpustat->cpustat[CPUTIME_SOFTIRQ];
+ *sysp += kcpustat->cpustat[CPUTIME_SYSTEM];
+ *sysp += kcpustat->cpustat[CPUTIME_IRQ];
+ *sysp += kcpustat->cpustat[CPUTIME_SOFTIRQ];
}
+}
- val = cputime64_to_clock_t(val);
- seq_printf(sf, "%s %lld\n", cpuacct_stat_desc[CPUACCT_STAT_SYSTEM], val);
+static int cpuacct_stats_show(struct seq_file *sf, void *v)
+{
+ cputime64_t user, sys;
+ cpuacct_stats_read(css_ca(seq_css(sf)), &user, &sys);
+ seq_printf(sf, "user %lld\n", cputime64_to_clock_t(user));
+ seq_printf(sf, "system %lld\n", cputime64_to_clock_t(sys));
return 0;
}
commit 1bb33e8a69f089f2d3f58a0e681d4ff352e11c97
Author: Tejun Heo <tj@kernel.org>
Date: Fri Mar 11 07:31:23 2016 -0500
sched: Implement interface for cgroup unified hierarchy
While the cpu controller doesn't have any functional problems, there
are a couple interface issues which can be addressed in the v2
interface.
* cpuacct being a separate controller. This separation is artificial
and rather pointless as demonstrated by most use cases co-mounting
the two controllers. It also forces certain information to be
accounted twice.
* Use of different time units. Writable control knobs use
microseconds, some stat fields use nanoseconds while other cpuacct
stat fields use centiseconds.
* Control knobs which can't be used in the root cgroup still show up
in the root.
* Control knob names and semantics aren't consistent with other
controllers.
This patchset implements cpu controller's interface on the unified
hierarchy which adheres to the controller file conventions described
in Documentation/cgroups/unified-hierarchy.txt. Overall, the
following changes are made.
* cpuacct is implictly enabled and disabled by cpu and its information
is reported through "cpu.stat" which now uses microseconds for all
time durations. All time duration fields now have "_usec" appended
to them for clarity. While this doesn't solve the double accounting
immediately, once majority of users switch to v2, cpu can directly
account and report the relevant stats and cpuacct can be disabled on
the unified hierarchy.
Note that cpuacct.usage_percpu is currently not included in
"cpu.stat". If this information is actually called for, it can be
added later.
* "cpu.shares" is replaced with "cpu.weight" and operates on the
standard scale defined by CGROUP_WEIGHT_MIN/DFL/MAX (1, 100, 10000).
The weight is scaled to scheduler weight so that 100 maps to 1024
and the ratio relationship is preserved - if weight is W and its
scaled value is S, W / 100 == S / 1024. While the mapped range is a
bit smaller than the orignal scheduler weight range, the dead zones
on both sides are relatively small and covers wider range than the
nice value mappings. This file doesn't make sense in the root
cgroup and isn't create on root.
* "cpu.cfs_quota_us" and "cpu.cfs_period_us" are replaced by "cpu.max"
which contains both quota and period.
* "cpu.rt_runtime_us" and "cpu.rt_period_us" are replaced by
"cpu.rt.max" which contains both runtime and period.
v2: cpu_stats_show() was incorrectly using CONFIG_FAIR_GROUP_SCHED for
CFS bandwidth stats and also using raw division for u64. Use
CONFIG_CFS_BANDWITH and do_div() instead.
The semantics of "cpu.rt.max" is not fully decided yet. Dropped
for now.
Signed-off-by: Tejun Heo <tj@kernel.org>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Li Zefan <lizefan@huawei.com>
Cc: Johannes Weiner <hannes@cmpxchg.org>
diff --git a/kernel/sched/core.c b/kernel/sched/core.c
index 77f3ddd..7aafe63 100644
--- a/kernel/sched/core.c
+++ b/kernel/sched/core.c
@@ -8591,6 +8591,139 @@ static struct cftype cpu_legacy_files[] = {
{ } /* terminate */
};
+static int cpu_stats_show(struct seq_file *sf, void *v)
+{
+ cpuacct_cpu_stats_show(sf);
+
+#ifdef CONFIG_CFS_BANDWIDTH
+ {
+ struct task_group *tg = css_tg(seq_css(sf));
+ struct cfs_bandwidth *cfs_b = &tg->cfs_bandwidth;
+ u64 throttled_usec;
+
+ throttled_usec = cfs_b->throttled_time;
+ do_div(throttled_usec, NSEC_PER_USEC);
+
+ seq_printf(sf, "nr_periods %d\n"
+ "nr_throttled %d\n"
+ "throttled_usec %llu\n",
+ cfs_b->nr_periods, cfs_b->nr_throttled,
+ throttled_usec);
+ }
+#endif
+ return 0;
+}
+
+#ifdef CONFIG_FAIR_GROUP_SCHED
+static u64 cpu_weight_read_u64(struct cgroup_subsys_state *css,
+ struct cftype *cft)
+{
+ struct task_group *tg = css_tg(css);
+ u64 weight = scale_load_down(tg->shares);
+
+ return DIV_ROUND_CLOSEST_ULL(weight * CGROUP_WEIGHT_DFL, 1024);
+}
+
+static int cpu_weight_write_u64(struct cgroup_subsys_state *css,
+ struct cftype *cftype, u64 weight)
+{
+ /*
+ * cgroup weight knobs should use the common MIN, DFL and MAX
+ * values which are 1, 100 and 10000 respectively. While it loses
+ * a bit of range on both ends, it maps pretty well onto the shares
+ * value used by scheduler and the round-trip conversions preserve
+ * the original value over the entire range.
+ */
+ if (weight < CGROUP_WEIGHT_MIN || weight > CGROUP_WEIGHT_MAX)
+ return -ERANGE;
+
+ weight = DIV_ROUND_CLOSEST_ULL(weight * 1024, CGROUP_WEIGHT_DFL);
+
+ return sched_group_set_shares(css_tg(css), scale_load(weight));
+}
+#endif
+
+static void __maybe_unused cpu_period_quota_print(struct seq_file *sf,
+ long period, long quota)
+{
+ if (quota < 0)
+ seq_puts(sf, "max");
+ else
+ seq_printf(sf, "%ld", quota);
+
+ seq_printf(sf, " %ld\n", period);
+}
+
+/* caller should put the current value in *@periodp before calling */
+static int __maybe_unused cpu_period_quota_parse(char *buf,
+ u64 *periodp, u64 *quotap)
+{
+ char tok[21]; /* U64_MAX */
+
+ if (!sscanf(buf, "%s %llu", tok, periodp))
+ return -EINVAL;
+
+ *periodp *= NSEC_PER_USEC;
+
+ if (sscanf(tok, "%llu", quotap))
+ *quotap *= NSEC_PER_USEC;
+ else if (!strcmp(tok, "max"))
+ *quotap = RUNTIME_INF;
+ else
+ return -EINVAL;
+
+ return 0;
+}
+
+#ifdef CONFIG_CFS_BANDWIDTH
+static int cpu_max_show(struct seq_file *sf, void *v)
+{
+ struct task_group *tg = css_tg(seq_css(sf));
+
+ cpu_period_quota_print(sf, tg_get_cfs_period(tg), tg_get_cfs_quota(tg));
+ return 0;
+}
+
+static ssize_t cpu_max_write(struct kernfs_open_file *of,
+ char *buf, size_t nbytes, loff_t off)
+{
+ struct task_group *tg = css_tg(of_css(of));
+ u64 period = tg_get_cfs_period(tg);
+ u64 quota;
+ int ret;
+
+ ret = cpu_period_quota_parse(buf, &period, &quota);
+ if (!ret)
+ ret = tg_set_cfs_bandwidth(tg, period, quota);
+ return ret ?: nbytes;
+}
+#endif
+
+static struct cftype cpu_files[] = {
+ {
+ .name = "stat",
+ .flags = CFTYPE_NOT_ON_ROOT,
+ .seq_show = cpu_stats_show,
+ },
+#ifdef CONFIG_FAIR_GROUP_SCHED
+ {
+ .name = "weight",
+ .flags = CFTYPE_NOT_ON_ROOT,
+ .read_u64 = cpu_weight_read_u64,
+ .write_u64 = cpu_weight_write_u64,
+ },
+#endif
+#ifdef CONFIG_CFS_BANDWIDTH
+ {
+ .name = "max",
+ .flags = CFTYPE_NOT_ON_ROOT,
+ .seq_show = cpu_max_show,
+ .write = cpu_max_write,
+ },
+#endif
+ { } /* terminate */
+};
+
struct cgroup_subsys cpu_cgrp_subsys = {
.css_alloc = cpu_cgroup_css_alloc,
.css_free = cpu_cgroup_css_free,
@@ -8600,7 +8733,15 @@ struct cgroup_subsys cpu_cgrp_subsys = {
.can_attach = cpu_cgroup_can_attach,
.attach = cpu_cgroup_attach,
.legacy_cftypes = cpu_legacy_files,
+ .dfl_cftypes = cpu_files,
.early_init = 1,
+#ifdef CONFIG_CGROUP_CPUACCT
+ /*
+ * cpuacct is enabled together with cpu on the unified hierarchy
+ * and its stats are reported through "cpu.stat".
+ */
+ .depends_on = 1 << cpuacct_cgrp_id,
+#endif
};
#endif /* CONFIG_CGROUP_SCHED */
diff --git a/kernel/sched/cpuacct.c b/kernel/sched/cpuacct.c
index 42b2dd5..b4d32a6 100644
--- a/kernel/sched/cpuacct.c
+++ b/kernel/sched/cpuacct.c
@@ -224,6 +224,30 @@ static struct cftype files[] = {
{ } /* terminate */
};
+/* used to print cpuacct stats in cpu.stat on the unified hierarchy */
+void cpuacct_cpu_stats_show(struct seq_file *sf)
+{
+ struct cgroup_subsys_state *css;
+ u64 usage, user, sys;
+
+ css = cgroup_get_e_css(seq_css(sf)->cgroup, &cpuacct_cgrp_subsys);
+
+ usage = cpuusage_read(css, seq_cft(sf));
+ cpuacct_stats_read(css_ca(css), &user, &sys);
+
+ user *= TICK_NSEC;
+ sys *= TICK_NSEC;
+ do_div(usage, NSEC_PER_USEC);
+ do_div(user, NSEC_PER_USEC);
+ do_div(sys, NSEC_PER_USEC);
+
+ seq_printf(sf, "usage_usec %llu\n"
+ "user_usec %llu\n"
+ "system_usec %llu\n", usage, user, sys);
+
+ css_put(css);
+}
+
/*
* charge this task's execution time to its accounting group.
*
diff --git a/kernel/sched/cpuacct.h b/kernel/sched/cpuacct.h
index ed60562..44eace9 100644
--- a/kernel/sched/cpuacct.h
+++ b/kernel/sched/cpuacct.h
@@ -2,6 +2,7 @@
extern void cpuacct_charge(struct task_struct *tsk, u64 cputime);
extern void cpuacct_account_field(struct task_struct *p, int index, u64 val);
+extern void cpuacct_cpu_stats_show(struct seq_file *sf);
#else
@@ -14,4 +15,8 @@ cpuacct_account_field(struct task_struct *p, int index, u64 val)
{
}
+static inline void cpuacct_cpu_stats_show(struct seq_file *sf)
+{
+}
+
#endif

View File

@ -0,0 +1,11 @@
{ stdenv, hostPlatform, fetchurl, perl, buildLinux, ... } @ args:
import ./generic.nix (args // rec {
version = "4.4.95";
extraMeta.branch = "4.4";
src = fetchurl {
url = "mirror://kernel/linux/kernel/v4.x/linux-${version}.tar.xz";
sha256 = "07vkxhh435gilxsh9ag6zvf2r9k5l9ffqp72900c50nsfjrdgdrx";
};
} // (args.argsOverride or {}))

View File

@ -1,13 +1,13 @@
{ stdenv, hostPlatform, fetchurl, perl, buildLinux, ... } @ args:
import ./generic.nix (args // rec {
version = "4.14-rc6";
modDirVersion = "4.14.0-rc6";
version = "4.14-rc7";
modDirVersion = "4.14.0-rc7";
extraMeta.branch = "4.14";
src = fetchurl {
url = "https://git.kernel.org/torvalds/t/linux-${version}.tar.gz";
sha256 = "0gmxrf4jmw8xl5gx487chyx94yas7rva5jbkczm9iw9sw0c8gwcb";
sha256 = "1w7b1sc5dsxcqywsdbwgs92i8jpj7hsnss67yzb58z3bz3hb73m3";
};
# Should the testing kernels ever be built on Hydra?

View File

@ -2,7 +2,7 @@
buildGoPackage rec {
name = "alertmanager-${version}";
version = "0.8.0";
version = "0.9.1";
rev = "v${version}";
goPackagePath = "github.com/prometheus/alertmanager";
@ -11,7 +11,7 @@ buildGoPackage rec {
inherit rev;
owner = "prometheus";
repo = "alertmanager";
sha256 = "0bqc58j0nrq7y8nbd927z7x74m8mcd2782cxkqwscpq6d9983qql";
sha256 = "1lkfj63pp4jf58xmn015r7s42p1wyj6fryihpmdn0k76b0ccwqzj";
};
# Tests exist, but seem to clash with the firewall.

View File

@ -1,14 +1,16 @@
{ stdenv, fetchurl, getopt, lua, boost, pkgconfig, gcc }:
{ stdenv, fetchFromGitHub, getopt, lua, boost, pkgconfig, gcc }:
with stdenv.lib;
stdenv.mkDerivation rec {
name = "highlight-${version}";
version = "3.39";
version = "3.40";
src = fetchurl {
url = "http://www.andre-simon.de/zip/${name}.tar.bz2";
sha256 = "0z8gs69sqlyis4kvl8wwdgzywi199k73kkvn1mf9pf60npvcxwj4";
src = fetchFromGitHub {
owner = "andre-simon";
repo = "highlight";
rev = "${version}";
sha256 = "0bkywhz4y10qcajimdha1ck5mvn7fsrv3yn8nd6rqbva39gbfmfd";
};
nativeBuildInputs = [ pkgconfig ] ++ optional stdenv.isDarwin gcc ;
@ -28,6 +30,6 @@ stdenv.mkDerivation rec {
description = "Source code highlighting tool";
homepage = http://www.andre-simon.de/doku/highlight/en/highlight.php;
platforms = platforms.unix;
maintainers = [ maintainers.ndowens ];
maintainers = with maintainers; [ ndowens willibutz ];
};
}

View File

@ -126,15 +126,6 @@ with pkgs;
vs = vs90wrapper;
};
fetchadc = callPackage ../build-support/fetchadc {
adc_user = if config ? adc_user
then config.adc_user
else throw "You need an adc_user attribute in your config to download files from Apple Developer Connection";
adc_pass = if config ? adc_pass
then config.adc_pass
else throw "You need an adc_pass attribute in your config to download files from Apple Developer Connection";
};
fetchbower = callPackage ../build-support/fetchbower {
inherit (nodePackages) bower2nix;
};
@ -153,8 +144,6 @@ with pkgs;
fetchgitPrivate = callPackage ../build-support/fetchgit/private.nix { };
fetchgitrevision = import ../build-support/fetchgitrevision runCommand git;
fetchgitLocal = callPackage ../build-support/fetchgitlocal { };
fetchmtn = callPackage ../build-support/fetchmtn (config.fetchmtn or {});
@ -12442,6 +12431,20 @@ with pkgs;
];
};
linux_4_4 = callPackage ../os-specific/linux/kernel/linux-4.4.nix {
kernelPatches =
[ kernelPatches.bridge_stp_helper
kernelPatches.p9_fixes
kernelPatches.cpu-cgroup-v2."4.4"
kernelPatches.modinst_arg_list_too_long
]
++ lib.optionals ((platform.kernelArch or null) == "mips")
[ kernelPatches.mips_fpureg_emu
kernelPatches.mips_fpu_sigill
kernelPatches.mips_ext3_n32
];
};
linux_4_9 = callPackage ../os-specific/linux/kernel/linux-4.9.nix {
kernelPatches =
[ kernelPatches.bridge_stp_helper
@ -12664,6 +12667,7 @@ with pkgs;
linuxPackages_hardened_copperhead = linuxPackagesFor pkgs.linux_hardened_copperhead;
linuxPackages_mptcp = linuxPackagesFor pkgs.linux_mptcp;
linuxPackages_rpi = linuxPackagesFor pkgs.linux_rpi;
linuxPackages_4_4 = recurseIntoAttrs (linuxPackagesFor pkgs.linux_4_4);
linuxPackages_4_9 = recurseIntoAttrs (linuxPackagesFor pkgs.linux_4_9);
linuxPackages_4_13 = recurseIntoAttrs (linuxPackagesFor pkgs.linux_4_13);
# Don't forget to update linuxPackages_latest!

View File

@ -66,7 +66,7 @@ in rec {
bower2nix.buildInputs = [ pkgs.makeWrapper ];
bower2nix.postInstall = ''
for prog in bower2nix fetch-bower; do
wrapProgram "$out/bin/$prog" --prefix PATH : "${pkgs.git}/bin"
wrapProgram "$out/bin/$prog" --prefix PATH : ${stdenv.lib.makeBinPath [ pkgs.git pkgs.nix ]}
done
'';
} // args.overrides or {};

View File

@ -12469,7 +12469,7 @@ in {
patches = [
(pkgs.fetchpatch {
url = https://github.com/drkjam/netaddr/commit/2ab73f10be7069c9412e853d2d0caf29bd624012.patch;
sha256 = "08rn1s3w9424jhandy4j9sksy852ny00088zh15nirw5ajqg1dn7";
sha256 = "0s1cdn9v5alpviabhcjmzc0m2pnpq9dh2fnnk2x96dnry1pshg39";
})
];