Add binaries from haskell packages to PATH#12
Conversation
abe75b1 to
6ebf50d
Compare
The same flags are already part of `packages_info.packagedb_args`.
- add package `path` projection to `HaskellPackageDbTSet`
6ebf50d to
e587d49
Compare
aherrmann
left a comment
There was a problem hiding this comment.
Thank you, looks good! Just a few comments.
| Allows to declare dependencies for sources manually, in case the automatic | ||
| dependency mechanism is not able to detect them. |
There was a problem hiding this comment.
The way it's phrased it sounds like it would override the automatic dependency detection. But, IIUC it extends the set of automatically discovered dependencies, correct?
There was a problem hiding this comment.
How about:
Allows to declare dependencies for sources manually, additionally to the dependencies automatically detected.
| ghc_args.add(ctx.attrs.compiler_flags) | ||
|
|
||
| md_args = cmd_args(md_gen) | ||
| md_args.add(packages_info.nix_packages) |
There was a problem hiding this comment.
Is this really Nix specific, or would the same approach be needed for other forms of GHC toolchains? I'm having the goal to upstream to facebook/buck2-prelude in mind. If there's a more general pattern, then it would be good to call that out. (Not necessarily in this PR though, but good to keep in mind as a follow-up)
There was a problem hiding this comment.
Well, this would work for anything that refers to a directory (symlink) which has a bin folder. Maybe we can change this to bin_path instead. I'll see if that works.
| if aux_deps: | ||
| compile_args_for_file.hidden(aux_deps) | ||
|
|
||
| for (path, src) in srcs_to_pairs(ctx.attrs.srcs): |
There was a problem hiding this comment.
Would these aux_deps suffice to replace this srcs_to_pairs loop?
There was a problem hiding this comment.
Yes, that's what I thought too, but I was a bit reluctant to remove this just yet. Maybe we should warn about other sources other than haskell being listed here and advice on using srcs_deps instead?
…tadata.py` This adds the given directory to the `PATH` of the environment when calling ghc.
e587d49 to
e9ef00f
Compare
-package-dbflags passed to ghc--nix-pkgargument toghc_wrapper.pyandgenerate_target_metadata.py--nix-pkgflag for each direct toolchain library dependency