Add RISC-V cross-compilation target for CI
This commit is contained in:
parent
dd7f24f455
commit
59e224a8cf
@ -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
|
||||||
|
@ -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
|
||||||
inherit (nixpkgs) lib;
|
inherit (nixpkgs) lib;
|
||||||
|
41
overlay.nix
41
overlay.nix
@ -96,10 +96,11 @@ let
|
|||||||
|
|
||||||
pkgs = filterAttrs (_: isDerivation) bscPkgs;
|
pkgs = filterAttrs (_: isDerivation) bscPkgs;
|
||||||
|
|
||||||
crossTargets = [ "riscv64" ];
|
# TODO: Native build in that platform doesn't imply cross build works
|
||||||
cross = prev.lib.genAttrs crossTargets (target:
|
canCrossCompile = platform: pkg: (isDerivation pkg) && (meta.availableOn platform pkg);
|
||||||
final.pkgsCross.${target}.bsc-ci.pkgs
|
|
||||||
);
|
# For now only RISC-V
|
||||||
|
crossSet = { riscv64 = final.pkgsCross.riscv64.bsc.pkgs; };
|
||||||
|
|
||||||
buildList = name: paths:
|
buildList = name: paths:
|
||||||
final.runCommandLocal name { } ''
|
final.runCommandLocal name { } ''
|
||||||
@ -113,22 +114,30 @@ 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 pkgs);
|
pkgsList = buildList "ci-pkgs" (builtins.attrValues pkgs);
|
||||||
testList = buildList "ci-tests" (collect isDerivation tests);
|
testsList = buildList "ci-tests" (collect isDerivation tests);
|
||||||
|
allList = buildList' "ci-all" [ pkgsList testsList ];
|
||||||
all = buildList' "ci-all" [ pkgsList testList ];
|
# For now only RISC-V
|
||||||
|
crossList = buildList "ci-cross"
|
||||||
|
(filter
|
||||||
|
(canCrossCompile final.pkgsCross.riscv64.stdenv.hostPlatform)
|
||||||
|
(builtins.attrValues crossSet.riscv64));
|
||||||
|
|
||||||
in bscPkgs // {
|
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;
|
||||||
|
cross = crossSet;
|
||||||
|
|
||||||
|
# Hydra uses attribute sets of pkgs
|
||||||
|
hydraJobs = { tests = tests; pkgs = bscPkgs; cross = crossSet; };
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
@ -86,4 +86,7 @@ in
|
|||||||
patchelf --add-needed libnuma.so $out/bin/AMDuProfPcm
|
patchelf --add-needed libnuma.so $out/bin/AMDuProfPcm
|
||||||
set +x
|
set +x
|
||||||
'';
|
'';
|
||||||
|
meta = {
|
||||||
|
platforms = [ "x86_64-linux" ];
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
@ -28,6 +28,6 @@ in stdenv.mkDerivation {
|
|||||||
meta = {
|
meta = {
|
||||||
description = "AMD Power Profiler Driver";
|
description = "AMD Power Profiler Driver";
|
||||||
homepage = "https://www.amd.com/es/developer/uprof.html";
|
homepage = "https://www.amd.com/es/developer/uprof.html";
|
||||||
platforms = lib.platforms.linux;
|
platforms = [ "x86_64-linux" ];
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
@ -40,4 +40,5 @@ stdenv.mkDerivation (finalAttrs: {
|
|||||||
'';
|
'';
|
||||||
installPhase = "touch $out";
|
installPhase = "touch $out";
|
||||||
};
|
};
|
||||||
|
meta.platforms = [ "x86_64-linux" ];
|
||||||
})
|
})
|
||||||
|
Loading…
x
Reference in New Issue
Block a user