Commit 0ed60bbc authored by emilylange's avatar emilylange Committed by Yureka
Browse files

chromium: fix increased build time for non-cross-compilation builds



Having

```nix
host_toolchain = "//build/toolchain/linux/unbundle:host";
v8_snapshot_toolchain = "//build/toolchain/linux/unbundle:host";
```

on native, non-cross-compilation builds roughly doubles the build steps
and, by proxy, compute and time needed to build.

So to resolve this, we conditionally change those values depending on
whether we are cross-compiling or not.

Co-authored-by: default avatarAdam Joseph <adam@westernsemico.com>
parent 0eb389be
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
@@ -387,9 +387,13 @@ let
      # depending on which part of the codebase you are in; see:
      # https://github.com/chromium/chromium/blob/d36462cc9279464395aea5e65d0893d76444a296/build/config/BUILDCONFIG.gn#L17-L44
      custom_toolchain = "//build/toolchain/linux/unbundle:default";
      host_toolchain = "//build/toolchain/linux/unbundle:default";
      # We only build those specific toolchains when we cross-compile, as native non-cross-compilations would otherwise
      # end up building much more things than they need to (roughtly double the build steps and time/compute):
    } // lib.optionalAttrs (stdenv.buildPlatform != stdenv.hostPlatform) {
      host_toolchain = "//build/toolchain/linux/unbundle:host";
      v8_snapshot_toolchain = "//build/toolchain/linux/unbundle:host";

    } // {
      host_pkg_config = "${pkgsBuildBuild.pkg-config}/bin/pkg-config";
      pkg_config      = "${pkgsBuildHost.pkg-config}/bin/${stdenv.cc.targetPrefix}pkg-config";