Skip to content

haskellPackages.slugger: Cannot use on macOS #462046

Closed

Description

@mpscholten

Nixpkgs version

  • Stable (25.05)

Describe the bug

When I try to add the haskellPackages.slugger package as a dependency to ihp in my cabal file (which is consumed via callCabal2nix), I get the following error during build:


�[;1m<no location info>: �[;1m�[31merror�[0m�[0m�[;1m:�[0m�[0m�[;1m
    dlopen(/nix/store/0p03dg77bwd38gahn9qj68ai8dprq85k-ihp-1.4.0/lib/links/libicuuc.dylib, 0x0005): tried: '/nix/store/0p03dg77bwd38gahn9qj68ai8dprq85k-ihp-1.4.0/lib/links/libicuuc.dylib' (mach-o file, but is an incompatible architecture (have 'x86_64', need 'arm64e' or 'arm64e.v1' or 'arm64' or 'arm64')), '/System/Volumes/Preboot/Cryptexes/OS/nix/store/0p03dg77bwd38gahn9qj68ai8dprq85k-ihp-1.4.0/lib/links/libicuuc.dylib' (no such file), '/nix/store/0p03dg77bwd38gahn9qj68ai8dprq85k-ihp-1.4.0/lib/links/libicuuc.dylib' (mach-o file, but is an incompatible architecture (have 'x86_64', need 'arm64e' or 'arm64e.v1' or 'arm64' or 'arm64')), '/usr/local/Cellar/icu4c/72.1/lib/libicuuc.72.1.dylib' (mach-o file, but is an incompatible architecture (have 'x86_64', need 'arm64e' or 'arm64e.v1' or 'arm64' or 'arm64')), '/System/Volumes/Preboot/Cryptexes/OS/usr/local/Cellar/icu4c/72.1/lib/libicuuc.72.1.dylib' (no such file), '/usr/local/Cellar/icu4c/72.1/lib/libicuuc.72.1.dylib' (mach-o file, but is an incompatible architecture (have 'x86_64', need 'arm64e' or 'arm64e.v1' or 'arm64' or 'arm64'))�[0m�[0m
[18 of 84] Compiling IHP.Breadcrumb.Types ( IHP/Breadcrumb/Types.hs, dist/build/IHP/Breadcrumb/Types.o, dist/build/IHP/Breadcrumb/Types.dyn_o )

�[;1m<no location info>: �[;1m�[31merror�[0m�[0m�[;1m:�[0m�[0m�[;1m
    dlopen(/nix/store/0p03dg77bwd38gahn9qj68ai8dprq85k-ihp-1.4.0/lib/links/libicuuc.dylib, 0x0005): tried: '/nix/store/0p03dg77bwd38gahn9qj68ai8dprq85k-ihp-1.4.0/lib/links/libicuuc.dylib' (mach-o file, but is an incompatible architecture (have 'x86_64', need 'arm64e' or 'arm64e.v1' or 'arm64' or 'arm64')), '/System/Volumes/Preboot/Cryptexes/OS/nix/store/0p03dg77bwd38gahn9qj68ai8dprq85k-ihp-1.4.0/lib/links/libicuuc.dylib' (no such file), '/nix/store/0p03dg77bwd38gahn9qj68ai8dprq85k-ihp-1.4.0/lib/links/libicuuc.dylib' (mach-o file, but is an incompatible architecture (have 'x86_64', need 'arm64e' or 'arm64e.v1' or 'arm64' or 'arm64')), '/usr/local/Cellar/icu4c/72.1/lib/libicuuc.72.1.dylib' (mach-o file, but is an incompatible architecture (have 'x86_64', need 'arm64e' or 'arm64e.v1' or 'arm64' or 'arm64')), '/System/Volumes/Preboot/Cryptexes/OS/usr/local/Cellar/icu4c/72.1/lib/libicuuc.72.1.dylib' (no such file), '/usr/local/Cellar/icu4c/72.1/lib/libicuuc.72.1.dylib' (mach-o file, but is an incompatible architecture (have 'x86_64', need 'arm64e' or 'arm64e.v1' or 'arm64' or 'arm64'))�[0m�[0m

It seems text-icu (a dependency of slugger) is causing this. Somehow it tries to load a x64 icu on my aarch64 system:

> file /nix/store/0p03dg77bwd38gahn9qj68ai8dprq85k-ihp-1.4.0/lib/links/libicuuc.dylib
/nix/store/0p03dg77bwd38gahn9qj68ai8dprq85k-ihp-1.4.0/lib/links/libicuuc.dylib: symbolic link to /usr/local/opt/icu4c/lib/libicuuc.dylib

Interestingly I can build slugger just fine as a standalone package:

cd nixpkgs
nix build .#haskellPackages.slugger
./result/bin/slugger test

It seems that either something is wrong with the text-icu package, or the callCabal2nix is somehow passing the wrong pkgs.icu to the ihp package.

Update: Interestingly the issue doesn't happen on a different Mac. So it's only my machine. But then this means some part of the nix sandboxing/isolation is not working as expected.

Steps to reproduce

Add the slugger to a cabal file and then use cabal2nix.

Expected behaviour

It should work

Screenshots

No response

Relevant log output

Additional context

No response

System metadata

  • system: "aarch64-darwin"
  • host os: Darwin 25.1.0, macOS 26.1
  • multi-user?: yes
  • sandbox: no
  • version: nix-env (Determinate Nix 3.12.1) 2.32.1
  • channels(root): "nixpkgs"
  • nixpkgs: /nix/store/ipyw6f3ah05zxy1imaydg5bmr8qmsiyc-source

Are you using nix-darwin?

Yes, I am using nix-darwin.

Notify maintainers

@sternenseemann do you have any ideas what could be causing this?


Note for maintainers: Please tag this issue in your pull request description. (i.e. Resolves #ISSUE.)

I assert that this issue is relevant for Nixpkgs

Is this issue important to you?

Add a 👍 reaction to issues you find important.

Activity

  1. added
    0.kind: bug
    6.topic: darwin
    6.topic: haskell
    on Nov 15, 2025
  2. mpscholten commented on Nov 16, 2025

    @mpscholten
    ContributorAuthor

    I figured it out. I had an old home-brew version on my Mac. text-icu has a cabal flag that defaults to true that makes it pick up homebrew paths for icu:

    flag homebrew
      Description: Assume homebrew on macOS. Automatically add /usr/local/opt/ and /opt/homebrew/opt/ paths to extra-lib-dirs and include-dirs.
      Default:     True
      Manual:      True

    I fixed this by deleting homebrew.

    I'll try to fix this by passing homebrew=false when building via nixpkgs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    0.kind: bug6.topic: darwin6.topic: haskell

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions