-
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 doesn't find custom snapshot package #3714
Comments
It turns out that the Here's what I was able to gather:
globalToSnapshot name lpi = lpi
{ lpiLocation = PLIndex (PackageIdentifierRevision (PackageIdentifier name (lpiVersion lpi)) CFILatest)
} It may well be that the package has unmet dependencies, however I'm surprised that stack goes ahead with the build by trying to refetch the package from Hackage rather than aborting. Moreover I've seen the issue in a project where the incriminated package had all its dependencies either in the parent snapshot (LTS) or in the custom snapshot. @snoyberg you seem to be the sole contributor to the |
Definitely sounds like a bug, thanks for the thorough investigation here. If it really does have unmet deps, then we should be complaining about that. If it doesn't have unmet deps, then it's a bigger bug. Do you have an example of a case where all of the dependencies were in fact met? |
I'm able to reproduce when all dependencies are met: stack.yaml resolver: snapshot.yaml
extra-deps:
- prim-uniq-0.1.0.1 snapshot.yaml resolver: lts-9.9
name: Dummy
packages:
- prim-uniq-0.1.0.1
- ref-tf-0.4.0.1
- git: https://github.com/reflex-frp/reflex
commit: d9ef8457dfd140fde32d15a6959a15ddcd7e15e4 $ stack build reflex
Didn't see reflex-0.5.0 in your package indices.
Updating and trying again.
Selected mirror https://s3.amazonaws.com/hackage.fpcomplete.com/
Downloading timestamp
No updates to your package index were found
Update complete
The following package identifiers were not found in your indices: reflex-0.5.0
Possible candidates: reflex-0.2, reflex-0.4.0, reflex-0.0.1, reflex-0.3.2, reflex-0.3, reflex-0.1.1, reflex-0.1.0, reflex-0.3.1. Note that
|
In the comment above, I didn't realize I had stack.yaml resolver: snapshot.yaml snapshot.yaml resolver: lts-9.9
name: Dummy
packages:
- prim-uniq-0.1.0.1
- ref-tf-0.4.0.1
- git: https://github.com/reflex-frp/reflex
commit: d9ef8457dfd140fde32d15a6959a15ddcd7e15e4 Running
|
This is definitely a bug that needs to be resolved, I've marked it as a blocker for the next release of Stack. I'm currently working on a number of other refactorings in the codebase, and won't be able to get to this immediately myself. A great next step (if you're up for the challenge) is to add a minimal reproducing case as an integration test. The minimal repro (something ideally smaller than reflex) will be massively useful for debugging this, and I'd be happy to help convert such a repro into an integration test. You interested in pursuing this? |
I'll try to find the time, I'll update you here when I get started. |
I believe I've reproduced the same bug with the
|
Same bugginess with the unordered-containers repo. When I have # snapshot.yaml
resolver: nightly-2018-01-04
packages:
- git: [email protected]:tibbe/unordered-containers
commit: 60ced060304840ed0bf368249ed6eb4e43d4cefc It will build unordered-containers from Hackage rather than the repo, since the cabal file at that commit specifies a version which has been released. (Expected behavior would be to build from the repo regardless.) If instead I use my patch which has bumped the version... # snapshot.yaml
resolver: nightly-2018-01-04
packages:
- git: [email protected]:danburton/unordered-containers
commit: d1f36251669687d96834df0c2a7bec1d162c1e89 Then it complains with the error message as mentioned above.
(Where, again, expected behavior is to build from the repo.) |
|
Seems to work, at least I can't reproduce the issue on the example above. Thanks a lot! |
Seems to work for the use cases I mentioned as well. |
Cool, thanks for confirming |
General summary/comments (optional)
I cannot pull
git:
defined packages in a custom snapshot. The package version is looked up from the custom snapshot correctly, but then stack tries to find it on hackage. Stack does download the source but it is never built.This is the (failing) lookup, as far as I can tell: https://github.com/commercialhaskell/stack/blob/master/src/Stack/Package.hs#L200
CC @mgsloan
Steps to reproduce
Clone this repo, run
stack build reflex
. The repo specifies a minimalstack.yaml
with a custom snapshot:stack.yaml
snapshot.yaml
Expected
Stack should have tried to build the
reflex
package.Actual
See the verbose output.
Stack version
Stack built from source at commit 8266a06, although reproducible with Stack 1.6.3
The text was updated successfully, but these errors were encountered: