NixOS / nixpkgs

Nix Packages collection & NixOS
MIT License
17.99k stars 14k forks source link

`ormolu-0.5.0.1` broken … #209397

Closed yvan-sraka closed 1 year ago

yvan-sraka commented 1 year ago

Steps To Reproduce

nix-shell -p ormolu with current nixpkgs-unstable, will produce error:

error: cycle detected in build of '/nix/store/mn4cj42d5b99i1iky0k6z0iq0m8jwrix-ormolu-0.5.0.1.drv' in the references of output 'bin' from output 'out'

Build log

https://gist.github.com/c0207dde2cda91d1883fb6c1e4815b2a

Additional context

The content of /nix/store/mn4cj42d5b99i1iky0k6z0iq0m8jwrix-ormolu-0.5.0.1.drv produced.

Notify maintainers

Cross-posted here: https://github.com/tweag/ormolu/issues/965

Metadata

Please run nix-shell -p nix-info --run "nix-info -m" and paste the result.

yvan@Butternut ~ % nix-shell -p nix-info --run "nix-info -m"
 - system: `"aarch64-darwin"`
 - host os: `Darwin 22.2.0, macOS 13.1`
 - multi-user?: `yes`
 - sandbox: `no`
 - version: `nix-env (Nix) 2.12.0`
 - channels(yvan): `"darwin, home-manager, nixpkgs"`
 - channels(root): `""`
 - nixpkgs: `/Users/yvan/.nix-defexpr/channels/nixpkgs`
srid commented 1 year ago

See https://github.com/NixOS/nixpkgs/issues/140774#issuecomment-1371565125

haroldcarr commented 1 year ago

Last night I helped a friend get setup using GHC via devenv.sh. We used this devenv.nix file (that works for me):

{ pkgs, ... }:

{
  packages = [ pkgs.ghc
               pkgs.git
               pkgs.haskell-language-server
               pkgs.hlint
               pkgs.stylish-haskell
             ];

  languages.haskell.enable = true;
  languages.nix.enable     = true;
}

We got the "ormolu cycle". Ugh.

In our case, the workaround was for me to have him delete his devenv.lock file and replace it with mine (which points to older stuff).

But this means anyone trying GHC via devenv is going to hit this. Not a good first look.

yvan-sraka commented 1 year ago

This has been fixed :)