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

Missing transitive dependencies are not listed the first time around #159

Closed
chreekat opened this issue Jun 1, 2015 · 6 comments
Closed

Comments

@chreekat
Copy link
Member

chreekat commented Jun 1, 2015

'github' depends on 'failure', but failure isn't listed as a missing dep at first:

$ b@fuzzbomb ~/tmp/snowdrifft (master) $ stack build
Checking against build plan lts-2.11
Checking against build plan lts-2.10
Checking against build plan lts-1.15
Checking against build plan nightly-2015-06-01
Writing default config file to: /home/b/tmp/snowdrifft/stack.yaml
stack: The following packages do not exist in the build plan:
github (used by Snowdrift)
mime (used by Snowdrift)
titlecase (used by Snowdrift)
yesod-markdown (used by Snowdrift)
Recommended action: modify the extra-deps field of /home/b/tmp/snowdrifft/stack.yaml to include the following:
- github-0.13.2
- mime-0.4.0.2
- titlecase-0.1.0.1
- yesod-markdown-0.9.4

$ (1) b@fuzzbomb ~/tmp/snowdrifft (master) $ vim stack.yaml
$ b@fuzzbomb ~/tmp/snowdrifft (master) $ stack build
stack: The following packages do not exist in the build plan:
failure (used by github)
Recommended action: modify the extra-deps field of /home/b/tmp/snowdrifft/stack.yaml to include the following:
- failure-0.2.0.3
@DanBurton
Copy link
Contributor

+1, I also experienced this "add extra dep, figure out what more extra deps to add" cycle and it was annoying. It would be better to calculate the transitive changes upfront so that the user only has to add extra deps once.

@snoyberg
Copy link
Contributor

snoyberg commented Jun 2, 2015

Good catch. I wrote code to handle this for the shadowing case, but I
missed this one. Should be easy.

On Tue, Jun 2, 2015, 1:48 AM Dan Burton [email protected] wrote:

+1, I also experienced this "add extra dep, figure out what more extra
deps to add" cycle and it was annoying. It would be better to calculate the
transitive changes upfront so that the user only has to add extra deps once.


Reply to this email directly or view it on GitHub
#159 (comment).

@snoyberg snoyberg added this to the Second release milestone Jun 2, 2015
@snoyberg snoyberg self-assigned this Jun 2, 2015
@snoyberg snoyberg added ready and removed ready labels Jun 2, 2015
@snoyberg
Copy link
Contributor

snoyberg commented Jun 2, 2015

Hmm... this is actually more subtle than it seems. To fully list all transitive dependencies, we'd have to assume that the user is actually going to follow all our recommendations. But we can't even be certain that our recommendations will work, since we're not actually checking bounds. If you follow this line of reasoning, you eventually come to the conclusion of needing to do dependency solving at this point.

That seems like a reasonable solution here actually, but it's more complicated to implement. I'd rather defer this to a later improvement, and short term just include a note in the message of "further dependencies may need to be added."

@snoyberg snoyberg removed their assignment Jun 2, 2015
@snoyberg snoyberg modified the milestones: Later improvements, Second release Jun 2, 2015
snoyberg added a commit that referenced this issue Jun 2, 2015
@snoyberg
Copy link
Contributor

Let's merge in #178 here as well. Idea is that, once we're able to determine what should be added to extra-deps, we'll also provide a flag (e.g. --assume-latest) and automatically upgrade the stack.yaml file.

@snoyberg
Copy link
Contributor

I've just added a new command, stack solver, which I believe addresses this pretty well. When run, it will run the cabal dependency solver on your project to determine what extra-deps are needed. Hopefully in the future we'll be able to switch it over to a better SAT-based solver.

Pinging @bitemyapp as well based on the request in #178.

@snoyberg snoyberg modified the milestones: 0.2.0.0, Later improvements Jun 21, 2015
@mboes
Copy link
Contributor

mboes commented Jun 21, 2015

a better SAT-based solver.

for the public record, "better" very likely implies "off-the-shelf" IMHO. :)

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

4 participants