From feffa020d2df58f642800b97679fa425e30ea239 Mon Sep 17 00:00:00 2001 From: Michal Rus Date: Wed, 3 Apr 2024 17:23:15 +0200 Subject: [PATCH] Add `cardano-node-8.9.1-aarch64-linux.tar.gz` for E2E tests --- ...rdano-node-8.9.1--expose-projectExes.patch | 13 ++++++++++ native-arm/flake.nix | 25 +++++++++++++++++++ 2 files changed, 38 insertions(+) create mode 100644 native-arm/cardano-node-8.9.1--expose-projectExes.patch diff --git a/native-arm/cardano-node-8.9.1--expose-projectExes.patch b/native-arm/cardano-node-8.9.1--expose-projectExes.patch new file mode 100644 index 0000000..5d46d29 --- /dev/null +++ b/native-arm/cardano-node-8.9.1--expose-projectExes.patch @@ -0,0 +1,13 @@ +diff --git a/flake.nix b/flake.nix +index 0804d9ff3..64362d27d 100644 +--- a/flake.nix ++++ b/flake.nix +@@ -305,6 +305,8 @@ + internal.roots.project = windowsProject.roots; + variants = mapAttrs (_: v: removeAttrs v.windows ["variants"]) ciJobsVariants; + }); ++ } // optionalAttrs (system == "aarch64-linux") { ++ linux-arm64.projectExes = collectExes project; + } // optionalAttrs (system == "x86_64-darwin") { + native = lib.filterAttrs + (n: _: diff --git a/native-arm/flake.nix b/native-arm/flake.nix index a1b9eeb..fc32f52 100644 --- a/native-arm/flake.nix +++ b/native-arm/flake.nix @@ -556,6 +556,10 @@ original = inputs.${input}; supportedSystemsPath = "nix/supported-systems.nix"; extraPatch = '' + ( + cd $out + patch -p1 -i ${./cardano-node-8.9.1--expose-projectExes.patch} + ) sed -r ' s/"ghc8107"/"ghc963"/g s/"-fexternal-interpreter"//g @@ -569,6 +573,27 @@ # { name = "${input}--cardano-submit-api"; value = theFlake.packages.${system}.cardano-submit-api; } { name = "${input}--oci"; value = retagOCI "cardano-node" version theFlake.legacyPackages.${system}.dockerImage; } { name = "${input}--oci-submit-api"; value = retagOCI "cardano-submit-api" version theFlake.legacyPackages.${system}.submitApiDockerImage; } + { + name = "${input}--tar"; + value = let + pkgs = theFlake.inputs.nixpkgs.legacyPackages.${system}; + nix-bundle-exe-with-symlinks = pkgs.runCommand "nix-bundle-exe-with-symlinks" {} '' + cp -r ${inputs.nix-bundle-exe} $out + chmod -R +w $out + sed -r "s/find '/find -L '/g" -i $out/default.nix + ''; + nix-bundle-exe = import nix-bundle-exe-with-symlinks { pkgs = pkgs; }; + allExes = pkgs.buildEnv { + name = "cardano-tools"; + paths = builtins.attrValues theFlake.hydraJobs.${system}.linux-arm64.projectExes; + pathsToLink = ["/bin"]; + }; + bundle = nix-bundle-exe allExes; + in pkgs.runCommand "${bundle.name}-tar" {} '' + mkdir -p $out + tar -czvf $out/cardano-node-${version}-${system}.tar.gz -C ${bundle} . + ''; + } ]) );