Skip to content
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

cabal get is confused if the package you want to get was add-source'd to a sandbox #3795

Closed
ezyang opened this issue Sep 6, 2016 · 8 comments

Comments

@ezyang
Copy link
Contributor

ezyang commented Sep 6, 2016

Steps to reproduce:

ezyang@sabre:~/Dev/labs/cabal-constraint-solver-repro$ ./repro
Unpacking to SHA-1.6.4.2/
Writing a default package environment file to
/srv/code/labs/cabal-constraint-solver-repro/cabal.sandbox.config
Creating a new sandbox at
/srv/code/labs/cabal-constraint-solver-repro/.cabal-sandbox
ezyang@sabre:~/Dev/labs/cabal-constraint-solver-repro$ ./repro
Distribution.Client.Get.unpack: the impossible happened.
CallStack (from HasCallStack):
error, called at Distribution/Client/Get.hs:140:13 in
main:Distribution.Client.Get
ezyang@sabre:~/Dev/labs/cabal-constraint-solver-repro$ cat repro
#!/bin/sh
set -e
cabal get SHA-1.6.4.2
cabal sandbox init

cabal sandbox add-source SHA-1.6.4.2

I'm not going to fix this but I thought I'd put a note.

@omefire
Copy link
Collaborator

omefire commented Sep 8, 2016

Is this a regression ?
With cabal@1.22, this doesn't seem to show up:

omefire@omefire-ubuntu:~/Projects/cabal/Bug_3795$ ./repro
cabal: The directory "SHA-1.6.4.2/" already exists, not unpacking.
omefire@omefire-ubuntu:~/Projects/cabal/Bug_3795$ cabal --version
cabal-install version 1.22.6.0
using version 1.22.5.0 of the Cabal library 
omefire@omefire-ubuntu:~/Projects/cabal/Bug_3795$

@ezyang
Copy link
Contributor Author

ezyang commented Sep 8, 2016

Yep, confirmed doesn't repro for cabal-install 1.22, but does repro on 1.24 and HEAD. @omefire, are you interested in diagnosing some more?

@omefire
Copy link
Collaborator

omefire commented Sep 8, 2016

Ok, I think this seems like a good bug for me to tackle and get my feet wet with the project. I'll assign it to myself.

@omefire
Copy link
Collaborator

omefire commented Sep 8, 2016

Hmm, can't assign it to myself though ...

@ezyang
Copy link
Contributor Author

ezyang commented Sep 8, 2016

If you accept the invite you should be able to assign yourself then.

Since we don't know what is causing the bug it may be annoying to fix. One way to diagnose is to bisect between 1.22 and 1.24 and find the offending commit.

@ezyang ezyang modified the milestones: 2.0, Obsoleted by nix-local-build Sep 8, 2016
@omefire
Copy link
Collaborator

omefire commented Sep 8, 2016

Yep, will do so.

@omefire
Copy link
Collaborator

omefire commented Sep 12, 2016

It seems like this issue has been fixed in master.
I can't repro it anymore after getting the latest:

omefire@omefire-ubuntu:~/Projects/cabal/Bug_3795$ /home/omefire/Projects/cabal/dist-newstyle/build/cabal-install-1.25.0.0/build/cabal/cabal get SHA-1.6.4.2
unpacKage
cabal: The directory "SHA-1.6.4.2/" already exists, not unpacking.

@omefire
Copy link
Collaborator

omefire commented Sep 12, 2016

Closing it ...

@omefire omefire closed this as completed Sep 12, 2016
omefire added a commit to omefire/cabal that referenced this issue Sep 15, 2016
… it doesn't support them and would instead fail.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants