Skip to content

Release 0.9

Compare
Choose a tag to compare
@Profpatsch Profpatsch released this 09 May 16:34

Highlights

  • The minimum supported Bazel version is now v0.24.

    The version is available from nixpkgs unstable and via
    official releases.

  • Initial Windows support

    A non-trivial subset of rules_haskell is now working on Windows.
    See the project tracker
    for finished and ongoing work.

  • Improved OSX support

    Due to the mach-o header size limit, we took extra measures to
    make sure generated library paths are as short as possible, so
    linking haskell binaries works even for large dependency graphs.

  • Better Bindist support

    The default start script sets up a
    bindist-based project by default.

    rules_nixpkgs is no longer a required dependency of
    rules_haskell (but can still be used as backend).

  • Full Haskell–C–Haskell Sandwich

    A haskell_library can be now be used nearly anywhere a
    cc_library can.

    The old cc_haskell_import and haskell_cc_import wrapper rules
    are no longer necessary and have been deprecated.

  • Greatly improved REPL support

    A new haskell_repl rule allows to load multiple source targets by
    source, or compiled, as needed. Example usage:

    haskell_repl(
      name = "my-repl",
      # Collect all transitive Haskell dependencies from these targets.
      deps = [
          "//package-a:target-1",
          "//package-b:target-2",
      ],
      # Load targets by source that match these patterns.
      include = [
          "//package-a/...",
          "//packaga-b/...",
          "//common/...",
      ],
      # Don't load targets by source that match these patterns.
      exclude = [
          "//package-a/vendored/...",
      ],
    )
    
  • Support for GHC plugins

    Each haskell_* rule now has a plugins attribute. It takes a
    list of bazel targets, which should be haskell_librarys that
    implement the GHC plugin
    specification
    .

  • Initial Code Coverage support

    Measure coverage of your Haskell code. See the “Checking Code
    Coverage”

    section in the manual.

Compatibility Notice

hazel was merged into
rules_haskell
, but
we are not yet certain about the exact interface we want to expose.
hazel is therefore not included in this release, and we can’t
guarantee the original, unmerged version is compatible with this
release. If you depend on hazel, please use a recent master commit
of rules_haskell.

Changed

  • haskell_register_ghc_bindists is no longer re-exported from
    //haskell/haskell.bzl.
    You must now load that macro from //haskell:nixpkgs.bzl.

  • rules_nixpkgs is no longer a dependency of rules_haskell.

  • haskell_import has been renamed to haskell_toolchain_library.
    This is a substantial breaking change. But adapting to it should be
    as simple as

    sed -i 's/^haskell_import/haskell_toolchain_library/' **/BUILD{,.bazel}
    sed -i 's/"haskell_import"/"haskell_toolchain_library"/' **/BUILD{,.bazel}
    

    See #843.

  • haskell_toolchain’s tools attribute is now a list of labels.
    Earlier entries take precendence. To migrate, add [] around your
    argument.
    See #854.

  • The default outputs of haskell_library are now the static and/or
    shared library files, not the package database config and cache
    files.

Added

  • haskell_repl rule that constructs a ghci wrapper that loads
    multiple targets by source.
    See #736.
  • plugins attribute to haskell_* rules to load GHC plugins.
    See #799.
  • The HaskellInfo and HaskellLibraryInfo providers are now
    exported and thus accessible by downstream rules.
    See #844.
  • Generate version macros for preprocessors (c2hs, hsc2hs).
    See #847.
  • bindist_toolchain rule gets haddock_flags and repl_ghci_args
    attributes.
  • @repl targets write json file with build information, usable by
    IDE tools.
    See #695.

Deprecated

  • haskell_cc_import; use cc_library instead.
    See #831.
  • cc_haskell_import; just use haskell_library like a cc_library.
    See #831.

Fixed

  • Support protobuf roots in haskell_proto_library.
    See #722.
  • Made GHC bindist relocatable on *nix.
    See #853.
  • Various other fixes