-
-
Notifications
You must be signed in to change notification settings - Fork 257
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
Understanding new-style cabal #572
Comments
@hvr your input would be very much appreciated! |
Here's my If I remove
|
I tried |
It's difficult to find any up to date information about using cabal. For example this page looks nice and authoritative, but links to broken blogs, and v1 documentation. I read some of https://www.haskell.org/cabal/users-guide/ until I got to a |
yeah this stuff is killing me
^^^ this is what I get also; and I think the UUID suffix is what is causing |
tidal is purely a lib right? That then gets used by ghci? Is it possible to just |
I fully agree. - This seems to be a fall-out of first As a drastic work-around: remove the user-global environment file (e.g., "rm ~/.ghc/i386-linux-8.6.5/environments/default") Then "cabal install --lib" works (to build from a source checkout) and Tidal can be used (I am testing with "ghci -ghci-script BootTidal.hs") This will re-create the user-global environment file, and it will contain an entry for Tidal. But - this also removes ghc's knowledge of other packages that have been installed by the user meanwhile. And when I try to install some other package (elsewhere) I am again getting incomprehensible cabal errors. ("next goal: tidal (user goal) .. Could not resolve dependencies: ... (constraint from user target requires ==1.4.5)" - that's the version of the source repo, but hackage has 1.4.4. only) Indeed, a local environment file might solve this, since it isolates the configuration. We need one local file (BootTidal.hs) anyway. This other problem seems similar: xmonad/xmonad#199 Note that they recommend "stick to v1-install" - or make a "build script" (probably that would include a pointer to an env file) |
Yes, from my perspective I see only confusion from this change. Why do I have to add |
Made an upstream issue here haskell/cabal#6391 |
By the way @jwaldmann, it's enough to remove the tidal lines from the environment file, you don't have to delete it completely. |
@gbaz Doesn't that then get in the way of using tidal together with other modules, such as |
this is an option to "cabal install" so it describes what will be done with result of "cabal build". From the man page:
Ah - now I see: your point is: if the cabal file does not specifiy any executables, then "--lib" should be the default? |
It was actually easy to use an environment file: In the top of the source tree,
will create
@gbaz: this is not "an env file in the tidal directory"? But it's working fine. |
@jwaldmann that still has the same problem for me, e.g. if I do:
then |
@jwaldmann Well |
Well indeed. For me, re-installing does not work - even when nothing is changed. I reported this in the cabal tracker haskell/cabal#6394 |
The thing to do is to follow @jwaldmann 's pattern, and install all the modules you want to use together into a single package environment in a single command line, and then use that environment. Then when you want to use a new version of some things, one-shot install all that stuff together into a new environment. The issue is really that incremental addition to environments isn't a very nice workflow, since the solver tries to be nice and isolated, unlike before, but this conflicts with the goal of incrementally building a consistent package set. |
@gbaz I see, but what if I'm making continual changes to a couple of packages? Is the expectation that I think of a new environment name each time I build them? I can't see the point in doing this, when I already have a package environment, except cabal keeps on breaking it, due to what seems like a bug. |
remove the env file, then write it anew? |
@jwaldmann Yep that's fine as a workaround, but when it comes to documenting things so that non-experts can try out new versions, it's unworkable really. |
this is haskell/cabal#6393 ? |
Looks like a relevant piece of internet https://gitlab.haskell.org/ghc/ghc/issues/17341 |
I've been trying to develop one project that produces a binary and another that produces a library together. It seems to be impossible! I don't understand who v2-install is aimed at, but it doesn't seem to be me. |
So do you mean a library that depends on a binary, or a binary that depends on a library? If you spell out the architecture you can probably get a good answer. One thing to try might be to use a single .project file to tie the two together... |
A binary (the feedforward editor) that depends on a library (tidal). |
I think new-style cabal just isn't useful for us and we should avoid it. cabal-env seems to be a solution but it is not released yet. https://github.com/haskell/cabal/projects/10#card-37408965 |
I'm having a hard time using the new cabal install.
For example if I do
cabal install
in the tidal folder, it'll work the first time, but if I make an edit and do that again, I end up with two versions of tidal with the same version number, and ghci will no longer load it. I have to edit~/.ghc/x86_64-linux-8.6.5/environments/default
to remove tidal and try again, then it works.However this morning, it's not installing at all:
I'm not sure why this is, the only thing I can think is that I installed some additional packages last night, including a binary that depends on tidal (https://github.com/yaxu/feedforward).
My feeling is that installing global packages isn't working too well. So what should we do instead? Probably if we embraced the new way of doing things we'd have a lot fewer install problems, but I'm not sure what that is..
The text was updated successfully, but these errors were encountered: