Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
soulomoon opened this issue Nov 28, 2021 · 3 comments
Labels

Comments

@soulomoon
Copy link

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
@soulomoon soulomoon added the 0.kind: bug Something is broken label Nov 28, 2021
@soulomoon soulomoon changed the title nix-shell error for haskell project, even nix-build is fine in aarch64-darwin nix-shell error for haskell project, even though nix-build is fine in aarch64-darwin Nov 28, 2021
@soulomoon soulomoon changed the title nix-shell error for haskell project, even though nix-build is fine in aarch64-darwin nix-shell error for minimal haskell project, even though nix-build is fine in aarch64-darwin Nov 28, 2021
@soulomoon
Copy link
Author

forcing broken with export NIXPKGS_ALLOW_BROKEN=1
result in

make: *** [Makefile:136: all] Error 2
error: builder for '/nix/store/1k6jvaqpqd2zadf0vqy24nprkpbp065v-compiler-rt-libc-9.0.1.drv' failed with exit code 2;
       last 10 log lines:
       > [ 75%] Building C object lib/builtins/CMakeFiles/clang_rt.cc_kext_arm64_osx.dir/clear_cache.c.o
       > [ 75%] Building C object lib/builtins/CMakeFiles/clang_rt.cc_kext_arm64_osx.dir/__/profile/InstrProfilingPlatformDarwin.c.o
       > [ 75%] Building C object lib/builtins/CMakeFiles/clang_rt.cc_kext_arm64_osx.dir/__/profile/InstrProfiling.c.o
       > [ 75%] Building C object lib/builtins/CMakeFiles/clang_rt.cc_kext_arm64_osx.dir/__/profile/InstrProfilingBuffer.c.o
       > [ 75%] Building C object lib/builtins/CMakeFiles/clang_rt.cc_kext_arm64_osx.dir/__/profile/InstrProfilingWriter.c.o
       > [ 75%] Linking C static library libclang_rt.builtins_arm64_osx.a
       > [ 76%] Linking C static library libclang_rt.cc_kext_arm64_osx.a
       > [ 76%] Built target clang_rt.builtins_arm64_osx
       > [ 76%] Built target clang_rt.cc_kext_arm64_osx
       > make: *** [Makefile:136: all] Error 2
       For full logs, run 'nix log /nix/store/1k6jvaqpqd2zadf0vqy24nprkpbp065v-compiler-rt-libc-9.0.1.drv'.
error: 1 dependencies of derivation '/nix/store/065sd77gg1isx8knyg2n2sgl65q54zy8-clang-wrapper-9.0.1.drv' failed to build
error: 1 dependencies of derivation '/nix/store/p7djf1n81i3qsnhi9fdbc4zhrgzb6iqv-ghc-8.10.7-with-packages.drv' failed to buil

@sternenseemann
Copy link
Member

sternenseemann commented Nov 30, 2021

This should at least be broken in a different way on current master, can you retry?

@sternenseemann
Copy link
Member

This issue has been fix, please do reopen if you can reproduce it on master again.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants