Commit 02333bc7 authored by Tim Schumacher's avatar Tim Schumacher
Browse files

linux/common-config: Split Rust toolchain and kernel-based conditions

The ongoing RISC-V breakage may become version independent in the
future, move it to the correct condition before updating it with the
full list of supported architectures.

While at it, simplify the remaining rustc-specific conditions into an
`availableOn`.
parent 9058a14b
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -43,7 +43,10 @@ let
  );

  forceRust = features.rust or false;
  kernelSupportsRust = lib.versionAtLeast version "6.7";
  kernelSupportsRust = lib.versionAtLeast version "6.7"
    # Known to be broken: https://lore.kernel.org/lkml/31885EDD-EF6D-4EF1-94CA-276BA7A340B7@kernel.org/T/
    && !(stdenv.hostPlatform.isRiscV && stdenv.cc.isGNU);


  # Currently only enabling Rust by default on kernel 6.12+,
  # which actually has features that use Rust that we want.
+1 −5
Original line number Diff line number Diff line
@@ -109,11 +109,7 @@ let

  commonStructuredConfig = import ./common-config.nix {
    inherit lib stdenv version;
    rustAvailable =
      lib.any (lib.meta.platformMatch stdenv.hostPlatform) rustc.targetPlatforms
      && lib.all (p: !lib.meta.platformMatch stdenv.hostPlatform p) rustc.badTargetPlatforms
      # Known to be broken: https://lore.kernel.org/lkml/31885EDD-EF6D-4EF1-94CA-276BA7A340B7@kernel.org/T/
      && !(stdenv.hostPlatform.isRiscV && stdenv.cc.isGNU);
    rustAvailable = lib.meta.availableOn stdenv.hostPlatform rustc;

    features = kernelFeatures; # Ensure we know of all extra patches, etc.
  };