mirror of
https://github.com/CHN-beta/nixpkgs.git
synced 2026-01-12 02:40:31 +08:00
Per059ce35c31/meson.build (L347-L349)but linking libbpf is not required, built in rust one should work fine. See8ec509cc13 (r2302122465)and https://github.com/sched-ext/scx/pull/2592
69 lines
1.4 KiB
Nix
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.
|
|
:::
|
|
'';
|
|
};
|
|
}
|