From 43dc8b8634f9eee89e1138199239282796f899a9 Mon Sep 17 00:00:00 2001 From: "code@dmj.io" Date: Fri, 9 Oct 2026 03:45:52 -0500 Subject: [PATCH 1/2] CI: also build on macOS (Apple Silicon) and Linux on ARM A build-other matrix job runs the WASM, MicroHs and JS builds on macos-latest and ubuntu-24.04-arm. It is separate from the build job, so it does not upload or gate the GitHub Pages deploy. Intel macOS is left out, since nixpkgs has dropped x86_64-darwin. --- .github/workflows/main.yml | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 804be02..948be37 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -52,6 +52,38 @@ jobs: # run: | # make ghcup-build + # The same builds on macOS (Apple Silicon) and Linux on ARM. These do not + # deploy, so a failure here does not hold back the site. (Intel macOS is + # left out: nixpkgs has dropped x86_64-darwin.) + build-other: + strategy: + fail-fast: false + matrix: + os: [ macos-latest, ubuntu-24.04-arm ] + runs-on: ${{ matrix.os }} + timeout-minutes: 240 + + steps: + - uses: actions/checkout@v6 + + - uses: cachix/install-nix-action@v31 + with: + github_access_token: ${{ secrets.GITHUB_TOKEN }} + + - name: Install cachix + uses: cachix/cachix-action@v17 + with: + name: haskell-miso-cachix + + - name: Build WASM using Nix + run: nix develop .#wasm --command bash -c "make" + + - name: Build MicroHs using Nix + run: nix develop .#mhs --command bash -c "make mhs" + + - name: Build JS using Nix + run: nix develop .#ghcjs --command bash -c "make js" + deploy: if: github.ref == 'refs/heads/main' runs-on: ubuntu-latest From dd3e835e1c18ded395c5fb504b5a553d6c327988 Mon Sep 17 00:00:00 2001 From: David Johnson Date: Thu, 5 Nov 2026 13:05:57 -0600 Subject: [PATCH 2/2] ghcjs shell: add hsc2hs (time needs it on macOS and Linux on ARM) The build-other jobs failed building time-1.14 for the JS backend: "The program 'hsc2hs' is required but it could not be found." miso's ghcjs shell has no hsc2hs; the build job only passed because ubuntu-latest has GHCup's on the PATH. Co-Authored-By: Claude Opus 5.5 --- flake.nix | 23 ++++++++++++++++------- 1 file changed, 16 insertions(+), 7 deletions(-) diff --git a/flake.nix b/flake.nix index 1306fa8..8691a16 100644 --- a/flake.nix +++ b/flake.nix @@ -18,13 +18,22 @@ }; outputs = inputs: - inputs.miso.inputs.flake-utils.lib.eachDefaultSystem (system: { - devShell = inputs.miso.outputs.devShells.${system}.default; - devShells.hls = inputs.miso.outputs.devShells.${system}.hls; - devShells.wasm = inputs.miso.outputs.devShells.${system}.wasm; - devShells.ghcjs = inputs.miso.outputs.devShells.${system}.ghcjs; - devShells.mhs = inputs.miso.outputs.devShells.${system}.mhs; - }); + inputs.miso.inputs.flake-utils.lib.eachDefaultSystem (system: + let + pkgs = inputs.miso.inputs.nixpkgs.legacyPackages.${system}; + in { + devShell = inputs.miso.outputs.devShells.${system}.default; + devShells.hls = inputs.miso.outputs.devShells.${system}.hls; + devShells.wasm = inputs.miso.outputs.devShells.${system}.wasm; + # miso's, with hsc2hs: cabal needs it to build time (and other + # packages with .hsc files) for the JS backend. GitHub's + # ubuntu-latest image has one from GHCup on the PATH, macOS and + # Linux on ARM do not. + devShells.ghcjs = inputs.miso.outputs.devShells.${system}.ghcjs.overrideAttrs (old: { + nativeBuildInputs = (old.nativeBuildInputs or [ ]) ++ [ pkgs.haskellPackages.hsc2hs ]; + }); + devShells.mhs = inputs.miso.outputs.devShells.${system}.mhs; + }); }