Skip to content

Release 0.10

Compare
Choose a tag to compare
@Profpatsch Profpatsch released this 09 Sep 17:29
· 2961 commits to master since this release

Highlights

  • The minimum supported Bazel version is now 0.27.

    rules_haskell supports Bazel up to 0.28.
    0.27 is a LTS release, which means upstream guarantees all new
    releases are backwards-compatible to it for 3 months. See the Bazel
    Stability

    blog post for more information.

  • The repository name has changed, to follow the
    new Bazel rule guidelines. It was
    previously called @io_tweag_rules_haskell. It is now called
    @rules_haskell. You should adapt your WORKSPACE file to match
    this, as well as your .bazelrc.local file, if any.

  • haskell_cabal_library/haskell_cabal_binary: Both use cabal to
    build Haskell package dependencies.

  • stack_snapshot: Uses stack’s dependency resolving algorithm to
    generate haskell_cabal_library targets automatically.
    Requires stack > 2.1, which it will download if cannot be found in
    PATH.

  • It is now possible to statically link Haskell libraries in CC
    binaries.

  • A new example has been added.

    cat_hs: is an example of a non-trivial application
    with multiple third-party dependencies downloaded from Hackage,
    C library dependencies and split up into multiple libraries and
    a binary. We use a rule wrapping Cabal to build the Hackage
    dependencies. This example requires Nix installed. It is used to
    build (or download from a binary cache) the C library dependencies.

  • Improved coverage reports.

  • Haddock links to prebuilt libraries.

  • Various improvements to reduce header size limits and command line
    argument length, in order to better support macOS and Windows.

Added

  • haskell_cabal_library/haskell_cabal_binary.
    See #879,
    #898 and
    #904.
  • stack_snapshot.
    See #887 (name
    changed to stack_snapshot after this PR).
    See also #1011.
  • tools arguments for stack and cabal rules.
    See #907.
    They can be arbitrary tools,
    see #987.
  • tools attribute to core haskell_* rules. This attribute can be
    used to expose GHC preprocessors.
    See #911.
  • Static GHC RTS can be specified in the toolchain.
    See #970.
  • runfiles library: manifest file support (for Windows).
    See #992.
  • Prototype implementation of bazel worker mode (not production-ready
    yet).
    See #1024
    and #1055

Changed

  • The haskell_toolchain macro now no longer adds a toolchain
    definition. You must now define yourself a haskell_toolchain and
    a toolchain separately. This should be a mostly transparent
    change, because nearly no one uses these functions directly. They
    are normally only used transitively via
    haskell_register_toolchains and related functions.
    See #843.

  • The haskell/haskell.bzl entrypoint is deprecated. use
    haskell/defs.bzl instead.

  • The haskell_repositories() macro is deprecated. Use
    rules_haskell_dependencies() from haskell/repositories.bzl
    instead.

  • The haskell_register_toolchains() macro is deprecated. Use
    rules_haskell_toolchains() from haskell/repositories.bzl
    instead.

  • The exports attribute’s semantics are changed:

    ‘A list of other haskell libraries that will be transparently added
    as a dependency to every downstream rule.’

    The original exports is available under the new name
    reexported_modules.
    See #1008.

  • @ is allowed in Haskell binary names.

  • haskell_library may be empty (no files in srcs).
    See #1035.

Removed

  • The haskell_lint rule has been removed. It should have been
    designed as a test rule and it should have had a different name. The
    rule isn't even necessary for its current purpose: it's more
    convenient to turn on compiler warnings globally in the toolchain
    definition.

  • The cc_haskell_import and haskell_cc_import rules have been removed.
    These rules were redundant since Haskell rules can directly interact with C
    rules. Use the following patterns instead.

    # To import Haskell from C.
    haskell_library(name = "haskell-lib", ...)
    cc_library(name = "cc-lib", deps = [":haskell-lib"], ...)
    
    # To import C from Haskell.
    cc_library(name = "cc-lib", ...)
    haskell_library(name = "haskell-lib", deps = [":cc-lib"], ...)
    
    # To import a pre-built library.
    cc_library(name = "so-lib", srcs = glob(["libxyz.so*", "libxyz.dylib", "libxyz.a", "libxyz.dll"]))
    haskell_library(name = "haskell-lib", deps = [":so-lib"], ...)
    

Fixed

  • haskell_register_ghc_nixpkgs: Forward all arguments to wrapped
    rules. See #886.
    Also support repository argument and nixopts.
  • Haddock links to prebuilt libraries.
    See #928
    and #934.
  • Documentation for GHC plugin targets is now included in
    the API documentation.
  • The Multi-REPL recognizes haskell_toolchain_library dependencies.
  • Various imrovements to linking. See
    #930.
  • $(location) expansion for “expression is not a declared
    prerequisite of this rule”.
    See #990.
  • Better error if the compiler version doesn’t match the one specified
    in the toolchain.
    See #1014.
  • macOS bindists correctly find ar and sed invocation was broken.
    See #1022
    and #1017.
  • Allow arbitrary name for haskell_cabal_library. See
    #1034.
  • Various fixes for c2hs on Windows
    See #1046
    and #1052.
  • :load command in ghci
    See #1046.

Improved

  • Profiling mode (--compilation_mode="dbg").
    See #896.
  • GHC errors won’t be swallowed anymore.
    See #1050.