Skip to content

Fails on macOS Big Sur (?) #982

Closed
Closed
@MarcoPolo

Description

@MarcoPolo

Hey there, I'm new to haskell.nix so it's possible I've done something wrong.

But following the directions (and some tweaking). Things don't seem to work on MacOS Big Sur. Likely becuase of the dylib issue and maybe because the cache doesn't contain everything I need?

When I use this for default.nix:

{
  # Fetch the latest haskell.nix and import its default.nix
  # Not using master so it's reproducible.
  haskellNix ? import (builtins.fetchTarball "https://github.com/input-output-hk/haskell.nix/archive/8970673cd07c1c62c13a35c7dba1fcc889487730.tar.gz") { }

  # haskell.nix provides access to the nixpkgs pins which are used by our CI,
  # hence you will be more likely to get cache hits when using these.
  # But you can also just use your own, e.g. '<nixpkgs>'.
, nixpkgsSrc ? haskellNix.sources.nixpkgs-2003

  # haskell.nix provides some arguments to be passed to nixpkgs, including some
  # patches and also the haskell.nix functionality itself as an overlay.
, nixpkgsArgs ? haskellNix.nixpkgsArgs

  # import nixpkgs with overlays
, pkgs ? import nixpkgsSrc nixpkgsArgs
}: pkgs.haskell-nix.project {
  # 'cleanGit' cleans a source directory based on the files known by git
  src = pkgs.haskell-nix.haskellLib.cleanGit {
    name = "haskell-nix-project";
    src = ./.;
  };
  # Specify the GHC version to use.
  compiler-nix-name = "ghc8102"; # Not required for `stack.yaml` based projects.
}

I get this error:

builder for '/nix/store/lszby9xx4lw69s4l5rq42bh0a98r31dw-popt-1.16.drv' failed with exit code 77

Because it failed to find a dylib.

When I do some tweaking (hoping to get a cache hit on the dylib) with this default.nix:

{
  # Fetch the latest haskell.nix and import its default.nix
  haskellNix ? import (builtins.fetchTarball "https://github.com/input-output-hk/haskell.nix/archive/c9dde4d9f4ad8eeaa117522563bdec0a4ff5a353.tar.gz") { }

  # haskell.nix provides access to the nixpkgs pins which are used by our CI,
  # hence you will be more likely to get cache hits when using these.
  # But you can also just use your own, e.g. '<nixpkgs>'.
  # , nixpkgsSrc ? haskellNix.sources.nixpkgs-2009
, nixpkgsSrc ? <nixpkgs>

  # haskell.nix provides some arguments to be passed to nixpkgs, including some
  # patches and also the haskell.nix functionality itself as an overlay.
, nixpkgsArgs ? haskellNix.nixpkgsArgs

  # import nixpkgs with overlays
, pkgs ? import nixpkgsSrc nixpkgsArgs
}: pkgs.haskell-nix.project {
  # 'cleanGit' cleans a source directory based on the files known by git
  src = pkgs.haskell-nix.haskellLib.cleanGit {
    name = "haskell-nix-project";
    src = ./.;
  };
  # Specify the GHC version to use.
  compiler-nix-name = "ghc8102"; # Not required for `stack.yaml` based projects.
}

I get a different, but similar error:

ld: file not found: /usr/lib/system/libcache.dylib for architecture x86_64
clang-7: error: linker command failed with exit code 1 (use -v to see invocation)
`cc' failed in phase `Linker'. (Exit code: 1)
error: --- Error --------------------------------------------------------------------------------------------------------------------------------------- nix-build
builder for '/nix/store/21vqa2x16mkgp5ffn29xywgp2wj7qqdd-nix-tools-exe-truncate-index-0.1.0.0.drv' failed with exit code 1
building '/nix/store/3ygjsfwgbgjaw1rwc2cwad7qzyfwizjq-hashable-lib-hashable-1.3.0.0.drv'...

I'm pretty sure I've setup the iohk hydra cache correctly since during the build I see a lot of:

copying path '/nix/store/...' from 'https://hydra.iohk.io'...

I guess my question is: Is this a known issue? If so I think it would be worth mentioning somewhere.

If not, is there an example default.nix that works on big sur?

Thanks! \o/

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions