Skip to content
This repository was archived by the owner on Jun 18, 2019. It is now read-only.
This repository was archived by the owner on Jun 18, 2019. It is now read-only.

Don't require manually generating a package.bzl file #46

@thumphries

Description

@thumphries

From internal issue tracker:

Currently, Hazel requires manually generating a packages.bzl file that reifies the Stack resolver:

load("//:packages.bzl", "prebuilt_dependencies", "packages")

hazel_repositories(
    prebuilt_dependencies=prebuilt_dependencies,
    packages=packages)

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:

hazel_repositories(
    resolver="lts-11.6",
    extra_deps = {
        "optparse-applicative": "0.14.2.0",
        ...,
    }) 

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions