Unverified Commit 6de5573e authored by Wolfgang Walther's avatar Wolfgang Walther
Browse files

gccWithoutTargetLibc: move assert to meta.badPlatforms

An assert can't be caught by CI for generation of attrpaths during Eval.
An error reported via meta.badPlatforms can be.

The alternative of returning null in the CI case, similar to the commits
before, is not helpful, because it only causes failed builds or eval
downstream - when this dependency is passed on and used as `null`.
parent f115f69d
Loading
Loading
Loading
Loading
+9 −3
Original line number Diff line number Diff line
@@ -5108,11 +5108,10 @@ with pkgs;
  # The GCC used to build libc for the target platform. Normal gccs will be
  # built with, and use, that cross-compiled libc.
  gccWithoutTargetLibc =
    assert stdenv.targetPlatform != stdenv.hostPlatform;
    let
      libc1 = binutilsNoLibc.libc;
    in
    wrapCCWith {
    (wrapCCWith {
      cc = gccFun {
        # copy-pasted
        inherit noSysDirs;
@@ -5138,7 +5137,14 @@ with pkgs;
      bintools = binutilsNoLibc;
      libc = libc1;
      extraPackages = [ ];
    }).overrideAttrs
      (prevAttrs: {
        meta = prevAttrs.meta // {
          badPlatforms =
            (prevAttrs.meta.badPlatforms or [ ])
            ++ lib.optionals (stdenv.targetPlatform == stdenv.hostPlatform) [ stdenv.hostPlatform.system ];
        };
      });

  inherit (callPackage ../development/compilers/gcc/all.nix { inherit noSysDirs; })
    gcc9