Workspace rules (GHC binary distributions)
Bazel

Workspace rules (GHC binary distributions)


ghc_bindist

ghc_bindist(name, version, target, compiler_flags, haddock_flags, repl_ghci_args)

Create a new repository from binary distributions of GHC. The repository exports two targets:

  • a bin filegroup containing all GHC commands,
  • a threaded-rts CC library.

These targets are unpacked from a binary distribution specific to your platform. Only the platforms that have a "binary package" on the GHC download page are supported.

Attributes

name

Name; Required

A unique name for this rule.

version

Unknown; Required

target

Unknown; Required

compiler_flags

Unknown; Optional

haddock_flags

Unknown; Optional

repl_ghci_args

Unknown; Optional

Examples

In WORKSPACE file:

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

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

haskell_register_ghc_bindists

haskell_register_ghc_bindists(version, compiler_flags, haddock_flags, repl_ghci_args)

Register GHC binary distributions for all platforms as toolchains.

Toolchains can be used to compile Haskell code. This function registers one toolchain for each known binary distribution on all platforms of the given GHC version. During the build, one toolchain will be selected based on the host and target platforms (See toolchain resolution).

Attributes

version

Unknown; Optional

compiler_flags

Unknown; Optional

haddock_flags

Unknown; Optional

repl_ghci_args

Unknown; Optional