From a745f47530a3af22a3e90e27a91db633ca10e8de Mon Sep 17 00:00:00 2001 From: Daniel Firth Date: Thu, 9 May 2024 13:51:10 +0000 Subject: [PATCH] Try with aarch64 pkgsCross --- .github/workflows/ci-nix.yaml | 6 +++ flake.nix | 87 +++++++++++++++++++++-------------- nix/hydra/docker.nix | 3 +- 3 files changed, 60 insertions(+), 36 deletions(-) diff --git a/.github/workflows/ci-nix.yaml b/.github/workflows/ci-nix.yaml index 58acc581fa6..cdfa55be384 100644 --- a/.github/workflows/ci-nix.yaml +++ b/.github/workflows/ci-nix.yaml @@ -28,6 +28,7 @@ jobs: - package: hydra-tui - package: hydra-node - package: hydra-cluster + - package: aarch64 steps: - name: 📥 Checkout repository uses: actions/checkout@v4 @@ -45,6 +46,11 @@ jobs: name: cardano-scaling authToken: '${{ secrets.CACHIX_CARDANO_SCALING_AUTH_TOKEN }}' + - name: ❓Aarch64 + if: ${{ matrix.package == 'aarch64' }} + run: | + nix build .#legacyPackages.x86_64-linux.aarch64.hydra-node + - name: ❓ Test (Pure) if: ${{ matrix.package == 'hydra-plutus' || matrix.package == 'plutus-cbor' diff --git a/flake.nix b/flake.nix index 05afacd8af7..a263739bec1 100644 --- a/flake.nix +++ b/flake.nix @@ -43,39 +43,40 @@ # nixpkgs enhanced with haskell.nix and crypto libs as used by iohk + overlays = [ + # This overlay contains libsodium and libblst libraries + inputs.iohk-nix.overlays.crypto + # This overlay contains pkg-config mappings via haskell.nix to use the + # crypto libraries above + inputs.iohk-nix.overlays.haskell-nix-crypto + # Keep haskell.nix as the last overlay! + # + # Reason: haskell.nix modules/overlays neds to be last + # https://github.com/input-output-hk/haskell.nix/issues/1954 + inputs.haskellNix.overlay + # Custom static libs used for darwin build + (import ./nix/static-libs.nix) + inputs.nix-npm-buildpackage.overlays.default + # Specific versions of tools we require + (final: prev: { + apply-refact = pkgs.haskell-nix.tool compiler "apply-refact" "0.14.0.0"; + cabal-fmt = pkgs.haskell-nix.tool compiler "cabal-fmt" "0.1.9"; + cabal-install = pkgs.haskell-nix.cabal-install.${compiler}; + cabal-plan = pkgs.haskell-nix.tool compiler "cabal-plan" "0.7.3.0"; + fourmolu = pkgs.haskell-nix.tool compiler "fourmolu" "0.14.1.0"; + haskell-language-server = pkgs.haskell-nix.tool compiler "haskell-language-server" rec { + src = inputs.hls; + cabalProject = builtins.readFile (src + "/cabal.project"); + }; + hlint = pkgs.haskell-nix.tool compiler "hlint" "3.8"; + cardano-cli = inputs.cardano-node.packages.${system}.cardano-cli; + cardano-node = inputs.cardano-node.packages.${system}.cardano-node; + mithril-client-cli = inputs.mithril.packages.${system}.mithril-client-cli; + }) + ]; + pkgs = import nixpkgs { - inherit system; - overlays = [ - # This overlay contains libsodium and libblst libraries - inputs.iohk-nix.overlays.crypto - # This overlay contains pkg-config mappings via haskell.nix to use the - # crypto libraries above - inputs.iohk-nix.overlays.haskell-nix-crypto - # Keep haskell.nix as the last overlay! - # - # Reason: haskell.nix modules/overlays neds to be last - # https://github.com/input-output-hk/haskell.nix/issues/1954 - inputs.haskellNix.overlay - # Custom static libs used for darwin build - (import ./nix/static-libs.nix) - inputs.nix-npm-buildpackage.overlays.default - # Specific versions of tools we require - (final: prev: { - apply-refact = pkgs.haskell-nix.tool compiler "apply-refact" "0.14.0.0"; - cabal-fmt = pkgs.haskell-nix.tool compiler "cabal-fmt" "0.1.9"; - cabal-install = pkgs.haskell-nix.cabal-install.${compiler}; - cabal-plan = pkgs.haskell-nix.tool compiler "cabal-plan" "0.7.3.0"; - fourmolu = pkgs.haskell-nix.tool compiler "fourmolu" "0.14.1.0"; - haskell-language-server = pkgs.haskell-nix.tool compiler "haskell-language-server" rec { - src = inputs.hls; - cabalProject = builtins.readFile (src + "/cabal.project"); - }; - hlint = pkgs.haskell-nix.tool compiler "hlint" "3.8"; - cardano-cli = inputs.cardano-node.packages.${system}.cardano-cli; - cardano-node = inputs.cardano-node.packages.${system}.cardano-node; - mithril-client-cli = inputs.mithril.packages.${system}.mithril-client-cli; - }) - ]; + inherit system overlays; }; inputMap = { "https://intersectmbo.github.io/cardano-haskell-packages" = inputs.CHaP; }; @@ -85,13 +86,31 @@ compiler-nix-name = compiler; }; + hsPkgsArm = import ./nix/hydra/project.nix { + inherit inputMap; + pkgs = pkgs.pkgsCross.aarch64-multiplatform-musl; + compiler-nix-name = compiler; + }; + + hydraPackages = import ./nix/hydra/packages.nix { inherit system pkgs inputs hsPkgs self; gitRev = self.rev or "dirty"; }; + hydraPackagesArm = import ./nix/hydra/packages.nix { + inherit system inputs hsPkgs self; + pkgs = pkgs.pkgsCross.aarch64-multiplatform-musl; + gitRev = self.rev or "dirty"; + }; + hydraImages = import ./nix/hydra/docker.nix { - inherit hydraPackages system nixpkgs; + inherit hydraPackages system pkgs; + }; + + hydraImagesArm = import ./nix/hydra/docker.nix { + inherit hydraPackages system; + pkgs = pkgs.pkgsCross.aarch64-multiplatform-musl; }; prefixAttrs = s: attrs: @@ -100,7 +119,7 @@ in rec { - legacyPackages = hsPkgs; + legacyPackages = hsPkgs // { aarch64 = hsPkgsArm; }; packages = hydraPackages // diff --git a/nix/hydra/docker.nix b/nix/hydra/docker.nix index a23a3c8fef6..c773e10707a 100644 --- a/nix/hydra/docker.nix +++ b/nix/hydra/docker.nix @@ -3,10 +3,9 @@ { hydraPackages # as defined in packages.nix , system -, nixpkgs +, pkgs }: let - pkgs = import nixpkgs { inherit system; }; in { hydra-node = pkgs.dockerTools.buildImage {