diff --git a/.gitea/workflows/ci.yaml b/.gitea/workflows/ci.yaml index 7393352e..ba80b87a 100644 --- a/.gitea/workflows/ci.yaml +++ b/.gitea/workflows/ci.yaml @@ -12,4 +12,9 @@ jobs: runs-on: native steps: - 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 diff --git a/flake.nix b/flake.nix index 0bdaabe2..9ff35543 100644 --- a/flake.nix +++ b/flake.nix @@ -42,9 +42,7 @@ in # full nixpkgs with our overlay applied legacyPackages.${system} = pkgs; - hydraJobs = { - inherit (self.legacyPackages.${system}.bsc-ci) tests pkgs cross; - }; + hydraJobs = self.legacyPackages.${system}.bsc.hydraJobs; # propagate nixpkgs lib, so we can do bscpkgs.lib inherit (nixpkgs) lib; diff --git a/overlay.nix b/overlay.nix index d54ea481..bc645dc8 100644 --- a/overlay.nix +++ b/overlay.nix @@ -96,10 +96,11 @@ let pkgs = filterAttrs (_: isDerivation) bscPkgs; - crossTargets = [ "riscv64" ]; - cross = prev.lib.genAttrs crossTargets (target: - final.pkgsCross.${target}.bsc-ci.pkgs - ); + # TODO: Native build in that platform doesn't imply cross build works + canCrossCompile = platform: pkg: (isDerivation pkg) && (meta.availableOn platform pkg); + + # For now only RISC-V + crossSet = { riscv64 = final.pkgsCross.riscv64.bsc.pkgs; }; buildList = name: paths: final.runCommandLocal name { } '' @@ -113,22 +114,30 @@ let printf '%s\n' $deps >$out ''; - crossList = builtins.mapAttrs (t: v: buildList t (builtins.attrValues v)) cross; - pkgsList = buildList "ci-pkgs" (builtins.attrValues pkgs); - testList = buildList "ci-tests" (collect isDerivation tests); - - all = buildList' "ci-all" [ pkgsList testList ]; + testsList = buildList "ci-tests" (collect isDerivation tests); + allList = buildList' "ci-all" [ pkgsList testsList ]; + # For now only RISC-V + crossList = buildList "ci-cross" + (filter + (canCrossCompile final.pkgsCross.riscv64.stdenv.hostPlatform) + (builtins.attrValues crossSet.riscv64)); in bscPkgs // { - # Prevent accidental usage of bsc attribute - bsc = throw "the bsc attribute is deprecated, packages are now in the root"; + # Prevent accidental usage of bsc-ci attribute + bsc-ci = throw "the bsc-ci attribute is deprecated, use bsc.ci"; # Internal for our CI tests - bsc-ci = { - inherit pkgs pkgsList; - inherit tests testList; - inherit cross crossList; - inherit all; + bsc = { + # CI targets for nix build + ci = { pkgs = pkgsList; tests = testsList; all = allList; cross = crossList; }; + + # Direct access to package sets + tests = tests; + pkgs = bscPkgs; + cross = crossSet; + + # Hydra uses attribute sets of pkgs + hydraJobs = { tests = tests; pkgs = bscPkgs; cross = crossSet; }; }; } diff --git a/pkgs/amd-uprof/default.nix b/pkgs/amd-uprof/default.nix index 9eb67079..913a4435 100644 --- a/pkgs/amd-uprof/default.nix +++ b/pkgs/amd-uprof/default.nix @@ -86,4 +86,7 @@ in patchelf --add-needed libnuma.so $out/bin/AMDuProfPcm set +x ''; + meta = { + platforms = [ "x86_64-linux" ]; + }; } diff --git a/pkgs/amd-uprof/driver.nix b/pkgs/amd-uprof/driver.nix index e69ef2c7..ddc2e272 100644 --- a/pkgs/amd-uprof/driver.nix +++ b/pkgs/amd-uprof/driver.nix @@ -28,6 +28,6 @@ in stdenv.mkDerivation { meta = { description = "AMD Power Profiler Driver"; homepage = "https://www.amd.com/es/developer/uprof.html"; - platforms = lib.platforms.linux; + platforms = [ "x86_64-linux" ]; }; } diff --git a/pkgs/cudainfo/default.nix b/pkgs/cudainfo/default.nix index 871d6978..ce101a24 100644 --- a/pkgs/cudainfo/default.nix +++ b/pkgs/cudainfo/default.nix @@ -40,4 +40,5 @@ stdenv.mkDerivation (finalAttrs: { ''; installPhase = "touch $out"; }; + meta.platforms = [ "x86_64-linux" ]; })