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

Give an example for --enable-nix flag #8333

Merged
merged 3 commits into from
Aug 3, 2022

Conversation

blackheaven
Copy link
Collaborator

Just a clarification in the documentation

@fendor
Copy link
Collaborator

fendor commented Jul 30, 2022

Does --enable-nix do anything for v2-* commands?

IIRC, --enable-nix only works for v1-* commands. Maybe we should rather document that or even remove the option altogether.

@blackheaven
Copy link
Collaborator Author

Does --enable-nix do anything for v2-* commands?

It does not seems to be involved in v2-* commands.

IIRC, --enable-nix only works for v1-* commands. Maybe we should rather document that or even remove the option altogether.

I think it's beyond the scope of this PR, but there's also --disable-nix, I'm not sure how it'll work if we keep v1-* commands.

@fgaz
Copy link
Member

fgaz commented Jul 30, 2022

if we keep v1-* commands

The plan is to remove them "soon".
+1 on removing --enable/disable-nix altogether, even before removing v1- if it's easy
edit: main ticket: #4646

@fendor
Copy link
Collaborator

fendor commented Jul 30, 2022

Even bigger context ticket to completely overhaul the flags displayed in cabal: #7437

@Kleidukos
Copy link
Member

Until we explicitly decide to allocate resource and time to go forward with the flag deprecation, I'll vote in favour to integrate this PR.

@Mikolaj
Copy link
Member

Mikolaj commented Jul 30, 2022

@blackheaven: are you a user of --enable-nix? Do we have users of that (I know we have users of v1-)?

@blackheaven
Copy link
Collaborator Author

@blackheaven: are you a user of --enable-nix? Do we have users of that (I know we have users of v1-)?

I was just struggling with Nix

@Mikolaj
Copy link
Member

Mikolaj commented Jul 30, 2022

@blackheaven: are you a user of --enable-nix? Do we have users of that (I know we have users of v1-)?

I was just struggling with Nix

Then I'm +1 on improving the documentation for as long as we keep the option.

I seem to remember Nix is also used via the Setup interface, which is sort of v1-, but without involving cabal-install. Perhaps that's something you'd rather use? It's not going to be ripped out. OTOH, it doesn't need the --enable-nix flag. Please do let us know if you find out a better workflow than Nix+v1, so that we have one more data point re timeline of deprecation.

option when you call ``cabal``. To use this option everywhere, edit
your :ref:`global configuration file<config-file-discovery>`
(default: ``$HOME/.cabal/config``) to include:
To enable Nix integration, simply pass the ``--enable-nix`` global option when you call ``cabal`` (eg. ``cabal --enable-nix build``).
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm afraid this won't work with new enough cabals, because now build is an alias for v2-build. You probably want to say v1-build. Actually, if the flag does nothing with v2- commands, it would be great to also change all the examples below by prepending command names with v1-? Otherwise, we are just adding content to misleading documentation.

Copy link
Member

@Mikolaj Mikolaj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Thank you.

@Mikolaj Mikolaj added the squash+merge me Tell Mergify Bot to squash-merge label Jul 30, 2022
@blackheaven
Copy link
Collaborator Author

I seem to remember Nix is also used via the Setup interface, which is sort of v1-, but without involving cabal-install. Perhaps that's something you'd rather use? It's not going to be ripped out. OTOH, it doesn't need the --enable-nix flag. Please do let us know if you find out a better workflow than Nix+v1, so that we have one more data point re timeline of deprecation.

To give a broader context, at work we use nix + bazel for the build and ghcid.

I have started a toy project, and, trying to keep the same workflow, I have a hard time figuring out that packages should be injected from nix instead of having cabal "finding the packages".

Saying it out-loud seems reasonable, but the thing is, I had a hard time to find coherent examples.

@ulysses4ever
Copy link
Collaborator

If you only need ghcid, I think you could get away with simply nix-shell --run ghcid and avoid the legacy v1- commands altogether.

@blackheaven
Copy link
Collaborator Author

If you only need ghcid, I think you could get away with simply nix-shell --run ghcid and avoid the legacy v1- commands altogether.

Sure, but at the time I was trying to get something compiling.

@ulysses4ever
Copy link
Collaborator

Sure, but at the time I was trying to get something compiling.

I see. All I want to say is that I think that whatever it is that you're trying to do, it does not have to go via v1- commands and --enable-nix. And that you'd be better off with v2- commands. I'm happy to (try to) answer more specific questions if you have them.

Thank you for contributing and good luck anyway!

@fgaz
Copy link
Member

fgaz commented Aug 1, 2022

Is mergify stuck?

@fgaz fgaz added squash+merge me Tell Mergify Bot to squash-merge and removed squash+merge me Tell Mergify Bot to squash-merge labels Aug 1, 2022
@ulysses4ever
Copy link
Collaborator

Is mergify stuck?

@fgaz no, it's #8285.

@fgaz
Copy link
Member

fgaz commented Aug 1, 2022

ooh so the waiting period is enforced by mergify now. neat!

@mergify mergify bot merged commit a911116 into haskell:master Aug 3, 2022
@Mikolaj
Copy link
Member

Mikolaj commented Aug 5, 2022

One more context ticket, after the fact: #6444

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

Successfully merging this pull request may close these issues.

6 participants