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`.
This commit is contained in:
@@ -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.
|
||||
|
||||
@@ -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.
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user