Skip to content

Commit

Permalink
Try with aarch64 pkgsCross
Browse files Browse the repository at this point in the history
  • Loading branch information
locallycompact committed May 9, 2024
1 parent f081958 commit a649c1b
Show file tree
Hide file tree
Showing 3 changed files with 60 additions and 36 deletions.
6 changes: 6 additions & 0 deletions .github/workflows/ci-nix.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ jobs:
- package: hydra-tui
- package: hydra-node
- package: hydra-cluster
- package: aarch64
steps:
- name: 📥 Checkout repository
uses: actions/checkout@v4
Expand All @@ -45,6 +46,11 @@ jobs:
name: cardano-scaling
authToken: '${{ secrets.CACHIX_CARDANO_SCALING_AUTH_TOKEN }}'

- name: ❓Aarch64
if: ${{ matrix.package == 'aarch64' }}
run: |
nix build .#packages.x86_64-linux.aarch64.hydra-node
- name: ❓ Test (Pure)
if: ${{ matrix.package == 'hydra-plutus'
|| matrix.package == 'plutus-cbor'
Expand Down
87 changes: 53 additions & 34 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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; };
Expand All @@ -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:
Expand All @@ -100,7 +119,7 @@

in
rec {
legacyPackages = hsPkgs;
legacyPackages = hsPkgs // { aarch64 = hsPkgsArm; };

packages =
hydraPackages //
Expand Down
3 changes: 1 addition & 2 deletions nix/hydra/docker.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit a649c1b

Please sign in to comment.