Skip to content

Commit

Permalink
Revert "zfs: dynamically determine latestCompatibleLinuxPackages"
Browse files Browse the repository at this point in the history
This reverts commit 27b52ad.

Fixes #341867

We could select linux_6_10 now if we wanted but I opted for linux_6_6 instead
because this will be removed anyways.

This is technically a breaking change but latestCompatibleLinuxPackages has no
expectancy of stability in the first place.
  • Loading branch information
Atemu committed Sep 17, 2024
1 parent e65aa83 commit f894950
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 12 deletions.
5 changes: 4 additions & 1 deletion pkgs/os-specific/linux/zfs/2_1.nix
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{ callPackage
, kernel ? null
, stdenv
, linuxKernel
, lib
, nixosTests
, ...
Expand All @@ -14,7 +15,9 @@ callPackage ./generic.nix args {
# this attribute is the correct one for this package.
kernelModuleAttribute = "zfs_2_1";
# check the release notes for compatible kernels
kernelCompatible = kernel: kernel.kernelOlder "6.8";
kernelCompatible = kernel.kernelOlder "6.8";

latestCompatibleLinuxPackages = linuxKernel.packages.linux_6_6;

# This is a fixed version to the 2.1.x series, move only
# if the 2.1.x series moves.
Expand Down
5 changes: 4 additions & 1 deletion pkgs/os-specific/linux/zfs/2_2.nix
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
, kernel ? null
, stdenv
, lib
, linuxKernel
, nixosTests
, ...
} @ args:
Expand All @@ -14,7 +15,9 @@ callPackage ./generic.nix args {
# this attribute is the correct one for this package.
kernelModuleAttribute = "zfs_2_2";
# check the release notes for compatible kernels
kernelCompatible = kernel: kernel.kernelOlder "6.11";
kernelCompatible = kernel.kernelOlder "6.11";

latestCompatibleLinuxPackages = linuxKernel.packages.linux_6_6;

# this package should point to the latest release.
version = "2.2.6";
Expand Down
12 changes: 3 additions & 9 deletions pkgs/os-specific/linux/zfs/generic.nix
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ let
genericBuild =
{ pkgs, lib, stdenv, fetchFromGitHub, fetchpatch
, autoreconfHook269, util-linux, nukeReferences, coreutils
, linuxKernel
, perl
, configFile ? "all"

Expand All @@ -28,6 +27,7 @@ let
, kernelModuleAttribute
, extraPatches ? []
, rev ? "zfs-${version}"
, latestCompatibleLinuxPackages
, kernelCompatible ? null
, maintainers ? (with lib.maintainers; [ amarshall ])
, tests
Expand Down Expand Up @@ -200,13 +200,7 @@ let
outputs = [ "out" ] ++ optionals buildUser [ "dev" ];

passthru = {
inherit enableMail kernelModuleAttribute;
latestCompatibleLinuxPackages = lib.pipe linuxKernel.packages [
builtins.attrValues
(builtins.filter (kPkgs: (builtins.tryEval kPkgs).success && kPkgs ? kernel && kPkgs.kernel.pname == "linux" && kernelCompatible kPkgs.kernel))
(builtins.sort (a: b: (lib.versionOlder a.kernel.version b.kernel.version)))
lib.last
];
inherit enableMail latestCompatibleLinuxPackages kernelModuleAttribute;
# The corresponding userspace tools to this instantiation
# of the ZFS package set.
userspaceTools = genericBuild (outerArgs // {
Expand Down Expand Up @@ -243,7 +237,7 @@ let
mainProgram = "zfs";
# If your Linux kernel version is not yet supported by zfs, try zfs_unstable.
# On NixOS set the option `boot.zfs.package = pkgs.zfs_unstable`.
broken = buildKernel && (kernelCompatible != null) && !(kernelCompatible kernel);
broken = buildKernel && (kernelCompatible != null) && !kernelCompatible;
};
};
in
Expand Down
5 changes: 4 additions & 1 deletion pkgs/os-specific/linux/zfs/unstable.nix
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{ callPackage
, kernel ? null
, stdenv
, linuxKernel
, nixosTests
, ...
} @ args:
Expand All @@ -13,7 +14,9 @@ callPackage ./generic.nix args {
# this attribute is the correct one for this package.
kernelModuleAttribute = "zfs_unstable";
# check the release notes for compatible kernels
kernelCompatible = kernel: kernel.kernelOlder "6.11";
kernelCompatible = kernel.kernelOlder "6.11";

latestCompatibleLinuxPackages = linuxKernel.packages.linux_6_10;

# this package should point to a version / git revision compatible with the latest kernel release
# IMPORTANT: Always use a tagged release candidate or commits from the
Expand Down

0 comments on commit f894950

Please sign in to comment.