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

Error if --enable-nix is passed to v2-command #6444

Open
phadej opened this issue Dec 18, 2019 · 4 comments
Open

Error if --enable-nix is passed to v2-command #6444

phadej opened this issue Dec 18, 2019 · 4 comments

Comments

@phadej
Copy link
Collaborator

phadej commented Dec 18, 2019

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
Copy link
Collaborator Author

phadej commented Dec 18, 2019

Similarly, we should error for

cabal --require-sandbox v2-build

@Pitometsu
Copy link

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

@dschrempf
Copy link

I just bumped into that.

cabal --enable-nix build

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

@jneira
Copy link
Member

jneira commented Mar 23, 2022

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

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

No branches or pull requests

5 participants