Skip to content

nix-shell error for minimal haskell project, even though nix-build is fine in aarch64-darwin  #147739

@soulomoon

Description

@soulomoon

Describe the bug

Could not enter nix-shell for haskell project, build is fine.

Steps To Reproduce

Steps to reproduce the behavior:
1 install nix
2 nix-env --install cabal2nix
3 files:

  • LICENSE
  • default.nix:
    { pkgs ? import <nixpkgs> { }}:
    pkgs.haskellPackages.callCabal2nix "project0" ./. { }
  • project0.cabal:
    name: project0
    version: 1.0.0
    license: BSD3
    license-file: LICENSE
    cabal-version: >= 1.18
    build-type: Simple
    
    executable project0
        build-depends: base 
        main-is: Main.hs
        default-language: Haskell2010
    
  • main.hs
    module Main where
    
    main :: IO ()
    main = putStrLn "Hello, world!"
    

4 nix-build works fine
5 could not enter nix-shell

➜ nix-shell --attr env
error: Package ‘compiler-rt-libc-9.0.1’ in /nix/store/m1pmrzsdyk4d2d9hsacnp73d4lj2nwfy-nixpkgs-21.11pre333180.98747f27ecf/nixpkgs/pkgs/development/compilers/llvm/9/compiler-rt/default.nix:95 is marked as broken, refusing to evaluate.

       a) To temporarily allow broken packages, you can use an environment variable
          for a single invocation of the nix tools.

            $ export NIXPKGS_ALLOW_BROKEN=1

       b) For `nixos-rebuild` you can set
         { nixpkgs.config.allowBroken = true; }
       in configuration.nix to override this.

       c) For `nix-env`, `nix-build`, `nix-shell` or any other Nix command you can add
         { allowBroken = true; }
       to ~/.config/nixpkgs/config.nix.
(use '--show-trace' to show detailed location information)

Expected behavior

Should enter nix-shell

Metadata

  • system: "aarch64-darwin"
  • host os: Darwin 21.1.0, macOS 12.0.1
  • multi-user?: yes
  • sandbox: no
  • version: nix-env (Nix) 2.4
  • channels(ares): "darwin"
  • channels(root): "nixpkgs-21.11pre333180.98747f27ecf"
  • nixpkgs: /nix/var/nix/profiles/per-user/root/channels/nixpkgs

Metadata

Metadata

Assignees

No one assigned

    Labels

    0.kind: bugSomething is broken6.topic: haskellGeneral-purpose, statically typed, purely functional programming language

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions