From ab22a0803996c40eee80aa0f81d151090ab15b01 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Czy=C5=BC?= Date: Sat, 11 Feb 2017 04:57:57 +0000 Subject: [PATCH 1/9] test all postgresql versions, test server restart (#1735) --- nixos/release.nix | 2 +- nixos/tests/postgresql.nix | 70 ++++++++++++++++++++++++-------------- 2 files changed, 46 insertions(+), 26 deletions(-) diff --git a/nixos/release.nix b/nixos/release.nix index 0f298188c6c7..a8c7d9fd0c35 100644 --- a/nixos/release.nix +++ b/nixos/release.nix @@ -286,7 +286,7 @@ in rec { tests.openssh = callTest tests/openssh.nix {}; #tests.panamax = hydraJob (import tests/panamax.nix { system = "x86_64-linux"; }); tests.peerflix = callTest tests/peerflix.nix {}; - tests.postgresql = callTest tests/postgresql.nix {}; + tests.postgresql = callSubTests tests/postgresql.nix {}; tests.printing = callTest tests/printing.nix {}; tests.proxy = callTest tests/proxy.nix {}; tests.pumpio = callTest tests/pump.io.nix {}; diff --git a/nixos/tests/postgresql.nix b/nixos/tests/postgresql.nix index f17384b44ba6..1f4f43a26669 100644 --- a/nixos/tests/postgresql.nix +++ b/nixos/tests/postgresql.nix @@ -1,26 +1,46 @@ -import ./make-test.nix ({ pkgs, ...} : { - name = "postgresql"; - meta = with pkgs.stdenv.lib.maintainers; { - maintainers = [ zagy ]; - }; - - nodes = { - master = - { pkgs, config, ... }: - - { - services.postgresql.enable = true; - services.postgresql.initialScript = pkgs.writeText "postgresql-init.sql" - '' - CREATE ROLE postgres WITH superuser login createdb; - ''; - }; - }; - - testScript = '' - startAll; - $master->waitForUnit("postgresql"); - $master->sleep(10); # Hopefully this is long enough!! - $master->succeed("echo 'select 1' | sudo -u postgres psql"); +{ system ? builtins.currentSystem }: +with import ../lib/testing.nix { inherit system; }; +with pkgs.lib; +let + postgresql-versions = pkgs.callPackages ../../pkgs/servers/sql/postgresql { }; + test-sql = pkgs.writeText "postgresql-test" '' + CREATE EXTENSION pgcrypto; -- just to check if lib loading works + CREATE TABLE sth ( + id int + ); + INSERT INTO sth (id) VALUES (1); + INSERT INTO sth (id) VALUES (1); + INSERT INTO sth (id) VALUES (1); + INSERT INTO sth (id) VALUES (1); + INSERT INTO sth (id) VALUES (1); ''; -}) + make-postgresql-test = postgresql-name: postgresql-package: { + name = postgresql-name; + meta = with pkgs.stdenv.lib.maintainers; { + maintainers = [ zagy ]; + }; + + machine = {pkgs, config, ...}: + { + services.postgresql.package=postgresql-package; + services.postgresql.enable = true; + }; + + testScript = '' + $machine->start; + $machine->waitForUnit("postgresql"); + # postgresql should be available just after unit start + $machine->succeed("cat ${test-sql} | psql postgres"); + $machine->shutdown; # make sure that postgresql survive restart (bug #1735) + sleep(2); + $machine->start; + $machine->waitForUnit("postgresql"); + $machine->fail('test $(psql postgres -tAc "SELECT * FROM sth;"|wc -l) -eq 3'); + $machine->succeed('test $(psql postgres -tAc "SELECT * FROM sth;"|wc -l) -eq 5'); + $machine->fail('test $(psql postgres -tAc "SELECT * FROM sth;"|wc -l) -eq 4'); + $machine->shutdown; + ''; + + }; +in + mapAttrs' (p-name: p-package: {name=p-name; value=make-postgresql-test p-name p-package;}) postgresql-versions From 518e5c09a85345512d712ee964f367adb6401803 Mon Sep 17 00:00:00 2001 From: Florian Jacob Date: Tue, 28 Feb 2017 14:10:52 +0100 Subject: [PATCH 2/9] avahi-daemon service: Add option to enable point-to-point interfaces. --- nixos/modules/services/networking/avahi-daemon.nix | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/nixos/modules/services/networking/avahi-daemon.nix b/nixos/modules/services/networking/avahi-daemon.nix index 6a786e75bbc8..e7ef68c90b2a 100644 --- a/nixos/modules/services/networking/avahi-daemon.nix +++ b/nixos/modules/services/networking/avahi-daemon.nix @@ -21,6 +21,7 @@ let use-ipv6=${if ipv6 then "yes" else "no"} ${optionalString (interfaces!=null) "allow-interfaces=${concatStringsSep "," interfaces}"} ${optionalString (domainName!=null) "domain-name=${domainName}"} + allow-point-to-point=${if allowPointToPoint then "yes" else "no"} [wide-area] enable-wide-area=${if wideArea then "yes" else "no"} @@ -98,6 +99,15 @@ in ''; }; + allowPointToPoint = mkOption { + default = false; + description= '' + Whether to use POINTTOPOINT interfaces. Might make mDNS unreliable due to usually large + latencies with such links and opens a potential security hole by allowing mDNS access from Internet + connections. Use with care and YMMV! + ''; + }; + wideArea = mkOption { default = true; description = ''Whether to enable wide-area service discovery.''; From f50258bba59c125e9a35102b1f6b7ace186786c9 Mon Sep 17 00:00:00 2001 From: Benjamin Staffin Date: Thu, 6 Apr 2017 21:17:25 -0400 Subject: [PATCH 3/9] vscode: 1.10.2 -> 1.11.1 --- pkgs/applications/editors/vscode/default.nix | 22 ++++++++++++-------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/pkgs/applications/editors/vscode/default.nix b/pkgs/applications/editors/vscode/default.nix index c46640602141..bdd8bd441678 100644 --- a/pkgs/applications/editors/vscode/default.nix +++ b/pkgs/applications/editors/vscode/default.nix @@ -2,24 +2,28 @@ makeWrapper, libXScrnSaver }: let - version = "1.10.2"; - rev = "8076a19fdcab7e1fc1707952d652f0bb6c6db331"; + version = "1.11.1"; + rev = "d9484d12b38879b7f4cdd1150efeb2fd2c1fbf39"; channel = "stable"; - # The revision can be obtained with the following command (see https://github.com/NixOS/nixpkgs/issues/22465): - # curl -w "%{url_effective}\n" -I -L -s -S https://vscode-update.azurewebsites.net/latest/linux-x64/stable -o /dev/null + # The revision and build timestamps can be obtained with the following + # command (see https://github.com/NixOS/nixpkgs/issues/22465): + # for a in x64 ia32; do + # curl -w "%{url_effective}\n" -I -L -s -S -o /dev/null \ + # "https://vscode-update.azurewebsites.net/latest/linux-${arch}/stable" \ + # done - sha256 = if stdenv.system == "i686-linux" then "1rhwrpv17c8j06qja7i58cggzka8jm9v9h27jy22z30yxjz0p241" - else if stdenv.system == "x86_64-linux" then "1c1w7wc39a5vdap8j143ym976p9l9iwns1y28mcgjwrihdlb5wb8" - else if stdenv.system == "x86_64-darwin" then "1zznsn84k79lqirzv950q7caq7c88yh2gglwjc11y8k69awmlpva" + sha256 = if stdenv.system == "i686-linux" then "14wdblh7q3m5qdsm34dpg5p7qk6llrbqk60md8wd0fb4chpvrq94" + else if stdenv.system == "x86_64-linux" then "0rmzvaiar3y062mbrggiwjbwxs7izcih5333rn208ax4jxmbk4pc" + else if stdenv.system == "x86_64-darwin" then "1f3zdwsz0l6r7c2k25a7j5m0dl78219jzg4axcmbfa2qcs2hw0x6" else throw "Unsupported system: ${stdenv.system}"; urlBase = "https://az764295.vo.msecnd.net/${channel}/${rev}/"; urlStr = if stdenv.system == "i686-linux" then - urlBase + "code-${channel}-code_${version}-1488982317_i386.tar.gz" + urlBase + "code-${channel}-code_${version}-1491487843_i386.tar.gz" else if stdenv.system == "x86_64-linux" then - urlBase + "code-${channel}-code_${version}-1488981323_amd64.tar.gz" + urlBase + "code-${channel}-code_${version}-1491486998_amd64.tar.gz" else if stdenv.system == "x86_64-darwin" then urlBase + "VSCode-darwin-${channel}.zip" else throw "Unsupported system: ${stdenv.system}"; From 4a08528b4aad94332006ad4c190c3f2fa207d630 Mon Sep 17 00:00:00 2001 From: Benjamin Staffin Date: Thu, 6 Apr 2017 22:18:18 -0400 Subject: [PATCH 4/9] vscode: Revamp URL generation scheme This ought to be way easier to maintain! Now just the version number and sha256 hashes need to be updated for an update, and there are no more manual cmdline steps to get version hashes and timestamps. Related to #22465 --- pkgs/applications/editors/vscode/default.nix | 34 ++++++++------------ 1 file changed, 13 insertions(+), 21 deletions(-) diff --git a/pkgs/applications/editors/vscode/default.nix b/pkgs/applications/editors/vscode/default.nix index bdd8bd441678..a2854208a493 100644 --- a/pkgs/applications/editors/vscode/default.nix +++ b/pkgs/applications/editors/vscode/default.nix @@ -3,37 +3,29 @@ let version = "1.11.1"; - rev = "d9484d12b38879b7f4cdd1150efeb2fd2c1fbf39"; channel = "stable"; - # The revision and build timestamps can be obtained with the following - # command (see https://github.com/NixOS/nixpkgs/issues/22465): - # for a in x64 ia32; do - # curl -w "%{url_effective}\n" -I -L -s -S -o /dev/null \ - # "https://vscode-update.azurewebsites.net/latest/linux-${arch}/stable" \ - # done + plat = { + "i686-linux" = "linux-ia32"; + "x86_64-linux" = "linux-x64"; + "x86_64-darwin" = "darwin"; + }.${stdenv.system}; - sha256 = if stdenv.system == "i686-linux" then "14wdblh7q3m5qdsm34dpg5p7qk6llrbqk60md8wd0fb4chpvrq94" - else if stdenv.system == "x86_64-linux" then "0rmzvaiar3y062mbrggiwjbwxs7izcih5333rn208ax4jxmbk4pc" - else if stdenv.system == "x86_64-darwin" then "1f3zdwsz0l6r7c2k25a7j5m0dl78219jzg4axcmbfa2qcs2hw0x6" - else throw "Unsupported system: ${stdenv.system}"; + sha256 = { + "i686-linux" = "14wdblh7q3m5qdsm34dpg5p7qk6llrbqk60md8wd0fb4chpvrq94"; + "x86_64-linux" = "0rmzvaiar3y062mbrggiwjbwxs7izcih5333rn208ax4jxmbk4pc"; + "x86_64-darwin" = "1f3zdwsz0l6r7c2k25a7j5m0dl78219jzg4axcmbfa2qcs2hw0x6"; + }.${stdenv.system}; - urlBase = "https://az764295.vo.msecnd.net/${channel}/${rev}/"; + archive_fmt = if stdenv.system == "x86_64-darwin" then "zip" else "tar.gz"; - urlStr = if stdenv.system == "i686-linux" then - urlBase + "code-${channel}-code_${version}-1491487843_i386.tar.gz" - else if stdenv.system == "x86_64-linux" then - urlBase + "code-${channel}-code_${version}-1491486998_amd64.tar.gz" - else if stdenv.system == "x86_64-darwin" then - urlBase + "VSCode-darwin-${channel}.zip" - else throw "Unsupported system: ${stdenv.system}"; in stdenv.mkDerivation rec { name = "vscode-${version}"; - inherit version; src = fetchurl { - url = urlStr; + name = "VSCode_${version}_${plat}.${archive_fmt}"; + url = "https://vscode-update.azurewebsites.net/${version}/${plat}/${channel}"; inherit sha256; }; From 0cacae6a5f283ccc1fee8ea718d7e4bb87e6c0a3 Mon Sep 17 00:00:00 2001 From: Dan Peebles Date: Thu, 6 Apr 2017 23:20:35 -0400 Subject: [PATCH 5/9] gcc6: fix for LLVM 4.0 --- .../gcc/6/darwin-const-correct.patch | 25 +++++++++++++++++++ pkgs/development/compilers/gcc/6/default.nix | 3 ++- 2 files changed, 27 insertions(+), 1 deletion(-) create mode 100644 pkgs/development/compilers/gcc/6/darwin-const-correct.patch diff --git a/pkgs/development/compilers/gcc/6/darwin-const-correct.patch b/pkgs/development/compilers/gcc/6/darwin-const-correct.patch new file mode 100644 index 000000000000..a9b9b85acab2 --- /dev/null +++ b/pkgs/development/compilers/gcc/6/darwin-const-correct.patch @@ -0,0 +1,25 @@ +From 5972cd58bde3bc8bacfe994e5b127c411241f255 Mon Sep 17 00:00:00 2001 +From: law +Date: Tue, 3 Jan 2017 05:36:40 +0000 +Subject: [PATCH] * config/darwin-driver.c (darwin_driver_init): + Const-correctness fixes for first_period and second_period variables. + +git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@244010 138bc75d-0d04-0410-961f-82ee72b054a4 +--- +diff --git a/gcc/config/darwin-driver.c b/gcc/config/darwin-driver.c +index 0c4f0cd..e3ed79d 100644 +--- a/gcc/config/darwin-driver.c ++++ b/gcc/config/darwin-driver.c +@@ -299,10 +299,10 @@ darwin_driver_init (unsigned int *decoded_options_count, + if (vers_string != NULL) + { + char *asm_major = NULL; +- char *first_period = strchr(vers_string, '.'); ++ const char *first_period = strchr(vers_string, '.'); + if (first_period != NULL) + { +- char *second_period = strchr(first_period+1, '.'); ++ const char *second_period = strchr(first_period+1, '.'); + if (second_period != NULL) + asm_major = xstrndup (vers_string, second_period-vers_string); + else diff --git a/pkgs/development/compilers/gcc/6/default.nix b/pkgs/development/compilers/gcc/6/default.nix index c6fac16a76ca..b4e588f6b143 100644 --- a/pkgs/development/compilers/gcc/6/default.nix +++ b/pkgs/development/compilers/gcc/6/default.nix @@ -73,7 +73,8 @@ let version = "6.3.0"; # The GNAT Makefiles did not pay attention to CFLAGS_FOR_TARGET for its # target libraries and tools. ++ optional langAda ../gnat-cflags.patch - ++ optional langFortran ../gfortran-driving.patch; + ++ optional langFortran ../gfortran-driving.patch + ++ optional stdenv.isDarwin ./darwin-const-correct.patch; # Kill this after 6.3.0 javaEcj = fetchurl { # The `$(top_srcdir)/ecj.jar' file is automatically picked up at From 1be61d192137ad022a9e1b8fd5d1f3d76fc5bbfc Mon Sep 17 00:00:00 2001 From: Dan Peebles Date: Thu, 6 Apr 2017 23:33:14 -0400 Subject: [PATCH 6/9] podofo: fix on LLVM 4 Not sure if the things I made optional on Darwin are really worth keeping at all, but I don't have a Linux box handy so I'm minimizing potential damage. --- pkgs/development/libraries/podofo/default.nix | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/pkgs/development/libraries/podofo/default.nix b/pkgs/development/libraries/podofo/default.nix index 5f5dcfb71e6a..1ba823540334 100644 --- a/pkgs/development/libraries/podofo/default.nix +++ b/pkgs/development/libraries/podofo/default.nix @@ -10,8 +10,12 @@ stdenv.mkDerivation rec { }; propagatedBuildInputs = [ zlib freetype libjpeg libtiff fontconfig openssl libpng libidn expat ]; - nativeBuildInputs = [ cmake gcc5 pkgconfig ]; - buildInputs = [ lua5 stdenv.cc.libc ]; + + # Does Linux really need gcc5? Darwin doesn't seem to... + nativeBuildInputs = [ cmake pkgconfig ] ++ stdenv.lib.optional stdenv.isLinux gcc5; + + # Does Linux really need libc here? Darwin doesn't seem to... + buildInputs = [ lua5 ] ++ stdenv.lib.optional stdenv.isLinux stdenv.cc.libc; crossAttrs = { propagatedBuildInputs = [ zlib.crossDrv freetype.crossDrv libjpeg.crossDrv From 987cafe5e041489ef530b4f8c55d0d5080e1de3e Mon Sep 17 00:00:00 2001 From: Benjamin Staffin Date: Thu, 6 Apr 2017 23:35:49 -0400 Subject: [PATCH 7/9] vscode: Add libxkbfile to rpath Otherwise vscode complains about it. --- pkgs/applications/editors/vscode/default.nix | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/pkgs/applications/editors/vscode/default.nix b/pkgs/applications/editors/vscode/default.nix index a2854208a493..b6734d09d0e7 100644 --- a/pkgs/applications/editors/vscode/default.nix +++ b/pkgs/applications/editors/vscode/default.nix @@ -1,5 +1,5 @@ { stdenv, lib, callPackage, fetchurl, unzip, atomEnv, makeDesktopItem, - makeWrapper, libXScrnSaver }: + makeWrapper, libXScrnSaver, libxkbfile }: let version = "1.11.1"; @@ -19,6 +19,13 @@ let archive_fmt = if stdenv.system == "x86_64-darwin" then "zip" else "tar.gz"; + rpath = lib.concatStringsSep ":" [ + atomEnv.libPath + "${lib.makeLibraryPath [libXScrnSaver]}/libXss.so.1" + "${lib.makeLibraryPath [libxkbfile]}/libxkbfile.so.1" + "$out/lib/vscode" + ]; + in stdenv.mkDerivation rec { name = "vscode-${version}"; @@ -41,7 +48,7 @@ in buildInputs = if stdenv.system == "x86_64-darwin" then [ unzip makeWrapper libXScrnSaver ] - else [ makeWrapper libXScrnSaver ]; + else [ makeWrapper libXScrnSaver libxkbfile ]; installPhase = if stdenv.system == "x86_64-darwin" then '' @@ -63,7 +70,7 @@ in postFixup = lib.optionalString (stdenv.system == "i686-linux" || stdenv.system == "x86_64-linux") '' patchelf \ --set-interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" \ - --set-rpath "${atomEnv.libPath}:${stdenv.lib.makeLibraryPath [libXScrnSaver]}/libXss.so.1:$out/lib/vscode" \ + --set-rpath "${rpath}" \ $out/lib/vscode/code ''; From 370452ef41eca6facdcb7d5a2728b33834694ff4 Mon Sep 17 00:00:00 2001 From: Markus Hauck Date: Fri, 7 Apr 2017 12:42:31 +0200 Subject: [PATCH 8/9] scalafmt: 0.6.7 -> 0.6.8 (#24699) --- pkgs/development/tools/scalafmt/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/development/tools/scalafmt/default.nix b/pkgs/development/tools/scalafmt/default.nix index b0d02cb8233a..dc7f96ea8a09 100644 --- a/pkgs/development/tools/scalafmt/default.nix +++ b/pkgs/development/tools/scalafmt/default.nix @@ -1,13 +1,13 @@ { stdenv, fetchurl, unzip, jre }: stdenv.mkDerivation rec { - version = "0.6.7"; + version = "0.6.8"; baseName = "scalafmt"; name = "${baseName}-${version}"; src = fetchurl { url = "https://github.com/scalameta/scalafmt/releases/download/v${version}/${baseName}.tar.gz"; - sha256 = "122x4a5x8024s7qqqs7vx8kz1x18q2l6alcvpzvsqkc304ybhfmh"; + sha256 = "1iaanrxk5lhxx1zj9gbxzgqbnyy1azfrab984mga7di5z1hs02s2"; }; unpackPhase = "tar xvzf $src"; From 27cec397b1229d6341de52ab878bad80c175c555 Mon Sep 17 00:00:00 2001 From: Dan Peebles Date: Fri, 7 Apr 2017 08:23:08 -0400 Subject: [PATCH 9/9] itk: 4.10 -> 4.11 Also includes a patch to work against clang 4, which was my original motivation for the 4.10 -> 4.11 upgrade (since it fixed another issue) --- pkgs/development/libraries/itk/default.nix | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/pkgs/development/libraries/itk/default.nix b/pkgs/development/libraries/itk/default.nix index 7e3220d8a37c..3865aa226f9a 100644 --- a/pkgs/development/libraries/itk/default.nix +++ b/pkgs/development/libraries/itk/default.nix @@ -1,13 +1,20 @@ -{ stdenv, fetchurl, cmake, libX11, libuuid, xz, vtk }: +{ stdenv, fetchurl, fetchpatch, cmake, libX11, libuuid, xz, vtk }: stdenv.mkDerivation rec { - name = "itk-4.10.0"; + name = "itk-4.11.0"; src = fetchurl { - url = mirror://sourceforge/itk/InsightToolkit-4.10.0.tar.xz; - sha256 = "0pxijhqsnwcp9jv1d8p11hsj90k8ajpwxhrnn8kk8c56k7y1207a"; + url = mirror://sourceforge/itk/InsightToolkit-4.11.0.tar.xz; + sha256 = "0axvyds0gads5914g0m70z5q16gzghr0rk0hy3qjpf1k9bkxvcq6"; }; + # Clang 4 dislikes signed comparisons of pointers against integers. Should no longer be + # necessary once we get past ITK 4.11. + patches = [ (fetchpatch { + url = "https://github.com/InsightSoftwareConsortium/ITK/commit/d1407a55910ad9c232f3d241833cfd2e59024946.patch"; + sha256 = "0h851afkv23fwgkibjss30fkbz4nkfg6rmmm4pfvkwpml23gzz7s"; + }) ]; + cmakeFlags = [ "-DBUILD_TESTING=OFF" "-DBUILD_EXAMPLES=OFF"