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

buildLinux: structuralize passthru.tests and kernelTests #287659

Closed

Conversation

ShamrockLee
Copy link
Contributor

@ShamrockLee ShamrockLee commented Feb 10, 2024

Description of changes

Currently, both the kernelTests input argument of buildLinux and the passthru.tests attribute of the result kernel package are lists. This PR brings the structural, passthru.tests.<name> attribute set pattern to buildLinux. This includes:

  • Presenting passthru.tests of the result package as an attribute set instead of a list.

  • Making the input argument kernelTests accept an attribute set instead of a list.

  • Handling the previous override interface of kerneTests as a list with a warning message and transform the elements into an attribute set in the form passthru.tests.extra-kernel-test-<0-based index>.

If applied, one will be able to run a specific test case intuitively, without having to go through complex --expr specification.

Things done

  • Built on platform(s)
    • x86_64-linux (no rebuild except nixos-install-tools)
    • aarch64-linux
    • x86_64-darwin
    • aarch64-darwin
  • For non-Linux: Is sandboxing enabled in nix.conf? (See Nix manual)
    • sandbox = relaxed
    • sandbox = true
  • 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/)
  • 24.05 Release Notes (or backporting 23.05 and 23.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
  • Fits CONTRIBUTING.md.

Add a 👍 reaction to pull requests you find important.

@github-actions github-actions bot added 6.topic: nixos Issues or PRs affecting NixOS modules, or package usability issues specific to NixOS 6.topic: kernel The Linux kernel 8.has: documentation This PR adds or changes documentation 8.has: changelog labels Feb 10, 2024
@ofborg ofborg bot added 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin 10.rebuild-linux: 1-10 labels Feb 10, 2024
@ShamrockLee
Copy link
Contributor Author

@ofborg build linux linux.tests

@ShamrockLee ShamrockLee force-pushed the linux-kernel-passthru-tests branch from 45c9ac3 to 243904a Compare February 26, 2024 22:27
@wegank wegank added the 2.status: merge conflict This PR has merge conflicts with the target branch label Mar 20, 2024
@ShamrockLee ShamrockLee force-pushed the linux-kernel-passthru-tests branch from 243904a to d86b534 Compare April 22, 2024 11:18
@ofborg ofborg bot removed the 2.status: merge conflict This PR has merge conflicts with the target branch label Apr 22, 2024
@ShamrockLee
Copy link
Contributor Author

Bump onto master and resolve merge conflict.

@wegank wegank added the 2.status: merge conflict This PR has merge conflicts with the target branch label May 3, 2024
Override `finalAttrs.finalPackage` instead of `kernel` from the let-in
block to make configEnv behave in accordance with overrideAttrs of the
result package.

Continuation of commit f10331c ("buildLinux: passthru by
<pkg>.overrideAttrs instead of lib.extendDerivation")
Present passthru.tests of the result package as an attribute set instead
of a list.

Recommend adding tests by overriding `passthru.tests` with
`overrideAttrs`.

Make the input argument kernelTests accept an attribute set instead of a
list.

Handle the previous override interface of kerneTests as a list with a
warning message and transform the elements into an attribute set in the
form `passthru.tests.extra-kernel-test-<0-based index>`.
@ShamrockLee ShamrockLee force-pushed the linux-kernel-passthru-tests branch from d86b534 to 5070af6 Compare July 27, 2024 15:14
@ShamrockLee
Copy link
Contributor Author

I rebased the changes and resolved merge conflicts.

@roberth, I restructured the two test cases as version-does-not-dependent-on-patches-etc-nixos and version-does-not-dependent-on-patches-etc. I excluded the former by commenting it out and prefixing it with a wall of number signs (#), but I wonder if this is the desired way to make it into the attribute set. Could you help take a look?

@ofborg ofborg bot removed the 2.status: merge conflict This PR has merge conflicts with the target branch label Jul 27, 2024
@nixos-discourse
Copy link

This pull request has been mentioned on NixOS Discourse. There might be relevant details there:

https://discourse.nixos.org/t/prs-ready-for-review/3032/4332

@wegank wegank added the 2.status: merge conflict This PR has merge conflicts with the target branch label Sep 10, 2024
@ShamrockLee
Copy link
Contributor Author

#350008 surpassed this PR. I'll open a new, backportable PR to improve the overriding of configEnv.

@ShamrockLee
Copy link
Contributor Author

Update: The new PR is #364679.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
2.status: merge conflict This PR has merge conflicts with the target branch 6.topic: kernel The Linux kernel 6.topic: nixos Issues or PRs affecting NixOS modules, or package usability issues specific to NixOS 8.has: changelog 8.has: documentation This PR adds or changes documentation 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin 10.rebuild-linux: 1-10
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants