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

linux: build dtbs in parallel #106846

Merged
merged 3 commits into from Oct 14, 2021
Merged

Conversation

lheckemann
Copy link
Member

Motivation for this change

Slightly faster builds, especially on aarch64 machines with lots of cores.

Things done

@lheckemann
Copy link
Member Author

lheckemann commented Dec 13, 2020

@ofborg test boot

@stale
Copy link

stale bot commented Jul 8, 2021

I marked this as stale due to inactivity. → More info

@stale stale bot added the 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md label Jul 8, 2021
This improves build speed, especially on machines with lots of cores
such as the aarch64 community box and hydra builders.
@stale stale bot removed the 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md label Sep 28, 2021
@lheckemann
Copy link
Member Author

Rebased on current nixos-unstable-small.

@Atemu Atemu removed their request for review September 28, 2021 13:29
@@ -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;
Copy link
Contributor

@pennae pennae Oct 7, 2021

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.

Copy link
Member Author

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.

Copy link
Contributor

@pennae pennae Oct 7, 2021

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?

Copy link
Member Author

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!

Copy link
Member Author

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.

Copy link
Contributor

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?

Copy link
Member Author

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 :)

Copy link
Contributor

Choose a reason for hiding this comment

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

eh, that happens. :) LGTM!

@Atemu Atemu removed their request for review October 7, 2021 18:03
@ofborg ofborg bot requested a review from Atemu October 8, 2021 09:54
@Atemu Atemu removed their request for review October 8, 2021 11:32
@lheckemann lheckemann merged commit dd5f07a into NixOS:master Oct 14, 2021
@lheckemann lheckemann deleted the kernel-parallel-dtbs branch October 14, 2021 17:41
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

4 participants