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

kernel: Fix overriding #149455

Closed
wants to merge 2 commits into from
Closed

Conversation

infinisil
Copy link
Member

@infinisil infinisil commented Dec 7, 2021

Motivation for this change

This was reported in #111504 but further complicated in #121518

This should clean it up, though I haven't tested it more than just a basic linuxPackages.kernel evaluation, as I'm not familiar with how it's all used.

I'd ideally like @samuela @samueldr, @kira-bruneau, @Atemu and @NeQuissimus to take a look at this, as they've been involved in the above two linked issues

Things done
  • Built on platform(s)
    • x86_64-linux
    • aarch64-linux
    • x86_64-darwin
    • aarch64-darwin
  • For non-Linux: Is sandbox = true set in nix.conf? (See Nix manual)
  • Tested, as applicable:
  • Tested compilation of all packages that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD". Note: all changes have to be committed, also see nixpkgs-review usage
  • Tested basic functionality of all binary files (usually in ./result/bin/)
  • 22.05 Release Notes (or backporting 21.11 Release notes)
    • (Package updates) Added a release notes entry if the change is major or breaking
    • (Module updates) Added a release notes entry if the change is significant
    • (Module addition) Added a release notes entry if adding a new NixOS module
    • (Release notes changes) Ran nixos/doc/manual/md-to-db.sh to update generated release notes
  • Fits CONTRIBUTING.md.

This was reported in NixOS#111504 but
further complicated in NixOS#121518

This should clean it up
@github-actions github-actions bot added the 6.topic: kernel The Linux kernel label Dec 7, 2021
overridableKernel = finalKernel // {
override = args:
lib.warn (
"override is stubbed for NixOS kernel tests, not applying changes these arguments: "
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But also, I don't know why this is done, there's no reasoning for it in the original PR

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@samuela
Copy link
Member

samuela commented Dec 7, 2021

I think you're looking for @samueldr I'm afraid I'm no help here!

@ofborg ofborg bot added 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild 10.rebuild-linux: 0 This PR does not cause any packages to rebuild labels Dec 7, 2021
Copy link
Member

@Atemu Atemu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nix-build -A linux.passthru.tests

error: attribute 'override' missing

       at /home/atemu/Projects/nixpkgs/nixos/modules/system/boot/kernel.nix:41:18:

           40|       apply = kernelPackages: kernelPackages.extend (self: super: {
           41|         kernel = super.kernel.override (originalArgs: {
             |                  ^
           42|           inherit randstructSeed;
(use '--show-trace' to show detailed location information)

.override previously didn't exist on kernels because the result from
`callPackage` (which contains a `.override`) was a function which was
then called with some more arguments.

This commit fixes this by passing all arguments in one go via callPackage
@infinisil
Copy link
Member Author

@Atemu Ah good catch, I'm surprised ofborg didn't run this. I fixed it with the latest commit.

@Atemu
Copy link
Member

Atemu commented Dec 10, 2021

You're a wizard.

ofBorg seems to be catching something else now though...

@infinisil
Copy link
Member Author

Closing for now. Hard to get motivation to fix this, it's really hard to wrap your head around this issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
6.topic: kernel The Linux kernel 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild 10.rebuild-linux: 0 This PR does not cause any packages to rebuild
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants