-
Notifications
You must be signed in to change notification settings - Fork 841
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
stack init --resolver ghc-7.10.3
creates incomplete stack file
#2475
Comments
Strange! I can reproduce the issue with stack-HEAD:
Executing Strangely the
EDIT: The solver seems to be correct, but why does |
Aren't the executables of all dependencies built? |
Oh, you're right. By default, they're built. It's even mentioned in the docs. But the BTW, this issue can be reproduced in a smaller project by simply adding |
Strange! At first I thought that the issue was that I cannot reproduce the issue. The init command adds From the output of |
Why do we build the executables of dependencies? |
It is a little weird, but I think it's because usages of the library might depend on the executable at compile-time (TH or Setup.hs). I can't immediately think of any good examples of that, though. It's also due to build-tool dependencies. Before proper build-tool deps were added, I think folks just relied on getting them via presence in It's also done because it's a reasonable thing to do with stack - the executables for deps get installed in sandboxed locations that're only on the PATH when they should be. |
I was using I guess this makes for a nice argument for using |
Is this really an upstream issue? The true problem seems to be that |
Yes, this would be addressed by having the solver in a library (if that existed!). However, that's less flexible for stack users to use the external process, at the cost of being more knobs to fiddle with. I think I figured it out. Line 523 in 4be2916
I think the solution is to:
|
So yeah, not an upstream issue, instead it's an upstream fix. Our code assumed Cabal was still broken in this way. |
I started working on a fix, and found that cabal version info would need to be plumbed through a lot of code that didn't previously care about the version. I've created an issue that details an approach to solving this - #2479 . Marking this as blocked on that. |
General summary/comments (optional)
When using
stack init --resolver ghc-7.10.3
stack
sometimes produces a valid stack file, except that there's one dependency missing:hex-0.1.2
. Why is that? Am I doing something wrong?Steps to reproduce
This will fail, recommending to add
hex-0.1.2
to theextra-deps
. After doing that,stack test
works.Stack version
Method of installation
stack upgrade
The text was updated successfully, but these errors were encountered: