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

Rework paths in Cradle Dependencies #203

Closed
fendor opened this issue Jun 14, 2020 · 1 comment · Fixed by #209
Closed

Rework paths in Cradle Dependencies #203

fendor opened this issue Jun 14, 2020 · 1 comment · Fixed by #209
Labels
type: bug Something isn't working

Comments

@fendor
Copy link
Collaborator

fendor commented Jun 14, 2020

Original issue: https://github.com/digital-asset/ghcide/issues/633

The dependencies could be relative to the cradleRootDir or to componentRootDir e.g.

.
├── cabal.project
├── servant-server
│   └── servant-server.cabal
└─── servant-docs
    └── servant-docs.cabal
Options for 'servant-server'
Root directory:      ./servant
Component directory: ./servant/servant-server
Dependencies:        stack.yaml servant-server.cabal package.yaml
Options for 'servant-docs'
Root directory:      ./servant
Component directory: ./servant/servant-docs
Dependencies:        stack.yaml servant-docs.cabal package.yaml

We need to reload both components in case of change to ./servant/stack.yaml but only one for changes to ./servant/servant-server/servant-server.cabal, ./servant/servant-server/package.yaml and ./servant/servant-docs/servant-docs.cabal, ./servant/servant-docs/package.yaml respectively.

A proposed solution:
Change the API of cradle dependencies in hie-bios to give absolute paths since this is the only location where we can know this. (Another breaking change, yay)
Unfortunately, this does not play nicely with the latest breaking change to extend a CradleError with the dependencies of the component, since we dont know the component dir in that case :(

@fendor fendor changed the title Make Cradle Depencies absolute Make Cradle Dependencies absolute Jun 14, 2020
@fendor
Copy link
Collaborator Author

fendor commented Jun 21, 2020

The simpler solution (and non backwards-compatibility breaking) would be to fix the returned dependencies.

@fendor fendor added the type: bug Something isn't working label Jul 3, 2020
@fendor fendor changed the title Make Cradle Dependencies absolute Rework paths in Cradle Dependencies Jul 3, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant