Workspace rules (GHC binary distributions)
Bazel

Workspace rules (GHC binary distributions)


ghc_bindist

ghc_bindist(name, version)

Create a new repository with given name which will contain two targets:

  • filegroup bin containing all executable files of GHC
  • C library threaded-rts

Attributes

name

Name; Required

A unique name for this rule.

version

String; Optional; Default is '8.4.1'

The desired GHC version

Examples

In WORKSPACE file:

load("@io_tweag_rules_haskell//haskell:haskell.bzl", "ghc_bindist")

# This repository rule creates @ghc repository.
ghc_bindist(
  name    = "ghc",
  version = "8.2.2",
)

# Register the toolchain defined locally in BUILD file:
register_toolchains("//:ghc")

In BUILD file:

# Use binaries from @ghc//:bin to define //:ghc toolchain.
haskell_toolchain(
  name = "ghc",
  version = "8.2.2",
  tools = "@ghc//:bin",
)