-
Notifications
You must be signed in to change notification settings - Fork 845
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
Force stack to use local packages over Stackage? #2181
Comments
|
|
|
I think I found the answer to my last question: Each version in the output of |
Before I close this, I still would like to know the answers to my questions 2 and 3 above. I will play around with this for a few minutes and report my observations. |
Okay, it seems like Stack is doing what I wanted it to do, so there was actually no problem here. It was building against the local/Git version that I specified, rather than the Stackage version. It would be nice to document this behavior. Is there a formal spec somewhere where we say how Stack chooses dependencies? If not, can we start one? |
Not really a formal spec, but: http://docs.haskellstack.org/en/stable/architecture/ and http://docs.haskellstack.org/en/stable/GUIDE/ . Do those not address this point? I would prefer to hold off on writing down anything too elaborate until #1265 is implemented. Not that the semantics will change too drastically, but if it mentions details of implementation, that may change. |
As far as I can tell, GUIDE doesn't have any relevant information on this. The "Shadowing" section of the architecture page (http://docs.haskellstack.org/en/stable/architecture/#shadowing), however, explains exactly what I wanted to know. I think we should put something about this in the Yaml Configuration page, under the "Project config" subheader. In particular, under the "packages", "complex package locations", "Local dependency packages", and "extra-deps" sections, I would like to add something like:
Alternatively, we could just add one note under the "resolver" heading (also under "Yaml Configuration/Project config"), like:
I believe this information belongs in Yaml configuration page (or at least some other prominent location, like the GUIDE) because it is part of the semantics of the Yaml file. In the section that explains what to put yaml file, I believe we ought to specify how those configurations are interpreted by Stack (the semantics). |
Do either of the changes I suggested sound reasonable? If so, I can submit a PR with these changes to the documentation. |
Sounds good to me. It will explicitly state the behavior which I found missing when I checked it after you asked this question. We can add a note in "Local Dependency packages" because it talks about the |
Sounds good to me too, thanks! |
@harendra-kumar Why only in the "Local Dependency packages", and not in the "packages", "complex package locations", and "extra-deps" sections? The situation is the same in all four cases. I think we should either mention this in all four sections, or in none of them. Ideally, we should find one place to keep it, instead of repeating ourselves 5 times. |
I'm going to draft a short paragraph to place directly under "Package config". We can discuss this once I open the PR. Thanks @harendra-kumar and @mgsloan for all your help! |
I'm trying to build a package using, as a dependency, the current version of a project in the dependency's Github repo. I've added that repo's Git location and commit ID to the
packages
section of mystack.yaml
.The problem is that I think that Stack might be selecting the version in the Stackage lts snapshot instead of the version that I specified in
stack.yaml
. (I'm not sure. Is there a way to check?)If this is indeed happening, I think it might be happening because the dependency's version number on Stackage is higher than the version number in the git repo (even though the version in the git repo is actually newer, and is the one I want to build against). (To be concrete, the dependency has version 1.3.1.2 on Stackage, but the cabal file of the version in the repo says version 1.3.)
So, in summary:
extra-dep
flag change this behavior?The text was updated successfully, but these errors were encountered: