Skip to content

Releases: tweag/rules_haskell

v1.0

23 Sep 18:34
a361943
Compare
Choose a tag to compare

Using Bzlmod with Bazel 6+

  1. Enable with common --enable_bzlmod in .bazelrc.
  2. Add to your MODULE.bazel file:
bazel_dep(name = "rules_haskell", version = "1.0")

Using WORKSPACE

Paste this snippet into your WORKSPACE.bazel file:

load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")

http_archive(
    name = "rules_haskell",
    sha256 = "4cae22bc84f327bf3cb7605021c3663160ff6bc8a0b7b6266062366bcbd19e79",
    strip_prefix = "rules_haskell-1.0",
    urls = ["https://github.com/tweag/rules_haskell/releases/download/v1.0/rules_haskell-1.0.tar.gz"],
)

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

rules_haskell_dependencies()

1.0 2024-09-23

Highlights

  • Support for Bazel 7 (see #2232)
  • Support for GHC 9.8.x (see #2132)

Added

  • Support for unit-based hie-bios script for ghc 9.4+ (See #2218)
  • Preliminary support for GHC 9.10.x (See #2198)

Fixed

  • Handle RTS library for GHC 9.4+ (See #2202)
  • Error when building cabal sub-libraries (See #2135)

Changed

  • Use ghc 9.4.6 by default
  • Use Bazel 6.5.0 by default (See #2117)
  • Update nixpkgs revision to nixos-24.05,
    note*: requires rules_nixpkgs version >= 0.12 (See #2217)
  • Asterius is deprecated and not tested anymore (See #2182)
  • No longer create empty libraries (See #2158)
  • Make static linking of haskell_cabal_binary explicit (See #2148)

Removed

  • Testing GHC 9.2.x on CI

v0.19

07 Feb 12:25
Compare
Choose a tag to compare

Using bzlmod with Bazel 6

  1. Enable with common --enable_bzlmod in .bazelrc.
  2. Add to your MODULE.bazel file:
bazel_dep(name = "rules_haskell", version = "0.19")

Using WORKSPACE

load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
http_archive(
    name = "rules_haskell",
    sha256 = "34742848a8882d94a0437b3b1917dea6f58c82fe5762afe8d249d3a36e51935d",
    strip_prefix = "rules_haskell-0.19",
    url = "https://github.com/tweag/rules_haskell/releases/download/v0.19/rules_haskell-0.19.tar.gz",
)

Highlights

  • Fix toolchain libraries creation when using ghcWithPackages (#2098)

Added

Changed

  • Upgrade rules_sh to 0.4.0 (#2103)

Fixed

v0.18

21 Dec 09:01
Compare
Choose a tag to compare

Using bzlmod with Bazel 6

  1. Enable with common --enable_bzlmod in .bazelrc.
  2. Add to your MODULE.bazel file:
bazel_dep(name = "rules_haskell", version = "0.18")

Using WORKSPACE

load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
http_archive(
    name = "rules_haskell",
    sha256 = "d1f0e1bd4f1d5e248b2882bfdc7c31a146112f9d85b9d2f0ef77e78d02ecba45",
    strip_prefix = "rules_haskell-0.18",
    url = "https://github.com/tweag/rules_haskell/releases/download/v0.18/rules_haskell-0.18.tar.gz",
)

Highlights

Changed

  • Use GHC 9.2.8 by default (See #1994)
  • Use Bazel 6.4.0 by default (See #2063)
  • start script supports bzlmod with bindists (See #2046)
  • Support Python Windows App aliases (See #2060)

Fixed

  • Error using snapshot tag from stack_snapshot module extension (See #2001)
  • Build gi-gtk from stackage (See #1752)
  • X is not a toolchain library (See #1920)

Removed

  • GHC versions < 8.10 are no longer supported (see #2093)
  • remove compiler_flags option which was deprecated since 0.14 from macros and rules
  • remove <name>-repl aliases for repl targets introduced in 0.7
  • remove deprecated nixpkgs platform aliases introduced in 0.13

v0.17

19 Oct 10:13
Compare
Choose a tag to compare

Using bzlmod with Bazel 6

  1. Enable with common --enable_bzlmod in .bazelrc.
  2. Add to your MODULE.bazel file:
bazel_dep(name = "rules_haskell", version = "0.17")

Using WORKSPACE

load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
http_archive(
    name = "rules_haskell",
    sha256 = "298f6f0db23391274b4eca215daa01797d05699469048ef94540d5829b466377",
    strip_prefix = "rules_haskell-0.17",
    url = "https://github.com/tweag/rules_haskell/archive/refs/tags/v0.17.tar.gz",
)

Highlights

  • Support Bazel's new "bzlmod" dependency system
  • Support GHC 9.2.x and 9.4.x

Changed

  • The minimum supported Bazel version is now 6.0.
  • IDE support : Output absolute paths in hie-bios flags (See #1862)
    • haskell_repl now defines an extra runable target name@bios that outputs the hie-bios flags.
    • hie_bios_path_prefix attribute for haskell_repl is a no-op now that we use absolute paths.
  • build_bazel_rules_nodejs dependency is replaced by rules_js which induces some changes to the experimental Asterius support (See [#1884]).
  • Replace use of exec_tools with semantically-identical tools (see #1925)
  • GHC 9.2 and 9.4 are supported and tested, older GHC releases only supported on a best effort basis (see #1878)

Fixed

  • Make the flags passed to Stack match Cabal (see #1913)
  • Fix include directories passed to hsc2hs (see #1922)

Added

  • Add support for Bazel 6
  • Add support for bzlmod (see #1864)
  • The provided cc_toolchain used for windows can now be used with --incompatible_enable_cc_toolchain_resolution so using the crosstool_top option is no longer necessary.
  • Add support for GHC 9.2.5 (see [#1869])
  • Add support for GHC 9.4.5 (linux, macOS) and GHC 9.6.1 (see #1890)

Removed

  • Remove support for Bazel 4

Release 0.16

06 Dec 16:42
Compare
Choose a tag to compare

WORKSPACE snippet:

load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
http_archive(
    name = "rules_haskell",
    sha256 = "2a07b55c30e526c07138c717b0343a07649e27008a873f2508ffab3074f3d4f3",
    strip_prefix = "rules_haskell-0.16",
    url = "https://github.com/tweag/rules_haskell/archive/refs/tags/v0.16.tar.gz",
)

Highlights

  • haskell_module: Avoid recompilation when ABI file did not change (see #1771)
  • Improved support for aarch64 on Darwin and Linux (see #1825)

Added

  • Add support for GHC 9.2.3 (see #1791)
  • Add support for GHC 9.2.4 (see #1814)
  • Add support for GHC 9.2.5 (see #1831)

Removed

  • Remove support for bindists of GHC versions 7.10.3, 8.0.2, 8.6.2, 8.6.3, 8.6.4, 8.8.1, 8.8.2, 8.8.3, 8.10.1 and 8.10.2 (see #1790)

Changed

  • Use node version 16 when compiling with asterius, and update rules_nodejs dependency to version 5.0.0 (see #1810)
  • Validate hidden modules (see #1796)
  • Use -pgml-supports-no-pie with GHC >= 9.4.1 (see #1804)
  • Fail with an error if package is declard twice in stack_snapshot (see #1815)

Fixed

  • Respect main_function when building a haskell module (see #1740)
  • Validate hidden modules (see #1796)

Release 0.15

22 Jul 19:41
Compare
Choose a tag to compare

Highlights

  • Support for Bazel version 5.x (see #1781)

Added

  • add use_stack() to override stack from anywhere (see #1705)
  • Add GHC 9.0.2 bindist (see #1672)

Changed

  • By default, the stack_snapshot rule now relies on stack to determine toolchain libraries.
    This can be a breaking change on windows if we rely on a stack snapshot containing Win32 <= 2.13.2.0,
    as we encounter this issue.
    In this case, to ensure the toolchain Win32 library is used (instead of trying to compile a new one),
    it can be droped from a custom stack snapshot as in the ./stackage_snapshot.yaml file.
  • Handle CPU value darwin_arm64 (see #1739)
  • Support Bazel 4.2.2 (see #1695)
  • haskell_module: Enable optimizations in opt mode (see #1708)
  • haskell_module: Pass cc toolchain linker flags when using the interpreter (see #1686)
  • Add more documentation for haskell_module (see #1688)
  • Reproducible interface files for Cabal packages with C dependencies (see #1689)
  • Handling of toolchain libraries in stack_snapshot (see #1685)
  • Expose object files of transitive dependencies when using TH (see #1680)
  • Expose dependencies of cross-library dependencies in the inputs of the build action of haskell_module (see #1678)

Fixed

  • HaskellC2Hs fails with clang: error: no input files (see #1778)
  • Fix build problems with GHC 9.x (see #1749)
  • Fix the error message in the stack version check (see #1722)
  • Fix all_files captures "bazel-*" directories (see #1674)
  • Fix computation of transitive dependencies (see #1669)
  • Don't discard dead_strip_dylibs in macos (see #1718)
  • Fix haskell_module when dependencies appear both as narrowed and not-narrowed (see #1691)
  • Fix stripPrefix for ghc 9.0.2 of win (see #1677)

v0.14

21 Dec 10:38
Compare
Choose a tag to compare

Highlights

  • Moved to exclusive support of Bazel 4
  • Support for GHC 8.8, 8.10, 9.0 and 9.2
  • Asterius support (experimental)
  • Cross-compilation support
  • haskell_module rule (experimental)

Added

  • Support for Bazel 4.1.0 and 4.2.1
  • Support for GHC 8.8.4, 8.10.3, 8.10.4, 8.10.7, 9.0.1 and 9.2.1.
  • Blacklisted empty ghc-byteorder package.
  • More reproducible GHC bindist on macOS.
    See #1462.
  • Track GHC's lib/settings as an action input by exposing a files attribute in the haskell_toolchain rule, which is used in downstream actions.
    See #1478.
  • Added ghc-bignum to the list of core packages (since GHC 9.0.1).
  • Provided a Bazel-compatible version of ghc-paths.
    See #1508.
  • Allow different repository names when registering Haskell toolchains for cross-compiling.
  • Added hsc2hs into the inputs of cabal_wrapper so it can be found when cross-compiling.
  • Support for platform constraints for GHCs in Nixpkgs.
  • Added hie_bios_path_prefix to the haskell_repl rule to allow hie-bios to output paths relative to a directory besides the workspace root.
  • Experimental haskell_module rule, with profiling, hs-boot, plugin, preprocessor, package database, dynamic build and Template Haskell support.
    See #1553.
  • Support for Cabal sublibraries, using the sublibrary_name attribute of the haskell_cabal_library rule.
  • Added generates_path_module attribute to haskell_cabal_library, such that its data files are accessible to haskell_binary rules.
    See #1575.
  • Added non_default_plugins attribute to haskell_library and haskell_binary rules to avoid setting -fplugin for every module.
  • Support for using Template Haskell and FFI with static C dependencies.
    See #1582.
  • Support for Asterius.
    See #1614, #1618, #1619, #1621, #1643 and #1660.
  • Support for sublibraries in the stack_snapshot rule.
    See #1638.
  • Support for the --incompatible_override_toolchain_transition flag.

Removed

  • Support for Bazel pre-4.0.0

Changed

  • Source file names are explicitly mapped to module names and corresponding object and interface files in Starlark. The main module is determined heuristically, but can be overridden with the main_file attribute.
    See #1281.
  • stack unpack now uses versioned packages.
    See #1455.
  • cabal_wrapper now takes its arguments as JSON.
  • Use GitHub API token in stack_snapshot pinning, if available, to avoid rate limiting.
    See #1494.
  • Invoke a runghc for the execution platform in cabal_wrapper.
  • compiler_flags options have been renamed to ghcopts in macros and rules, for consistency. The old name will still work, but has been deprecated.
  • Automatic visibility of stack_snapshot dependencies to vendored packages.
    See #1583.
  • All REPL targets are tagged as manual, so are only built on-demand.
  • Use a more deterministic distdir path in haskell_cabal_* rules to improve reproducibility.
    See #1648.

Fixed

  • stack_snapshot pinning with archives containing Cabal files located deeper down the tree.
  • A regression whereby dynamically linked binaries were missing their libraries in the runfiles.
  • Compatibility issue with macOS Big Sur.
    See #1442.

Release 0.13

20 Sep 17:17
Compare
Choose a tag to compare

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.

Release 0.12

16 Mar 14:10
Compare
Choose a tag to compare

[0.12.0] - 2020-03-16

Highlights

  • Various improvements to Windows support.

  • Support for Bazel 2.0.0

  • Minimum supported Bazel version is now 0.29, but GHC bindist is known to fail on macOS with Bazel 0.29. Please use a more recent version for macOS.

Added

  • haskell_repl now has a hie_bios output group
    See #1263
  • Added support for hrepl (a standalone binary that runs REPLS for Bazel Haskell targets).
    See #1210.
  • haskell_cabal_library, haskell_cabal_binary, and stack_snapshot now have a verbose argument, to allow suppressing their output.
    See #1208.
  • haskell_cabal_library and stack_snapshot now build the Haddock documentation if the parameter haddock is set to True (the default).
    See #1102 and #1200.
  • Added support for GHC bindist versions 8.8.3, 8.8.2, and 8.8.1.
  • Windows: support for cabal
    See #1133.
  • rules_haskell now depends on rules_sh, a toolchain for common shell commands.
    See #1117,
    #1143, and #1136 for motivation.
    See #1096 for the issue that triggered this train of thought.

Removed

  • hazel has been deleted, please use stack_snapshot instead.
    See #1158.

Changed

  • The haskell_register_toolchains() is no longer defined in haskell/repositories.bzl, load it from haskell/toolchain.bzl instead.
  • cabal wrapper: specify python3 as a requirement, to enhance error messages on macOS and reduce cache invalidations.
    See #1251, #1097, and #1096.
  • ghc_bindist and haskell_register_ghc_bindists now have
    a locale argument. Set it to circumvent issues on systems without
    the default C.UTF-8 locale.
    See #1249.
  • macOS: BAZEL_USE_CPP_ONLY_TOOLCHAIN = 1 must be set for Bazel to pick the correct C compiler.
    See #1159.
  • stack_snapshot: warning of stackage dependencies are not shown anymore, as they are irrelevant.
    See #1146 and #1026.
  • Sorted the content of generated manifest files, hereby avoid some spurious rebuilds (more builds caching).
    See #1128 and
    #1126.
  • Windows: possible race condition on stack update is now avoided, by calling stack update only once.
    See #1199 and #1090.

Fixed

  • haskell_cabal_library and haskell_library now set relative RUNPATH entries.
    See #1267
  • Fixed that GHC bindist could contain absolute RUNPATH to rts.
    See #1131.
  • Documentations of rules haskelly_library, haskell_binary, and haskell_test now show the documentation of attributes.
    See #1122.

Release 0.11

10 Oct 17:31
Compare
Choose a tag to compare

[0.11.0] - 2019-10-10

Highlights

  • Various improvements to cabal_binary/library and stack_snapshot.

  • Initial experimental Windows support for cabal_binary/library and
    stack_snapshot.

  • 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.
    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.