-
Notifications
You must be signed in to change notification settings - Fork 701
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
Reinstall of package breaks things #6391
Comments
This bug is still present - I spend time helping people work around this on a daily basis. |
Hey @yaxu, I should have some time in the next couple of days to investigate this. I'm not familiar with this part of the code (@phadej could you give me some code pointers?). It sounds like install should check the environment for an existing package with the same version (but different hash) and: a) Fail installation instead of happily installing something which will result in an error later
There's discussion on splitting
Yeah...it's not 🙃 I'm planning to get around to updating the docs soon. |
Hi - Just want to +1 this bug and ask if there's documentation anywhere about how to get around it. What's most frustrating to me about this bug is that it relies on global state - I messed up my installations somewhere and reverting my git repo back to my last commit didn't fix things. |
Hey @ertyseidohl I'm actually actively working on this now, I'm hoping to have a PR out for review this week. In the meantime, the workaround is to manually edit the GHC env file and remove the entry (or entries) of the libraries you're re-installing before running the install command. For example, say you have previously installed
If you manually edit this file to remove the entry for |
Thanks for looking at this. I've helped many people with broken cabal installs lately, and I'm also seeing this problem with duplicate versions for people who are installing straight from hackage, so presumably it's possible to install the same package version twice even if they have the same hash. |
@yaxu do you happen to have a repro case when installing directly from hackage? If the package has the same hash there shouldn't be any modifications made to the env file. |
Also @yaxu, this is a bit of a meta-comment/question, but I just wanted to make sure that your use case actually requires modifying the global package environment; apologies if you're already aware of this and have determined it doesn't work for you.(this goes back to the v1->v2 behaviour change and workflows is not well documented). With the v1- commands, in order to use a library in a package/project you're developing you would need to |
Thanks @m-renaud, I'd love to understand this more! The use case I have is supporting a library (tidal) for end-user programmers, in this case musicians who are generally unfamiliar with Haskell and its build systems. The don't want to deal with git repos, or develop any code, they just want to install the tidal library according to the easiest and most reliable method, and use it in the ghci repl (via an editor plugin). As I understand it there isn't really a global environment with v2- commands, just a 'default' one, is that right? So I assume any problem I'm having with the default package environment would still be a problem if I used another named environment. |
Gotcha, thanks for the context. Yeah it sounds like using a global environment is probably the best way forward, and the root of the issue is when you make changes to tidal locally and re-install it corrupts the env file. You should soon be able to run:
which would overwrite any existing packages referenced in |
I’m sorry to interrupt but I veto any cli changes to That said |
Hi @phadej, if the UI isn't finalised, to the extent that bugs like this aren't able to be fixed, why is this already in production? I've found the transition to v2-install a bumpy ride to say the least. I've been spending a hours a week recently helping people with install problems. |
That is a good question.
Yet adding more debt and implementing not so well-thought out ideas is kind of the way we got here in the first place.
install —lib doesn’t seem to be designed at all. Just implemented. (I haven’t looked into history how it came to existence, will do tomorrow).
…On 28. Apr 2020, at 22.14, Alex McLean ***@***.***> wrote:
Hi @phadej, if the UI isn't finalised, to the extent that bugs like this aren't able to be fixed, why is this already in production? I've found the transition to v2-install a bumpy ride to say the least. I've been spending a hours a week recently helping people with install problems.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or unsubscribe.
|
I've got a pretty decent handle on the I can start with that and then we can start sketching out what a |
Also, is there a good real-time place to chat about this? #cabal irc? Going back and fourth on comments works for some things but getting on the same page is sometimes easier and more expedient with an "in-person" discussion. |
If it helps, I've written up my process with all of the errors and fixes at https://organicdonut.com/2020/04/cabal-package-installation-woes/ |
Hey @ertyseidohl I just took a look at your post and it doesn't appear that you need to use Do you have the full code that I could look at to confirm? Also, what version of cabal are you using? |
I think part of my problem is just being new to haskell and not understanding what I'm doing with the package management :) My code (at the time of writing) is here: https://github.com/ertyseidohl/crossword-hs/tree/072b4efa11346dc12b20835d09d4eb7559c13a36 |
Ahh yeah there was a time when you needed to install libraries to the global package namespace to use them but that hasn't been the case for quite some time (although there are random docs scattered across the internet that still say you need to do that). The best resource for getting started is the Getting Started guide in the user docs. If you have any issues following those instructions please file an issue about it :) |
Returning to this, and trying the --force option.. It doesn't help.
|
Perhaps it has a stale |
I'm sorry but was |
Doh, I guess, it's accepted only because it's a prefix of |
If I change then install a package I'm developing, ghci can no longer use it, it seems because there are two installations with the same version number. Transcript below. This is with the a fresh install via ghcup under linux.
Also, I don't know why I now have to specify
--lib
when presumably the module knows it's a library. As a general comment, documentation forv2-install
doesn't seem up to date and I can't find clear explanations of the changes and how they can help my projectThe text was updated successfully, but these errors were encountered: