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
linux: build dtbs in parallel #106846
linux: build dtbs in parallel #106846
Conversation
@ofborg test boot |
55e8585
to
8c4d52e
Compare
I marked this as stale due to inactivity. → More info |
This improves build speed, especially on machines with lots of cores such as the aarch64 community box and hydra builders.
8c4d52e
to
27af856
Compare
Rebased on current nixos-unstable-small. |
@@ -56,6 +56,8 @@ let | |||
# Dependencies that are required to build kernel modules | |||
moduleBuildDependencies = optional (lib.versionAtLeast version "4.14") libelf; | |||
|
|||
buildDTBs = stdenv.platform.kernelDTB or false; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
had to delete this line and replace buildDTBs
with kernelConf.DTB or false
throughout to get a correct kernel with parallel dtb build. with that change applied it builds a functional pinebook pro kernel though.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, thanks for checking, I forgot to check if there were DTBs in the result 🤦 ! We should probably still use the buildDTBs
variable, setting it to kernelConf.DTB or stdenv.platform.kernelDTB or false
, in order to prioritise observable kernel config while falling back to the platform default and false otherwise.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sounds good :D we've also just noticed that on the PBP at least there is no stdenv.platform.kernelDTB
key, and kernelDTB
does not seem to appear in the entirety of nixpkgs. there is stdenv.targetPlatform.linux-kernel.DTB
though, did it get renamed in the almost-year since you opened this PR?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, presumably. or
can be practical, but it can also obscure breakage due to renames… Will fix!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I haven't been able to build this yet because my connection isn't super stable, but I've had a look at the nix-diff and it looks sensible.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
tested again: no kernel rebuild, so presumably still works. not sure about the config.isSet "DTB"
though since there doesn't seem to be a DTB kconfig option. hardware.deviceTree
exclusive uses stdenv.hostPlatform.linux-kernel.DTB
to enable device tree support too, maybe that's the way to go?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, got the definition completely wrong, I thoroughly misunderstood what you'd written at the beginning >_< fixed, episode 2. And it built with DTBs :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
eh, that happens. :) LGTM!
Motivation for this change
Slightly faster builds, especially on aarch64 machines with lots of cores.
Things done
sandbox
innix.conf
on non-NixOS linux)