From f7ced1be35aac96933bf29b786a7bc1db5993a96 Mon Sep 17 00:00:00 2001 From: Marcin Szamotulski Date: Thu, 27 Aug 2026 10:15:57 +0200 Subject: [PATCH 1/2] Run hydra on aarch64-linux Also include aarch64-linux artifacts in releases. --- .github/workflows/release-upload.yaml | 36 ++++++++++--------- ...0260901_124637_coot_aarch64_linux_build.md | 23 ++++++++++++ nix/dmq-node.nix | 10 ++++-- nix/outputs.nix | 14 ++++++-- 4 files changed, 62 insertions(+), 21 deletions(-) create mode 100644 dmq-node/changelog.d/20260901_124637_coot_aarch64_linux_build.md diff --git a/.github/workflows/release-upload.yaml b/.github/workflows/release-upload.yaml index 18a1020f..883ae38b 100644 --- a/.github/workflows/release-upload.yaml +++ b/.github/workflows/release-upload.yaml @@ -22,13 +22,16 @@ env: jobs: wait-for-hydra: - name: "Wait for hydra check-runs" + name: "Wait for hydra check-runs (${{ matrix.system }})" + strategy: + matrix: + system: [x86_64-linux, aarch64-linux] runs-on: ubuntu-latest steps: - - name: Waiting for ci/hydra-build:x86_64-linux.required to complete + - name: Waiting for ci/hydra-build:${{ matrix.system }}.required to complete run: | while [[ true ]]; do - check_name='ci/hydra-build:x86_64-linux.required' + check_name='ci/hydra-build:${{ matrix.system }}.required' conclusion=$(gh api "repos/$GITHUB_REPOSITORY/commits/$GITHUB_SHA/check-runs?check_name=$check_name" --paginate --jq '.check_runs[].conclusion') case "$conclusion" in success) @@ -47,8 +50,12 @@ jobs: needs: [wait-for-hydra] strategy: matrix: - arch: [linux] - name: "Download Asset from the Cache" + include: + - system: x86_64-linux + asset_name: dmq-node-linux + - system: aarch64-linux + asset_name: dmq-node-linux-aarch64 + name: "Download Asset from the Cache (${{ matrix.system }})" runs-on: ubuntu-latest steps: - name: Install Nix with good defaults @@ -67,20 +74,17 @@ jobs: - name: Build run: | - case ${{ matrix.arch }} in - linux) - nix build \ - --builders "" \ - --max-jobs 0 \ - .#packages.x86_64-linux.dmq-node-static - esac + nix build \ + --builders "" \ + --max-jobs 0 \ + .#packages.${{ matrix.system }}.dmq-node-static - name: Compress binary - run: tar -czf dmq-node-linux.tar.gz result/bin/dmq-node + run: tar -czf ${{ matrix.asset_name }}.tar.gz result/bin/dmq-node - name: Checksums run: | - sha256sum dmq-node-linux.tar.gz >> "dmq-node-linux.tar.gz.sha256sum.txt" + sha256sum ${{ matrix.asset_name }}.tar.gz >> "${{ matrix.asset_name }}.tar.gz.sha256sum.txt" - name: Release uses: input-output-hk/action-gh-release@v1 @@ -88,5 +92,5 @@ jobs: draft: true name: "Release dmq-node-${{ github.ref_name }}" files: | - dmq-node-linux.tar.gz - dmq-node-linux.tar.gz.sha256sum.txt + ${{ matrix.asset_name }}.tar.gz + ${{ matrix.asset_name }}.tar.gz.sha256sum.txt diff --git a/dmq-node/changelog.d/20260901_124637_coot_aarch64_linux_build.md b/dmq-node/changelog.d/20260901_124637_coot_aarch64_linux_build.md new file mode 100644 index 00000000..795b3d42 --- /dev/null +++ b/dmq-node/changelog.d/20260901_124637_coot_aarch64_linux_build.md @@ -0,0 +1,23 @@ + + + +### Non-Breaking + +- Build natively on `aarch64-linux`, included the build artifact it in a release. + + diff --git a/nix/dmq-node.nix b/nix/dmq-node.nix index 3fcb69b8..c5101afc 100644 --- a/nix/dmq-node.nix +++ b/nix/dmq-node.nix @@ -41,9 +41,15 @@ let inputMap = { "https://chap.intersectmbo.org/" = inputs.CHaP; }; # TODO: enable cross compilation for windows by adding `p.ucrt64`. + # + # Both of these are libc swaps for the build platform's own arch (not a + # cross-arch build), giving a fully static, natively-built executable: + # `musl64` on x86_64-linux, `aarch64-multiplatform-musl` on aarch64-linux. crossPlatforms = p: - lib.optionals (pkgs.stdenv.hostPlatform.isLinux && config.compiler-nix-name == defaultCompiler) - [ p.musl64 ]; + lib.optionals (pkgs.stdenv.hostPlatform.isLinux && config.compiler-nix-name == defaultCompiler) ( + lib.optional pkgs.stdenv.hostPlatform.isx86_64 p.musl64 + ++ lib.optional pkgs.stdenv.hostPlatform.isAarch64 p.aarch64-multiplatform-musl + ); modules = [ (forAllProjectPackages ({ ... }: { diff --git a/nix/outputs.nix b/nix/outputs.nix index 20943f2b..08f2cfdb 100644 --- a/nix/outputs.nix +++ b/nix/outputs.nix @@ -12,6 +12,14 @@ let buildSystem = pkgs.stdenv.buildPlatform.system; + # Fully static, natively-built variant for each system we support it on. + # Both are libc swaps for the build platform's own arch, not a cross-arch + # build (see `crossPlatforms` in nix/dmq-node.nix). + staticCrossTarget = { + "x86_64-linux" = "musl64"; + "aarch64-linux" = "aarch64-multiplatform-musl"; + }; + packages = rec { # TODO: `nix build .\#dmq-node` will have the git revision set in the binary, # `nib build .\#hydraJobs.x86_64-linux.packages.dmq-node:exe:dmq-node` won't @@ -21,11 +29,11 @@ let # (inputs.self.rev or inputs.self.dirtyShortRev) pkgs.dmq-node.hsPkgs.dmq-node.components.exes.dmq-node; default = dmq-node; - } // lib.optionalAttrs (buildSystem == "x86_64-linux") { + } // lib.optionalAttrs (builtins.hasAttr buildSystem staticCrossTarget) { dmq-node-static = # pkgs.setGitRev # (inputs.self.rev or inputs.self.dirtyShortRev) - pkgs.dmq-node.projectCross.musl64.hsPkgs.dmq-node.components.exes.dmq-node; + pkgs.dmq-node.projectCross.${staticCrossTarget.${buildSystem}}.hsPkgs.dmq-node.components.exes.dmq-node; docker-dmq = pkgs.dockerTools.buildImage { name = "docker-dmq-node"; tag = "latest"; @@ -70,7 +78,7 @@ let { "x86_64-linux" = defaultHydraJobs; "x86_64-darwin" = { }; - "aarch64-linux" = { }; + "aarch64-linux" = defaultHydraJobs; "aarch64-darwin" = defaultHydraJobs; }.${system}; in From 0fa553f51970a027626d0efacd24a6976ee687c0 Mon Sep 17 00:00:00 2001 From: Marcin Szamotulski Date: Tue, 1 Sep 2026 12:48:19 +0200 Subject: [PATCH 2/2] dmq-node-0.7.1.0 --- dmq-node/CHANGELOG.md | 9 ++++++++ .../20260812_kolam_bump_consensus_4_1.md | 21 ----------------- ...0260901_124637_coot_aarch64_linux_build.md | 23 ------------------- dmq-node/dmq-node.cabal | 2 +- 4 files changed, 10 insertions(+), 45 deletions(-) delete mode 100644 dmq-node/changelog.d/20260812_kolam_bump_consensus_4_1.md delete mode 100644 dmq-node/changelog.d/20260901_124637_coot_aarch64_linux_build.md diff --git a/dmq-node/CHANGELOG.md b/dmq-node/CHANGELOG.md index c55e35e0..14c25033 100644 --- a/dmq-node/CHANGELOG.md +++ b/dmq-node/CHANGELOG.md @@ -2,6 +2,15 @@ + +## 0.7.1.0 -- 2026-09-01 + +### Non-Breaking + +- Bump `ouroboros-consensus` to `v4.1`. + +- Build natively on `aarch64-linux`, included the build artifact it in a release. + ## 0.7.0.0 -- 2026-07-31 diff --git a/dmq-node/changelog.d/20260812_kolam_bump_consensus_4_1.md b/dmq-node/changelog.d/20260812_kolam_bump_consensus_4_1.md deleted file mode 100644 index 0ce593ec..00000000 --- a/dmq-node/changelog.d/20260812_kolam_bump_consensus_4_1.md +++ /dev/null @@ -1,21 +0,0 @@ - - -### Non-Breaking - -- Bump `ouroboros-consensus` to `v4.1`. - - \ No newline at end of file diff --git a/dmq-node/changelog.d/20260901_124637_coot_aarch64_linux_build.md b/dmq-node/changelog.d/20260901_124637_coot_aarch64_linux_build.md deleted file mode 100644 index 795b3d42..00000000 --- a/dmq-node/changelog.d/20260901_124637_coot_aarch64_linux_build.md +++ /dev/null @@ -1,23 +0,0 @@ - - - -### Non-Breaking - -- Build natively on `aarch64-linux`, included the build artifact it in a release. - - diff --git a/dmq-node/dmq-node.cabal b/dmq-node/dmq-node.cabal index 4238dd2c..750f73b8 100644 --- a/dmq-node/dmq-node.cabal +++ b/dmq-node/dmq-node.cabal @@ -1,6 +1,6 @@ cabal-version: 3.4 name: dmq-node -version: 0.7.0.0 +version: 0.7.1.0 synopsis: Decentralised Message Queue Node description: Decentralised Message Queue Node based on Cardano Diffusion