Files
nixpkgs/pkgs/os-specific/linux/scx/scx_rustscheds.nix
John Titor 079b7a006c scx.rustscheds: restore RUSTFLAGS
Per 059ce35c31/meson.build (L347-L349)
but linking libbpf is not required, built in rust one should work fine.

See 8ec509cc13 (r2302122465) and https://github.com/sched-ext/scx/pull/2592
2025-08-28 13:51:20 +05:30

69 lines
1.4 KiB
Nix

{
lib,
rustPlatform,
llvmPackages,
pkg-config,
elfutils,
zlib,
zstd,
scx-common,
protobuf,
libseccomp,
}:
rustPlatform.buildRustPackage {
pname = "scx_rustscheds";
inherit (scx-common) version src;
inherit (scx-common.versionInfo.scx) cargoHash;
nativeBuildInputs = [
pkg-config
rustPlatform.bindgenHook
protobuf
];
buildInputs = [
elfutils
zlib
zstd
libseccomp
];
env = {
BPF_CLANG = lib.getExe llvmPackages.clang;
RUSTFLAGS = lib.concatStringsSep " " [
"-C relocation-model=pic"
"-C link-args=-lelf"
"-C link-args=-lz"
"-C link-args=-lzstd"
];
};
hardeningDisable = [
"stackprotector"
"zerocallusedregs"
];
doCheck = true;
checkFlags = [
"--skip=compat::tests::test_ksym_exists"
"--skip=compat::tests::test_read_enum"
"--skip=compat::tests::test_struct_has_field"
"--skip=cpumask"
"--skip=topology"
"--skip=proc_data::tests::test_thread_operations"
];
meta = scx-common.meta // {
description = "Sched-ext Rust userspace schedulers";
longDescription = ''
This includes Rust based schedulers such as
scx_rustland, scx_bpfland, scx_lavd, scx_layered, scx_rlfifo.
::: {.note}
Sched-ext schedulers are only available on kernels version 6.12 or later.
It is recommended to use the latest kernel for the best compatibility.
:::
'';
};
}