Skip to content

[doc] Remove references to "Nix" in "How to build locally..." #11008

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

simonmar
Copy link
Member

See #6105

Please read Github PR Conventions and then fill in one of these two templates.

  • [X ] Patches conform to the coding conventions.
  • Is this a PR that fixes CI? If so, it will need to be backported to older cabal release branches (ask maintainers for directions).

Copy link
Collaborator

@TeofilC TeofilC left a comment

Choose a reason for hiding this comment

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

Nice!

@@ -23,14 +23,14 @@ To run an executable defined in this package, use this command:

::

$ cabal run <executable name> [executable args]
$ cabal run <executable name> -- [executable args]
Copy link
Collaborator

Choose a reason for hiding this comment

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

Nice! I think people quite often forget and then run into issues

Copy link
Collaborator

@ulysses4ever ulysses4ever Jun 22, 2025

Choose a reason for hiding this comment

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

This actually can work without --. Maybe this is a misfeature but it works...

In particular, cabal run has a special argument parser that takes into account a curious fact: cabal run can only take one target (unlike many other subcommand like build or test), so, everything after it can be treated as arguments for the executable. Unless... well, the manual says it all:

Except in the case of the empty target, the strings after it will be passed to the executable as arguments.

If one of the arguments starts with - it will be interpreted as a cabal flag, so if you need to pass flags to the executable you have to separate them with --.

https://cabal.readthedocs.io/en/3.14/cabal-commands.html#cabal-run

Now, what to do about it: I'm ambivalent. If people think that this is confusing, I'm fine with --.

@Mikolaj
Copy link
Member

Mikolaj commented Jun 20, 2025

@simonmar: thank you for the PR. Please feel free to set the merge_me label to start the ~2 days merging process.

Copy link
Collaborator

@ulysses4ever ulysses4ever left a comment

Choose a reason for hiding this comment

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

Good stuff, thanks! I have two questions so far. (I can't get to reviewing it more thoroughly before next week)

Copy link
Collaborator

Choose a reason for hiding this comment

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

Should we rename both files so that the URL doesn't mention Nix as well?

commands. For example, flags passed to ``cabal build`` are only
applied to *local* packages, so that adding a flag to
``cabal build`` doesn't necessitate a rebuild of *every* transitive
dependency in the global package store.

In cabal-install 2.0 and above, Nix-style local builds also take advantage of a
new Cabal library feature, `per-component
builds <https://github.com/ezyang/ghc-proposals/blob/master/proposals/0000-componentized-cabal.rst>`__,
Copy link
Collaborator

Choose a reason for hiding this comment

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

So, we lose this link in this patch... It may be good to think about preserving it in some form. I don't think there's a comparable explanation in the manual itself currently.

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.

5 participants