cabal icon indicating copy to clipboard operation
cabal copied to clipboard

Error if `--enable-nix` is passed to `v2-command`

Open phadej opened this issue 5 years ago • 4 comments

It probably (hopefully) does nothing, but seems to confuse at least one user.

Alternatively, make v2-build etc do what it says, i.e.

    --enable-nix                   Enable Nix integration: run commands through
                                   nix-shell if a 'shell.nix' file exists

EDIT: I think it could possibly work, if cabal-hash.txt picks everything relevant. Probably cache won't be hit that often though. Also one would require that ~/.cabal/store places indirect nix gc-roots. In short, I think it's hard to make --enable-nix work well, instead I'd recommend users to run nix-shell themselves and run cabal v2-* commands inside.

phadej avatar Dec 18 '19 11:12 phadej

Similarly, we should error for

cabal --require-sandbox v2-build

phadej avatar Dec 18 '19 11:12 phadej

Yeah, I did expect an option in cabal.project.local for that, or deprecation message in case it does nothing.

Pitometsu avatar Dec 18 '19 11:12 Pitometsu

I just bumped into that.

cabal --enable-nix build

Does not seem to honor shell.nix. This should be an error.

dschrempf avatar Jun 01 '21 11:06 dschrempf

The integration with nix was heavily discussed here: #4646 Throw an error is the very least thing we should do.

jneira avatar Mar 23 '22 08:03 jneira