-
Notifications
You must be signed in to change notification settings - Fork 697
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
Separate cabal install --lib
into own command (cabal env)
#6481
Comments
The only alternative that I can see is to make it so that |
@typedrat the drawback of install everything, is that when you e.g. That said, I guess there's a way to tell solver to solve for all components in the target package. I don't fully understand what will happen if the component sets change across versions: e.g. One way is to have This is a tough UX question. Also I motivate
One could argue that "it's just moving and editing files", but editing files is very bad UX; nor is well scriptable (c.f. So I think that |
One argument for keeping both behaviors under the same command is that, conceptually, both installing an executable and installing a library take something that lives safely in the store under the control of Cabal, and put it "somewhere else" not directly under Cabal control, where it can be useful to other tools but also potentially overwrite stuff that shouldn't be overwritten. That said, if we had multiple commands that did that, a sentence like "Warning: this command can alter global settings not directly under control of Cabal" could simply be added to each command's help. One argument for splitting the command: I have the impression that some newcomers to cabal have the idea that Not to mention that the notion of "global package environment" is not very clear for newcomers (and it isn't very clear to me, either). In what sense is the global environment different from the Nix-like store? Are they the same thing? They are both "global", after all. A whole separate command for managing them would be a better place from which to hang documentation about the concept and its relationship to Cabal. A further hint that the command should be split is that there are flags that only seem to affect one of the behaviors. |
Proposed
|
@m-renaud That is good start. Let me comment based on
When new package is asked to be added to the environment
Local packages. I understood that's what Tidal users need.
we need hash to not destroy other environments. |
We could do something with an interactive prompt for any destructive operations: a) Before deleting/removing, have a prompt which reiterates what the command is about to do, and prompt for y/n (see examples below) ex.
|
Another thought: for the case of overwriting locally installed packages with same name and version but different hash (local development case), we could split out the overwrite case from
|
I've been using @phadej's
Other ideas:
EDIT:
|
More positive feedback: #5650 (comment) |
As a side note, global environments currently don't work on Windows. I filed the bug in the GHC repo because the behavior seem to contradict GHC's own user guide. |
I think the only way you can use Citing some things removed in that PR:
And the changelog of this PR:
|
@Mikolaj Thanks, no I'm not using that! |
…3.4 which has removed the v1-sandbox command (haskell/cabal#6445) and all sandbox functionality. cabal v2-install --lib appears unable to provide a local installation in a sandbox-like directory though that functionality may be pursued as an "env" command (haskell/cabal#6481). Support of GHC >= 9.0 will be blocked on cabal-install's ability to use local installations of libraries. Changes based on the current cabal-install support have been added for further improvement. Update Haskell network dependency to 3.1.2.7 . Update Haskell zlib dependency to 0.6.3.0 .
(This issue is linked from the The semantics of I get that there are many colourable panels on the bikeshed that is Currently there is no output at all when you run |
Great idea, I think. I'd open a separate issue though. |
* Add a warning when an env file is created #6481 (comment) * Formatting * Improve wording of warning message * Only show warning if --package-env not given * Improve message and its formatting * Formatting
* Add a warning when an env file is created #6481 (comment) * Formatting * Improve wording of warning message * Only show warning if --package-env not given * Improve message and its formatting * Formatting (cherry picked from commit 00ce024)
* Add a warning when an env file is created haskell#6481 (comment) * Formatting * Improve wording of warning message * Only show warning if --package-env not given * Improve message and its formatting * Formatting
* Add a warning when an env file is created #6481 (comment) * Formatting * Improve wording of warning message * Only show warning if --package-env not given * Improve message and its formatting * Formatting (cherry picked from commit 00ce024)
... e.g.
cabal env
.People do confuse what "installing libraries" and "installing executables" means, and after answering on few issues, I think stronger that separation of commands will make UX clearer.
An alternative is to drop
--lib
flag, and teachcabal install
to do the right thing every time. I don't see how it would work.edit by @fgaz: I'm hijacking the OP to raise the visibility of the cabal env prototype: https://github.com/phadej/cabal-extras/tree/master/cabal-env
help & feedback are welcome
The text was updated successfully, but these errors were encountered: