Compare commits

..

5 Commits

Author SHA1 Message Date
dd7744358f
Add meta to intel 2023
All checks were successful
CI / build:cross (pull_request) Successful in 6s
CI / build:all (pull_request) Successful in 15s
2025-10-10 12:29:55 +02:00
fee9c0ffe7
Add meta to packages 2025-10-10 12:29:55 +02:00
a2e47e666a
Add maintainers 2025-10-10 12:29:55 +02:00
1fba0a14a8 Enable ovni for cross compilation
All checks were successful
CI / build:cross (pull_request) Successful in 5s
CI / build:all (pull_request) Successful in 15s
CI / build:all (push) Successful in 3s
CI / build:cross (push) Successful in 6s
Reviewed-by: Aleix Boné <abonerib@bsc.es>
Tested-by: Rodrigo Arias Mallo <rodrigo.arias@bsc.es>
2025-10-10 12:08:28 +02:00
d6621e939a Add RISC-V cross-compilation target for CI
Reviewed-by: Aleix Boné <abonerib@bsc.es>
2025-10-10 12:08:24 +02:00
4 changed files with 41 additions and 22 deletions

View File

@ -12,4 +12,9 @@ jobs:
runs-on: native runs-on: native
steps: steps:
- uses: https://gitea.com/ScMi1/checkout@v1.4 - uses: https://gitea.com/ScMi1/checkout@v1.4
- run: nix build -L --no-link --print-out-paths .#bsc-ci.all - run: nix build -L --no-link --print-out-paths .#bsc.ci.all
build:cross:
runs-on: native
steps:
- uses: https://gitea.com/ScMi1/checkout@v1.4
- run: nix build -L --no-link --print-out-paths .#bsc.ci.cross

View File

@ -42,9 +42,7 @@ in
# full nixpkgs with our overlay applied # full nixpkgs with our overlay applied
legacyPackages.${system} = pkgs; legacyPackages.${system} = pkgs;
hydraJobs = { hydraJobs = self.legacyPackages.${system}.bsc.hydraJobs;
inherit (self.legacyPackages.${system}.bsc-ci) tests pkgs cross;
};
# propagate nixpkgs lib, so we can do bscpkgs.lib # propagate nixpkgs lib, so we can do bscpkgs.lib
lib = nixpkgs.lib // { lib = nixpkgs.lib // {

View File

@ -94,12 +94,18 @@ let
}; };
}; };
pkgs = filterAttrs (_: isDerivation) bscPkgs; # For now, only build toplevel packages in CI/Hydra
pkgsTopLevel = filterAttrs (_: isDerivation) bscPkgs;
crossTargets = [ "riscv64" ]; # Native build in that platform doesn't imply cross build works
cross = prev.lib.genAttrs crossTargets (target: canCrossCompile = platform: pkg:
final.pkgsCross.${target}.bsc-ci.pkgs (isDerivation pkg) &&
); # Must be defined explicitly
(pkg.meta.cross or false) &&
(meta.availableOn platform pkg);
# For now only RISC-V
crossSet = { riscv64 = final.pkgsCross.riscv64.bsc.pkgsTopLevel; };
buildList = name: paths: buildList = name: paths:
final.runCommandLocal name { } '' final.runCommandLocal name { } ''
@ -113,12 +119,14 @@ let
printf '%s\n' $deps >$out printf '%s\n' $deps >$out
''; '';
crossList = builtins.mapAttrs (t: v: buildList t (builtins.attrValues v)) cross; pkgsList = buildList "ci-pkgs" (builtins.attrValues pkgsTopLevel);
testsList = buildList "ci-tests" (collect isDerivation tests);
pkgsList = buildList "ci-pkgs" (builtins.attrValues pkgs); allList = buildList' "ci-all" [ pkgsList testsList ];
testList = buildList "ci-tests" (collect isDerivation tests); # For now only RISC-V
crossList = buildList "ci-cross"
all = buildList' "ci-all" [ pkgsList testList ]; (filter
(canCrossCompile final.pkgsCross.riscv64.stdenv.hostPlatform)
(builtins.attrValues crossSet.riscv64));
in bscPkgs // { in bscPkgs // {
@ -128,14 +136,21 @@ in bscPkgs // {
}; };
}; };
# Prevent accidental usage of bsc attribute # Prevent accidental usage of bsc-ci attribute
bsc = throw "the bsc attribute is deprecated, packages are now in the root"; bsc-ci = throw "the bsc-ci attribute is deprecated, use bsc.ci";
# Internal for our CI tests # Internal for our CI tests
bsc-ci = { bsc = {
inherit pkgs pkgsList; # CI targets for nix build
inherit tests testList; ci = { pkgs = pkgsList; tests = testsList; all = allList; cross = crossList; };
inherit cross crossList;
inherit all; # Direct access to package sets
tests = tests;
pkgs = bscPkgs;
pkgsTopLevel = pkgsTopLevel;
cross = crossSet;
# Hydra uses attribute sets of pkgs
hydraJobs = { tests = tests; pkgs = pkgsTopLevel; cross = crossSet; };
}; };
} }

View File

@ -62,5 +62,6 @@ in
maintainers = with lib.maintainers.bsc; [ rarias ]; maintainers = with lib.maintainers.bsc; [ rarias ];
platforms = lib.platforms.linux; platforms = lib.platforms.linux;
license = lib.licenses.gpl3Plus; license = lib.licenses.gpl3Plus;
cross = true;
}; };
} }