From d0492e8f71b7ae6f52bfb2869a20177ec4d16df8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dani=C3=ABl=20de=20Kok?= Date: Fri, 18 Dec 2020 08:21:12 +0100 Subject: [PATCH 01/29] llvmPackages_rocm: 3.10.0 -> 4.0.0 --- pkgs/development/compilers/llvm/rocm/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/development/compilers/llvm/rocm/default.nix b/pkgs/development/compilers/llvm/rocm/default.nix index c67b011721a0..36b42cef3926 100644 --- a/pkgs/development/compilers/llvm/rocm/default.nix +++ b/pkgs/development/compilers/llvm/rocm/default.nix @@ -1,12 +1,12 @@ { stdenv, fetchFromGitHub, callPackage, wrapCCWith }: let - version = "3.10.0"; + version = "4.0.0"; src = fetchFromGitHub { owner = "RadeonOpenCompute"; repo = "llvm-project"; rev = "rocm-${version}"; - hash = "sha256-Lnma831RXJMnn3N8im3QLy6dYfXAvtbeFX/0CKvpkgY="; + hash = "sha256-nIvqEk18NLtY8Hec2Iq6ufWMblzYJ8SOIXgqomtqa0s="; }; in rec { clang = wrapCCWith rec { From ea9bc06e8b69daf4307e57b4fc3068225e108c65 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dani=C3=ABl=20de=20Kok?= Date: Fri, 18 Dec 2020 08:23:50 +0100 Subject: [PATCH 02/29] rocm-device-libs: 3.10.0 -> 4.0.0 No changes compared to the previous release. --- pkgs/development/libraries/rocm-device-libs/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/development/libraries/rocm-device-libs/default.nix b/pkgs/development/libraries/rocm-device-libs/default.nix index 54c7cb9a10b5..7c50e3752280 100644 --- a/pkgs/development/libraries/rocm-device-libs/default.nix +++ b/pkgs/development/libraries/rocm-device-libs/default.nix @@ -9,7 +9,7 @@ stdenv.mkDerivation rec { pname = "rocm-device-libs"; - version = "3.10.0"; + version = "4.0.0"; src = fetchFromGitHub { owner = "RadeonOpenCompute"; From 0cb9af406ff0a32fc1252fad10ef0d5f968fc3c2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dani=C3=ABl=20de=20Kok?= Date: Fri, 18 Dec 2020 08:25:13 +0100 Subject: [PATCH 03/29] rocm-thunk: 3.10.0 -> 4.0.0 --- pkgs/development/libraries/rocm-thunk/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/development/libraries/rocm-thunk/default.nix b/pkgs/development/libraries/rocm-thunk/default.nix index bf0a05fe73e8..535f686f23d0 100644 --- a/pkgs/development/libraries/rocm-thunk/default.nix +++ b/pkgs/development/libraries/rocm-thunk/default.nix @@ -7,13 +7,13 @@ stdenv.mkDerivation rec { pname = "rocm-thunk"; - version = "3.10.0"; + version = "4.0.0"; src = fetchFromGitHub { owner = "RadeonOpenCompute"; repo = "ROCT-Thunk-Interface"; rev = "rocm-${version}"; - hash = "sha256-FLH+GHXA0zepbR1wPPSez/hx1hiG2kkCTneDKhJJRjU="; + hash = "sha256-2kLSlGwX3pD8I5pXwV5L0k9l8OzJRkUvnAqv5E+gcd4="; }; preConfigure = '' From edfcf08028004bf772ac9c3d56f1ce5f26d47e64 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dani=C3=ABl=20de=20Kok?= Date: Sat, 19 Dec 2020 07:58:42 +0100 Subject: [PATCH 04/29] rocm-runtime: 3.10.0 -> 4.0.0 No changes compared to the previous release. --- pkgs/development/libraries/rocm-runtime/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/development/libraries/rocm-runtime/default.nix b/pkgs/development/libraries/rocm-runtime/default.nix index 4df954f4b258..15435e7914d3 100644 --- a/pkgs/development/libraries/rocm-runtime/default.nix +++ b/pkgs/development/libraries/rocm-runtime/default.nix @@ -11,7 +11,7 @@ stdenv.mkDerivation rec { pname = "rocm-runtime"; - version = "3.10.0"; + version = "4.0.0"; src = fetchFromGitHub { owner = "RadeonOpenCompute"; From 240416a10b43e1ad8268cdd4ef764cdc11838850 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dani=C3=ABl=20de=20Kok?= Date: Fri, 18 Dec 2020 08:27:47 +0100 Subject: [PATCH 05/29] rocm-comgr: 3.10.0 -> 4.0.0 No changes compared to the previous release. --- pkgs/development/libraries/rocm-comgr/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/development/libraries/rocm-comgr/default.nix b/pkgs/development/libraries/rocm-comgr/default.nix index e6546e0d3361..f8254991013c 100644 --- a/pkgs/development/libraries/rocm-comgr/default.nix +++ b/pkgs/development/libraries/rocm-comgr/default.nix @@ -2,7 +2,7 @@ stdenv.mkDerivation rec { pname = "rocm-comgr"; - version = "3.10.0"; + version = "4.0.0"; src = fetchFromGitHub { owner = "RadeonOpenCompute"; From 03e8a2f03b5b90acb4efab30085d0a71024c8015 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dani=C3=ABl=20de=20Kok?= Date: Fri, 18 Dec 2020 08:30:12 +0100 Subject: [PATCH 06/29] rocm-cmake: 3.10.0 -> 4.0.0 No changes compared to the previous release. --- pkgs/development/tools/build-managers/rocm-cmake/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/development/tools/build-managers/rocm-cmake/default.nix b/pkgs/development/tools/build-managers/rocm-cmake/default.nix index 8f01b9aca318..1dd931981dad 100644 --- a/pkgs/development/tools/build-managers/rocm-cmake/default.nix +++ b/pkgs/development/tools/build-managers/rocm-cmake/default.nix @@ -2,7 +2,7 @@ stdenv.mkDerivation rec { pname = "rocm-cmake"; - version = "3.10.0"; + version = "4.0.0"; src = fetchFromGitHub { owner = "RadeonOpenCompute"; From 39fefb90b680a618d6b790fe48686ca590643d79 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dani=C3=ABl=20de=20Kok?= Date: Fri, 18 Dec 2020 08:31:49 +0100 Subject: [PATCH 07/29] rocclr: 3.10.0 -> 4.0.0 --- pkgs/development/libraries/rocclr/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/development/libraries/rocclr/default.nix b/pkgs/development/libraries/rocclr/default.nix index 55b2f0ff1868..5e6ce5d67978 100644 --- a/pkgs/development/libraries/rocclr/default.nix +++ b/pkgs/development/libraries/rocclr/default.nix @@ -15,13 +15,13 @@ stdenv.mkDerivation rec { pname = "rocclr"; - version = "3.10.0"; + version = "4.0.0"; src = fetchFromGitHub { owner = "ROCm-Developer-Tools"; repo = "ROCclr"; rev = "rocm-${version}"; - hash = "sha256-P36JKFgXSZagWzHB6WB2WlDu7jkVvfYVo1BaV0b8iEk="; + hash = "sha256-B27ff1b9JRhxFUsBt7CGuYaR87hvKbVSCERWD45d8tM="; }; nativeBuildInputs = [ cmake rocm-cmake ]; From 78ca64c5405608396fb45a859f24348cc0420d15 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dani=C3=ABl=20de=20Kok?= Date: Fri, 18 Dec 2020 08:32:57 +0100 Subject: [PATCH 08/29] rocm-opencl-runtime: 3.10.0 -> 4.0.0 No changes compared to the previous release. --- pkgs/development/libraries/rocm-opencl-runtime/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/development/libraries/rocm-opencl-runtime/default.nix b/pkgs/development/libraries/rocm-opencl-runtime/default.nix index 4681267da18a..ecd9e0f7e825 100644 --- a/pkgs/development/libraries/rocm-opencl-runtime/default.nix +++ b/pkgs/development/libraries/rocm-opencl-runtime/default.nix @@ -21,7 +21,7 @@ stdenv.mkDerivation rec { pname = "rocm-opencl-runtime"; - version = "3.10.0"; + version = "4.0.0"; src = fetchFromGitHub { owner = "RadeonOpenCompute"; From 3cdb918f62f131774823e3dd8a6c343e656ebd1e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dani=C3=ABl=20de=20Kok?= Date: Fri, 18 Dec 2020 08:34:56 +0100 Subject: [PATCH 09/29] rocm-smi: 3.10.0 -> 4.0.0 No changes compared to the previous release. --- pkgs/tools/system/rocm-smi/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/tools/system/rocm-smi/default.nix b/pkgs/tools/system/rocm-smi/default.nix index 1ed1d9135165..cd4eef89520b 100644 --- a/pkgs/tools/system/rocm-smi/default.nix +++ b/pkgs/tools/system/rocm-smi/default.nix @@ -2,7 +2,7 @@ buildPythonApplication rec { pname = "rocm-smi"; - version = "3.10.0"; + version = "4.0.0"; src = fetchFromGitHub { owner = "RadeonOpenCompute"; From ecb0291e1a531d3223793e47f07b0207b688b588 Mon Sep 17 00:00:00 2001 From: mohe2015 Date: Mon, 28 Sep 2020 23:16:43 +0200 Subject: [PATCH 10/29] nixos/mongodb: fix running initialScript without a set root password Co-authored-by: Timo Kaufmann --- nixos/modules/services/databases/mongodb.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nixos/modules/services/databases/mongodb.nix b/nixos/modules/services/databases/mongodb.nix index 4453a182990d..4af0b9d44e13 100644 --- a/nixos/modules/services/databases/mongodb.nix +++ b/nixos/modules/services/databases/mongodb.nix @@ -176,7 +176,7 @@ in postStart = '' if test -e "${cfg.dbpath}/.first_startup"; then ${optionalString (cfg.initialScript != null) '' - ${mongodb}/bin/mongo -u root -p ${cfg.initialRootPassword} admin "${cfg.initialScript}" + ${mongodb}/bin/mongo ${optionalString (cfg.enableAuth) "-u root -p ${cfg.initialRootPassword}"} admin "${cfg.initialScript}" ''} rm -f "${cfg.dbpath}/.first_startup" fi From 674a99882cf39df329f81efe403a62358955d533 Mon Sep 17 00:00:00 2001 From: Marc Seeger Date: Sun, 20 Dec 2020 08:24:11 -0800 Subject: [PATCH 11/29] Maintainers: Add rb2k to maintainers list. --- maintainers/maintainer-list.nix | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/maintainers/maintainer-list.nix b/maintainers/maintainer-list.nix index e1b000529485..320b88e02b88 100644 --- a/maintainers/maintainer-list.nix +++ b/maintainers/maintainer-list.nix @@ -7343,6 +7343,12 @@ githubId = 1758708; name = "Răzvan Flavius Panda"; }; + rb2k = { + email = "nix@marc-seeger.com"; + github = "rb2k"; + githubId = 9519; + name = "Marc Seeger"; + }; rbasso = { email = "rbasso@sharpgeeks.net"; github = "rbasso"; From 6f21ae7a626cee022f5c20eacaaf934281e806c0 Mon Sep 17 00:00:00 2001 From: Francesco Gazzetta Date: Thu, 19 Nov 2020 17:18:02 +0100 Subject: [PATCH 12/29] nixos/lib/make-disk-image.nix: support content mode and ownership --- nixos/lib/make-disk-image.nix | 48 +++++++++++++++++++++++++++++++---- 1 file changed, 43 insertions(+), 5 deletions(-) diff --git a/nixos/lib/make-disk-image.nix b/nixos/lib/make-disk-image.nix index 0ad0cf1fef5a..3f50bb431c5e 100644 --- a/nixos/lib/make-disk-image.nix +++ b/nixos/lib/make-disk-image.nix @@ -18,9 +18,13 @@ bootSize ? "256M" , # The files and directories to be placed in the target file system. - # This is a list of attribute sets {source, target} where `source' - # is the file system object (regular file or directory) to be - # grafted in the file system at path `target'. + # This is a list of attribute sets {source, target, mode, user, group} where + # `source' is the file system object (regular file or directory) to be + # grafted in the file system at path `target', `mode' is a string containing + # the permissions that will be set (ex. "755"), `user' and `group' are the + # user and group name that will be set as owner of the files. + # `mode', `user', and `group' are optional. + # When setting one of `user' or `group', the other needs to be set too. contents ? [] , # Type of partition table to use; either "legacy", "efi", or "none". @@ -60,6 +64,11 @@ assert partitionTableType == "legacy" || partitionTableType == "legacy+gpt" || partitionTableType == "efi" || partitionTableType == "hybrid" || partitionTableType == "none"; # We use -E offset=X below, which is only supported by e2fsprogs assert partitionTableType != "none" -> fsType == "ext4"; +# Either both or none of {user,group} need to be set +assert lib.all + (attrs: ((attrs.user or null) == null) + == ((attrs.group or null) == null)) + contents; with lib; @@ -148,6 +157,9 @@ let format' = format; in let # !!! should use XML. sources = map (x: x.source) contents; targets = map (x: x.target) contents; + modes = map (x: x.mode or "''") contents; + users = map (x: x.user or "''") contents; + groups = map (x: x.group or "''") contents; closureInfo = pkgs.closureInfo { rootPaths = [ config.system.build.toplevel channelSources ]; }; @@ -174,22 +186,33 @@ let format' = format; in let set -f sources_=(${concatStringsSep " " sources}) targets_=(${concatStringsSep " " targets}) + modes_=(${concatStringsSep " " modes}) set +f for ((i = 0; i < ''${#targets_[@]}; i++)); do source="''${sources_[$i]}" target="''${targets_[$i]}" + mode="''${modes_[$i]}" + if [ -n "$mode" ]; then + rsync_chmod_flags="--chmod=$mode" + else + rsync_chmod_flags="" + fi + # Unfortunately cptofs only supports modes, not ownership, so we can't use + # rsync's --chown option. Instead, we change the ownerships in the + # VM script with chown. + rsync_flags="-a --no-o --no-g $rsync_chmod_flags" if [[ "$source" =~ '*' ]]; then # If the source name contains '*', perform globbing. mkdir -p $root/$target for fn in $source; do - rsync -a --no-o --no-g "$fn" $root/$target/ + rsync $rsync_flags "$fn" $root/$target/ done else mkdir -p $root/$(dirname $target) if ! [ -e $root/$target ]; then - rsync -a --no-o --no-g $source $root/$target + rsync $rsync_flags $source $root/$target else echo "duplicate entry $target -> $source" exit 1 @@ -284,6 +307,21 @@ in pkgs.vmTools.runInLinuxVM ( # The above scripts will generate a random machine-id and we don't want to bake a single ID into all our images rm -f $mountPoint/etc/machine-id + # Set the ownerships of the contents. The modes are set in preVM. + # No globbing on targets, so no need to set -f + targets_=(${concatStringsSep " " targets}) + users_=(${concatStringsSep " " users}) + groups_=(${concatStringsSep " " groups}) + for ((i = 0; i < ''${#targets_[@]}; i++)); do + target="''${targets_[$i]}" + user="''${users_[$i]}" + group="''${groups_[$i]}" + if [ -n "$user$group" ]; then + # We have to nixos-enter since we need to use the user and group of the VM + nixos-enter --root $mountPoint -- chown -R "$user:$group" "$target" + fi + done + umount -R /mnt # Make sure resize2fs works. Note that resize2fs has stricter criteria for resizing than a normal From 8e5219372161d4d1d122cc86b9ac0c52dbf7daf8 Mon Sep 17 00:00:00 2001 From: Francesco Gazzetta Date: Sun, 20 Dec 2020 21:18:54 +0100 Subject: [PATCH 13/29] nixosTests.image-contents: init --- nixos/tests/all-tests.nix | 1 + nixos/tests/image-contents.nix | 51 ++++++++++++++++++++++++++++++++++ 2 files changed, 52 insertions(+) create mode 100644 nixos/tests/image-contents.nix diff --git a/nixos/tests/all-tests.nix b/nixos/tests/all-tests.nix index 2e79a214569a..d171b796dec7 100644 --- a/nixos/tests/all-tests.nix +++ b/nixos/tests/all-tests.nix @@ -271,6 +271,7 @@ in openssh = handleTest ./openssh.nix {}; openstack-image-metadata = (handleTestOn ["x86_64-linux"] ./openstack-image.nix {}).metadata or {}; openstack-image-userdata = (handleTestOn ["x86_64-linux"] ./openstack-image.nix {}).userdata or {}; + image-contents = handleTest ./image-contents.nix {}; orangefs = handleTest ./orangefs.nix {}; os-prober = handleTestOn ["x86_64-linux"] ./os-prober.nix {}; osrm-backend = handleTest ./osrm-backend.nix {}; diff --git a/nixos/tests/image-contents.nix b/nixos/tests/image-contents.nix new file mode 100644 index 000000000000..90908968a7e2 --- /dev/null +++ b/nixos/tests/image-contents.nix @@ -0,0 +1,51 @@ +# Tests the contents attribute of nixos/lib/make-disk-image.nix +# including its user, group, and mode attributes. +{ system ? builtins.currentSystem, + config ? {}, + pkgs ? import ../.. { inherit system config; } +}: + +with import ../lib/testing-python.nix { inherit system pkgs; }; +with pkgs.lib; + +with import common/ec2.nix { inherit makeTest pkgs; }; + +let + config = (import ../lib/eval-config.nix { + inherit system; + modules = [ + ../modules/testing/test-instrumentation.nix + ../modules/profiles/qemu-guest.nix + { + fileSystems."/".device = "/dev/disk/by-label/nixos"; + boot.loader.grub.device = "/dev/vda"; + boot.loader.timeout = 0; + } + ]; + }).config; + image = (import ../lib/make-disk-image.nix { + inherit pkgs config; + lib = pkgs.lib; + format = "qcow2"; + contents = [{ + source = pkgs.writeText "testFile" "contents"; + target = "/testFile"; + user = "1234"; + group = "5678"; + mode = "755"; + }]; + }) + "/nixos.qcow2"; + +in makeEc2Test { + name = "image-contents"; + inherit image; + userData = null; + script = '' + machine.start() + assert "content" in machine.succeed("cat /testFile") + fileDetails = machine.succeed("ls -l /testFile") + assert "1234" in fileDetails + assert "5678" in fileDetails + assert "rwxr-xr-x" in fileDetails + ''; +} From ce7608d6e7cac1b6c616b9ef0dc7c4c838ff547b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maximilian=20G=C3=BCntner?= Date: Thu, 10 Dec 2020 21:27:51 +0100 Subject: [PATCH 14/29] nginxlog-exporter: 1.3.0 -> 1.8.0 --- .../prometheus/nginxlog-exporter.nix | 14 +- .../prometheus/nginxlog-exporter_deps.nix | 282 ------------------ 2 files changed, 7 insertions(+), 289 deletions(-) delete mode 100644 pkgs/servers/monitoring/prometheus/nginxlog-exporter_deps.nix diff --git a/pkgs/servers/monitoring/prometheus/nginxlog-exporter.nix b/pkgs/servers/monitoring/prometheus/nginxlog-exporter.nix index 2c2fabf2357d..a9276e0c924a 100644 --- a/pkgs/servers/monitoring/prometheus/nginxlog-exporter.nix +++ b/pkgs/servers/monitoring/prometheus/nginxlog-exporter.nix @@ -1,21 +1,21 @@ -{ stdenv, buildGoPackage, fetchFromGitHub }: +{ stdenv, buildGoModule, fetchFromGitHub }: -buildGoPackage rec { +buildGoModule rec { pname = "nginxlog_exporter"; - version = "1.3.0"; + version = "1.8.0"; src = fetchFromGitHub { owner = "martin-helmich"; repo = "prometheus-nginxlog-exporter"; rev = "v${version}"; - sha256 = "0cma6hgagqdms6x40v0q4jn8gjq1awyg1aqk5l8mz7l6k132qq7k"; + sha256 = "1kqyjw5yqgjb8xa5irdhpqvwp1qhba6igpc23n2qljhbh0aybkbq"; }; - goPackagePath = "github.com/martin-helmich/prometheus-nginxlog-exporter"; + vendorSha256 = "130hq19y890amxhjywg5blassl8br2p9d62aai8fj839p3p2a7zp"; - goDeps = ./nginxlog-exporter_deps.nix; + subPackages = [ "." ]; - doCheck = true; + runVend = true; meta = with stdenv.lib; { description = "Export metrics from Nginx access log files to Prometheus"; diff --git a/pkgs/servers/monitoring/prometheus/nginxlog-exporter_deps.nix b/pkgs/servers/monitoring/prometheus/nginxlog-exporter_deps.nix deleted file mode 100644 index 3051258a6361..000000000000 --- a/pkgs/servers/monitoring/prometheus/nginxlog-exporter_deps.nix +++ /dev/null @@ -1,282 +0,0 @@ -# file generated from go.mod using vgo2nix (https://github.com/adisbladis/vgo2nix) -[ - { - goPackagePath = "github.com/armon/go-radix"; - fetch = { - type = "git"; - url = "https://github.com/armon/go-radix"; - rev = "v1.0.0"; - sha256 = "1m1k0jz9gjfrk4m7hjm7p03qmviamfgxwm2ghakqxw3hdds8v503"; - }; - } - { - goPackagePath = "github.com/beorn7/perks"; - fetch = { - type = "git"; - url = "https://github.com/beorn7/perks"; - rev = "3ac7bf7a47d1"; - sha256 = "1qc3l4r818xpvrhshh1sisc5lvl9479qspcfcdbivdyh0apah83r"; - }; - } - { - goPackagePath = "github.com/davecgh/go-spew"; - fetch = { - type = "git"; - url = "https://github.com/davecgh/go-spew"; - rev = "v1.1.1"; - sha256 = "0hka6hmyvp701adzag2g26cxdj47g21x6jz4sc6jjz1mn59d474y"; - }; - } - { - goPackagePath = "github.com/fsnotify/fsnotify"; - fetch = { - type = "git"; - url = "https://github.com/fsnotify/fsnotify"; - rev = "v1.4.7"; - sha256 = "07va9crci0ijlivbb7q57d2rz9h27zgn2fsm60spjsqpdbvyrx4g"; - }; - } - { - goPackagePath = "github.com/golang/protobuf"; - fetch = { - type = "git"; - url = "https://github.com/golang/protobuf"; - rev = "0c1f6d65b5a1"; - sha256 = "1ad3zv0s3swslfwmk0wry9qbjz596689z13f2s7d9gska6msigsl"; - }; - } - { - goPackagePath = "github.com/gopherjs/gopherjs"; - fetch = { - type = "git"; - url = "https://github.com/gopherjs/gopherjs"; - rev = "0766667cb4d1"; - sha256 = "13pfc9sxiwjky2lm1xb3i3lcisn8p6mgjk2d927l7r92ysph8dmw"; - }; - } - { - goPackagePath = "github.com/hashicorp/consul"; - fetch = { - type = "git"; - url = "https://github.com/hashicorp/consul"; - rev = "de080672fee9"; - sha256 = "1q46gn7gv7ara21akkbyzlnari4naxax2d0z917y56ra4lwm259i"; - }; - } - { - goPackagePath = "github.com/hashicorp/go-msgpack"; - fetch = { - type = "git"; - url = "https://github.com/hashicorp/go-msgpack"; - rev = "v0.5.3"; - sha256 = "00jv0ajqd58pkb2yyhlrjp0rv1mvb1ijx3yqjyikcmzvk9jb4h5m"; - }; - } - { - goPackagePath = "github.com/hashicorp/golang-lru"; - fetch = { - type = "git"; - url = "https://github.com/hashicorp/golang-lru"; - rev = "v0.5.1"; - sha256 = "13f870cvk161bzjj6x41l45r5x9i1z9r2ymwmvm7768kg08zznpy"; - }; - } - { - goPackagePath = "github.com/hashicorp/hcl"; - fetch = { - type = "git"; - url = "https://github.com/hashicorp/hcl"; - rev = "v1.0.0"; - sha256 = "0q6ml0qqs0yil76mpn4mdx4lp94id8vbv575qm60jzl1ijcl5i66"; - }; - } - { - goPackagePath = "github.com/hpcloud/tail"; - fetch = { - type = "git"; - url = "https://github.com/hpcloud/tail"; - rev = "v1.0.0"; - sha256 = "1njpzc0pi1acg5zx9y6vj9xi6ksbsc5d387rd6904hy6rh2m6kn0"; - }; - } - { - goPackagePath = "github.com/jtolds/gls"; - fetch = { - type = "git"; - url = "https://github.com/jtolds/gls"; - rev = "v4.20.0"; - sha256 = "1k7xd2q2ysv2xsh373qs801v6f359240kx0vrl0ydh7731lngvk6"; - }; - } - { - goPackagePath = "github.com/kr/pretty"; - fetch = { - type = "git"; - url = "https://github.com/kr/pretty"; - rev = "v0.1.0"; - sha256 = "18m4pwg2abd0j9cn5v3k2ksk9ig4vlwxmlw9rrglanziv9l967qp"; - }; - } - { - goPackagePath = "github.com/kr/pty"; - fetch = { - type = "git"; - url = "https://github.com/kr/pty"; - rev = "v1.1.1"; - sha256 = "0383f0mb9kqjvncqrfpidsf8y6ns5zlrc91c6a74xpyxjwvzl2y6"; - }; - } - { - goPackagePath = "github.com/kr/text"; - fetch = { - type = "git"; - url = "https://github.com/kr/text"; - rev = "v0.1.0"; - sha256 = "1gm5bsl01apvc84bw06hasawyqm4q84vx1pm32wr9jnd7a8vjgj1"; - }; - } - { - goPackagePath = "github.com/matttproud/golang_protobuf_extensions"; - fetch = { - type = "git"; - url = "https://github.com/matttproud/golang_protobuf_extensions"; - rev = "v1.0.1"; - sha256 = "1d0c1isd2lk9pnfq2nk0aih356j30k3h1gi2w0ixsivi5csl7jya"; - }; - } - { - goPackagePath = "github.com/pmezard/go-difflib"; - fetch = { - type = "git"; - url = "https://github.com/pmezard/go-difflib"; - rev = "v1.0.0"; - sha256 = "0c1cn55m4rypmscgf0rrb88pn58j3ysvc2d0432dp3c6fqg6cnzw"; - }; - } - { - goPackagePath = "github.com/prometheus/client_golang"; - fetch = { - type = "git"; - url = "https://github.com/prometheus/client_golang"; - rev = "5636dc67ae77"; - sha256 = "0fb4w52zp0jk8218gwk4wgbhpj7d4hp6n00dvm8s0ajbysbx524d"; - }; - } - { - goPackagePath = "github.com/prometheus/client_model"; - fetch = { - type = "git"; - url = "https://github.com/prometheus/client_model"; - rev = "fa8ad6fec335"; - sha256 = "11a7v1fjzhhwsl128znjcf5v7v6129xjgkdpym2lial4lac1dhm9"; - }; - } - { - goPackagePath = "github.com/prometheus/common"; - fetch = { - type = "git"; - url = "https://github.com/prometheus/common"; - rev = "4402f4e5ea79"; - sha256 = "1nskicw0k0kay9dqg8hw2clgcnvjfcz839rijvrz4wh7gl42qiag"; - }; - } - { - goPackagePath = "github.com/prometheus/procfs"; - fetch = { - type = "git"; - url = "https://github.com/prometheus/procfs"; - rev = "abf152e5f3e9"; - sha256 = "0cp8lznv1b4zhi3wnbjkfxwzhkqd3wbmiy6mwgjanip8l9l3ykws"; - }; - } - { - goPackagePath = "github.com/satyrius/gonx"; - fetch = { - type = "git"; - url = "https://github.com/satyrius/gonx"; - rev = "47c52b995fe5"; - sha256 = "0f0b6ac9xlai168d32zas4v2afk5b2q1bs0qi3dykkk6lhq7b58m"; - }; - } - { - goPackagePath = "github.com/smartystreets/assertions"; - fetch = { - type = "git"; - url = "https://github.com/smartystreets/assertions"; - rev = "b2de0cb4f26d"; - sha256 = "1i7ldgavgl35c7gk25p7bvdr282ckng090zr4ch9mk1705akx09y"; - }; - } - { - goPackagePath = "github.com/smartystreets/goconvey"; - fetch = { - type = "git"; - url = "https://github.com/smartystreets/goconvey"; - rev = "200a235640ff"; - sha256 = "08hgfwjs5zqwsx1z5ja15d0g4glprb3ck7dfi88kwv5q5fl1p139"; - }; - } - { - goPackagePath = "github.com/stretchr/objx"; - fetch = { - type = "git"; - url = "https://github.com/stretchr/objx"; - rev = "v0.1.0"; - sha256 = "19ynspzjdynbi85xw06mh8ad5j0qa1vryvxjgvbnyrr8rbm4vd8w"; - }; - } - { - goPackagePath = "github.com/stretchr/testify"; - fetch = { - type = "git"; - url = "https://github.com/stretchr/testify"; - rev = "v1.4.0"; - sha256 = "187i5g88sxfy4vxpm7dw1gwv29pa2qaq475lxrdh5livh69wqfjb"; - }; - } - { - goPackagePath = "golang.org/x/sys"; - fetch = { - type = "git"; - url = "https://go.googlesource.com/sys"; - rev = "c200b10b5d5e"; - sha256 = "1f764m3q05q2dq1pdms07jcixw4xakqw46w1djrmbhjmd9q8b0av"; - }; - } - { - goPackagePath = "gopkg.in/check.v1"; - fetch = { - type = "git"; - url = "https://gopkg.in/check.v1"; - rev = "788fd7840127"; - sha256 = "0v3bim0j375z81zrpr5qv42knqs0y2qv2vkjiqi5axvb78slki1a"; - }; - } - { - goPackagePath = "gopkg.in/fsnotify.v1"; - fetch = { - type = "git"; - url = "https://gopkg.in/fsnotify.v1"; - rev = "v1.4.7"; - sha256 = "07va9crci0ijlivbb7q57d2rz9h27zgn2fsm60spjsqpdbvyrx4g"; - }; - } - { - goPackagePath = "gopkg.in/tomb.v1"; - fetch = { - type = "git"; - url = "https://gopkg.in/tomb.v1"; - rev = "dd632973f1e7"; - sha256 = "1lqmq1ag7s4b3gc3ddvr792c5xb5k6sfn0cchr3i2s7f1c231zjv"; - }; - } - { - goPackagePath = "gopkg.in/yaml.v2"; - fetch = { - type = "git"; - url = "https://gopkg.in/yaml.v2"; - rev = "v2.2.4"; - sha256 = "11bwj757wi8kdrcnlgfqb8vv2d2xdhlghmyagd19i62khrkchsg2"; - }; - } -] From e8488ab545383da8e189ccaddc33c6d9ef5a5ef1 Mon Sep 17 00:00:00 2001 From: Arnout Engelen Date: Mon, 21 Dec 2020 15:33:39 +0100 Subject: [PATCH 15/29] notion: 4.0.1 -> 4.0.2 What's New The highlight of this release is fixing the long-standing issue where Firefox popups would sometimes show up in the wrong place on multi-monitor setups (https://github.com/raboof/notion/issue/59), thanks to great detective work by @florolf . Thanks! * Initial implementation of _NET_FRAME_EXTENTS (https://github.com/raboof/notion/pull/303) @florolf/@raboof * Fix potential livelock in do_timer_set (https://github.com/raboof/notion/pull/302) @dnr Docs * Add more docs to cfg_notion.lua (https://github.com/raboof/notion/pull/283) @raboof Under the hood * Trigger release drafter from github actions (https://github.com/raboof/notion/pull/304) @raboof * Remove some colorful language (https://github.com/raboof/notion/pull/296) @raboof https://github.com/raboof/notion/releases/tag/4.0.2 --- pkgs/applications/window-managers/notion/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/applications/window-managers/notion/default.nix b/pkgs/applications/window-managers/notion/default.nix index 494bb9ff1b71..a00462e81113 100644 --- a/pkgs/applications/window-managers/notion/default.nix +++ b/pkgs/applications/window-managers/notion/default.nix @@ -7,13 +7,13 @@ stdenv.mkDerivation rec { pname = "notion"; - version = "4.0.1"; + version = "4.0.2"; src = fetchFromGitHub { owner = "raboof"; repo = pname; rev = version; - sha256 = "1s0fyacygvc9iz7b9v3b2cmzzqc02nh4g1p9bfcxbg254iscd502"; + sha256 = "14swd0yqci8lxn259fkd9w92bgyf4rmjwgvgyqp78wlfix6ai4mv"; }; nativeBuildInputs = [ pkgconfig makeWrapper groff ]; From fd018e990b57b7decf495ee783f8875befed6acc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=94=D0=B0=D0=BC=D1=98=D0=B0=D0=BD=20=D0=93=D0=B5=D0=BE?= =?UTF-8?q?=D1=80=D0=B3=D0=B8=D0=B5=D0=B2=D1=81=D0=BA=D0=B8?= Date: Mon, 7 Sep 2020 11:59:17 +0200 Subject: [PATCH 16/29] uwsgi: set UWSGICONFIG_PHPPATH to the php.dev store uwsgi needs to run php-config to get the include path. set the UWSGICONFIG_PHPPATH to the php-config in the php.dev store. Patch common.h to directly include php_session.h (since it's a separate package on nixos). NIX_CFLAGS_LINK was removed since it doesn't seem to be used at all https://github.com/unbit/uwsgi/blob/master/plugins/php/common.h --- ...o-ext-session-php_session.h-on-NixOS.patch | 29 +++++++++++++++++++ pkgs/servers/uwsgi/default.nix | 12 +++++--- 2 files changed, 37 insertions(+), 4 deletions(-) create mode 100644 pkgs/servers/uwsgi/0001-no-ext-session-php_session.h-on-NixOS.patch diff --git a/pkgs/servers/uwsgi/0001-no-ext-session-php_session.h-on-NixOS.patch b/pkgs/servers/uwsgi/0001-no-ext-session-php_session.h-on-NixOS.patch new file mode 100644 index 000000000000..bde8f4fda1dc --- /dev/null +++ b/pkgs/servers/uwsgi/0001-no-ext-session-php_session.h-on-NixOS.patch @@ -0,0 +1,29 @@ +From 6b9b3559d8ce59eda6c5cd6f04224cebaaa5d0ea Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?=D0=94=D0=B0=D0=BC=D1=98=D0=B0=D0=BD=20=D0=93=D0=B5=D0=BE?= + =?UTF-8?q?=D1=80=D0=B3=D0=B8=D0=B5=D0=B2=D1=81=D0=BA=D0=B8?= + +Date: Tue, 8 Sep 2020 17:11:39 +0200 +Subject: [PATCH] no ext/session/php_session.h on NixOS + +on NixOS php_session.h is in its own package, and is not installed in +ext/session/ +--- + plugins/php/common.h | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/plugins/php/common.h b/plugins/php/common.h +index 9bf1c069..be93f519 100644 +--- a/plugins/php/common.h ++++ b/plugins/php/common.h +@@ -10,7 +10,7 @@ + #endif + #include "ext/standard/info.h" + +-#include "ext/session/php_session.h" ++#include "php_session.h" + + #include + +-- +2.28.0 + diff --git a/pkgs/servers/uwsgi/default.nix b/pkgs/servers/uwsgi/default.nix index 39a3113eb410..bb2742ecba8e 100644 --- a/pkgs/servers/uwsgi/default.nix +++ b/pkgs/servers/uwsgi/default.nix @@ -38,8 +38,12 @@ let php-embed = php.override { (lib.nameValuePair "php" { # usage: https://uwsgi-docs.readthedocs.io/en/latest/PHP.html#running-php-apps-with-nginx path = "plugins/php"; - inputs = [ php-embed ] ++ php-embed.buildInputs; - NIX_CFLAGS_LINK = [ "-L${libmysqlclient}/lib/mysql" ]; + inputs = [ + php-embed + php-embed.extensions.session + php-embed.extensions.session.dev + php-embed.unwrapped.dev + ] ++ php-embed.unwrapped.buildInputs; }) ]; @@ -61,6 +65,8 @@ stdenv.mkDerivation rec { sha256 = "0256v72b7zr6ds4srpaawk1px3bp0djdwm239w3wrxpw7dzk1gjn"; }; + patches = [ ./0001-no-ext-session-php_session.h-on-NixOS.patch ]; + nativeBuildInputs = [ python3 pkgconfig ]; buildInputs = [ jansson pcre ] @@ -94,8 +100,6 @@ stdenv.mkDerivation rec { ${lib.concatMapStringsSep "\n" (x: x.install or "") needed} ''; - NIX_CFLAGS_LINK = toString (lib.optional withSystemd "-lsystemd" ++ lib.concatMap (x: x.NIX_CFLAGS_LINK or []) needed); - meta = with stdenv.lib; { homepage = "https://uwsgi-docs.readthedocs.org/en/latest/"; description = "A fast, self-healing and developer/sysadmin-friendly application container server coded in pure C"; From 22e8804308ff8e328f9f17210573a8a66c3b9a3f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=94=D0=B0=D0=BC=D1=98=D0=B0=D0=BD=20=D0=93=D0=B5=D0=BE?= =?UTF-8?q?=D1=80=D0=B3=D0=B8=D0=B5=D0=B2=D1=81=D0=BA=D0=B8?= Date: Wed, 9 Sep 2020 12:51:40 +0200 Subject: [PATCH 17/29] uwsgi: the php plugin needs to link with session.so On NixOS the session.so php extension is a separate package (and not builtin in libphp.so). But since the uwsgi php plugin uses the session mechanisms, we need to link the plugin to that library too. With this change uwsgipluginpy is hacked to take an additional UWSGICONFIG_PHP_LDFLAGS environment variable and add it to its LDFLAGS, and then in the nix expression the UWSGICONFIG_PHP_LDFLAGS is set to point to php.extensions.session --- pkgs/servers/uwsgi/additional-php-ldflags.patch | 13 +++++++++++++ pkgs/servers/uwsgi/default.nix | 15 ++++++++++++++- ...> no-ext-session-php_session.h-on-NixOS.patch} | 0 3 files changed, 27 insertions(+), 1 deletion(-) create mode 100644 pkgs/servers/uwsgi/additional-php-ldflags.patch rename pkgs/servers/uwsgi/{0001-no-ext-session-php_session.h-on-NixOS.patch => no-ext-session-php_session.h-on-NixOS.patch} (100%) diff --git a/pkgs/servers/uwsgi/additional-php-ldflags.patch b/pkgs/servers/uwsgi/additional-php-ldflags.patch new file mode 100644 index 000000000000..8549d5c2d03c --- /dev/null +++ b/pkgs/servers/uwsgi/additional-php-ldflags.patch @@ -0,0 +1,13 @@ +diff --git a/plugins/php/uwsgiplugin.py b/plugins/php/uwsgiplugin.py +index d930c44e..2fcbc22a 100644 +--- a/plugins/php/uwsgiplugin.py ++++ b/plugins/php/uwsgiplugin.py +@@ -17,6 +17,8 @@ php_version = os.popen(PHPPATH + ' --version').read().rstrip().split('.')[0] + CFLAGS = [os.popen(PHPPATH + ' --includes').read().rstrip(), '-Wno-sign-compare'] + LDFLAGS = os.popen(PHPPATH + ' --ldflags').read().rstrip().split() + ++LDFLAGS.append(os.environ.get('UWSGICONFIG_PHP_LDFLAGS', [])) ++ + if ld_run_path: + LDFLAGS.append('-L%s' % ld_run_path) + os.environ['LD_RUN_PATH'] = ld_run_path diff --git a/pkgs/servers/uwsgi/default.nix b/pkgs/servers/uwsgi/default.nix index bb2742ecba8e..cf69d76bd1a4 100644 --- a/pkgs/servers/uwsgi/default.nix +++ b/pkgs/servers/uwsgi/default.nix @@ -65,7 +65,10 @@ stdenv.mkDerivation rec { sha256 = "0256v72b7zr6ds4srpaawk1px3bp0djdwm239w3wrxpw7dzk1gjn"; }; - patches = [ ./0001-no-ext-session-php_session.h-on-NixOS.patch ]; + patches = [ + ./no-ext-session-php_session.h-on-NixOS.patch + ./additional-php-ldflags.patch + ]; nativeBuildInputs = [ python3 pkgconfig ]; @@ -89,6 +92,16 @@ stdenv.mkDerivation rec { substituteAll ${./nixos.ini} buildconf/nixos.ini ''; + # this is a hack to make the php plugin link with session.so (which on nixos is a separate package) + # the hack works in coordination with ./additional-php-ldflags.patch + UWSGICONFIG_PHP_LDFLAGS = lib.optionalString (builtins.any (x: x.name == "php") needed) + lib.concatStringsSep "," [ + "-Wl" + "-rpath=${php-embed.extensions.session}/lib/php/extensions/" + "--library-path=${php-embed.extensions.session}/lib/php/extensions/" + "-l:session.so" + ]; + buildPhase = '' mkdir -p $pluginDir python3 uwsgiconfig.py --build nixos diff --git a/pkgs/servers/uwsgi/0001-no-ext-session-php_session.h-on-NixOS.patch b/pkgs/servers/uwsgi/no-ext-session-php_session.h-on-NixOS.patch similarity index 100% rename from pkgs/servers/uwsgi/0001-no-ext-session-php_session.h-on-NixOS.patch rename to pkgs/servers/uwsgi/no-ext-session-php_session.h-on-NixOS.patch From c32ef2192f0117e5355e3a049f79bcf3fda9f504 Mon Sep 17 00:00:00 2001 From: rnhmjoj Date: Mon, 21 Dec 2020 00:22:29 +0100 Subject: [PATCH 18/29] nixos/tests/uwsgi: test PHP plugin --- nixos/tests/uwsgi.nix | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/nixos/tests/uwsgi.nix b/nixos/tests/uwsgi.nix index 7f4945a88030..5c0b294e2d29 100644 --- a/nixos/tests/uwsgi.nix +++ b/nixos/tests/uwsgi.nix @@ -4,12 +4,13 @@ import ./make-test-python.nix ({ pkgs, ... }: meta = with pkgs.stdenv.lib.maintainers; { maintainers = [ lnl7 ]; }; + machine = { pkgs, ... }: { services.uwsgi.enable = true; - services.uwsgi.plugins = [ "python3" ]; + services.uwsgi.plugins = [ "python3" "php" ]; services.uwsgi.instance = { type = "emperor"; - vassals.hello = { + vassals.python = { type = "normal"; master = true; workers = 2; @@ -25,6 +26,17 @@ import ./make-test-python.nix ({ pkgs, ... }: ''; pythonPackages = self: with self; [ flask ]; }; + vassals.php = { + type = "normal"; + master = true; + workers = 2; + http-socket = ":8001"; + http-socket-modifier1 = 14; + php-index = "index.php"; + php-docroot = pkgs.writeTextDir "index.php" '' + + ''; + }; }; }; @@ -33,6 +45,8 @@ import ./make-test-python.nix ({ pkgs, ... }: machine.wait_for_unit("multi-user.target") machine.wait_for_unit("uwsgi.service") machine.wait_for_open_port(8000) + machine.wait_for_open_port(8001) assert "Hello World" in machine.succeed("curl -fv 127.0.0.1:8000") + assert "Hello World" in machine.succeed("curl -fv 127.0.0.1:8001") ''; }) From 5e5139ea207aa30455e9ce0524d65230eeff0c9f Mon Sep 17 00:00:00 2001 From: Martin Weinelt Date: Mon, 21 Dec 2020 17:46:42 +0100 Subject: [PATCH 19/29] python3Packages.ircstates: 0.11.6 -> 0.11.7 --- pkgs/development/python-modules/ircstates/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/development/python-modules/ircstates/default.nix b/pkgs/development/python-modules/ircstates/default.nix index 3e54451eb362..b5404febfa3c 100644 --- a/pkgs/development/python-modules/ircstates/default.nix +++ b/pkgs/development/python-modules/ircstates/default.nix @@ -10,14 +10,14 @@ buildPythonPackage rec { pname = "ircstates"; - version = "0.11.6"; + version = "0.11.7"; disabled = pythonOlder "3.6"; # f-strings src = fetchFromGitHub { owner = "jesopo"; repo = pname; rev = "v${version}"; - sha256 = "0yhrd1nmf9fjwknbga8wspy3bab40lgp4qqnr7w75x9wq5ivmqhg"; + sha256 = "00dyd6mry10na98x1gs92xnfpjf1wd9zpblx1wcx8ggv5rqvgqrm"; }; propagatedBuildInputs = [ From e189177c26a5d9250db1d7cb10bc072a4cf174c3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=94=D0=B0=D0=BC=D1=98=D0=B0=D0=BD=20=D0=93=D0=B5=D0=BE?= =?UTF-8?q?=D1=80=D0=B3=D0=B8=D0=B5=D0=B2=D1=81=D0=BA=D0=B8?= Date: Mon, 21 Dec 2020 17:52:04 +0100 Subject: [PATCH 20/29] uwsgi: add passthru.tests.uwsgi to derivation --- pkgs/servers/uwsgi/default.nix | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/pkgs/servers/uwsgi/default.nix b/pkgs/servers/uwsgi/default.nix index cf69d76bd1a4..18f2846b47db 100644 --- a/pkgs/servers/uwsgi/default.nix +++ b/pkgs/servers/uwsgi/default.nix @@ -1,4 +1,4 @@ -{ stdenv, lib, fetchurl, pkgconfig, jansson, pcre +{ stdenv, nixosTests, lib, fetchurl, pkgconfig, jansson, pcre # plugins: list of strings, eg. [ "python2" "python3" ] , plugins ? [] , pam, withPAM ? stdenv.isLinux @@ -120,4 +120,7 @@ stdenv.mkDerivation rec { maintainers = with maintainers; [ abbradar schneefux globin ]; platforms = platforms.unix; }; + + passthru.tests.uwsgi = nixosTests.uwsgi; + } From 4bded92554967c3475702d32abc260e37bc2a2d2 Mon Sep 17 00:00:00 2001 From: John Ericson Date: Mon, 21 Dec 2020 18:13:41 +0000 Subject: [PATCH 21/29] nixos/thermald: Allow switching package Sometimes newer versions than what nixpkgs provides is needed for certain hardware, especially for stable releases where I will backport this commit. --- nixos/modules/services/hardware/thermald.nix | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/nixos/modules/services/hardware/thermald.nix b/nixos/modules/services/hardware/thermald.nix index 6be255cebf1d..aa936ac09d1d 100644 --- a/nixos/modules/services/hardware/thermald.nix +++ b/nixos/modules/services/hardware/thermald.nix @@ -23,19 +23,26 @@ in { default = null; description = "the thermald manual configuration file."; }; + + package = mkOption { + type = types.package; + default = pkgs.thermald; + defaultText = "pkgs.thermald"; + description = "Which thermald package to use."; + }; }; }; ###### implementation config = mkIf cfg.enable { - services.dbus.packages = [ pkgs.thermald ]; + services.dbus.packages = [ cfg.package ]; systemd.services.thermald = { description = "Thermal Daemon Service"; wantedBy = [ "multi-user.target" ]; serviceConfig = { ExecStart = '' - ${pkgs.thermald}/sbin/thermald \ + ${cfg.package}/sbin/thermald \ --no-daemon \ ${optionalString cfg.debug "--loglevel=debug"} \ ${optionalString (cfg.configFile != null) "--config-file ${cfg.configFile}"} \ From 7e63c97223525b4dbbce6a57bfde866555d31de4 Mon Sep 17 00:00:00 2001 From: Sohalt Date: Mon, 21 Dec 2020 19:32:25 +0100 Subject: [PATCH 22/29] folly: 2019.11.11.00 -> 2020.09.28.00, fix build (#99133) --- pkgs/development/libraries/folly/default.nix | 43 ++++++++++++++++---- 1 file changed, 35 insertions(+), 8 deletions(-) diff --git a/pkgs/development/libraries/folly/default.nix b/pkgs/development/libraries/folly/default.nix index be648cf5a845..62f73a361916 100644 --- a/pkgs/development/libraries/folly/default.nix +++ b/pkgs/development/libraries/folly/default.nix @@ -1,18 +1,37 @@ -{ stdenv, fetchFromGitHub, cmake, boost, libevent, double-conversion, glog -, gflags, libiberty, openssl }: +{ stdenv +, fetchFromGitHub +, cmake +, boost +, libevent +, double-conversion +, glog +, gflags +, libiberty +, lz4 +, lzma +, zlib +, jemalloc +, openssl +, pkg-config +, libunwind +, fmt +}: -stdenv.mkDerivation rec { +stdenv.mkDerivation (rec { pname = "folly"; - version = "2019.11.11.00"; + version = "2020.09.28.00"; src = fetchFromGitHub { owner = "facebook"; repo = "folly"; rev = "v${version}"; - sha256 = "1sgv7sdalbs7zhz3zcc95gn2h8j2xjf7hkw2c618zc3pdn6aa58w"; + sha256 = "1ry2nqfavcbz0jvsqw71105gbxm5hpmdi2k1w155m957jrv3n5vg"; }; - nativeBuildInputs = [ cmake ]; + nativeBuildInputs = [ + cmake + pkg-config + ]; # See CMake/folly-deps.cmake in the Folly source tree. buildInputs = [ @@ -23,9 +42,15 @@ stdenv.mkDerivation rec { libevent libiberty openssl + lz4 + lzma + zlib + jemalloc + libunwind + fmt ]; - enableParallelBuilding = true; + cmakeFlags = [ "-DBUILD_SHARED_LIBS=ON" ]; meta = with stdenv.lib; { description = "An open-source C++ library developed and used at Facebook"; @@ -35,4 +60,6 @@ stdenv.mkDerivation rec { platforms = [ "x86_64-linux" "x86_64-darwin" ]; maintainers = with maintainers; [ abbradar pierreis ]; }; -} +} // stdenv.lib.optionalAttrs stdenv.isDarwin { + LDFLAGS = "-ljemalloc"; +}) From 95c123d1831832af617c1deef15fc3f076f51a09 Mon Sep 17 00:00:00 2001 From: Marc Seeger Date: Sun, 20 Dec 2020 08:41:06 -0800 Subject: [PATCH 23/29] libsmartcols: init at v2.36.1 --- .../libraries/libsmartcols/default.nix | 32 +++++++++++++++++++ pkgs/top-level/all-packages.nix | 2 ++ 2 files changed, 34 insertions(+) create mode 100644 pkgs/development/libraries/libsmartcols/default.nix diff --git a/pkgs/development/libraries/libsmartcols/default.nix b/pkgs/development/libraries/libsmartcols/default.nix new file mode 100644 index 000000000000..bb3de08cf72e --- /dev/null +++ b/pkgs/development/libraries/libsmartcols/default.nix @@ -0,0 +1,32 @@ +{ stdenv, fetchFromGitHub, autoreconfHook, pkgconfig, python3 }: + +stdenv.mkDerivation rec { + name = "libsmartcols"; + version = "v2.36.1"; + + nativeBuildInputs = [ autoreconfHook pkgconfig python3 ]; + + src = fetchFromGitHub { + owner = "karelzak"; + repo = "util-linux"; + rev = version; + sha256 = "0z7nv054pqhlihqiw0vk3h40j0cxk1yxf8zzh0ddmvk6834cnyxs"; + }; + + configureFlags = [ "--disable-all-programs" "--enable-libsmartcols" ]; + + buildPhase = '' + make libsmartcols.la + ''; + + installTargets = [ "install-am" "install-pkgconfigDATA" ]; + + meta = { + description = "smart column output alignment library"; + homepage = https://github.com/karelzak/util-linux/tree/master/libsmartcols; + license = stdenv.lib.licenses.gpl2Plus; + platforms = stdenv.lib.platforms.linux ++ stdenv.lib.platforms.darwin; + maintainers = with stdenv.lib.maintainers; [ rb2k ]; + }; +} + diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 3937ae566e68..b69a6b8469a0 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -5174,6 +5174,8 @@ in libcryptui = callPackage ../development/libraries/libcryptui { }; + libsmartcols = callPackage ../development/libraries/libsmartcols { }; + libsmi = callPackage ../development/libraries/libsmi { }; libgen-cli = callPackage ../tools/misc/libgen-cli { }; From bbd59a224be98b12c616aa16615640d2a191a0d7 Mon Sep 17 00:00:00 2001 From: Martin Weinelt Date: Sun, 18 Oct 2020 16:17:32 +0200 Subject: [PATCH 24/29] python3Packages.pytest-trio: 0.6.0 -> 0.7.0 --- pkgs/development/python-modules/pytest-trio/default.nix | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pkgs/development/python-modules/pytest-trio/default.nix b/pkgs/development/python-modules/pytest-trio/default.nix index 923fe14cfacf..7bf05013f214 100644 --- a/pkgs/development/python-modules/pytest-trio/default.nix +++ b/pkgs/development/python-modules/pytest-trio/default.nix @@ -3,14 +3,14 @@ buildPythonPackage rec { pname = "pytest-trio"; - version = "0.6.0"; - disabled = pythonOlder "3.5"; + version = "0.7.0"; + disabled = pythonOlder "3.6"; src = fetchFromGitHub { owner = "python-trio"; repo = pname; rev = "v${version}"; - sha256 = "09v2031yxm8ryhq12205ldcck76n3wwqhjjsgfmn6dxfiqb0vbw9"; + sha256 = "0bhh2nknhp14jzsx4zzpqm4qnfaihyi65cjf6kf6qgdhc0ax6nf4"; }; propagatedBuildInputs = [ From 65fd0312778cc86f0db9c4c87edcd5b06aacee7f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maximilian=20G=C3=BCntner?= Date: Sun, 13 Dec 2020 18:26:13 +0100 Subject: [PATCH 25/29] nixos: add prometheus_nginxlog_exporter module + test --- .../monitoring/prometheus/exporters.nix | 1 + .../prometheus/exporters/nginxlog.nix | 51 ++++++++++++++++ nixos/tests/prometheus-exporters.nix | 61 +++++++++++++++++++ .../prometheus/nginxlog-exporter.nix | 4 +- 4 files changed, 116 insertions(+), 1 deletion(-) create mode 100644 nixos/modules/services/monitoring/prometheus/exporters/nginxlog.nix diff --git a/nixos/modules/services/monitoring/prometheus/exporters.nix b/nixos/modules/services/monitoring/prometheus/exporters.nix index 1f8c5aeded1f..683dc0390c59 100644 --- a/nixos/modules/services/monitoring/prometheus/exporters.nix +++ b/nixos/modules/services/monitoring/prometheus/exporters.nix @@ -37,6 +37,7 @@ let "modemmanager" "nextcloud" "nginx" + "nginxlog" "node" "openvpn" "postfix" diff --git a/nixos/modules/services/monitoring/prometheus/exporters/nginxlog.nix b/nixos/modules/services/monitoring/prometheus/exporters/nginxlog.nix new file mode 100644 index 000000000000..8c1f552d58a7 --- /dev/null +++ b/nixos/modules/services/monitoring/prometheus/exporters/nginxlog.nix @@ -0,0 +1,51 @@ +{ config, lib, pkgs, options }: + +with lib; + +let + cfg = config.services.prometheus.exporters.nginxlog; +in { + port = 9117; + extraOpts = { + settings = mkOption { + type = types.attrs; + default = {}; + description = '' + All settings of nginxlog expressed as an Nix attrset. + + Check the official documentation for the corresponding YAML + settings that can all be used here: https://github.com/martin-helmich/prometheus-nginxlog-exporter + + The `listen` object is already generated by `port`, `listenAddress` and `metricsEndpoint` and + will be merged with the value of `settings` before writting it as JSON. + ''; + }; + + metricsEndpoint = mkOption { + type = types.str; + default = "/metrics"; + description = '' + Path under which to expose metrics. + ''; + }; + }; + + serviceOpts = let + listenConfig = { + listen = { + port = cfg.port; + address = cfg.listenAddress; + metrics_endpoint = cfg.metricsEndpoint; + }; + }; + completeConfig = pkgs.writeText "nginxlog-exporter.yaml" (builtins.toJSON (lib.recursiveUpdate listenConfig cfg.settings)); + in { + serviceConfig = { + ExecStart = '' + ${pkgs.prometheus-nginxlog-exporter}/bin/prometheus-nginxlog-exporter -config-file ${completeConfig} + ''; + Restart="always"; + ProtectSystem="full"; + }; + }; +} diff --git a/nixos/tests/prometheus-exporters.nix b/nixos/tests/prometheus-exporters.nix index 3eb4341e39cb..ffa7f420c093 100644 --- a/nixos/tests/prometheus-exporters.nix +++ b/nixos/tests/prometheus-exporters.nix @@ -444,6 +444,67 @@ let ''; }; + nginxlog = { + exporterConfig = { + enable = true; + group = "nginx"; + settings = { + namespaces = [ + { + name = "filelogger"; + source = { + files = [ "/var/log/nginx/filelogger.access.log" ]; + }; + } + { + name = "syslogger"; + source = { + syslog = { + listen_address = "udp://127.0.0.1:10000"; + format = "rfc3164"; + tags = ["nginx"]; + }; + }; + } + ]; + }; + }; + metricProvider = { + services.nginx = { + enable = true; + httpConfig = '' + server { + listen 80; + server_name filelogger.local; + access_log /var/log/nginx/filelogger.access.log; + } + server { + listen 81; + server_name syslogger.local; + access_log syslog:server=127.0.0.1:10000,tag=nginx,severity=info; + } + ''; + }; + }; + exporterTest = '' + wait_for_unit("nginx.service") + wait_for_unit("prometheus-nginxlog-exporter.service") + wait_for_open_port(9117) + wait_for_open_port(80) + wait_for_open_port(81) + succeed("curl http://localhost") + execute("sleep 1") + succeed( + "curl -sSf http://localhost:9117/metrics | grep 'filelogger_http_response_count_total' | grep -q 1" + ) + succeed("curl http://localhost:81") + execute("sleep 1") + succeed( + "curl -sSf http://localhost:9117/metrics | grep 'syslogger_http_response_count_total' | grep -q 1" + ) + ''; + }; + node = { exporterConfig = { enable = true; diff --git a/pkgs/servers/monitoring/prometheus/nginxlog-exporter.nix b/pkgs/servers/monitoring/prometheus/nginxlog-exporter.nix index a9276e0c924a..771bbf39b081 100644 --- a/pkgs/servers/monitoring/prometheus/nginxlog-exporter.nix +++ b/pkgs/servers/monitoring/prometheus/nginxlog-exporter.nix @@ -1,4 +1,4 @@ -{ stdenv, buildGoModule, fetchFromGitHub }: +{ stdenv, buildGoModule, fetchFromGitHub, nixosTests }: buildGoModule rec { pname = "nginxlog_exporter"; @@ -17,6 +17,8 @@ buildGoModule rec { runVend = true; + passthru.tests = { inherit (nixosTests.prometheus-exporters) nginxlog; }; + meta = with stdenv.lib; { description = "Export metrics from Nginx access log files to Prometheus"; homepage = "https://github.com/martin-helmich/prometheus-nginxlog-exporter"; From bf444739ec4fae170fa7fc3fdaa201a914000b03 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20=C4=8Cun=C3=A1t?= Date: Mon, 21 Dec 2020 22:13:29 +0100 Subject: [PATCH 26/29] Revert "Merge #107253: bintools-wrapper: fix inverted link32 check" This reverts commit 241c3912555e0f80e3a61a808c70986f0f4cb8fe, reversing changes made to ab8c2b2b2ca6579104f5692ead859db31030de35. These toolchain changes are too problematic, so reverting for now; see https://github.com/NixOS/nixpkgs/pull/107086#issuecomment-749196366 --- pkgs/build-support/bintools-wrapper/ld-wrapper.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/build-support/bintools-wrapper/ld-wrapper.sh b/pkgs/build-support/bintools-wrapper/ld-wrapper.sh index bdffdc3b7855..abecf6a8e5d1 100644 --- a/pkgs/build-support/bintools-wrapper/ld-wrapper.sh +++ b/pkgs/build-support/bintools-wrapper/ld-wrapper.sh @@ -145,7 +145,7 @@ then done fi -if [[ "$link32" = "1" && "$setDynamicLinker" = 1 && -e "@out@/nix-support/dynamic-linker-m32" ]]; then +if [[ "$link32" = "0" && "$setDynamicLinker" = 1 && -e "@out@/nix-support/dynamic-linker-m32" ]]; then # We have an alternate 32-bit linker and we're producing a 32-bit ELF, let's # use it. extraAfter+=( From 363175cd99a14fd13f6019e8049271d2d65b7151 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20=C4=8Cun=C3=A1t?= Date: Mon, 21 Dec 2020 22:20:42 +0100 Subject: [PATCH 27/29] Revert "bintools-wrapper: skip dynamic linker for static binaries" This reverts commit ccfd26ef14ea213320f0b49db3fb347785b38f06. These toolchain changes are too problematic, so reverting for now; see https://github.com/NixOS/nixpkgs/pull/107086#issuecomment-749196366 --- .../bintools-wrapper/add-flags.sh | 5 ---- .../bintools-wrapper/default.nix | 8 ++++++- .../bintools-wrapper/ld-wrapper.sh | 13 +---------- pkgs/build-support/cc-wrapper/cc-wrapper.sh | 6 ----- pkgs/test/cc-wrapper/default.nix | 23 ++++--------------- 5 files changed, 12 insertions(+), 43 deletions(-) diff --git a/pkgs/build-support/bintools-wrapper/add-flags.sh b/pkgs/build-support/bintools-wrapper/add-flags.sh index 83d47027104c..e99beb381586 100644 --- a/pkgs/build-support/bintools-wrapper/add-flags.sh +++ b/pkgs/build-support/bintools-wrapper/add-flags.sh @@ -3,7 +3,6 @@ var_templates_list=( NIX_IGNORE_LD_THROUGH_GCC NIX_LDFLAGS NIX_LDFLAGS_BEFORE - NIX_DYNAMIC_LINKER NIX_LDFLAGS_AFTER NIX_LDFLAGS_HARDEN NIX_HARDENING_ENABLE @@ -26,10 +25,6 @@ if [ -e @out@/nix-support/libc-ldflags ]; then NIX_LDFLAGS_@suffixSalt@+=" $(< @out@/nix-support/libc-ldflags)" fi -if [ -z "$NIX_DYNAMIC_LINKER_@suffixSalt@" ] && [ -e @out@/nix-support/dynamic-linker ]; then - NIX_DYNAMIC_LINKER_@suffixSalt@="$(< @out@/nix-support/dynamic-linker)" -fi - if [ -e @out@/nix-support/libc-ldflags-before ]; then NIX_LDFLAGS_BEFORE_@suffixSalt@="$(< @out@/nix-support/libc-ldflags-before) $NIX_LDFLAGS_BEFORE_@suffixSalt@" fi diff --git a/pkgs/build-support/bintools-wrapper/default.nix b/pkgs/build-support/bintools-wrapper/default.nix index 21c66521fb2c..6da0e58436d0 100644 --- a/pkgs/build-support/bintools-wrapper/default.nix +++ b/pkgs/build-support/bintools-wrapper/default.nix @@ -243,7 +243,13 @@ stdenv.mkDerivation { if [ -e ${libc_lib}/lib/32/ld-linux.so.2 ]; then echo ${libc_lib}/lib/32/ld-linux.so.2 > $out/nix-support/dynamic-linker-m32 fi - '') + '' + '' + # The dynamic linker is passed in `ldflagsBefore' to allow + # explicit overrides of the dynamic linker by callers to ld + # (the *last* value counts, so ours should come first). + + '' + echo -dynamic-linker "$dynamicLinker" >> $out/nix-support/libc-ldflags-before + '') + '' fi '') diff --git a/pkgs/build-support/bintools-wrapper/ld-wrapper.sh b/pkgs/build-support/bintools-wrapper/ld-wrapper.sh index abecf6a8e5d1..81b5a90edd5c 100644 --- a/pkgs/build-support/bintools-wrapper/ld-wrapper.sh +++ b/pkgs/build-support/bintools-wrapper/ld-wrapper.sh @@ -20,7 +20,6 @@ if [ -z "${NIX_BINTOOLS_WRAPPER_FLAGS_SET_@suffixSalt@:-}" ]; then source @out@/nix-support/add-flags.sh fi -setDynamicLinker=1 # Optionally filter out paths not refering to the store. expandResponseParams "$@" @@ -48,11 +47,6 @@ if [[ "${NIX_ENFORCE_PURITY:-}" = 1 && -n "${NIX_STORE:-}" # Our ld is not built with sysroot support (Can we fix that?) : else - if [[ "$p" = -static || "$p" = -static-pie ]]; then - # Using a dynamic linker for static binaries can lead to crashes. - # This was observed for rust binaries. - setDynamicLinker=0 - fi rest+=("$p") fi n+=1 @@ -69,11 +63,6 @@ extraBefore=(${hardeningLDFlags[@]+"${hardeningLDFlags[@]}"}) if [ -z "${NIX_LDFLAGS_SET_@suffixSalt@:-}" ]; then extraAfter+=($NIX_LDFLAGS_@suffixSalt@) extraBefore+=($NIX_LDFLAGS_BEFORE_@suffixSalt@) - # By adding dynamic linker to extraBefore we allow the users set their - # own dynamic linker as NIX_LD_FLAGS will override earlier set flags - if [ "$setDynamicLinker" = 1 ]; then - extraBefore+=("-dynamic-linker" "$NIX_DYNAMIC_LINKER_@suffixSalt@") - fi fi extraAfter+=($NIX_LDFLAGS_AFTER_@suffixSalt@) @@ -145,7 +134,7 @@ then done fi -if [[ "$link32" = "0" && "$setDynamicLinker" = 1 && -e "@out@/nix-support/dynamic-linker-m32" ]]; then +if [ -e "@out@/nix-support/dynamic-linker-m32" ] && (( "$link32" )); then # We have an alternate 32-bit linker and we're producing a 32-bit ELF, let's # use it. extraAfter+=( diff --git a/pkgs/build-support/cc-wrapper/cc-wrapper.sh b/pkgs/build-support/cc-wrapper/cc-wrapper.sh index 1c60beb9bf57..7e734f57773e 100644 --- a/pkgs/build-support/cc-wrapper/cc-wrapper.sh +++ b/pkgs/build-support/cc-wrapper/cc-wrapper.sh @@ -28,7 +28,6 @@ cc1=0 [[ "@prog@" = *++ ]] && isCpp=1 || isCpp=0 cppInclude=1 cInclude=1 -setDynamicLinker=1 expandResponseParams "$@" declare -i n=0 @@ -59,8 +58,6 @@ while (( "$n" < "$nParams" )); do cppInclude=0 elif [ "$p" = -nostdinc++ ]; then cppInclude=0 - elif [[ "$p" = -static || "$p" = -static-pie ]]; then - setDynamicLinker=0 elif [[ "$p" != -?* ]]; then # A dash alone signifies standard input; it is not a flag nonFlagArgs=1 @@ -155,9 +152,6 @@ if [ "$dontLink" != 1 ]; then for i in $NIX_LDFLAGS_BEFORE_@suffixSalt@; do extraBefore+=("-Wl,$i") done - if [ "$setDynamicLinker" = 1 ]; then - extraBefore+=("-Wl,-dynamic-linker=$NIX_DYNAMIC_LINKER_@suffixSalt@") - fi for i in $NIX_LDFLAGS_@suffixSalt@; do if [ "${i:0:3}" = -L/ ]; then extraAfter+=("$i") diff --git a/pkgs/test/cc-wrapper/default.nix b/pkgs/test/cc-wrapper/default.nix index fae3448c44c6..c0c89d63ffff 100644 --- a/pkgs/test/cc-wrapper/default.nix +++ b/pkgs/test/cc-wrapper/default.nix @@ -1,13 +1,11 @@ -{ stdenv, glibc }: +{ stdenv }: with stdenv.lib; let # Sanitizers are not supported on Darwin. # Sanitizer headers aren't available in older libc++ stdenvs due to a bug - sanitizersWorking = !stdenv.hostPlatform.isMusl && ( - (stdenv.cc.isClang && versionAtLeast (getVersion stdenv.cc.name) "5.0.0") - || (stdenv.cc.isGNU && stdenv.isLinux) - ); - staticLibc = optionalString (stdenv.hostPlatform.libc == "glibc") "-L ${glibc.static}/lib"; + sanitizersWorking = + (stdenv.cc.isClang && versionAtLeast (getVersion stdenv.cc.name) "5.0.0") + || (stdenv.cc.isGNU && stdenv.isLinux); in stdenv.mkDerivation { name = "cc-wrapper-test"; @@ -30,19 +28,6 @@ in stdenv.mkDerivation { ./core-foundation-check ''} - - ${optionalString (!stdenv.isDarwin) '' - printf "checking whether compiler builds valid static C binaries... " >&2 - $CC ${staticLibc} -static -o cc-static ${./cc-main.c} - ./cc-static - # our glibc does not have pie enabled yet. - ${optionalString (stdenv.hostPlatform.isMusl && stdenv.cc.isGNU) '' - printf "checking whether compiler builds valid static pie C binaries... " >&2 - $CC ${staticLibc} -static-pie -o cc-static-pie ${./cc-main.c} - ./cc-static-pie - ''} - ''} - printf "checking whether compiler uses NIX_CFLAGS_COMPILE... " >&2 mkdir -p foo/include cp ${./foo.c} foo/include/foo.h From ac03cfa3c57027e82073ea7db71248d4ab78af66 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20=C4=8Cun=C3=A1t?= Date: Mon, 21 Dec 2020 22:21:35 +0100 Subject: [PATCH 28/29] Revert "Merge #94582: clang, cc-wrapper: Move `--gcc-toolchain` logic..." This reverts commit 0f25eb3e7dc1ad60288f95b7bc9ec8c7ce3959e5, reversing changes made to df91ae1ac0733a5ad42411bc72826b4eee9e5111. These toolchain changes are too problematic, so reverting for now; see https://github.com/NixOS/nixpkgs/pull/107086#issuecomment-749196366 --- pkgs/build-support/cc-wrapper/default.nix | 17 ++--------------- pkgs/development/compilers/llvm/10/default.nix | 2 ++ pkgs/development/compilers/llvm/11/default.nix | 2 ++ pkgs/development/compilers/llvm/5/default.nix | 2 ++ pkgs/development/compilers/llvm/6/default.nix | 2 ++ pkgs/development/compilers/llvm/7/default.nix | 2 ++ pkgs/development/compilers/llvm/8/default.nix | 2 ++ pkgs/development/compilers/llvm/9/default.nix | 2 ++ pkgs/top-level/all-packages.nix | 2 ++ 9 files changed, 18 insertions(+), 15 deletions(-) diff --git a/pkgs/build-support/cc-wrapper/default.nix b/pkgs/build-support/cc-wrapper/default.nix index ad9d2e1b8416..09cef8b8678d 100644 --- a/pkgs/build-support/cc-wrapper/default.nix +++ b/pkgs/build-support/cc-wrapper/default.nix @@ -278,25 +278,12 @@ stdenv.mkDerivation { ## ## GCC libs for non-GCC support ## - + optionalString useGccForLibs ('' + + optionalString useGccForLibs '' - '' - # In theory we shouldn't need this, because we always set `useLLVM` on - # Darwin, and maybe also break down `useLLVM` into fine-grained use flags - # (libgcc vs compiler-rt, ld.lld vs legacy, libc++ vs libstdc++, etc.) - # since Darwin isn't `useLLVM` on all counts. (See - # https://clang.llvm.org/docs/Toolchain.html for all the axes one might - # break `useLLVM` into.) - # - # But, for now, we haven't doneo these things, so we use - # `targetPlatform.isLinux` as a proxy. - + optionalString targetPlatform.isLinux '' - echo "--gcc-toolchain=${gccForLibs}" >> $out/nix-support/cc-cflags - '' + '' echo "-B${gccForLibs}/lib/gcc/${targetPlatform.config}/${gccForLibs.version}" >> $out/nix-support/cc-cflags echo "-L${gccForLibs}/lib/gcc/${targetPlatform.config}/${gccForLibs.version}" >> $out/nix-support/cc-ldflags echo "-L${gccForLibs.lib}/${targetPlatform.config}/lib" >> $out/nix-support/cc-ldflags - '') + '' ## ## General libc support diff --git a/pkgs/development/compilers/llvm/10/default.nix b/pkgs/development/compilers/llvm/10/default.nix index d18d15420e97..3d2cb3544b9f 100644 --- a/pkgs/development/compilers/llvm/10/default.nix +++ b/pkgs/development/compilers/llvm/10/default.nix @@ -26,6 +26,8 @@ let ln -s "${targetLlvmLibraries.compiler-rt.out}/lib" "$rsrc/lib" ln -s "${targetLlvmLibraries.compiler-rt.out}/share" "$rsrc/share" echo "-resource-dir=$rsrc" >> $out/nix-support/cc-cflags + '' + stdenv.lib.optionalString (stdenv.targetPlatform.isLinux && !(stdenv.targetPlatform.useLLVM or false)) '' + echo "--gcc-toolchain=${gccForLibs}" >> $out/nix-support/cc-cflags ''; in { diff --git a/pkgs/development/compilers/llvm/11/default.nix b/pkgs/development/compilers/llvm/11/default.nix index 8da51af68a25..e6765ec68990 100644 --- a/pkgs/development/compilers/llvm/11/default.nix +++ b/pkgs/development/compilers/llvm/11/default.nix @@ -26,6 +26,8 @@ let ln -s "${targetLlvmLibraries.compiler-rt.out}/lib" "$rsrc/lib" ln -s "${targetLlvmLibraries.compiler-rt.out}/share" "$rsrc/share" echo "-resource-dir=$rsrc" >> $out/nix-support/cc-cflags + '' + stdenv.lib.optionalString (stdenv.targetPlatform.isLinux && !(stdenv.targetPlatform.useLLVM or false)) '' + echo "--gcc-toolchain=${gccForLibs}" >> $out/nix-support/cc-cflags ''; in { diff --git a/pkgs/development/compilers/llvm/5/default.nix b/pkgs/development/compilers/llvm/5/default.nix index c06522c7e822..36495249d16f 100644 --- a/pkgs/development/compilers/llvm/5/default.nix +++ b/pkgs/development/compilers/llvm/5/default.nix @@ -25,6 +25,8 @@ let ln -s "${cc}/lib/clang/${release_version}/include" "$rsrc" ln -s "${targetLlvmLibraries.compiler-rt.out}/lib" "$rsrc/lib" echo "-resource-dir=$rsrc" >> $out/nix-support/cc-cflags + '' + stdenv.lib.optionalString (stdenv.targetPlatform.isLinux && !(stdenv.targetPlatform.useLLVM or false)) '' + echo "--gcc-toolchain=${gccForLibs}" >> $out/nix-support/cc-cflags ''; in { diff --git a/pkgs/development/compilers/llvm/6/default.nix b/pkgs/development/compilers/llvm/6/default.nix index d9a57258e5a0..4c2e87ec5e1a 100644 --- a/pkgs/development/compilers/llvm/6/default.nix +++ b/pkgs/development/compilers/llvm/6/default.nix @@ -25,6 +25,8 @@ let ln -s "${cc}/lib/clang/${release_version}/include" "$rsrc" ln -s "${targetLlvmLibraries.compiler-rt.out}/lib" "$rsrc/lib" echo "-resource-dir=$rsrc" >> $out/nix-support/cc-cflags + '' + stdenv.lib.optionalString (stdenv.targetPlatform.isLinux && !(stdenv.targetPlatform.useLLVM or false)) '' + echo "--gcc-toolchain=${gccForLibs}" >> $out/nix-support/cc-cflags ''; in { diff --git a/pkgs/development/compilers/llvm/7/default.nix b/pkgs/development/compilers/llvm/7/default.nix index 317e344f72e2..3dd067ae607e 100644 --- a/pkgs/development/compilers/llvm/7/default.nix +++ b/pkgs/development/compilers/llvm/7/default.nix @@ -25,6 +25,8 @@ let ln -s "${cc}/lib/clang/${release_version}/include" "$rsrc" ln -s "${targetLlvmLibraries.compiler-rt.out}/lib" "$rsrc/lib" echo "-resource-dir=$rsrc" >> $out/nix-support/cc-cflags + '' + stdenv.lib.optionalString (stdenv.targetPlatform.isLinux && !(stdenv.targetPlatform.useLLVM or false)) '' + echo "--gcc-toolchain=${gccForLibs}" >> $out/nix-support/cc-cflags ''; in { diff --git a/pkgs/development/compilers/llvm/8/default.nix b/pkgs/development/compilers/llvm/8/default.nix index 7f87ea9fc05d..6e80737f32ad 100644 --- a/pkgs/development/compilers/llvm/8/default.nix +++ b/pkgs/development/compilers/llvm/8/default.nix @@ -25,6 +25,8 @@ let ln -s "${cc}/lib/clang/${release_version}/include" "$rsrc" ln -s "${targetLlvmLibraries.compiler-rt.out}/lib" "$rsrc/lib" echo "-resource-dir=$rsrc" >> $out/nix-support/cc-cflags + '' + stdenv.lib.optionalString (stdenv.targetPlatform.isLinux && !(stdenv.targetPlatform.useLLVM or false)) '' + echo "--gcc-toolchain=${gccForLibs}" >> $out/nix-support/cc-cflags ''; in { diff --git a/pkgs/development/compilers/llvm/9/default.nix b/pkgs/development/compilers/llvm/9/default.nix index b3afbca68bac..6f5bdb8e8cc1 100644 --- a/pkgs/development/compilers/llvm/9/default.nix +++ b/pkgs/development/compilers/llvm/9/default.nix @@ -25,6 +25,8 @@ let ln -s "${cc}/lib/clang/${release_version}/include" "$rsrc" ln -s "${targetLlvmLibraries.compiler-rt.out}/lib" "$rsrc/lib" echo "-resource-dir=$rsrc" >> $out/nix-support/cc-cflags + '' + stdenv.lib.optionalString (stdenv.targetPlatform.isLinux && !(stdenv.targetPlatform.useLLVM or false)) '' + echo "--gcc-toolchain=${gccForLibs}" >> $out/nix-support/cc-cflags ''; in { diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 6b89e68817f3..86077b5a6d8d 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -8987,6 +8987,8 @@ in mkdir -p "$rsrc/lib" ln -s "${cc}/lib" "$rsrc/include" echo "-resource-dir=$rsrc" >> $out/nix-support/cc-cflags + '' + stdenv.lib.optionalString (stdenv.targetPlatform.isLinux && !(stdenv.targetPlatform.useLLVM or false)) '' + echo "--gcc-toolchain=${gccForLibs}" >> $out/nix-support/cc-cflags ''; }; From 583470209f9d51f1c6884e0afb5a9949ac988bcd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20=C4=8Cun=C3=A1t?= Date: Mon, 21 Dec 2020 22:48:19 +0100 Subject: [PATCH 29/29] Revert "Merge #97536: uwsgi: fix compiling and linking" This reverts commit df4d0b03efe967e07b227edc004169701e39fd3e, reversing changes made to b333263534e23f6e5a394193c5cb2c5f793f6525. It didn't even evaluate! --- nixos/tests/uwsgi.nix | 18 ++--------- .../uwsgi/additional-php-ldflags.patch | 13 -------- pkgs/servers/uwsgi/default.nix | 30 ++++--------------- ...o-ext-session-php_session.h-on-NixOS.patch | 29 ------------------ 4 files changed, 7 insertions(+), 83 deletions(-) delete mode 100644 pkgs/servers/uwsgi/additional-php-ldflags.patch delete mode 100644 pkgs/servers/uwsgi/no-ext-session-php_session.h-on-NixOS.patch diff --git a/nixos/tests/uwsgi.nix b/nixos/tests/uwsgi.nix index 5c0b294e2d29..7f4945a88030 100644 --- a/nixos/tests/uwsgi.nix +++ b/nixos/tests/uwsgi.nix @@ -4,13 +4,12 @@ import ./make-test-python.nix ({ pkgs, ... }: meta = with pkgs.stdenv.lib.maintainers; { maintainers = [ lnl7 ]; }; - machine = { pkgs, ... }: { services.uwsgi.enable = true; - services.uwsgi.plugins = [ "python3" "php" ]; + services.uwsgi.plugins = [ "python3" ]; services.uwsgi.instance = { type = "emperor"; - vassals.python = { + vassals.hello = { type = "normal"; master = true; workers = 2; @@ -26,17 +25,6 @@ import ./make-test-python.nix ({ pkgs, ... }: ''; pythonPackages = self: with self; [ flask ]; }; - vassals.php = { - type = "normal"; - master = true; - workers = 2; - http-socket = ":8001"; - http-socket-modifier1 = 14; - php-index = "index.php"; - php-docroot = pkgs.writeTextDir "index.php" '' - - ''; - }; }; }; @@ -45,8 +33,6 @@ import ./make-test-python.nix ({ pkgs, ... }: machine.wait_for_unit("multi-user.target") machine.wait_for_unit("uwsgi.service") machine.wait_for_open_port(8000) - machine.wait_for_open_port(8001) assert "Hello World" in machine.succeed("curl -fv 127.0.0.1:8000") - assert "Hello World" in machine.succeed("curl -fv 127.0.0.1:8001") ''; }) diff --git a/pkgs/servers/uwsgi/additional-php-ldflags.patch b/pkgs/servers/uwsgi/additional-php-ldflags.patch deleted file mode 100644 index 8549d5c2d03c..000000000000 --- a/pkgs/servers/uwsgi/additional-php-ldflags.patch +++ /dev/null @@ -1,13 +0,0 @@ -diff --git a/plugins/php/uwsgiplugin.py b/plugins/php/uwsgiplugin.py -index d930c44e..2fcbc22a 100644 ---- a/plugins/php/uwsgiplugin.py -+++ b/plugins/php/uwsgiplugin.py -@@ -17,6 +17,8 @@ php_version = os.popen(PHPPATH + ' --version').read().rstrip().split('.')[0] - CFLAGS = [os.popen(PHPPATH + ' --includes').read().rstrip(), '-Wno-sign-compare'] - LDFLAGS = os.popen(PHPPATH + ' --ldflags').read().rstrip().split() - -+LDFLAGS.append(os.environ.get('UWSGICONFIG_PHP_LDFLAGS', [])) -+ - if ld_run_path: - LDFLAGS.append('-L%s' % ld_run_path) - os.environ['LD_RUN_PATH'] = ld_run_path diff --git a/pkgs/servers/uwsgi/default.nix b/pkgs/servers/uwsgi/default.nix index 18f2846b47db..39a3113eb410 100644 --- a/pkgs/servers/uwsgi/default.nix +++ b/pkgs/servers/uwsgi/default.nix @@ -1,4 +1,4 @@ -{ stdenv, nixosTests, lib, fetchurl, pkgconfig, jansson, pcre +{ stdenv, lib, fetchurl, pkgconfig, jansson, pcre # plugins: list of strings, eg. [ "python2" "python3" ] , plugins ? [] , pam, withPAM ? stdenv.isLinux @@ -38,12 +38,8 @@ let php-embed = php.override { (lib.nameValuePair "php" { # usage: https://uwsgi-docs.readthedocs.io/en/latest/PHP.html#running-php-apps-with-nginx path = "plugins/php"; - inputs = [ - php-embed - php-embed.extensions.session - php-embed.extensions.session.dev - php-embed.unwrapped.dev - ] ++ php-embed.unwrapped.buildInputs; + inputs = [ php-embed ] ++ php-embed.buildInputs; + NIX_CFLAGS_LINK = [ "-L${libmysqlclient}/lib/mysql" ]; }) ]; @@ -65,11 +61,6 @@ stdenv.mkDerivation rec { sha256 = "0256v72b7zr6ds4srpaawk1px3bp0djdwm239w3wrxpw7dzk1gjn"; }; - patches = [ - ./no-ext-session-php_session.h-on-NixOS.patch - ./additional-php-ldflags.patch - ]; - nativeBuildInputs = [ python3 pkgconfig ]; buildInputs = [ jansson pcre ] @@ -92,16 +83,6 @@ stdenv.mkDerivation rec { substituteAll ${./nixos.ini} buildconf/nixos.ini ''; - # this is a hack to make the php plugin link with session.so (which on nixos is a separate package) - # the hack works in coordination with ./additional-php-ldflags.patch - UWSGICONFIG_PHP_LDFLAGS = lib.optionalString (builtins.any (x: x.name == "php") needed) - lib.concatStringsSep "," [ - "-Wl" - "-rpath=${php-embed.extensions.session}/lib/php/extensions/" - "--library-path=${php-embed.extensions.session}/lib/php/extensions/" - "-l:session.so" - ]; - buildPhase = '' mkdir -p $pluginDir python3 uwsgiconfig.py --build nixos @@ -113,6 +94,8 @@ stdenv.mkDerivation rec { ${lib.concatMapStringsSep "\n" (x: x.install or "") needed} ''; + NIX_CFLAGS_LINK = toString (lib.optional withSystemd "-lsystemd" ++ lib.concatMap (x: x.NIX_CFLAGS_LINK or []) needed); + meta = with stdenv.lib; { homepage = "https://uwsgi-docs.readthedocs.org/en/latest/"; description = "A fast, self-healing and developer/sysadmin-friendly application container server coded in pure C"; @@ -120,7 +103,4 @@ stdenv.mkDerivation rec { maintainers = with maintainers; [ abbradar schneefux globin ]; platforms = platforms.unix; }; - - passthru.tests.uwsgi = nixosTests.uwsgi; - } diff --git a/pkgs/servers/uwsgi/no-ext-session-php_session.h-on-NixOS.patch b/pkgs/servers/uwsgi/no-ext-session-php_session.h-on-NixOS.patch deleted file mode 100644 index bde8f4fda1dc..000000000000 --- a/pkgs/servers/uwsgi/no-ext-session-php_session.h-on-NixOS.patch +++ /dev/null @@ -1,29 +0,0 @@ -From 6b9b3559d8ce59eda6c5cd6f04224cebaaa5d0ea Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?=D0=94=D0=B0=D0=BC=D1=98=D0=B0=D0=BD=20=D0=93=D0=B5=D0=BE?= - =?UTF-8?q?=D1=80=D0=B3=D0=B8=D0=B5=D0=B2=D1=81=D0=BA=D0=B8?= - -Date: Tue, 8 Sep 2020 17:11:39 +0200 -Subject: [PATCH] no ext/session/php_session.h on NixOS - -on NixOS php_session.h is in its own package, and is not installed in -ext/session/ ---- - plugins/php/common.h | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/plugins/php/common.h b/plugins/php/common.h -index 9bf1c069..be93f519 100644 ---- a/plugins/php/common.h -+++ b/plugins/php/common.h -@@ -10,7 +10,7 @@ - #endif - #include "ext/standard/info.h" - --#include "ext/session/php_session.h" -+#include "php_session.h" - - #include - --- -2.28.0 -