-
Notifications
You must be signed in to change notification settings - Fork 715
[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
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this 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] |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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 --
.
@simonmar: thank you for the PR. Please feel free to set the merge_me label to start the ~2 days merging process. |
There was a problem hiding this 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)
There was a problem hiding this comment.
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>`__, |
There was a problem hiding this comment.
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.
See #6105
Please read Github PR Conventions and then fill in one of these two templates.