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

linuxPackages.ena: 2.12.0 -> 2.12.3; general maintenance #313941

Merged
merged 4 commits into from
Jul 30, 2024

Conversation

kiike
Copy link
Member

@kiike kiike commented May 23, 2024

Description of changes

This PR reworks the packaging of ena to improve some actions carried out on #310680.

  • instead of patching the Kcompat.h file to resolve building, remove an unneeded flag that breaks kernel feature detection. This flag was introduced for 3.12, which is a kernel version that NixOS doesn't support anymore.
  • replace the current patch, which targets fixing building for all supported versions, for one that only targets 4.19, the only version that will not build with the vanilla sources. This patch comes from upstream and is temporary until the next release.
  • reformat using nixfmt-rfc-style

EDIT 5 June: upgrade to 2.12.1

Things done

  • Built on platform(s)
    • x86_64-linux
    • 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.11 Release Notes (or backporting 23.11 and 24.05 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.

@ofborg ofborg bot requested review from edolstra and sielicki May 23, 2024 10:21
@ofborg ofborg bot added 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild 10.rebuild-linux: 11-100 labels May 23, 2024
@kiike
Copy link
Member Author

kiike commented May 23, 2024

Result of nixpkgs-review pr 313941 run on x86_64-linux 1

22 packages built:
  • linuxKernel.packages.linux_4_19.ena
  • linuxKernel.packages.linux_4_19_hardened.ena
  • linuxKernel.packages.linux_5_10.ena
  • linuxKernel.packages.linux_5_10_hardened.ena
  • linuxKernel.packages.linux_5_15.ena
  • linuxKernel.packages.linux_5_15_hardened.ena
  • linuxKernel.packages.linux_5_4.ena
  • linuxKernel.packages.linux_5_4_hardened.ena
  • linuxKernel.packages.linux_6_1.ena
  • linuxKernel.packages.linux_6_1_hardened.ena
  • linuxKernel.packages.linux_6_6.ena
  • linuxKernel.packages.linux_hardened.ena (linuxKernel.packages.linux_6_6_hardened.ena)
  • linuxKernel.packages.linux_6_8.ena
  • linuxKernel.packages.linux_6_8_hardened.ena
  • linuxKernel.packages.linux_6_9.ena
  • linuxKernel.packages.linux_6_9_hardened.ena
  • linuxKernel.packages.linux_latest_libre.ena
  • linuxKernel.packages.linux_libre.ena
  • linuxKernel.packages.linux_lqx.ena
  • linuxKernel.packages.linux_xanmod.ena
  • linuxKernel.packages.linux_xanmod_latest.ena (linuxKernel.packages.linux_xanmod_stable.ena)
  • linuxKernel.packages.linux_zen.ena

@kiike
Copy link
Member Author

kiike commented Jun 5, 2024

Result of nixpkgs-review pr 313941 run on x86_64-linux 1

22 packages built:
  • linuxKernel.packages.linux_4_19.ena
  • linuxKernel.packages.linux_4_19_hardened.ena
  • linuxKernel.packages.linux_5_10.ena
  • linuxKernel.packages.linux_5_10_hardened.ena
  • linuxKernel.packages.linux_5_15.ena
  • linuxKernel.packages.linux_5_15_hardened.ena
  • linuxKernel.packages.linux_5_4.ena
  • linuxKernel.packages.linux_5_4_hardened.ena
  • linuxKernel.packages.linux_6_1.ena
  • linuxKernel.packages.linux_6_1_hardened.ena
  • linuxKernel.packages.linux_6_6.ena
  • linuxKernel.packages.linux_hardened.ena (linuxKernel.packages.linux_6_6_hardened.ena)
  • linuxKernel.packages.linux_6_8.ena
  • linuxKernel.packages.linux_6_8_hardened.ena
  • linuxKernel.packages.linux_6_9.ena
  • linuxKernel.packages.linux_6_9_hardened.ena
  • linuxKernel.packages.linux_latest_libre.ena
  • linuxKernel.packages.linux_libre.ena
  • linuxKernel.packages.linux_lqx.ena
  • linuxKernel.packages.linux_xanmod.ena
  • linuxKernel.packages.linux_xanmod_latest.ena (linuxKernel.packages.linux_xanmod_stable.ena)
  • linuxKernel.packages.linux_zen.ena

@github-actions github-actions bot removed the 6.topic: kernel The Linux kernel label Jun 5, 2024
@kiike kiike changed the title linuxPackages.ena: reformat, use upstream patch, remove problematic flag linuxPackages.ena: 2.12.0 -> 2.12.1; general maintenance Jun 5, 2024
@kiike kiike marked this pull request as ready for review June 5, 2024 09:13
@kiike kiike force-pushed the refactor/ena branch 2 times, most recently from b236a5b to 77d4ccf Compare June 5, 2024 09:18
@IldenH
Copy link

IldenH commented Jul 14, 2024

2.12.3 is out. Upgrade straight to that instead?
https://github.com/amzn/amzn-drivers/releases/tag/ena_linux_2.12.3.

@Mic92 Mic92 requested a review from arianvp July 20, 2024 10:36
@ofborg ofborg bot requested a review from sielicki July 20, 2024 11:25
@arianvp arianvp changed the title linuxPackages.ena: 2.12.0 -> 2.12.1; general maintenance linuxPackages.ena: 2.12.0 -> 2.12.3; general maintenance Jul 27, 2024
@arianvp
Copy link
Member

arianvp commented Jul 27, 2024

Hmm:

Result of nixpkgs-review pr 313941 run on aarch64-linux 1

5 packages marked as broken and skipped:
  • linuxKernel.packages.linux_lqx.ena
  • linuxKernel.packages.linux_xanmod.ena
  • linuxKernel.packages.linux_xanmod_latest.ena
  • linuxKernel.packages.linux_xanmod_stable.ena
  • linuxKernel.packages.linux_zen.ena
2 packages failed to build:
  • linuxKernel.packages.linux_6_10.ena
  • linuxKernel.packages.linux_latest_libre.ena
17 packages built:
  • linuxKernel.packages.linux_4_19.ena
  • linuxKernel.packages.linux_4_19_hardened.ena
  • linuxKernel.packages.linux_5_10.ena
  • linuxKernel.packages.linux_5_10_hardened.ena
  • linuxKernel.packages.linux_5_15.ena
  • linuxKernel.packages.linux_5_15_hardened.ena
  • linuxKernel.packages.linux_5_4.ena
  • linuxKernel.packages.linux_5_4_hardened.ena
  • linuxKernel.packages.linux_6_1.ena
  • linuxKernel.packages.linux_6_1_hardened.ena
  • linuxKernel.packages.linux_6_6.ena
  • linuxKernel.packages.linux_hardened.ena (linuxKernel.packages.linux_6_6_hardened.ena)
  • linuxKernel.packages.linux_6_8.ena
  • linuxKernel.packages.linux_6_8_hardened.ena
  • linuxKernel.packages.linux_6_9.ena
  • linuxKernel.packages.linux_6_9_hardened.ena
  • linuxKernel.packages.linux_libre.ena

@arianvp
Copy link
Member

arianvp commented Jul 27, 2024

The error in question is

make -C /nix/store/2yg16mg5cgcckxl0hjzvhz7sw3yrkwjm-linux-6.10.1-dev/lib/modules/6.10.1/build M=/build/source/kernel/linux/ena modules
make[1]: Entering directory '/nix/store/2yg16mg5cgcckxl0hjzvhz7sw3yrkwjm-linux-6.10.1-dev/lib/modules/6.10.1/build'
  CC [M]  /build/source/kernel/linux/ena/ena_netdev.o
  CC [M]  /build/source/kernel/linux/ena/ena_ethtool.o
  CC [M]  /build/source/kernel/linux/ena/ena_lpc.o
  CC [M]  /build/source/kernel/linux/ena/ena_phc.o
  CC [M]  /build/source/kernel/linux/ena/ena_xdp.o
/build/source/kernel/linux/ena/ena_xdp.c: In function 'ena_xdp_rx_skb_zc':
/build/source/kernel/linux/ena/ena_xdp.c:749:15: error: implicit declaration of function '__napi_alloc_skb'; did you mean 'napi_alloc_skb'? [-Werror=implicit-function-declaration]
  749 |         skb = __napi_alloc_skb(rx_ring->napi,
      |               ^~~~~~~~~~~~~~~~
      |               napi_alloc_skb
compilation terminated due to -Wfatal-errors.
cc1: some warnings being treated as errors
make[3]: *** [/nix/store/2yg16mg5cgcckxl0hjzvhz7sw3yrkwjm-linux-6.10.1-dev/lib/modules/6.10.1/source/scripts/Makefile.build:244: /build/source/kernel/linux/ena/ena_xdp.o] Error 1
make[2]: *** [/nix/store/2yg16mg5cgcckxl0hjzvhz7sw3yrkwjm-linux-6.10.1-dev/lib/modules/6.10.1/source/Makefile:1934: /build/source/kernel/linux/ena] Error 2
make[1]: *** [/nix/store/2yg16mg5cgcckxl0hjzvhz7sw3yrkwjm-linux-6.10.1-dev/lib/modules/6.10.1/source/Makefile:240: __sub-make] Error 2
make[1]: Leaving directory '/nix/store/2yg16mg5cgcckxl0hjzvhz7sw3yrkwjm-linux-6.10.1-dev/lib/modules/6.10.1/build'
make: *** [Makefile:102: ena.ko] Error 2

@ofborg ofborg bot requested a review from arianvp July 27, 2024 10:04
@arianvp
Copy link
Member

arianvp commented Jul 28, 2024

I think this is ready to go.

The patch is by me from amzn/amzn-drivers#313 (comment)

They'll provide a modified version if it in the next release but I prefer not waiting for that.

The XDP support is experimental anyways so most people aren't using this codepath.

If no complaints I'm gonna merge this

@arianvp
Copy link
Member

arianvp commented Jul 29, 2024

Okay fixing this patch surfaces more errors. How do we feel about marking this broken on 6.10?

error: builder for '/nix/store/lxmbs6ya60x68wf5a8mpk5njg3f0xrwh-ena-2.12.3-6.10.2.drv' failed with exit code 2;
       last 10 log lines:
       > /build/source/kernel/linux/ena/ena_xdp.c: In function 'ena_xdp_clean_rx_irq_zc':
       > /build/source/kernel/linux/ena/ena_xdp.c:816:17: error: too many arguments to function 'xsk_buff_dma_sync_for_cpu'
       >   816 |                 xsk_buff_dma_sync_for_cpu(xdp, rx_ring->xsk_pool);
       >       |                 ^~~~~~~~~~~~~~~~~~~~~~~~~
       > compilation terminated due to -Wfatal-errors.
       > make[3]: *** [/nix/store/216k8yzq05s5r3lvnh7jd9hbric4cmln-linux-libre-6.10.2-dev/lib/modules/6.10.2-gnu/source/scripts/Makefile.build:244: /build/source/kernel/linux/ena/ena_xdp.o] Error 1
       > make[2]: *** [/nix/store/216k8yzq05s5r3lvnh7jd9hbric4cmln-linux-libre-6.10.2-dev/lib/modules/6.10.2-gnu/source/Makefile:1934: /build/source/kernel/linux/ena] Error 2
       > make[1]: *** [/nix/store/216k8yzq05s5r3lvnh7jd9hbric4cmln-linux-libre-6.10.2-dev/lib/modules/6.10.2-gnu/source/Makefile:240: __sub-make] Error 2
       > make[1]: Leaving directory '/nix/store/216k8yzq05s5r3lvnh7jd9hbric4cmln-linux-libre-6.10.2-dev/lib/modules/6.10.2-gnu/build'
       > make: *** [Makefile:102: ena.ko] Error 2
       For full logs, run 'nix log /nix/store/lxmbs6ya60x68wf5a8mpk5njg3f0xrwh-ena-2.12.3-6.10.2.drv'.
error: builder for '/nix/store/j23sjz0wq8gq3y9p8a6082r0nvg9qnyi-ena-2.12.3-6.10.2.drv' failed with exit code 2;
       last 10 log lines:
       > /build/source/kernel/linux/ena/ena_xdp.c: In function 'ena_xdp_clean_rx_irq_zc':
       > /build/source/kernel/linux/ena/ena_xdp.c:816:17: error: too many arguments to function 'xsk_buff_dma_sync_for_cpu'
       >   816 |                 xsk_buff_dma_sync_for_cpu(xdp, rx_ring->xsk_pool);
       >       |                 ^~~~~~~~~~~~~~~~~~~~~~~~~
       > compilation terminated due to -Wfatal-errors.
       > make[3]: *** [/nix/store/4pi3spm0m1w4hyr659wkpxmf9cj7b6zr-linux-6.10.2-dev/lib/modules/6.10.2/source/scripts/Makefile.build:244: /build/source/kernel/linux/ena/ena_xdp.o] Error 1
       > make[2]: *** [/nix/store/4pi3spm0m1w4hyr659wkpxmf9cj7b6zr-linux-6.10.2-dev/lib/modules/6.10.2/source/Makefile:1934: /build/source/kernel/linux/ena] Error 2
       > make[1]: *** [/nix/store/4pi3spm0m1w4hyr659wkpxmf9cj7b6zr-linux-6.10.2-dev/lib/modules/6.10.2/source/Makefile:240: __sub-make] Error 2
       > make[1]: Leaving directory '/nix/store/4pi3spm0m1w4hyr659wkpxmf9cj7b6zr-linux-6.10.2-dev/lib/modules/6.10.2/build'
       > make: *** [Makefile:102: ena.ko] Error 2
       For full logs, run 'nix log /nix/store/j23sjz0wq8gq3y9p8a6082r0nvg9qnyi-ena-2.12.3-6.10.2.drv'.
       ```

@arianvp arianvp force-pushed the refactor/ena branch 2 times, most recently from 983e81b to c59d0ea Compare July 29, 2024 19:42
This now builds on 4.19 without the patch but needs a new patch for 6.10
@Mic92
Copy link
Member

Mic92 commented Jul 30, 2024

Okay fixing this patch surfaces more errors. How do we feel about marking this broken on 6.10?

Sounds reasonable. Upstream will catch up eventually.

@arianvp
Copy link
Member

arianvp commented Jul 30, 2024

Okay it builds now on all kernels!

Result of nixpkgs-review pr 313941 run on aarch64-linux 1

5 packages marked as broken and skipped:
  • linuxKernel.packages.linux_lqx.ena
  • linuxKernel.packages.linux_xanmod.ena
  • linuxKernel.packages.linux_xanmod_latest.ena
  • linuxKernel.packages.linux_xanmod_stable.ena
  • linuxKernel.packages.linux_zen.ena
19 packages built:
  • linuxKernel.packages.linux_4_19.ena
  • linuxKernel.packages.linux_4_19_hardened.ena
  • linuxKernel.packages.linux_5_10.ena
  • linuxKernel.packages.linux_5_10_hardened.ena
  • linuxKernel.packages.linux_5_15.ena
  • linuxKernel.packages.linux_5_15_hardened.ena
  • linuxKernel.packages.linux_5_4.ena
  • linuxKernel.packages.linux_5_4_hardened.ena
  • linuxKernel.packages.linux_6_1.ena
  • linuxKernel.packages.linux_6_10.ena
  • linuxKernel.packages.linux_6_1_hardened.ena
  • linuxKernel.packages.linux_6_6.ena
  • linuxKernel.packages.linux_hardened.ena (linuxKernel.packages.linux_6_6_hardened.ena)
  • linuxKernel.packages.linux_6_8.ena
  • linuxKernel.packages.linux_6_8_hardened.ena
  • linuxKernel.packages.linux_6_9.ena
  • linuxKernel.packages.linux_6_9_hardened.ena
  • linuxKernel.packages.linux_latest_libre.ena
  • linuxKernel.packages.linux_libre.ena

@arianvp arianvp merged commit f763682 into NixOS:master Jul 30, 2024
9 of 10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
0.kind: enhancement Add something new 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild 10.rebuild-linux: 11-100 needs_reviewer
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants