Add RISC-V cross-compilation target for CI #195

Manually merged
rarias merged 2 commits from add-cross-ci into master 2025-10-10 12:13:10 +02:00
Owner

Allows packages to be cross-compiled from x86_64 to RISC-V. For now it will only take packages that explicitly set the meta.cross attribute to true, so that they can be cross compiled. The meta.platform attribute can be also used to disable specific platforms.

For now, only ovni is marked as suitable for cross compilation, but the idea is to incrementally add more packages until all work.

Allows packages to be cross-compiled from x86_64 to RISC-V. For now it will only take packages that explicitly set the meta.cross attribute to true, so that they can be cross compiled. The meta.platform attribute can be also used to disable specific platforms. For now, only ovni is marked as suitable for cross compilation, but the idea is to incrementally add more packages until all work.
rarias added 1 commit 2025-10-09 14:26:43 +02:00
Add RISC-V cross-compilation target for CI
Some checks failed
CI / build:all (pull_request) Failing after 4s
CI / build:cross (pull_request) Failing after 40s
9340010ea3
rarias force-pushed add-cross-ci from 9340010ea3 to 59e224a8cf 2025-10-09 14:33:12 +02:00 Compare
rarias force-pushed add-cross-ci from 59e224a8cf to c19786a3d4 2025-10-09 14:42:37 +02:00 Compare
rarias force-pushed add-cross-ci from c19786a3d4 to 40c8a12a34 2025-10-09 14:48:31 +02:00 Compare
rarias changed title from WIP: Add RISC-V cross-compilation target for CI to Add RISC-V cross-compilation target for CI 2025-10-09 14:49:35 +02:00
Collaborator

Here is a list of packages that cross compile in hydra right now: http://weasel:3001/eval/52?filter=cross&compare=46&full=#tabs-still-succeed

  • bigotes
  • jemallocNanos6
  • meteocat-exporter
  • nixtools
  • openmp
  • openmpv
  • ovni
  • paraverKernel
  • prometheus-slurm-exporter
  • upc-qaire-exporter

Also #194 should fix:

  • nosv
  • nanos6
  • nodes
  • extrae
Here is a list of packages that cross compile in hydra right now: http://weasel:3001/eval/52?filter=cross&compare=46&full=#tabs-still-succeed - bigotes - jemallocNanos6 - meteocat-exporter - nixtools - openmp - openmpv - ovni - paraverKernel - prometheus-slurm-exporter - upc-qaire-exporter Also #194 should fix: - nosv - nanos6 - nodes - extrae
abonerib reviewed 2025-10-09 15:24:39 +02:00
overlay.nix Outdated
@ -100,3 +99,1 @@
cross = prev.lib.genAttrs crossTargets (target:
final.pkgsCross.${target}.bsc-ci.pkgs
);
# Native build in that platform doesn't imply cross build works
Collaborator

So, meta.cross = true is for packages that cross compile, and we know they are correct (tested to be working), right?

So, `meta.cross = true` is for packages that cross compile, and we know they are correct (tested to be working), right?
Author
Owner

I think for now I would keep the meaning to just: "This package will be added to the bsc.ci.cross target". The precise meaning is whatever we currently have set in bsc.ci.cross, so we could add future architectures there without touching the packages. Banning a package from cross-compilation to a future arch can be controlled with meta.badPlatforms.

In particular, it would mean that the package builds, not neccesarily that it was further tested.

I think for now I would keep the meaning to just: "This package will be added to the `bsc.ci.cross` target". The precise meaning is whatever we currently have set in `bsc.ci.cross`, so we could add future architectures there without touching the packages. Banning a package from cross-compilation to a future arch can be controlled with `meta.badPlatforms`. In particular, it would mean that the package builds, not neccesarily that it was further tested.
rarias marked this conversation as resolved
Collaborator

Nix flake show seems to be broken since the sets get into intelPackages and linxuPackages. Not sure what changed.

nix flake show
git+file:///home/leix/Documents/jungle?rev=40c8a12a34040f802dbbf0f0b94fc8e4d8ee0cfe
├───bscOverlay: unknown
├───hydraJobs
│   ├───cross
│   │   └───riscv64
│   │       ├───amd-uprof: derivation 'AMD-uProf-riscv64-unknown-linux-gnu-5.1.701'
│   │       ├───bench6: derivation 'bench6-riscv64-unknown-linux-gnu-bf29a53'
│   │       ├───bigotes: derivation 'bigotes-riscv64-unknown-linux-gnu-9dce13'
│   │       ├───clangOmpss2: derivation 'clang-ompss2-wrapper-2025.06'
│   │       ├───clangOmpss2Nanos6: derivation 'clang-ompss2-wrapper-2025.06'
│   │       ├───clangOmpss2Nodes: derivation 'clang-ompss2-wrapper-2025.06'
│   │       ├───clangOmpss2NodesOmpv: derivation 'clang-ompss2-wrapper-2025.06'
│   │       ├───clangOmpss2Unwrapped: derivation 'clang-ompss2-riscv64-unknown-linux-gnu-2025.06'
│   │       ├───cudainfo: derivation 'cudainfo-riscv64-unknown-linux-gnu'
│   │       ├───gpi-2: derivation 'GPI-2-riscv64-unknown-linux-gnu-tagaspi-2021.11'
│   │       ├───intelPackages_2023
│   │       │   ├───icc: derivation 'intel-compiler-wrapper-2023.1.0'
│   │       │   ├───icx: derivation 'intel-compiler-wrapper-2023.1.0'
│   │       │   ├───ifort: derivation 'intel-fortran-wrapper-2023.1.0'
│   │       │   ├───intel-mpi: derivation 'intel-mpi-riscv64-unknown-linux-gnu-2021.9.0'
│   │       │   ├───override
│   │       │   │   ├───__functionArgs
│   │       │   │   │   ├───autoPatchelfHook
error: 'hydraJobs.cross.riscv64.intelPackages_2023.override.__functionArgs.autoPatchelfHook' is not an attribute set

I ran an eval in hydra and its building all kernel modules:

http://weasel:3001/eval/55

Nix flake show seems to be broken since the sets get into intelPackages and linxuPackages. Not sure what changed. ``` nix flake show git+file:///home/leix/Documents/jungle?rev=40c8a12a34040f802dbbf0f0b94fc8e4d8ee0cfe ├───bscOverlay: unknown ├───hydraJobs │ ├───cross │ │ └───riscv64 │ │ ├───amd-uprof: derivation 'AMD-uProf-riscv64-unknown-linux-gnu-5.1.701' │ │ ├───bench6: derivation 'bench6-riscv64-unknown-linux-gnu-bf29a53' │ │ ├───bigotes: derivation 'bigotes-riscv64-unknown-linux-gnu-9dce13' │ │ ├───clangOmpss2: derivation 'clang-ompss2-wrapper-2025.06' │ │ ├───clangOmpss2Nanos6: derivation 'clang-ompss2-wrapper-2025.06' │ │ ├───clangOmpss2Nodes: derivation 'clang-ompss2-wrapper-2025.06' │ │ ├───clangOmpss2NodesOmpv: derivation 'clang-ompss2-wrapper-2025.06' │ │ ├───clangOmpss2Unwrapped: derivation 'clang-ompss2-riscv64-unknown-linux-gnu-2025.06' │ │ ├───cudainfo: derivation 'cudainfo-riscv64-unknown-linux-gnu' │ │ ├───gpi-2: derivation 'GPI-2-riscv64-unknown-linux-gnu-tagaspi-2021.11' │ │ ├───intelPackages_2023 │ │ │ ├───icc: derivation 'intel-compiler-wrapper-2023.1.0' │ │ │ ├───icx: derivation 'intel-compiler-wrapper-2023.1.0' │ │ │ ├───ifort: derivation 'intel-fortran-wrapper-2023.1.0' │ │ │ ├───intel-mpi: derivation 'intel-mpi-riscv64-unknown-linux-gnu-2021.9.0' │ │ │ ├───override │ │ │ │ ├───__functionArgs │ │ │ │ │ ├───autoPatchelfHook error: 'hydraJobs.cross.riscv64.intelPackages_2023.override.__functionArgs.autoPatchelfHook' is not an attribute set ``` I ran an eval in hydra and its building all kernel modules: http://weasel:3001/eval/55
abonerib reviewed 2025-10-09 15:33:59 +02:00
overlay.nix Outdated
@ -133,0 +138,4 @@
# Direct access to package sets
tests = tests;
pkgs = bscPkgs;
Collaborator

inherit pkgs; would fix the set building non top-level derivations, but maybe we want to do something else?

I think building intelPackages should be fine, but callPackage adding override messes things up.

`inherit pkgs;` would fix the set building non top-level derivations, but maybe we want to do something else? I think building intelPackages should be fine, but callPackage adding override messes things up.
Author
Owner

I think building derivations in intelPackages would be a good thing. But we only want to build the amd driver, not every package in linuxPackages. Not sure if recurseForDerivations could help here.

Otherwise, leaving it only for top-level packages would be ok for now.

I think building derivations in intelPackages would be a good thing. But we only want to build the amd driver, not every package in linuxPackages. Not sure if recurseForDerivations could help here. Otherwise, leaving it only for top-level packages would be ok for now.
Author
Owner

Leaving it for top-level only.

Leaving it for top-level only.
rarias marked this conversation as resolved
Author
Owner

Here is a list of packages that cross compile in hydra right now: http://weasel:3001/eval/52?filter=cross&compare=46&full=#tabs-still-succeed
...

Thanks, I think in this PR I only want to address the mechanism to mark what cross compiles and what not in the CI. We can add those in other PR to avoid noise here.

> Here is a list of packages that cross compile in hydra right now: http://weasel:3001/eval/52?filter=cross&compare=46&full=#tabs-still-succeed > ... Thanks, I think in this PR I only want to address the mechanism to mark what cross compiles and what not in the CI. We can add those in other PR to avoid noise here.
rarias force-pushed add-cross-ci from 40c8a12a34 to 24eec53b93 2025-10-09 16:47:44 +02:00 Compare
rarias requested review from abonerib 2025-10-09 16:57:55 +02:00
abonerib approved these changes 2025-10-10 10:01:03 +02:00
abonerib left a comment
Collaborator

LGTM

We could consider adding a dep on all, so cross runs only on success, but since the cross set is small it should be fine.

LGTM We could consider adding a dep on all, so cross runs only on success, but since the cross set is small it should be fine.
rarias force-pushed add-cross-ci from 24eec53b93 to 1fba0a14a8 2025-10-10 12:12:18 +02:00 Compare
rarias manually merged commit 1fba0a14a8 into master 2025-10-10 12:13:10 +02:00
Sign in to join this conversation.
No Reviewers
2 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: rarias/jungle#195
No description provided.