Skip to content

Revert "perf: inherit makeFlags from kernel"#429818

Merged
alyssais merged 1 commit intoNixOS:stagingfrom
alyssais:perl-kernelModuleMakeFlags
Aug 4, 2025
Merged

Revert "perf: inherit makeFlags from kernel"#429818
alyssais merged 1 commit intoNixOS:stagingfrom
alyssais:perl-kernelModuleMakeFlags

Conversation

@alyssais
Copy link
Member

This reverts commit 94276da.

Original justification was:

it reduces unnecessary code duplication and should help with cross compilation (although this cannot be tested yet because some dependencies fail).

However, as time as gone on its become increasingly clear that the kernels make flags are going to be specific to building a kernel, not a userspace program, hence them having been renamed to kernelModuleMakeFlags in the meantime. This has become even more apparent now that we're using unwrapped compilers for the kernel, which doesn't go at all well with building a userspace program like perf, so we stop inheriting any make flags from the kernel, and instead just set the two flags necessary for cross compilation to work.

Fixes: e9b2edb ("linux: un-simplify toolchain selection")

Things done

  • Built on platform:
    • x86_64-linux
    • aarch64-linux
    • x86_64-darwin
    • aarch64-darwin
  • Tested, as applicable:
  • Ran nixpkgs-review on this PR. See nixpkgs-review usage.
  • Tested basic functionality of all binary files, usually in ./result/bin/.
  • Nixpkgs Release Notes
    • Package update: when the change is major or breaking.
  • NixOS Release Notes
    • Module addition: when adding a new NixOS module.
    • Module update: when the change is significant.
  • Fits CONTRIBUTING.md, pkgs/README.md, maintainers/README.md and other READMEs.

Add a 👍 reaction to pull requests you find important.

This reverts commit 94276da.

Original justification[1] was:

> it reduces unnecessary code duplication and should help with cross
> compilation (although this cannot be tested yet because some
> dependencies fail).

However, as time as gone on its become increasingly clear that the
kernels make flags are going to be specific to building a kernel, not
a userspace program, hence them having been renamed to
kernelModuleMakeFlags in the meantime.  This has become even more
apparent now that we're using unwrapped compilers for the kernel,
which doesn't go at all well with building a userspace program like
perf, so we stop inheriting any make flags from the kernel, and
instead just set the two flags necessary for cross compilation to
work.

Link: NixOS#34068 [1]
Fixes: e9b2edb ("linux: un-simplify toolchain selection")
@alyssais alyssais mentioned this pull request Jul 31, 2025
13 tasks
@nix-owners nix-owners bot requested review from NeQuissimus and TredwellGit July 31, 2025 11:14
@nixpkgs-ci nixpkgs-ci bot added 10.rebuild-linux: 11-100 This PR causes between 11 and 100 packages to rebuild on Linux. 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin. 6.topic: kernel The Linux kernel labels Jul 31, 2025
@nix-owners nix-owners bot requested a review from tobim July 31, 2025 11:19
@nixpkgs-ci nixpkgs-ci bot added 12.approvals: 1 This PR was reviewed and approved by one person. 12.approved-by: package-maintainer This PR was reviewed and approved by a maintainer listed in any of the changed packages. labels Jul 31, 2025
@alyssais alyssais merged commit c0e42f6 into NixOS:staging Aug 4, 2025
30 of 32 checks passed
@alyssais alyssais deleted the perl-kernelModuleMakeFlags branch August 4, 2025 12:19
lopsided98 added a commit to lopsided98/nixpkgs that referenced this pull request Aug 27, 2025
tmon broke with the addition of unwrapped compilers to
kernelModuleMakeFlags. Apply the same fix as with perf (see NixOS#429818) and
manually pass ARCH and CROSS_COMPILE.

Fixes: e9b2edb ("linux: un-simplify toolchain selection")
alyssais pushed a commit that referenced this pull request Aug 28, 2025
tmon broke with the addition of unwrapped compilers to
kernelModuleMakeFlags. Apply the same fix as with perf (see #429818) and
manually pass ARCH and CROSS_COMPILE.

Fixes: e9b2edb ("linux: un-simplify toolchain selection")
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 on Darwin. 10.rebuild-linux: 11-100 This PR causes between 11 and 100 packages to rebuild on Linux. 12.approvals: 1 This PR was reviewed and approved by one person. 12.approved-by: package-maintainer This PR was reviewed and approved by a maintainer listed in any of the changed packages.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants