Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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)
Comment on lines +18 to +19

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just in case anyone else was also wondering: #211728 copies this condition (which LLVM 9 and 11 have) and disables the tests on RISC-V hosts for LLVM 12 - 14 (though not LLVM 10...); it'll have to be adjusted once this PR is merged.

, 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