Skip to content
Snippets Groups Projects

ci: Rework CI for Darwin

Closed Ben Gamari requested to merge wip/darwin-ci into master

This branch does a few things:

  • Makes GHC on platforms which ship runtime-retargetable toolchains (e.g. Darwin) more robust by passing the --target=<triple> flag where possible (fixing #20162 (closed))
  • Refactors the CI-phase timing logic into ci.sh
  • Isolates the build from $HOME, using the CABAL_DIR environment variable to ensure that cabal-install doesn't look in $HOME
  • Eliminates the usage of nix-shell from the CI infrastructure, rather generating a shell fragment to provide the environment (fixing #20131 (closed))
  • Performs a few sundry cleanups
Edited by Ben Gamari

Merge request reports

Merge request pipeline #41095 passed with warnings

Merge request pipeline passed with warnings for 0643eb23

Approval is optional

Merged by avatar (Jun 4, 2025 12:05am UTC)

Merge details

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
    • I think the toolchain needs a system flag, and then needs to be prameterized over the system. We can't assume that people on regular intel macs can run arm64 binaries, which the toolchain defaults to. Nor can we rule out there are bugs that result from building x86_64 software with an arm toolchain. I still believe we should cleanly separate both environments. We are effectively pretending to be on an intel-mac building intel-mac software to cover for the x86_64-darwin case. And the same for aarch64-darwin case, however as it is now, we assume we are always on an aarch64-darwin machine.

      I don't argue that being explicit about the target is a good thing, but this is lacking the "native" element in our CI setup.

    • Author Maintainer

      Done.

    • Please register or sign in to reply
  • Ben Gamari added 4 commits

    added 4 commits

    • 7f5d7ee8 - ci: More surgical use of nix in Darwin builds
    • d1611635 - configure: Move nm search logic to new file
    • 9e7c8f9b - configure: Add check for whether CC supports --target
    • 219af807 - ci: Add version to cache key

    Compare with previous version

  • Ben Gamari added 4 commits

    added 4 commits

    • 9ea0ed3a - ci: More surgical use of nix in Darwin builds
    • 4fadf398 - configure: Move nm search logic to new file
    • b4c73284 - configure: Add check for whether CC supports --target
    • a065d271 - ci: Add version to cache key

    Compare with previous version

  • Author Maintainer

    I think I'll hold off on merging this until %8.10.6 is out since it's currently suffering from #19950 (closed).

  • Ben Gamari added 61 commits

    added 61 commits

    • a065d271...10678945 - 52 commits from branch master
    • 777adf96 - ci: Drop redundant `cabal update`s
    • 45d59a08 - ci: Consolidate handling of cabal cache
    • da94951d - ci: Isolate build from HOME
    • e63c3b6a - ci: Move phase timing logic into ci.sh
    • 2e265a10 - ci: More surgical use of nix in Darwin builds
    • f2f611b1 - configure: Move nm search logic to new file
    • bd7b8bbc - configure: Add check for whether CC supports --target
    • e0a5847e - ci: Add version to cache key
    • 8aa40ff6 - DEBUG

    Compare with previous version

  • Ben Gamari mentioned in merge request !5737 (closed)

    mentioned in merge request !5737 (closed)

    • Resolved by Ben Gamari

      aarch64 build currently fails with

      error: Package ‘ghc-8.10.4’ in /nix/store/9ry8c3r3213rqrbm4j8vdh66mwj02i6r-nixpkgs-src/pkgs/development/compilers/ghc/8.10.4.nix:267 is not supported on ‘aarch64-darwin’, refusing to evaluate.
      a) To temporarily allow packages that are unsupported for this system, you can use an environment variable
         for a single invocation of the nix tools.
           $ export NIXPKGS_ALLOW_UNSUPPORTED_SYSTEM=1
      b) For `nixos-rebuild` you can set
        { nixpkgs.config.allowUnsupportedSystem = true; }
      in configuration.nix to override this.
      c) For `nix-env`, `nix-build`, `nix-shell` or any other Nix command you can add
        { allowUnsupportedSystem = true; }
      to ~/.config/nixpkgs/config.nix.
      (use '--show-trace' to show detailed location information)
  • Ben Gamari added 74 commits

    added 74 commits

    • 8aa40ff6...5d651c78 - 64 commits from branch master
    • d7adfc4e - ci: Drop redundant `cabal update`s
    • 9562858b - ci: Consolidate handling of cabal cache
    • 37443969 - ci: Isolate build from HOME
    • ba329c1a - ci: Move phase timing logic into ci.sh
    • 8563a87f - ci: More surgical use of nix in Darwin builds
    • 3a000172 - configure: Move nm search logic to new file
    • fb443430 - configure: Add check for whether CC supports --target
    • 45d5b3bb - ci: Add version to cache key
    • cf811a51 - DEBUG
    • 82fd33d6 - gitlab-ci: Ensure that CABAL_DIR is a Windows path

    Compare with previous version

  • Ben Gamari added 1 commit

    added 1 commit

    • de7d9fa2 - gitlab-ci: Use correct CABAL executable

    Compare with previous version

  • Ben Gamari added 50 commits

    added 50 commits

    • de7d9fa2...4ff4d434 - 38 commits from branch master
    • 740b2931 - ci: Drop redundant `cabal update`s
    • 72db296c - ci: Consolidate handling of cabal cache
    • 5d428ee0 - ci: Isolate build from HOME
    • e560e95a - ci: Move phase timing logic into ci.sh
    • c23e02a5 - ci: More surgical use of nix in Darwin builds
    • 9ef396d0 - configure: Move nm search logic to new file
    • de056a66 - configure: Add check for whether CC supports --target
    • 1234704c - ci: Add version to cache key
    • 0ed2c6cb - DEBUG
    • 2899232c - gitlab-ci: Ensure that CABAL_DIR is a Windows path
    • 4a77a5df - gitlab-ci: Use correct CABAL executable
    • 439e1e87 - Ensure that cabal update is invoked before building

    Compare with previous version

  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Please register or sign in to reply
    Loading