From 4cdf72504956c3a045d496cd2d9160e5b33df0ce Mon Sep 17 00:00:00 2001 From: "R. RyanTM" Date: Sat, 14 Aug 2021 08:41:12 +0000 Subject: [PATCH 1/3] libyamlcpp: 0.6.3 -> 0.7.0 --- pkgs/development/libraries/libyaml-cpp/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/development/libraries/libyaml-cpp/default.nix b/pkgs/development/libraries/libyaml-cpp/default.nix index 13141923202a..ebfe53b25138 100644 --- a/pkgs/development/libraries/libyaml-cpp/default.nix +++ b/pkgs/development/libraries/libyaml-cpp/default.nix @@ -2,13 +2,13 @@ stdenv.mkDerivation rec { pname = "libyaml-cpp"; - version = "0.6.3"; + version = "0.7.0"; src = fetchFromGitHub { owner = "jbeder"; repo = "yaml-cpp"; rev = "yaml-cpp-${version}"; - sha256 = "0ykkxzxcwwiv8l8r697gyqh1nl582krpvi7m7l6b40ijnk4pw30s"; + sha256 = "sha256-2tFWccifn0c2lU/U1WNg2FHrBohjx8CXMllPJCevaNk="; }; # implement https://github.com/jbeder/yaml-cpp/commit/52a1378e48e15d42a0b755af7146394c6eff998c From 218df5159cd2c0888afbc2cf6cefd280d007b22b Mon Sep 17 00:00:00 2001 From: Andreas Rammhold Date: Sat, 14 Aug 2021 13:27:15 +0200 Subject: [PATCH 2/3] sconsPackages: expose the python version used with scons This allows users of scons to pick the correct version of python. Previously we had issues with some build systems not picking the right python3 version when adding additional python modules to the build environment. A famous example of this is mongodb where additional python modules are required to run the scons build. This is change doesn't introduce rebuilds (to the best of my knowledge) as it only adds a passthru argument and changes how we pass the python version around. --- pkgs/development/tools/build-managers/scons/common.nix | 10 ++++++++-- .../development/tools/build-managers/scons/default.nix | 10 ++++++---- 2 files changed, 14 insertions(+), 6 deletions(-) diff --git a/pkgs/development/tools/build-managers/scons/common.nix b/pkgs/development/tools/build-managers/scons/common.nix index 6af302851234..da276be7287c 100644 --- a/pkgs/development/tools/build-managers/scons/common.nix +++ b/pkgs/development/tools/build-managers/scons/common.nix @@ -1,8 +1,8 @@ { version, sha256 }: -{ fetchurl, python3Packages, lib }: +{ fetchurl, python, lib }: -python3Packages.buildPythonApplication rec { +python.pkgs.buildPythonApplication rec { pname = "scons"; inherit version; @@ -29,6 +29,12 @@ python3Packages.buildPythonApplication rec { mv "$out/"*.1 "$out/share/man/man1/" ''; + passthru = { + # expose the used python version so tools using this (and extensing scos with other python modules) + # can use the exact same python version. + inherit python; + }; + meta = with lib; { description = "An improved, cross-platform substitute for Make"; longDescription = '' diff --git a/pkgs/development/tools/build-managers/scons/default.nix b/pkgs/development/tools/build-managers/scons/default.nix index 4b07eb0501d8..884d7482faf5 100644 --- a/pkgs/development/tools/build-managers/scons/default.nix +++ b/pkgs/development/tools/build-managers/scons/default.nix @@ -1,16 +1,18 @@ -{ callPackage, python2Packages }: +{ callPackage, python2, python3 }: let - mkScons = args: callPackage (import ./common.nix args) { }; + mkScons = args: callPackage (import ./common.nix args) { + python = python3; + }; in { scons_3_0_1 = (mkScons { version = "3.0.1"; sha256 = "0wzid419mlwqw9llrg8gsx4nkzhqy16m4m40r0xnh6cwscw5wir4"; - }).override { python3Packages = python2Packages; }; + }).override { python = python3; }; scons_3_1_2 = (mkScons { version = "3.1.2"; sha256 = "1yzq2gg9zwz9rvfn42v5jzl3g4qf1khhny6zfbi2hib55zvg60bq"; - }).override { python3Packages = python2Packages; }; + }).override { python = python2; }; scons_latest = mkScons { version = "4.1.0"; sha256 = "11axk03142ziax6i3wwy9qpqp7r3i7h5jg9y2xzph9i15rv8vlkj"; From cd20497c66d45df7f986c34f9105338df1de7d41 Mon Sep 17 00:00:00 2001 From: Andreas Rammhold Date: Sat, 14 Aug 2021 13:39:37 +0200 Subject: [PATCH 3/3] mongodb: pick python version from scons The python modules that we to the enviroment should always come from the same python version as scons as otherwise they can't be loaded. This unbreaks the build of mongodb 4.2 which pinned python to 3.8 while our python attribute moved on to 3.9 which is what scons uses now. --- pkgs/servers/nosql/mongodb/mongodb.nix | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/pkgs/servers/nosql/mongodb/mongodb.nix b/pkgs/servers/nosql/mongodb/mongodb.nix index 8a66528d81cd..7c66d348ffb0 100644 --- a/pkgs/servers/nosql/mongodb/mongodb.nix +++ b/pkgs/servers/nosql/mongodb/mongodb.nix @@ -1,5 +1,5 @@ { lib, stdenv, fetchurl, sconsPackages, boost, gperftools, pcre-cpp, snappy, zlib, libyamlcpp -, sasl, openssl, libpcap, python27, python38, curl, Security, CoreFoundation, cctools }: +, sasl, openssl, libpcap, curl, Security, CoreFoundation, cctools }: # Note: # The command line tools are written in Go as part of a different package (mongodb-tools) @@ -12,17 +12,16 @@ with lib; let variants = if versionAtLeast version "4.2" - then { python = python38.withPackages (ps: with ps; [ pyyaml cheetah3 psutil setuptools ]); + then rec { python = scons.python.withPackages (ps: with ps; [ pyyaml cheetah3 psutil setuptools ]); scons = sconsPackages.scons_latest; mozjsVersion = "60"; mozjsReplace = "defined(HAVE___SINCOS)"; } - else { python = python27.withPackages (ps: with ps; [ pyyaml typing cheetah ]); + else rec { python = scons.python.withPackages (ps: with ps; [ pyyaml typing cheetah ]); scons = sconsPackages.scons_3_1_2; mozjsVersion = "45"; mozjsReplace = "defined(HAVE_SINCOS)"; }; - python = python27.withPackages (ps: with ps; [ pyyaml typing cheetah ]); system-libraries = [ "boost" "pcre"