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

How do I add a dependency I expect to be locally installed? #2055

Closed
bananu7 opened this issue Apr 22, 2016 · 5 comments
Closed

How do I add a dependency I expect to be locally installed? #2055

bananu7 opened this issue Apr 22, 2016 · 5 comments
Milestone

Comments

@bananu7
Copy link

bananu7 commented Apr 22, 2016

Let's say I have two projects, A and B, B depending on A. Neither of them is on Stackage. I clone and build A, then do stack install. At this point, I can globally run any executables provided by it and I'd expect it to be available to other libraries as well.

However, when doing stack build in B, it doesn't want to pick up A. It only looks in the relative path, namely .../B/A/, fails to see A there and fails.

How do I specify that a dependency is expected to be locally installed?

@mgsloan
Copy link
Contributor

mgsloan commented Apr 22, 2016

You need to create a stack.yaml file has both projects. See the docs - there are a variety of ways to specify this. Easiest would be to write a stack.yaml file like the following:

packages:
- A
- B

However, when doing stack build in B, it doesn't want to pick up A. It only looks in the relative path, namely .../B/A/, fails to see A there and fails.

I don't follow the reasoning here

How do I specify that a dependency is expected to be locally installed?

For dependencies outside of snapshots, you need to have them in your stack.yaml project. Alternatively, you can use custom snapshots. It is on the agenda to improve such package sharing - #1265

@mgsloan mgsloan added this to the Support milestone Apr 22, 2016
@xpe
Copy link

xpe commented Apr 23, 2016

@bananu7 Have you seen the extra-dep: true option, as mentioned at http://docs.haskellstack.org/en/stable/yaml_configuration/#project-config? It may help you.

@mgsloan
Copy link
Contributor

mgsloan commented Apr 23, 2016

Gonna go ahead and close this, feel free to reopen

@mgsloan mgsloan closed this as completed Apr 23, 2016
@bananu7
Copy link
Author

bananu7 commented Apr 26, 2016

Oh sorry, I got kinda swamped with other things.

You need to create a stack.yaml file has both projects.

That's what I did, except I did put . and A there; and that prompted stack to look for A relatively to the Bs path, despite the fact I did stack install in A's folder

Have you seen the extra-dep: true option

Yeah, I did use it, but it still required me to pass relative path there.

However, I think this is an exact duplicate of #1265, so I'm not gonna reopen it and watch that one instead.

PS Oh also, if you were wondering about the use case, I'm developing both of those packages at the same time; that's why I need dev snapshots of both of them locally installed and available.

@mgsloan
Copy link
Contributor

mgsloan commented Apr 27, 2016

Yeah, I did use it, but it still required me to pass relative path there.

Yes. Perhaps it is too stringent of a restriction, but relative paths are preferred to make it so that you can move your packages / send the code to someone else.

PS Oh also, if you were wondering about the use case, I'm developing both of those packages at the same time; that's why I need dev snapshots of both of them locally installed and available.

Makes sense. In that circumstance, I have a stack.yaml file which includes both of them.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants