You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jun 18, 2019. It is now read-only.
We ought to be able to do better; the only thing that we should need to pass is the resolver name (and potentially extra-dep versions), and have Hazel do the rest:
Note that for parsing a Cabal file we could just use GHC + built-ins, but for a YAML file we don't get enough from the built-in packages. Instead I think we can just write a Python script using the yaml package. (Bazel already requires Python to be installed anyway.)
Subtasks
Write a Python script to generate a packages.bzl file for a given Stackage resolver
Change hazel_repositories to take the resolver name directly, as described above,
call the above Python script and save packages.bzl in @hazel_base_repositories.
Update docs
The text was updated successfully, but these errors were encountered:
write a macro/rule/whatever that uses all-cabal-hashes for decorating the package dict with the sha256
pass that dict to hazel_repositories
this means specifying:
• a resolver and the hash of its yaml representation
• a list of custom packages and their versions
• a commit and hash for the cabal hashes
limitations:
• it'll always pull the initial cabal revision, but same with Stackage.hs
I suspect this is doable but I don't have enough experience with bazel to be truly confident that it'll work as expected.
Couldn't you just generate the packages.bzl file and store it in a github repo which is tagged to the stackage version? I.e. create a new repo, https://github.com/FormationAI/hazel-packagesets that contains a single packages.bzl file but many tags, one tag for each version. You could even set up CI to build nightlies. Then the user just has to specify the package set version in WORKSPACE.
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
From internal issue tracker:
Currently, Hazel requires manually generating a
packages.bzl
file that reifies the Stack resolver:We ought to be able to do better; the only thing that we should need to pass is the resolver name (and potentially extra-dep versions), and have Hazel do the rest:
Note that for parsing a Cabal file we could just use GHC + built-ins, but for a YAML file we don't get enough from the built-in packages. Instead I think we can just write a Python script using the
yaml
package. (Bazel already requires Python to be installed anyway.)Subtasks
packages.bzl
file for a given Stackage resolverhazel_repositories
to take the resolver name directly, as described above,call the above Python script and save
packages.bzl
in@hazel_base_repositories
.The text was updated successfully, but these errors were encountered: