Merge pull request #33603 from obsidiansystems/cross-check
stdenv: Force `doCheck` to be false when we are cross compiling
This commit is contained in:
commit
06a8d66528
@ -995,13 +995,14 @@ but only if the <varname>doCheck</varname> variable is enabled.</para>
|
|||||||
|
|
||||||
<varlistentry>
|
<varlistentry>
|
||||||
<term><varname>doCheck</varname></term>
|
<term><varname>doCheck</varname></term>
|
||||||
<listitem><para>If set to a non-empty string, the check phase is
|
<listitem><para>
|
||||||
executed, otherwise it is skipped (default). Thus you should set
|
Controls whether the check phase is executed.
|
||||||
|
By default it is skipped, but if <varname>doCheck</varname> is set to true, the check phase is usually executed.
|
||||||
<programlisting>
|
Thus you should set <programlisting>doCheck = true;</programlisting> in the derivation to enable checks.
|
||||||
doCheck = true;</programlisting>
|
The exception is cross compilation.
|
||||||
|
Cross compiled builds never run tests, no matter how <varname>doCheck</varname> is set,
|
||||||
in the derivation to enable checks.</para></listitem>
|
as the newly-built program won't run on the platform used to build it.
|
||||||
|
</para></listitem>
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
|
|
||||||
<varlistentry>
|
<varlistentry>
|
||||||
@ -1280,12 +1281,14 @@ installcheck</command>.</para>
|
|||||||
|
|
||||||
<varlistentry>
|
<varlistentry>
|
||||||
<term><varname>doInstallCheck</varname></term>
|
<term><varname>doInstallCheck</varname></term>
|
||||||
<listitem><para>If set to a non-empty string, the installCheck phase is
|
<listitem><para>
|
||||||
executed, otherwise it is skipped (default). Thus you should set
|
Controls whether the installCheck phase is executed.
|
||||||
|
By default it is skipped, but if <varname>doInstallCheck</varname> is set to true, the installCheck phase is usually executed.
|
||||||
<programlisting>doInstallCheck = true;</programlisting>
|
Thus you should set <programlisting>doInstallCheck = true;</programlisting> in the derivation to enable install checks.
|
||||||
|
The exception is cross compilation.
|
||||||
in the derivation to enable install checks.</para></listitem>
|
Cross compiled builds never run tests, no matter how <varname>doInstallCheck</varname> is set,
|
||||||
|
as the newly-built program won't run on the platform used to build it.
|
||||||
|
</para></listitem>
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
|
|
||||||
<varlistentry>
|
<varlistentry>
|
||||||
|
@ -13,7 +13,7 @@ stdenv.mkDerivation rec {
|
|||||||
|
|
||||||
nativeBuildInputs = [ lzip ];
|
nativeBuildInputs = [ lzip ];
|
||||||
|
|
||||||
doCheck = hostPlatform == buildPlatform;
|
doCheck = true; # not cross;
|
||||||
|
|
||||||
meta = {
|
meta = {
|
||||||
description = "An implementation of the standard Unix editor";
|
description = "An implementation of the standard Unix editor";
|
||||||
|
@ -20,7 +20,7 @@ stdenv.mkDerivation rec {
|
|||||||
[ "--enable-cplusplus" ]
|
[ "--enable-cplusplus" ]
|
||||||
++ lib.optional enableLargeConfig "--enable-large-config";
|
++ lib.optional enableLargeConfig "--enable-large-config";
|
||||||
|
|
||||||
doCheck = stdenv.buildPlatform == stdenv.hostPlatform;
|
doCheck = true; # not cross;
|
||||||
|
|
||||||
# Don't run the native `strip' when cross-compiling.
|
# Don't run the native `strip' when cross-compiling.
|
||||||
dontStrip = hostPlatform != buildPlatform;
|
dontStrip = hostPlatform != buildPlatform;
|
||||||
|
@ -15,7 +15,7 @@ stdenv.mkDerivation rec {
|
|||||||
|
|
||||||
outputMan = "dev"; # tiny page for a dev tool
|
outputMan = "dev"; # tiny page for a dev tool
|
||||||
|
|
||||||
doCheck = stdenv.hostPlatform == stdenv.buildPlatform;
|
doCheck = true; # not cross;
|
||||||
|
|
||||||
preCheck = ''
|
preCheck = ''
|
||||||
patchShebangs ./run.sh
|
patchShebangs ./run.sh
|
||||||
|
@ -8,7 +8,7 @@ stdenv.mkDerivation rec {
|
|||||||
sha256 = "0lx201q20dvc70f8a3c9s7s18z15inlxvbffph97ngvrgnyjq9cx";
|
sha256 = "0lx201q20dvc70f8a3c9s7s18z15inlxvbffph97ngvrgnyjq9cx";
|
||||||
};
|
};
|
||||||
|
|
||||||
doCheck = stdenv.buildPlatform == stdenv.hostPlatform;
|
doCheck = true; # not cross;
|
||||||
|
|
||||||
# Linking static stubs on cygwin requires correct ordering.
|
# Linking static stubs on cygwin requires correct ordering.
|
||||||
# Consider upstreaming this.
|
# Consider upstreaming this.
|
||||||
|
@ -1,6 +1,5 @@
|
|||||||
{ stdenv, fetchurl, m4, cxx ? true
|
{ stdenv, fetchurl, m4, cxx ? true
|
||||||
, buildPackages
|
, buildPackages
|
||||||
, buildPlatform, hostPlatform
|
|
||||||
, withStatic ? false }:
|
, withStatic ? false }:
|
||||||
|
|
||||||
let inherit (stdenv.lib) optional optionalString; in
|
let inherit (stdenv.lib) optional optionalString; in
|
||||||
@ -43,7 +42,7 @@ let self = stdenv.mkDerivation rec {
|
|||||||
configureFlagsArray+=("--build=$(./configfsf.guess)")
|
configureFlagsArray+=("--build=$(./configfsf.guess)")
|
||||||
'';
|
'';
|
||||||
|
|
||||||
doCheck = buildPlatform == hostPlatform;
|
doCheck = true; # not cross;
|
||||||
|
|
||||||
dontDisableStatic = withStatic;
|
dontDisableStatic = withStatic;
|
||||||
|
|
||||||
|
@ -21,7 +21,7 @@ stdenv.mkDerivation rec {
|
|||||||
|
|
||||||
enableParallelBuilding = true;
|
enableParallelBuilding = true;
|
||||||
|
|
||||||
doCheck = stdenv.buildPlatform == stdenv.hostPlatform;
|
doCheck = true; # not cross;
|
||||||
checkTarget = "test";
|
checkTarget = "test";
|
||||||
|
|
||||||
meta = with stdenv.lib; {
|
meta = with stdenv.lib; {
|
||||||
|
@ -18,7 +18,7 @@ stdenv.mkDerivation rec {
|
|||||||
|
|
||||||
CFLAGS = "-I${gmp.dev}/include";
|
CFLAGS = "-I${gmp.dev}/include";
|
||||||
|
|
||||||
doCheck = hostPlatform == buildPlatform;
|
doCheck = true; # not cross;
|
||||||
|
|
||||||
meta = {
|
meta = {
|
||||||
description = "Library for multiprecision complex arithmetic with exact rounding";
|
description = "Library for multiprecision complex arithmetic with exact rounding";
|
||||||
|
@ -30,7 +30,7 @@ in stdenv.mkDerivation rec {
|
|||||||
|
|
||||||
# it's hard to cross-run tests and some check programs didn't compile anyway
|
# it's hard to cross-run tests and some check programs didn't compile anyway
|
||||||
makeFlags = stdenv.lib.optional (!doCheck) "check_PROGRAMS=";
|
makeFlags = stdenv.lib.optional (!doCheck) "check_PROGRAMS=";
|
||||||
doCheck = hostPlatform == buildPlatform;
|
doCheck = true; # not cross;
|
||||||
|
|
||||||
passthru = { inherit zlib; };
|
passthru = { inherit zlib; };
|
||||||
|
|
||||||
|
@ -13,7 +13,7 @@ stdenv.mkDerivation rec {
|
|||||||
|
|
||||||
patches = if enableSigbusFix then [ ./sigbus_fix.patch ] else null;
|
patches = if enableSigbusFix then [ ./sigbus_fix.patch ] else null;
|
||||||
|
|
||||||
doCheck = hostPlatform == buildPlatform;
|
doCheck = true; # not cross;
|
||||||
|
|
||||||
meta = {
|
meta = {
|
||||||
homepage = http://www.gnu.org/software/libsigsegv/;
|
homepage = http://www.gnu.org/software/libsigsegv/;
|
||||||
|
@ -29,7 +29,7 @@ stdenv.mkDerivation rec {
|
|||||||
|
|
||||||
enableParallelBuilding = true;
|
enableParallelBuilding = true;
|
||||||
|
|
||||||
doCheck = stdenv.buildPlatform == stdenv.hostPlatform;
|
doCheck = true; # not cross;
|
||||||
|
|
||||||
meta = with stdenv.lib; {
|
meta = with stdenv.lib; {
|
||||||
description = "Library and utilities for working with the TIFF image file format";
|
description = "Library and utilities for working with the TIFF image file format";
|
||||||
|
@ -12,7 +12,7 @@ stdenv.mkDerivation rec {
|
|||||||
|
|
||||||
enableParallelBuilding = true;
|
enableParallelBuilding = true;
|
||||||
|
|
||||||
doCheck = stdenv.hostPlatform == stdenv.buildPlatform;
|
doCheck = true; # not cross;
|
||||||
|
|
||||||
meta = with stdenv.lib; {
|
meta = with stdenv.lib; {
|
||||||
description = "Real-time data (de)compression library";
|
description = "Real-time data (de)compression library";
|
||||||
|
@ -21,7 +21,7 @@ stdenv.mkDerivation rec {
|
|||||||
stdenv.lib.optional hostPlatform.isSunOS "--disable-thread-safe" ++
|
stdenv.lib.optional hostPlatform.isSunOS "--disable-thread-safe" ++
|
||||||
stdenv.lib.optional hostPlatform.is64bit "--with-pic";
|
stdenv.lib.optional hostPlatform.is64bit "--with-pic";
|
||||||
|
|
||||||
doCheck = hostPlatform == buildPlatform;
|
doCheck = true; # not cross;
|
||||||
|
|
||||||
enableParallelBuilding = true;
|
enableParallelBuilding = true;
|
||||||
|
|
||||||
|
@ -36,6 +36,7 @@ rec {
|
|||||||
, depsTargetTarget ? [] # 1 -> 1
|
, depsTargetTarget ? [] # 1 -> 1
|
||||||
, depsTargetTargetPropagated ? [] # 1 -> 1
|
, depsTargetTargetPropagated ? [] # 1 -> 1
|
||||||
|
|
||||||
|
# Configure Phase
|
||||||
, configureFlags ? []
|
, configureFlags ? []
|
||||||
, # Target is not included by default because most programs don't care.
|
, # Target is not included by default because most programs don't care.
|
||||||
# Including it then would cause needless mass rebuilds.
|
# Including it then would cause needless mass rebuilds.
|
||||||
@ -44,6 +45,13 @@ rec {
|
|||||||
configurePlatforms ? lib.optionals
|
configurePlatforms ? lib.optionals
|
||||||
(stdenv.hostPlatform != stdenv.buildPlatform)
|
(stdenv.hostPlatform != stdenv.buildPlatform)
|
||||||
[ "build" "host" ]
|
[ "build" "host" ]
|
||||||
|
|
||||||
|
# Check phase
|
||||||
|
, doCheck ? false
|
||||||
|
|
||||||
|
# InstallCheck phase
|
||||||
|
, doInstallCheck ? false
|
||||||
|
|
||||||
, crossConfig ? null
|
, crossConfig ? null
|
||||||
, meta ? {}
|
, meta ? {}
|
||||||
, passthru ? {}
|
, passthru ? {}
|
||||||
@ -60,6 +68,7 @@ rec {
|
|||||||
|
|
||||||
, hardeningEnable ? []
|
, hardeningEnable ? []
|
||||||
, hardeningDisable ? []
|
, hardeningDisable ? []
|
||||||
|
|
||||||
, ... } @ attrs:
|
, ... } @ attrs:
|
||||||
|
|
||||||
# TODO(@Ericson2314): Make this more modular, and not O(n^2).
|
# TODO(@Ericson2314): Make this more modular, and not O(n^2).
|
||||||
@ -178,9 +187,15 @@ rec {
|
|||||||
"/bin/sh"
|
"/bin/sh"
|
||||||
];
|
];
|
||||||
__propagatedImpureHostDeps = computedPropagatedImpureHostDeps ++ __propagatedImpureHostDeps;
|
__propagatedImpureHostDeps = computedPropagatedImpureHostDeps ++ __propagatedImpureHostDeps;
|
||||||
} // (if outputs' != [ "out" ] then {
|
} // lib.optionalAttrs (outputs' != [ "out" ]) {
|
||||||
outputs = outputs';
|
outputs = outputs';
|
||||||
} else { }));
|
} // lib.optionalAttrs (attrs ? doCheck) {
|
||||||
|
# TODO(@Ericson2314): Make unconditional / resolve #33599
|
||||||
|
doCheck = doCheck && (stdenv.hostPlatform == stdenv.targetPlatform);
|
||||||
|
} // lib.optionalAttrs (attrs ? doInstallCheck) {
|
||||||
|
# TODO(@Ericson2314): Make unconditional / resolve #33599
|
||||||
|
doInstallCheck = doInstallCheck && (stdenv.hostPlatform == stdenv.targetPlatform);
|
||||||
|
});
|
||||||
|
|
||||||
# The meta attribute is passed in the resulting attribute set,
|
# The meta attribute is passed in the resulting attribute set,
|
||||||
# but it's not part of the actual derivation, i.e., it's not
|
# but it's not part of the actual derivation, i.e., it's not
|
||||||
|
@ -15,7 +15,7 @@ stdenv.mkDerivation rec {
|
|||||||
|
|
||||||
nativeBuildInputs = [ lzip ];
|
nativeBuildInputs = [ lzip ];
|
||||||
|
|
||||||
doCheck = hostPlatform == buildPlatform;
|
doCheck = true; # not cross;
|
||||||
configureFlags = [ "CXX=${stdenv.cc.targetPrefix}c++" ];
|
configureFlags = [ "CXX=${stdenv.cc.targetPrefix}c++" ];
|
||||||
|
|
||||||
meta = with stdenv.lib; {
|
meta = with stdenv.lib; {
|
||||||
|
@ -17,7 +17,7 @@ stdenv.mkDerivation rec {
|
|||||||
"ac_cv_func_strnlen_working=yes"
|
"ac_cv_func_strnlen_working=yes"
|
||||||
];
|
];
|
||||||
|
|
||||||
doCheck = hostPlatform == buildPlatform;
|
doCheck = true; # not cross;
|
||||||
|
|
||||||
meta = {
|
meta = {
|
||||||
description = "GNU Patch, a program to apply differences to files";
|
description = "GNU Patch, a program to apply differences to files";
|
||||||
|
Loading…
x
Reference in New Issue
Block a user