diff --git a/pkgs/development/compilers/llvm/10/llvm/default.nix b/pkgs/development/compilers/llvm/10/llvm/default.nix index 41c20ac47ebf..fba387adf867 100644 --- a/pkgs/development/compilers/llvm/10/llvm/default.nix +++ b/pkgs/development/compilers/llvm/10/llvm/default.nix @@ -15,6 +15,8 @@ , zlib , buildLlvmTools , debugVersion ? false +, doCheck ? stdenv.isLinux && (!stdenv.isx86_32) + && (stdenv.hostPlatform == stdenv.buildPlatform) , enableManpages ? false , enableSharedLibraries ? !stdenv.hostPlatform.isStatic # broken for Ampere eMAG 8180 (c2.large.arm on Packet) #56245 @@ -30,6 +32,29 @@ let shortVersion = with lib; concatStringsSep "." (take 1 (splitString "." release_version)); + # Ordinarily we would just the `doCheck` and `checkDeps` functionality + # `mkDerivation` gives us to manage our test dependencies (instead of breaking + # out `doCheck` as a package level attribute). + # + # Unfortunately `lit` does not forward `$PYTHONPATH` to children processes, in + # particular the children it uses to do feature detection. + # + # This means that python deps we add to `checkDeps` (which the python + # interpreter is made aware of via `$PYTHONPATH` – populated by the python + # setup hook) are not picked up by `lit` which causes it to skip tests. + # + # Adding `python3.withPackages (ps: [ ... ])` to `checkDeps` also doesn't work + # because this package is shadowed in `$PATH` by the regular `python3` + # package. + # + # So, we "manually" assemble one python derivation for the package to depend + # on, taking into account whether checks are enabled or not: + python = if doCheck then + let + checkDeps = ps: with ps; [ psutil ]; + in python3.withPackages checkDeps + else python3; + in stdenv.mkDerivation (rec { pname = "llvm"; inherit version; @@ -48,7 +73,7 @@ in stdenv.mkDerivation (rec { outputs = [ "out" "lib" "dev" "python" ]; - nativeBuildInputs = [ cmake python3 ] + nativeBuildInputs = [ cmake python ] ++ optionals enableManpages [ python3.pkgs.sphinx python3.pkgs.recommonmark ]; buildInputs = [ libxml2 libffi ] @@ -255,8 +280,7 @@ in stdenv.mkDerivation (rec { cp NATIVE/bin/llvm-config $dev/bin/llvm-config-native ''; - doCheck = stdenv.isLinux && (!stdenv.isx86_32) - && (stdenv.hostPlatform == stdenv.buildPlatform); + inherit doCheck; checkTarget = "check-all"; diff --git a/pkgs/development/compilers/llvm/11/llvm/default.nix b/pkgs/development/compilers/llvm/11/llvm/default.nix index 93cf2757c652..df9749fe1c27 100644 --- a/pkgs/development/compilers/llvm/11/llvm/default.nix +++ b/pkgs/development/compilers/llvm/11/llvm/default.nix @@ -15,6 +15,8 @@ , zlib , buildLlvmTools , debugVersion ? false +, doCheck ? stdenv.isLinux && (!stdenv.isx86_32) && (!stdenv.hostPlatform.isMusl) && (!stdenv.hostPlatform.isRiscV) + && (stdenv.hostPlatform == stdenv.buildPlatform) , enableManpages ? false , enableSharedLibraries ? !stdenv.hostPlatform.isStatic # broken for Ampere eMAG 8180 (c2.large.arm on Packet) #56245 @@ -30,6 +32,29 @@ let shortVersion = with lib; concatStringsSep "." (take 1 (splitString "." release_version)); + # Ordinarily we would just the `doCheck` and `checkDeps` functionality + # `mkDerivation` gives us to manage our test dependencies (instead of breaking + # out `doCheck` as a package level attribute). + # + # Unfortunately `lit` does not forward `$PYTHONPATH` to children processes, in + # particular the children it uses to do feature detection. + # + # This means that python deps we add to `checkDeps` (which the python + # interpreter is made aware of via `$PYTHONPATH` – populated by the python + # setup hook) are not picked up by `lit` which causes it to skip tests. + # + # Adding `python3.withPackages (ps: [ ... ])` to `checkDeps` also doesn't work + # because this package is shadowed in `$PATH` by the regular `python3` + # package. + # + # So, we "manually" assemble one python derivation for the package to depend + # on, taking into account whether checks are enabled or not: + python = if doCheck then + let + checkDeps = ps: with ps; [ psutil ]; + in python3.withPackages checkDeps + else python3; + in stdenv.mkDerivation (rec { pname = "llvm"; inherit version; @@ -48,7 +73,7 @@ in stdenv.mkDerivation (rec { outputs = [ "out" "lib" "dev" "python" ]; - nativeBuildInputs = [ cmake python3 ] + nativeBuildInputs = [ cmake python ] ++ optionals enableManpages [ python3.pkgs.sphinx python3.pkgs.recommonmark ]; buildInputs = [ libxml2 libffi ] @@ -267,8 +292,7 @@ in stdenv.mkDerivation (rec { cp NATIVE/bin/llvm-config $dev/bin/llvm-config-native ''; - doCheck = stdenv.isLinux && (!stdenv.isx86_32) && (!stdenv.hostPlatform.isMusl) && (!stdenv.hostPlatform.isRiscV) - && (stdenv.hostPlatform == stdenv.buildPlatform); + inherit doCheck; checkTarget = "check-all"; diff --git a/pkgs/development/compilers/llvm/12/llvm/default.nix b/pkgs/development/compilers/llvm/12/llvm/default.nix index 3d5592e19ee5..2d7f70540dd8 100644 --- a/pkgs/development/compilers/llvm/12/llvm/default.nix +++ b/pkgs/development/compilers/llvm/12/llvm/default.nix @@ -15,6 +15,8 @@ , zlib , buildLlvmTools , debugVersion ? false +, doCheck ? stdenv.isLinux && (!stdenv.isx86_32) && (!stdenv.hostPlatform.isMusl) + && (stdenv.hostPlatform == stdenv.buildPlatform) , enableManpages ? false , enableSharedLibraries ? !stdenv.hostPlatform.isStatic # broken for Ampere eMAG 8180 (c2.large.arm on Packet) #56245 @@ -30,6 +32,29 @@ let shortVersion = with lib; concatStringsSep "." (take 1 (splitString "." release_version)); + # Ordinarily we would just the `doCheck` and `checkDeps` functionality + # `mkDerivation` gives us to manage our test dependencies (instead of breaking + # out `doCheck` as a package level attribute). + # + # Unfortunately `lit` does not forward `$PYTHONPATH` to children processes, in + # particular the children it uses to do feature detection. + # + # This means that python deps we add to `checkDeps` (which the python + # interpreter is made aware of via `$PYTHONPATH` – populated by the python + # setup hook) are not picked up by `lit` which causes it to skip tests. + # + # Adding `python3.withPackages (ps: [ ... ])` to `checkDeps` also doesn't work + # because this package is shadowed in `$PATH` by the regular `python3` + # package. + # + # So, we "manually" assemble one python derivation for the package to depend + # on, taking into account whether checks are enabled or not: + python = if doCheck then + let + checkDeps = ps: with ps; [ psutil ]; + in python3.withPackages checkDeps + else python3; + in stdenv.mkDerivation (rec { pname = "llvm"; inherit version; @@ -48,7 +73,7 @@ in stdenv.mkDerivation (rec { outputs = [ "out" "lib" "dev" "python" ]; - nativeBuildInputs = [ cmake python3 ] + nativeBuildInputs = [ cmake python ] ++ optionals enableManpages [ python3.pkgs.sphinx python3.pkgs.recommonmark ]; buildInputs = [ libxml2 libffi ] @@ -255,8 +280,7 @@ in stdenv.mkDerivation (rec { cp NATIVE/bin/llvm-config $dev/bin/llvm-config-native ''; - doCheck = stdenv.isLinux && (!stdenv.isx86_32) && (!stdenv.hostPlatform.isMusl) - && (stdenv.hostPlatform == stdenv.buildPlatform); + inherit doCheck; checkTarget = "check-all"; diff --git a/pkgs/development/compilers/llvm/13/llvm/default.nix b/pkgs/development/compilers/llvm/13/llvm/default.nix index e2d6da816f32..f3a9ced70e19 100644 --- a/pkgs/development/compilers/llvm/13/llvm/default.nix +++ b/pkgs/development/compilers/llvm/13/llvm/default.nix @@ -16,6 +16,8 @@ , which , buildLlvmTools , debugVersion ? false +, doCheck ? stdenv.isLinux && (!stdenv.isx86_32) && (!stdenv.hostPlatform.isMusl) + && (stdenv.hostPlatform == stdenv.buildPlatform) , enableManpages ? false , enableSharedLibraries ? !stdenv.hostPlatform.isStatic # broken for Ampere eMAG 8180 (c2.large.arm on Packet) #56245 @@ -31,6 +33,29 @@ let shortVersion = with lib; concatStringsSep "." (take 1 (splitString "." release_version)); + # Ordinarily we would just the `doCheck` and `checkDeps` functionality + # `mkDerivation` gives us to manage our test dependencies (instead of breaking + # out `doCheck` as a package level attribute). + # + # Unfortunately `lit` does not forward `$PYTHONPATH` to children processes, in + # particular the children it uses to do feature detection. + # + # This means that python deps we add to `checkDeps` (which the python + # interpreter is made aware of via `$PYTHONPATH` – populated by the python + # setup hook) are not picked up by `lit` which causes it to skip tests. + # + # Adding `python3.withPackages (ps: [ ... ])` to `checkDeps` also doesn't work + # because this package is shadowed in `$PATH` by the regular `python3` + # package. + # + # So, we "manually" assemble one python derivation for the package to depend + # on, taking into account whether checks are enabled or not: + python = if doCheck then + let + checkDeps = ps: with ps; [ psutil ]; + in python3.withPackages checkDeps + else python3; + in stdenv.mkDerivation (rec { pname = "llvm"; inherit version; @@ -40,7 +65,7 @@ in stdenv.mkDerivation (rec { outputs = [ "out" "lib" "dev" "python" ]; - nativeBuildInputs = [ cmake python3 ] + nativeBuildInputs = [ cmake python ] ++ optionals enableManpages [ python3.pkgs.sphinx python3.pkgs.recommonmark ]; buildInputs = [ libxml2 libffi ] @@ -217,8 +242,7 @@ in stdenv.mkDerivation (rec { cp NATIVE/bin/llvm-config $dev/bin/llvm-config-native ''; - doCheck = stdenv.isLinux && (!stdenv.isx86_32) && (!stdenv.hostPlatform.isMusl) - && (stdenv.hostPlatform == stdenv.buildPlatform); + inherit doCheck; checkTarget = "check-all"; diff --git a/pkgs/development/compilers/llvm/14/llvm/default.nix b/pkgs/development/compilers/llvm/14/llvm/default.nix index 9bd24b9ac068..e4c004d24ac3 100644 --- a/pkgs/development/compilers/llvm/14/llvm/default.nix +++ b/pkgs/development/compilers/llvm/14/llvm/default.nix @@ -17,6 +17,8 @@ , which , buildLlvmTools , debugVersion ? false +, doCheck ? stdenv.isLinux && (!stdenv.isx86_32) && (!stdenv.hostPlatform.isMusl) + && (stdenv.hostPlatform == stdenv.buildPlatform) , enableManpages ? false , enableSharedLibraries ? !stdenv.hostPlatform.isStatic # broken for Ampere eMAG 8180 (c2.large.arm on Packet) #56245 @@ -32,6 +34,29 @@ let shortVersion = with lib; concatStringsSep "." (take 1 (splitString "." release_version)); + # Ordinarily we would just the `doCheck` and `checkDeps` functionality + # `mkDerivation` gives us to manage our test dependencies (instead of breaking + # out `doCheck` as a package level attribute). + # + # Unfortunately `lit` does not forward `$PYTHONPATH` to children processes, in + # particular the children it uses to do feature detection. + # + # This means that python deps we add to `checkDeps` (which the python + # interpreter is made aware of via `$PYTHONPATH` – populated by the python + # setup hook) are not picked up by `lit` which causes it to skip tests. + # + # Adding `python3.withPackages (ps: [ ... ])` to `checkDeps` also doesn't work + # because this package is shadowed in `$PATH` by the regular `python3` + # package. + # + # So, we "manually" assemble one python derivation for the package to depend + # on, taking into account whether checks are enabled or not: + python = if doCheck then + let + checkDeps = ps: with ps; [ psutil ]; + in python3.withPackages checkDeps + else python3; + in stdenv.mkDerivation (rec { pname = "llvm"; inherit version; @@ -50,7 +75,7 @@ in stdenv.mkDerivation (rec { outputs = [ "out" "lib" "dev" "python" ]; - nativeBuildInputs = [ cmake python3 ] + nativeBuildInputs = [ cmake python ] ++ optionals enableManpages [ python3.pkgs.sphinx python3.pkgs.recommonmark ]; buildInputs = [ libxml2 libffi ] @@ -230,8 +255,7 @@ in stdenv.mkDerivation (rec { cp NATIVE/bin/llvm-config $dev/bin/llvm-config-native ''; - doCheck = stdenv.isLinux && (!stdenv.isx86_32) && (!stdenv.hostPlatform.isMusl) - && (stdenv.hostPlatform == stdenv.buildPlatform); + inherit doCheck; checkTarget = "check-all"; diff --git a/pkgs/development/compilers/llvm/6/llvm/default.nix b/pkgs/development/compilers/llvm/6/llvm/default.nix index 954887cd2368..22a3970f76ce 100644 --- a/pkgs/development/compilers/llvm/6/llvm/default.nix +++ b/pkgs/development/compilers/llvm/6/llvm/default.nix @@ -13,6 +13,8 @@ , zlib , buildLlvmTools , fetchpatch +, doCheck ? stdenv.isLinux && (!stdenv.isi686) + && (stdenv.hostPlatform == stdenv.buildPlatform) , debugVersion ? false , enableManpages ? false , enableSharedLibraries ? !stdenv.hostPlatform.isStatic @@ -26,6 +28,29 @@ let versionSuffixes = with lib; let parts = splitVersion release_version; in imap (i: _: concatStringsSep "." (take i parts)) parts; + + # Ordinarily we would just the `doCheck` and `checkDeps` functionality + # `mkDerivation` gives us to manage our test dependencies (instead of breaking + # out `doCheck` as a package level attribute). + # + # Unfortunately `lit` does not forward `$PYTHONPATH` to children processes, in + # particular the children it uses to do feature detection. + # + # This means that python deps we add to `checkDeps` (which the python + # interpreter is made aware of via `$PYTHONPATH` – populated by the python + # setup hook) are not picked up by `lit` which causes it to skip tests. + # + # Adding `python3.withPackages (ps: [ ... ])` to `checkDeps` also doesn't work + # because this package is shadowed in `$PATH` by the regular `python3` + # package. + # + # So, we "manually" assemble one python derivation for the package to depend + # on, taking into account whether checks are enabled or not: + python = if doCheck then + let + checkDeps = ps: with ps; [ psutil ]; + in python3.withPackages checkDeps + else python3; in stdenv.mkDerivation (rec { @@ -46,7 +71,7 @@ stdenv.mkDerivation (rec { outputs = [ "out" "lib" "dev" "python" ]; - nativeBuildInputs = [ cmake python3 ] + nativeBuildInputs = [ cmake python ] ++ optional enableManpages python3.pkgs.sphinx; buildInputs = [ libxml2 libffi ]; @@ -227,8 +252,7 @@ stdenv.mkDerivation (rec { cp NATIVE/bin/llvm-config $dev/bin/llvm-config-native ''; - doCheck = stdenv.isLinux && (!stdenv.isi686) - && (stdenv.hostPlatform == stdenv.buildPlatform); + inherit doCheck; checkTarget = "check-all"; diff --git a/pkgs/development/compilers/llvm/7/llvm/default.nix b/pkgs/development/compilers/llvm/7/llvm/default.nix index eaeef3c2ef50..185ae884442e 100644 --- a/pkgs/development/compilers/llvm/7/llvm/default.nix +++ b/pkgs/development/compilers/llvm/7/llvm/default.nix @@ -15,6 +15,8 @@ , zlib , buildLlvmTools , debugVersion ? false +, doCheck ? stdenv.isLinux && (!stdenv.isx86_32) + && (stdenv.hostPlatform == stdenv.buildPlatform) , enableManpages ? false , enableSharedLibraries ? !stdenv.hostPlatform.isStatic # broken for Ampere eMAG 8180 (c2.large.arm on Packet) #56245 @@ -31,6 +33,29 @@ let let parts = splitVersion release_version; in imap (i: _: concatStringsSep "." (take i parts)) parts; + # Ordinarily we would just the `doCheck` and `checkDeps` functionality + # `mkDerivation` gives us to manage our test dependencies (instead of breaking + # out `doCheck` as a package level attribute). + # + # Unfortunately `lit` does not forward `$PYTHONPATH` to children processes, in + # particular the children it uses to do feature detection. + # + # This means that python deps we add to `checkDeps` (which the python + # interpreter is made aware of via `$PYTHONPATH` – populated by the python + # setup hook) are not picked up by `lit` which causes it to skip tests. + # + # Adding `python3.withPackages (ps: [ ... ])` to `checkDeps` also doesn't work + # because this package is shadowed in `$PATH` by the regular `python3` + # package. + # + # So, we "manually" assemble one python derivation for the package to depend + # on, taking into account whether checks are enabled or not: + python = if doCheck then + let + checkDeps = ps: with ps; [ psutil ]; + in python3.withPackages checkDeps + else python3; + in stdenv.mkDerivation (rec { pname = "llvm"; inherit version; @@ -49,7 +74,7 @@ in stdenv.mkDerivation (rec { outputs = [ "out" "lib" "dev" "python" ]; - nativeBuildInputs = [ cmake python3 ] + nativeBuildInputs = [ cmake python ] ++ optional enableManpages python3.pkgs.sphinx; buildInputs = [ libxml2 libffi ] @@ -245,8 +270,7 @@ in stdenv.mkDerivation (rec { cp NATIVE/bin/llvm-config $dev/bin/llvm-config-native ''; - doCheck = stdenv.isLinux && (!stdenv.isx86_32) - && (stdenv.hostPlatform == stdenv.buildPlatform); + inherit doCheck; checkTarget = "check-all"; diff --git a/pkgs/development/compilers/llvm/8/llvm/default.nix b/pkgs/development/compilers/llvm/8/llvm/default.nix index aa76fc0c3cf7..3b0877115e06 100644 --- a/pkgs/development/compilers/llvm/8/llvm/default.nix +++ b/pkgs/development/compilers/llvm/8/llvm/default.nix @@ -15,6 +15,8 @@ , zlib , buildLlvmTools , debugVersion ? false +, doCheck ? stdenv.isLinux && (!stdenv.isx86_32) + && (stdenv.hostPlatform == stdenv.buildPlatform) , enableManpages ? false , enableSharedLibraries ? !stdenv.hostPlatform.isStatic # broken for Ampere eMAG 8180 (c2.large.arm on Packet) #56245 @@ -30,6 +32,29 @@ let shortVersion = with lib; concatStringsSep "." (take 1 (splitVersion release_version)); + # Ordinarily we would just the `doCheck` and `checkDeps` functionality + # `mkDerivation` gives us to manage our test dependencies (instead of breaking + # out `doCheck` as a package level attribute). + # + # Unfortunately `lit` does not forward `$PYTHONPATH` to children processes, in + # particular the children it uses to do feature detection. + # + # This means that python deps we add to `checkDeps` (which the python + # interpreter is made aware of via `$PYTHONPATH` – populated by the python + # setup hook) are not picked up by `lit` which causes it to skip tests. + # + # Adding `python3.withPackages (ps: [ ... ])` to `checkDeps` also doesn't work + # because this package is shadowed in `$PATH` by the regular `python3` + # package. + # + # So, we "manually" assemble one python derivation for the package to depend + # on, taking into account whether checks are enabled or not: + python = if doCheck then + let + checkDeps = ps: with ps; [ psutil ]; + in python3.withPackages checkDeps + else python3; + in stdenv.mkDerivation (rec { pname = "llvm"; inherit version; @@ -48,7 +73,7 @@ in stdenv.mkDerivation (rec { outputs = [ "out" "lib" "dev" "python" ]; - nativeBuildInputs = [ cmake python3 ] + nativeBuildInputs = [ cmake python ] ++ optionals enableManpages [ python3.pkgs.sphinx python3.pkgs.recommonmark ]; buildInputs = [ libxml2 libffi ] @@ -237,8 +262,7 @@ in stdenv.mkDerivation (rec { cp NATIVE/bin/llvm-config $dev/bin/llvm-config-native ''; - doCheck = stdenv.isLinux && (!stdenv.isx86_32) - && (stdenv.hostPlatform == stdenv.buildPlatform); + inherit doCheck; checkTarget = "check-all"; diff --git a/pkgs/development/compilers/llvm/9/llvm/default.nix b/pkgs/development/compilers/llvm/9/llvm/default.nix index 89bc014f5c65..0838fd8c5844 100644 --- a/pkgs/development/compilers/llvm/9/llvm/default.nix +++ b/pkgs/development/compilers/llvm/9/llvm/default.nix @@ -15,6 +15,8 @@ , zlib , buildLlvmTools , debugVersion ? false +, doCheck ? stdenv.isLinux && (!stdenv.isx86_32) && (!stdenv.hostPlatform.isRiscV) + && (stdenv.hostPlatform == stdenv.buildPlatform) , enableManpages ? false , enableSharedLibraries ? !stdenv.hostPlatform.isStatic # broken for Ampere eMAG 8180 (c2.large.arm on Packet) #56245 @@ -30,6 +32,29 @@ let shortVersion = with lib; concatStringsSep "." (take 1 (splitString "." release_version)); + # Ordinarily we would just the `doCheck` and `checkDeps` functionality + # `mkDerivation` gives us to manage our test dependencies (instead of breaking + # out `doCheck` as a package level attribute). + # + # Unfortunately `lit` does not forward `$PYTHONPATH` to children processes, in + # particular the children it uses to do feature detection. + # + # This means that python deps we add to `checkDeps` (which the python + # interpreter is made aware of via `$PYTHONPATH` – populated by the python + # setup hook) are not picked up by `lit` which causes it to skip tests. + # + # Adding `python3.withPackages (ps: [ ... ])` to `checkDeps` also doesn't work + # because this package is shadowed in `$PATH` by the regular `python3` + # package. + # + # So, we "manually" assemble one python derivation for the package to depend + # on, taking into account whether checks are enabled or not: + python = if doCheck then + let + checkDeps = ps: with ps; [ psutil ]; + in python3.withPackages checkDeps + else python3; + in stdenv.mkDerivation (rec { pname = "llvm"; inherit version; @@ -48,7 +73,7 @@ in stdenv.mkDerivation (rec { outputs = [ "out" "lib" "dev" "python" ]; - nativeBuildInputs = [ cmake python3 ] + nativeBuildInputs = [ cmake python ] ++ optionals enableManpages [ python3.pkgs.sphinx python3.pkgs.recommonmark ]; buildInputs = [ libxml2 libffi ] @@ -252,8 +277,7 @@ in stdenv.mkDerivation (rec { cp NATIVE/bin/llvm-config $dev/bin/llvm-config-native ''; - doCheck = stdenv.isLinux && (!stdenv.isx86_32) && (!stdenv.hostPlatform.isRiscV) - && (stdenv.hostPlatform == stdenv.buildPlatform); + inherit doCheck; checkTarget = "check-all"; diff --git a/pkgs/development/compilers/llvm/git/llvm/default.nix b/pkgs/development/compilers/llvm/git/llvm/default.nix index 140c2db71f54..1daeb745e588 100644 --- a/pkgs/development/compilers/llvm/git/llvm/default.nix +++ b/pkgs/development/compilers/llvm/git/llvm/default.nix @@ -18,6 +18,8 @@ , which , buildLlvmTools , debugVersion ? false +, doCheck ? stdenv.isLinux && (!stdenv.isx86_32) && (!stdenv.hostPlatform.isMusl) + && (stdenv.hostPlatform == stdenv.buildPlatform) , enableManpages ? false , enableSharedLibraries ? !stdenv.hostPlatform.isStatic , enablePFM ? !(stdenv.isDarwin @@ -34,6 +36,29 @@ let shortVersion = with lib; concatStringsSep "." (take 1 (splitString "." release_version)); + # Ordinarily we would just the `doCheck` and `checkDeps` functionality + # `mkDerivation` gives us to manage our test dependencies (instead of breaking + # out `doCheck` as a package level attribute). + # + # Unfortunately `lit` does not forward `$PYTHONPATH` to children processes, in + # particular the children it uses to do feature detection. + # + # This means that python deps we add to `checkDeps` (which the python + # interpreter is made aware of via `$PYTHONPATH` – populated by the python + # setup hook) are not picked up by `lit` which causes it to skip tests. + # + # Adding `python3.withPackages (ps: [ ... ])` to `checkDeps` also doesn't work + # because this package is shadowed in `$PATH` by the regular `python3` + # package. + # + # So, we "manually" assemble one python derivation for the package to depend + # on, taking into account whether checks are enabled or not: + python = if doCheck then + let + checkDeps = ps: with ps; [ psutil ]; + in python3.withPackages checkDeps + else python3; + in stdenv.mkDerivation (rec { pname = "llvm"; inherit version; @@ -52,7 +77,7 @@ in stdenv.mkDerivation (rec { outputs = [ "out" "lib" "dev" "python" ]; - nativeBuildInputs = [ cmake ninja python3 ] + nativeBuildInputs = [ cmake ninja python ] ++ optionals enableManpages [ python3.pkgs.sphinx python3.pkgs.recommonmark ]; buildInputs = [ libxml2 libffi ] @@ -217,8 +242,7 @@ in stdenv.mkDerivation (rec { cp NATIVE/bin/llvm-config $dev/bin/llvm-config-native ''; - doCheck = stdenv.isLinux && (!stdenv.isx86_32) && (!stdenv.hostPlatform.isMusl) - && (stdenv.hostPlatform == stdenv.buildPlatform); + inherit doCheck; checkTarget = "check-all";