All Versions
Latest Version
Avg Release Cycle
76 days
Latest Release
608 days ago

Changelog History
Page 1

  • v0.13.0 Changes

    September 20, 2020

    βž• Added

    • πŸ‘Œ Support for GHC 8.10.
    • πŸ‘Œ Support for building fully-static binaries. These binaries have fewer dependencies and are more portable across systems.
    • πŸ‘Œ Support Cabal setup script dependencies. See #1347.
    • πŸ‘Œ Support ghcide.
    • πŸ‘Œ Support building Stackage binaries in stack_snapshot, not just libraries. See #1304.
    • πŸ‘ Better compatibility with --remote_download_minimal.
    • πŸ‘Œ Support Stack snapshot pinning. In the common case, users don't even need to run Stack to resolve a snapshot to a set of package tarballs. The tarballs can be cached in the Bazel repository cache. See #1376.

    πŸ”„ Changed

    • The platform name for Nix users has changed. The platforms in @//haskell/platforms/... are still supported, but are deprecated. Use @io_tweag_rules_nixpkgs//nixpkgs/platforms:host instead.
    • 🏁 Avoid unnecessary recompilation on Windows. See #1280.
    • πŸ‘‰ Use Stack >= 2.3.1 in the implementation of stack_snapshot. This enables better sdist caching, better performance, and makes bazel fetch more effective.
    • More aggressive shortening of library names to avoid exceeding MACH-O header size limits on macOS.
    • πŸ‘‰ Make variables are now expanded in compiler and REPL flags. See #1381.

    πŸ›  Fixed

    • πŸ”— Linking shared libraries and binaries on Linux distributions that have PIE enabled by default, like Ubuntu from at least 18.04 onwards. See #1388.
  • v0.12.0

    March 16, 2020
  • v0.11.0 Changes

    October 10, 2019


    • Various improvements to cabal_binary/library and stack_snapshot.

    • πŸŽ‰ Initial experimental Windows support for cabal_binary/library and stack_snapshot.

    • [start](./start) script for setting up rules_haskell allows to set up a nixpkgs-based bazel workspace, for NixOS users, via the --use-nix option.

    βž• Added

    • 🏁 Windows-support for cabal/stack. See #1074.
    • stack_snapshot: vendored_packages attribute for manually overriding packages in a stack snapshot. There is an example in [./examples/WORKSPACE](./examples/WORKSPACE). See #1060.

    βœ‚ Removed

    • πŸ—„ The haskell/haskell.bzl entrypoint, which was deprecated in the previous release, was removed. Please use haskell/defs.bzl instead.

    πŸ”„ Changed

    • The deps attribute to stack_snapshot has been replaced by the extra_deps attribute. It no longer takes a list of dependencies to be added to all packages, but instead a dictionary specifying additional dependencies to select packages. See stack_snapshot API docs for an example. See #1068.

    πŸ›  Fixed

    • Unified the cc_wrapper on all OSes.
      • Consistently shortens paths of library dependencies to work around size limits on Windows and macOS
      • fixes .so/.dylib ending confusing on macOS
      • improves the REPL on macOS See #1039.
    • cabal_binary/library targets don’t name-clash anymore
    • haskell_cabal_library no longer builds exe components, speeding up builds. See #1095.
    • Haddock information for protobuf rules generates correctly. See #1108.
  • v0.10.0 Changes

    September 03, 2019


    • πŸ‘ 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][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:](./examples/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.

    πŸš€ [bazel-rule-guidelines]:

    βž• 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.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.
  • v0.9.1 Changes

    June 03, 2019

    πŸ›  Fixed

    • 🍎 Bindists were broken on MacOS.
      πŸ‘€ See 884.
  • v0.9 Changes

    May 07, 2019


    πŸ‘ 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
    0️⃣ 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:

      name = "my-repl",
      # Collect all transitive Haskell dependencies from these targets.
      deps = [
      # Load targets by source that match these patterns.
      include = [
      # Don't load targets by source that match these patterns.
      exclude = [

    πŸ‘Œ 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

    πŸŽ‰ 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
    , 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
    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
    πŸ‘€ See #854.

    0️⃣ The default outputs of haskell_library are now the static and/or
    πŸ“¦ shared library files, not the package database config and cache

    βž• 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
    • πŸ— @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
  • v0.8 Changes

    January 28, 2019

    [0.8] - 2019-01-28

    • πŸ‘ The minimum supported Bazel version is now v0.21.

    βž• Added

    • haskell_register_toolchains, haskell_register_ghc_bindists and
      haskell_register_ghc_nixpkgs to register multiple toolchains for
      multiple platforms at once. Toolchains from binary distributions can
      now coexist with toolchains from Nixpkgs, even on the same platform.
      πŸ‘€ On nixpkgs you need to provide a toolchain. See
      the README for instructions.
      πŸ‘€ See #597
      and #610.
    • Instructions on how to reference a local checkout of rules_haskell.
    • rules_haskell is forward-compatible with the next breaking changes
      in bazel versions, via the --all_incompatible_changes flag.
      πŸ‘€ See #613.

    βœ‚ Removed

    • The generate_so attribute of haskell_binary and haskell_test
      πŸš€ has been completely superseded by linkstatic in the last release
      🚚 and became a no-op, so it is removed.
    • The main_file attribute of haskell_binary and haskell_test
      🚚 had been deprecated because it was a no-op, so it is removed.
    • The prebuilt_dependencies attribute of all haskell rules
      🚚 had been deprecated two versions ago and is removed.
      πŸ‘€ Use haskell_import instead (see docs for usage).
    • πŸ‘ The extra_binaries field is now no longer supported.

    πŸ”„ Changed

    • ghc_bindist now requires a target argument. Use
      haskell_register_ghc_nixpkgs to call ghc_bindist once per known
      πŸ‘€ See #610.
    • ghc_bindist now registers itself as a toolchain. We no longer
      require a separate toolchain definition and registration in addition
      to ghc_bindist.
      πŸ‘€ See #610.
    • πŸ‘ c2hs support is now provided in a separate toolchain called
      c2hs_toolchain, rather than an optional extra to the
      πŸ‘€ See #590.
    • πŸ“‡ Rename bindist arch names so they are the same as in

    πŸ›  Fixed

    • Prevent duplicate installs of bazel_skylib
      πŸ‘€ See #536.
    • βœ… Test suite now executes all binaries, various runtime errors were
      πŸ‘€ See #551.
    • Repl targets that have indirect cc_library dependencies.
      πŸ‘€ See #576.
    • linkstatic for haskell binaries that have an indirect dependency
      πŸ“¦ on a prebuilt haskell package.
      πŸ‘€ See #569.
    • … and an indirect dependency on a C library.
      πŸ‘€ See #567.
    • Prefer linking agains static C libraries with linkstatic.
      πŸ‘€ See #587.
    • Haddock flags take precedence over GHC compiler flags.
      πŸ‘€ See #572.
    • 0️⃣ User-defined GHC flags now override default flags.
      πŸ‘€ See #607.
    • Dynamic transitive C(++) libraries work.
      πŸ‘€ See #627.
  • v0.7 Changes

    December 24, 2018

    βž• Added

    • πŸ‘Œ Support for Bazel 0.20.0. This is now also the lower bound for the supported version.
    • πŸ‘Œ Supported reexported modules, via the new exports attribute. See #357.
    • πŸ‘Œ Support linkstatic attribute, for building mostly static binaries. This is now the default for binaries, to match the C/C++ rules defaults. See #378.
    • 0️⃣ It is now possible to set default Haddock flags in the toolchain definition. See #425.
    • πŸ‘Œ Support wrapping Haskell libraries as shared objects callable from Python. See #370.

    πŸ”„ Changed

    • REPL targets have changed name. If you have a library target foo, then the corresponding REPL target is now called [email protected]. It was previously called foo-repl. The old name is still supported but is deprecated.
    • 0️⃣ Don't set a default version number anymore in libraries and binaries. Version numbers, and CPP version macros, are now only used for packages imported from Hackage. Don't use them otherwise. See #386, #414 and #446.
    • 🍎 On macOS, we use ar for linking, not Libtool. See #392.
    • The runfiles Haskell library has been broken out into a Cabal library and published on Hackage.

    πŸ›  Fixed

    • πŸ— Make REPL force building of dependencies. See #363.
    • πŸ‘€ Don’t crash on inputs missing .haddock interface files. See #362
    • πŸ›  Fix handling of non-unique package names. See #403.
  • v0.6 Changes

    July 21, 2018

    [0.6] - 2018-07-21

    βž• Added

    πŸ‘€ Protocol buffers integration using proto-lens. See

    strip_include_prefix attribute to the haskell_cc_import rule. See

    πŸ‘Œ Support for c2hs files. See

    The extra_srcs attribute that allows to list non-Haskell source files
    that should be visible during compilation and linking (usually useful with
    πŸ‘€ TH). See #292.

    The extra_binaries attribute to the haskell_toolchain rule. See

    πŸ‘€ A Haskell library for looking up runfiles. See

    βœ… A separate toolchain for doctestβ€”haskell_doctest_toolchain. See

    The compiler_flags attribute to the haskell_toolchain rule allowing to
    πŸ‘€ specify default compiler flags. See

    The ability to set locale to be used during compilation by adding the
    locale and locale_archive attributes to haskell_toolchain. See

    πŸ‘€ Proper support for profiling. See

    The repl_ghci_args attribute to the haskell_toolchain rule. See

    The haskell_import rule allowing us to make specifying dependencies more
    πŸ‘€ uniform and to deprecate the prebuilt_dependencies attribute. See

    πŸ›  Fixed

    πŸ‘€ Template Haskell linking against cc_library. See

    πŸ”— Linking issues on MacOS. See

    πŸ“¦ GHC packages that correspond to targets with the same name but in
    πŸ‘€ different Bazel packages no longer clash. See

    🍎 Build breakage on MacOS when XCode is not installed. See

    πŸ› Bug preventing Haddock generation because of missing dynamic shared
    πŸ‘€ libraries when targets have TH in them. See

    πŸ“¦ Hyperlinks between targets contained in different Bazel packages
    πŸ‘€ (Haddocks). See #231.

    πŸ‘€ Generated source files do not cause issues now. See

    πŸ‘€ data attributes now allow files in them. See

    πŸ› Bug when headers and hsc2hs-produced files were not visible to Haddock.
    πŸ‘€ See #254.

    Bug preventing using genrule-produced headers via haskell_cc_import. See

    πŸ› Bug that allowed us avoid specifying certain prebuilt_dependencies if
    πŸ‘€ they were already specified for transitive dependencies. See

    πŸ› Bug that was making modules generated from .hsc and .chs files and
    πŸ‘€ generated modules in general not available in the REPLs. See

    πŸ”„ Changed

    βž• Added -Wnoncanonical-monad-instances to default warnings in
    πŸ‘• haskell_lint.

    How REPLs work. Now there is an optional output per binary/library. Its
    πŸ— name is the name of target with -repl added. Users can then build and
    πŸ‘€ run such a REPL for any defined target. See
    #220 and

    πŸ“š The haskell_doc rule now produces self-contained documentation bundle
    πŸ‘€ with unified index. See

    πŸ‘• haskell_lint now only lints direct dependencies. See

    βœ… haskell_doctest has been re-designed. It's now a normal rule that works
    only on direct dependencies and allows to specify modules which should be
    πŸ‘€ tested, pass custom flags to doctest executable. See

    The prebuilt_dependencies attribute of haskell_binary and
    πŸ‘€ haskell_library has been deprecated. See

  • v0.5 Changes

    April 15, 2018

    [0.5] - 2018-04-15

    βž• Added

    πŸ‘Œ Support for MacOS, courtesy of Judah Jacobson. See

    Support for data attributes in haskell_binary and haskell_library
    πŸ‘€ rules. See #167.

    πŸ— Output on building of GHC bindists so it's clearer what went wrong in case
    of a failure.

    πŸ‘€ haskell_repl rule allowing to interact with GHCi. See

    πŸ‘Œ Support for GHC 8.4.1 bindist. See

    πŸ‘• haskell_lint rule. See

    πŸ‘€ haskell_doctest rule. See

    πŸ”„ Changed

    πŸ‘Œ Improved hermeticity of builds. See

    cc_haskell_import now works with haskell_binary targets as well. See