Commit 748361e0 authored by K900's avatar K900
Browse files

scx: split C and Rust versions, Rust 1.0.20 -> 1.1.0, C 1.0.20 -> unstable

parent ade7e63e
Loading
Loading
Loading
Loading
+13 −4
Original line number Diff line number Diff line
{
  fetchFromGitHub,
  llvmPackages,
  libbpf,
  pkg-config,
@@ -12,7 +13,14 @@

llvmPackages.stdenv.mkDerivation {
  pname = "scx_cscheds";
  inherit (scx.rustscheds) version src;
  version = "0-unstable-2026-01-13";

  src = fetchFromGitHub {
    owner = "sched-ext";
    repo = "scx-c-examples";
    rev = "82c692afe32ed4e79fd047a93d3ff316bf399287";
    hash = "sha256-buXwId/4TwDfo/5mApMAEWHri92bW9x3jLEE5rawS3w=";
  };

  postPatch = ''
    substituteInPlace ./scheds/c/Makefile \
@@ -47,10 +55,11 @@ llvmPackages.stdenv.mkDerivation {
  };

  meta = scx.rustscheds.meta // {
    description = "Sched-ext C userspace schedulers";
    description = "Sched-ext C example schedulers";
    longDescription = ''
      This includes C based schedulers such as scx_central, scx_flatcg,
      scx_nest, scx_pair, scx_qmap, scx_simple, scx_userland.
      This includes C based example schedulers such as scx_central, scx_flatcg,
      scx_nest, scx_pair, scx_qmap, scx_simple, scx_userland. These are examples,
      and generally not recommended for end users.

      ::: {.note}
      Sched-ext schedulers are only available on kernels version 6.12 or later.
+6 −14
Original line number Diff line number Diff line
@@ -14,16 +14,16 @@
}:
rustPlatform.buildRustPackage (finalAttrs: {
  pname = "scx_rustscheds";
  version = "1.0.20";
  version = "1.1.0";

  src = fetchFromGitHub {
    owner = "sched-ext";
    repo = "scx";
    tag = "v${finalAttrs.version}";
    hash = "sha256-MUWbNsxmbCRCOWB2dHpi5dEY2rNRrINxJSyl5SNSO9Y=";
    hash = "sha256-kPOAiy2siIKZ6/zz43qPW7bp27T98MOhwmZMxpVpito=";
  };

  cargoHash = "sha256-H58wschck+l41fQh9W5SNVb5g9lAnw90SOSd/RtGXyw=";
  cargoHash = "sha256-nXiprz5ryGJeTy9nnKaLSKE0FSl17YE88xFt9bUTTL8=";

  nativeBuildInputs = [
    pkg-config
@@ -51,17 +51,9 @@ rustPlatform.buildRustPackage (finalAttrs: {
    "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"
    "--skip=json::tests::test_with_resources"
    "--skip=json::tests::test_with_dir"
  ];
  # most of the tests rely on system CPU topology info,
  # which is not available in the sandbox
  doCheck = false;

  passthru.tests.basic = nixosTests.scx;
  passthru.updateScript = nix-update-script { };