-
Notifications
You must be signed in to change notification settings - Fork 61
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
WIP: Add dependencies of cradles #39
Conversation
cradleRootDir = wdir | ||
, cradleDependencies = ["cabal.project", "cabal.project.local"] ++ cabalFiles |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
are there any overlooked special cases?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will not work if the cabal file is in some sub-directory.
We could recursively search all sub-directories for cabal files, or parse "cabal.project" and "stack.yaml" respectively to get the subdirectories we are interested in.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's close. Ideally stack and cabal would spit this information out themselves.
@@ -267,6 +280,7 @@ rulesHaskellCradle :: FilePath -> Cradle | |||
rulesHaskellCradle wdir = | |||
Cradle { | |||
cradleRootDir = wdir | |||
, cradleDependencies = ["BUILD.bazel", "WORKSPACE"] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I dont use rules_haskell, so I am not sure if these are all cradle dependencies
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks awesome!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
While thinking about how Cabal/Stack could be persuaded to support it, I realised that they can't in this form. They would have to do so in the IO of returning flags also say what files they consulted. Not sure this is worth addressing now, because it's not something we can use, and this solution is the simpler and effective for most instances.
Another idea that works around most of the problems: Add a field to hie.yaml "cradle-deps" where a user can specify the deps for a cradle. |
@mpickering suggested that it should be possible to query the build tool for cradle dependencies, e.g. then the signature would be |
Would it be cheaper to query the build tool for cradle dependencies simultaneously with querying it for flags? In which case an extra field in the return of |
Closed in favour of #42 |
closes #35
Adds a new record-field for files that are dependencies of the cradle.
cc @ndmitchell