Skip to content

Commit

Permalink
llvm: add in a missing check dep
Browse files Browse the repository at this point in the history
Port of 6d0c876 ("llvmPackages_15.llvm: add in a missing check
dep").

I did not include the sysctl nativeCheckInputs change from that
commit, as it looks like it was included by mistake and was supposed
to be in c7231c0 ("llvmPackages_15.llvm: run the tests on macOS").
I've also included the doCheck default from that commit (without the
change to run on non-Linux), as 6d0c876 just set it to true.
  • Loading branch information
alyssais committed Mar 1, 2023
1 parent 63e505f commit be122fa
Show file tree
Hide file tree
Showing 10 changed files with 270 additions and 30 deletions.
30 changes: 27 additions & 3 deletions pkgs/development/compilers/llvm/10/llvm/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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;
Expand All @@ -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 ]
Expand Down Expand Up @@ -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";

Expand Down
30 changes: 27 additions & 3 deletions pkgs/development/compilers/llvm/11/llvm/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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;
Expand All @@ -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 ]
Expand Down Expand Up @@ -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";

Expand Down
30 changes: 27 additions & 3 deletions pkgs/development/compilers/llvm/12/llvm/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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;
Expand All @@ -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 ]
Expand Down Expand Up @@ -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";

Expand Down
30 changes: 27 additions & 3 deletions pkgs/development/compilers/llvm/13/llvm/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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;
Expand All @@ -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 ]
Expand Down Expand Up @@ -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";

Expand Down
30 changes: 27 additions & 3 deletions pkgs/development/compilers/llvm/14/llvm/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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;
Expand All @@ -49,7 +74,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 ]
Expand Down Expand Up @@ -229,8 +254,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";

Expand Down
30 changes: 27 additions & 3 deletions pkgs/development/compilers/llvm/6/llvm/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
, zlib
, buildLlvmTools
, fetchpatch
, doCheck ? stdenv.isLinux && (!stdenv.isi686)
&& (stdenv.hostPlatform == stdenv.buildPlatform)
, debugVersion ? false
, enableManpages ? false
, enableSharedLibraries ? !stdenv.hostPlatform.isStatic
Expand All @@ -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 {
Expand All @@ -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 ];
Expand Down Expand Up @@ -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";

Expand Down
Loading

0 comments on commit be122fa

Please sign in to comment.