Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

linuxPackagesFor: wireguard: respect supported kernel versions #76722

Merged
merged 1 commit into from Dec 31, 2019

Conversation

d-xo
Copy link
Contributor

@d-xo d-xo commented Dec 30, 2019

Motivation for this change

As discussed in #76578: Only include the out of tree wireguard module for supported kernel versions.

I checked a few other modules with version bounds and they both assert in the module and then add bounds in linuxPackagesFor, so I did the same for wireguard.

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS linux)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Determined the impact on package closure size (by running nix path-info -S before and after)
  • Ensured that relevant documentation is up to date
  • Fits CONTRIBUTING.md.
Notify maintainers

cc @Ma27 @zx2c4

@teto
Copy link
Member

teto commented Dec 30, 2019

these bounds are evaluated to allow comparing different kernelPackages and warn if several are set in user config.
Oldest kernel in nixpkgs is 4.4 so you could do without the lower bound.

@d-xo
Copy link
Contributor Author

d-xo commented Dec 30, 2019

these bounds are evaluated to allow comparing different kernelPackages and warn if several are set in user config.

Could you expand on this, I'm not sure I follow. I had understood that linuxPackagesFor was used to produce the various top-level linuxPackages_X_Y attributes?

@teto
Copy link
Member

teto commented Dec 30, 2019

In all-packages.nix, you can see ```
linuxPackages_4_4 = recurseIntoAttrs (linuxPackagesFor pkgs.linux_4_4);
linuxPackages_4_9 = recurseIntoAttrs (linuxPackagesFor pkgs.linux_4_9);

Reason why attrset packages are evaluated: https://github.com/NixOS/nixpkgs/pull/58207

@d-xo
Copy link
Contributor Author

d-xo commented Dec 31, 2019

@teto thanks! TIL about custom merge strategies for types in the module system 🙂.

rebased on master and addressed review comments:

  • stenv.lib -> lib
  • rm lower bound

@Mic92 Mic92 merged commit 073623d into NixOS:master Dec 31, 2019
@d-xo d-xo deleted the wireguard-kernel-versions branch January 8, 2020 15:13
@Ma27
Copy link
Member

Ma27 commented Apr 9, 2020

Backported to 19.09 in 60c4ddb. We just had a discussion in the Nix-channel on matrix.org where a user built their own 5.6 kernel on a 19.09-machine which broke eval when rebuilding the system with this kernel. I figured that a backport is fine here since we support building kernels with custom sources.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants