Changelog History
Page 1
-
v0.14.0 Changes
December 21, 2021Highlights
- π 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 afiles
attribute in thehaskell_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 ofcabal_wrapper
so it can be found when cross-compiling. - π Support for platform constraints for GHCs in Nixpkgs.
- Added
hie_bios_path_prefix
to thehaskell_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 thehaskell_cabal_library
rule. - Added
generates_path_module
attribute tohaskell_cabal_library
, such that its data files are accessible tohaskell_binary
rules. See #1575. - 0οΈβ£ Added
non_default_plugins
attribute tohaskell_library
andhaskell_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. #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 themain_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 incabal_wrapper
. compiler_flags
options have been renamed toghcopts
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 inhaskell_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.
-
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 makesbazel 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 Changes
March 16, 2020Highlights
π 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 ahie_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
, andstack_snapshot
now have averbose
argument, to allow suppressing their output. See #1208.haskell_cabal_library
andstack_snapshot
now build the Haddock documentation if the parameterhaddock
is set toTrue
(the default). See #1102 and #1200.- β Added support for GHC bindist versions
8.8.3
,8.8.2
, and8.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 usestack_snapshot
instead. See #1158.
π Changed
- The
haskell_register_toolchains()
is no longer defined inhaskell/repositories.bzl
, load it fromhaskell/toolchain.bzl
instead. cabal
wrapper: specifypython3
as a requirement, to enhance error messages on macOS and reduce cache invalidations. See #1251, #1097, and #1096.ghc_bindist
andhaskell_register_ghc_bindists
now have alocale
argument. Set it to circumvent issues on systems without the defaultC.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 callingstack update
only once. See #1199 and #1090.
π Fixed
-
v0.11.0 Changes
October 10, 2019Highlights
Various improvements to
cabal_binary/library
andstack_snapshot
.π Initial experimental Windows support for
cabal_binary/library
andstack_snapshot
.[
start
](./start) script for setting uprules_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 usehaskell/defs.bzl
instead.
π Changed
- The
deps
attribute tostack_snapshot
has been replaced by theextra_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. Seestack_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 anymorehaskell_cabal_library
no longer buildsexe
components, speeding up builds. See #1095.- Haddock information for protobuf rules generates correctly. See #1108.
-
v0.10.0 Changes
September 03, 2019Highlights
- π 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 yourWORKSPACE
file to match this, as well as your.bazelrc.local
file, if any.haskell_cabal_library
/haskell_cabal_binary
: Both usecabal
to build Haskell package dependencies.stack_snapshot
: Uses stackβs dependency resolving algorithm to generatehaskell_cabal_library
targets automatically. Requiresstack
> 2.1, which it will download if cannot be found inPATH
.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]: https://docs.bazel.build/versions/master/skylark/deploying.html
β Added
haskell_cabal_library
/haskell_cabal_binary
. See #879, #898 and #904.stack_snapshot
. See #887 (name changed tostack_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 corehaskell_*
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 atoolchain
definition. You must now define yourself ahaskell_toolchain
and atoolchain
separately. This should be a mostly transparent change, because nearly no one uses these functions directly. They are normally only used transitively viahaskell_register_toolchains
and related functions. See #843. - π The
haskell/haskell.bzl
entrypoint is deprecated. usehaskell/defs.bzl
instead. - π The
haskell_repositories()
macro is deprecated. Userules_haskell_dependencies()
fromhaskell/repositories.bzl
instead. - The
haskell_register_toolchains()
macro is deprecated. Userules_haskell_toolchains()
fromhaskell/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 namereexported_modules
. See #1008.@
is allowed in Haskell binary names.haskell_library
may be empty (no files insrcs
). 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
andhaskell_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 supportrepository
argument andnixopts
.- 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
andsed
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 inghci
See #1046.
π Improved
-
v0.9.1 Changes
June 03, 2019π Fixed
- π Bindists were broken on MacOS.
π See 884.
- π Bindists were broken on MacOS.
-
v0.9 Changes
May 07, 2019Highlights
π 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 theproject 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
andhaskell_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 aplugins
attribute. It takes a
list of bazel targets, which should behaskell_library
s 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 onhazel
, please use a recentmaster
commit
ofrules_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 ofrules_haskell
.haskell_import
has been renamed tohaskell_toolchain_library
.
This is a substantial breaking change. But adapting to it should be
as simple assed -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.0οΈβ£ 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 tohaskell_*
rules to load GHC plugins.
π See #799. - The
HaskellInfo
andHaskellLibraryInfo
providers are now
exported and thus accessible by downstream rules.
π See #844. - Generate version macros for preprocessors (
c2hs
,hsc2hs
).
π See #847. bindist_toolchain
rule getshaddock_flags
andrepl_ghci_args
attributes.- π
@repl
targets write json file with build information, usable by
IDE tools.
π See #695.
π Deprecated
haskell_cc_import
; usecc_library
instead.
π See #831.cc_haskell_import
; just usehaskell_library
like acc_library
.
π See #831.
π Fixed
-
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
theREADME
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
inbazel
versions, via the--all_incompatible_changes
flag.
π See #613.
β Removed
- The
generate_so
attribute ofhaskell_binary
andhaskell_test
π has been completely superseded bylinkstatic
in the last release
π and became a no-op, so it is removed. - The
main_file
attribute ofhaskell_binary
andhaskell_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.
π Usehaskell_import
instead (see docs for usage). - π The
extra_binaries
field is now no longer supported.
π Changed
ghc_bindist
now requires atarget
argument. Use
haskell_register_ghc_nixpkgs
to callghc_bindist
once per known
target.
π See #610.ghc_bindist
now registers itself as a toolchain. We no longer
require a separate toolchain definition and registration in addition
toghc_bindist
.
π See #610.- π
c2hs
support is now provided in a separate toolchain called
c2hs_toolchain
, rather than an optional extra to the
haskell_toolchain
.
π See #590. - π Rename bindist arch names so they are the same as in
rules_go/nodejs
.
π Fixed
- Prevent duplicate installs of bazel_skylib
π See #536. - β
Test suite now executes all binaries, various runtime errors were
uncovered.
π 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 calledfoo@repl
. It was previously calledfoo-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
-
v0.6 Changes
July 21, 2018[0.6] - 2018-07-21
β Added
π Protocol buffers integration using
proto-lens
. See
#239.strip_include_prefix
attribute to thehaskell_cc_import
rule. See
#241.π Support for
c2hs
files. See
#351.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 thehaskell_toolchain
rule. See
#282.π A Haskell library for looking up runfiles. See
#302.β A separate toolchain for
doctest
βhaskell_doctest_toolchain
. See
#310.The
compiler_flags
attribute to thehaskell_toolchain
rule allowing to
π specify default compiler flags. See
#315.The ability to set locale to be used during compilation by adding the
locale
andlocale_archive
attributes tohaskell_toolchain
. See
#328.π Proper support for profiling. See
#332.The
repl_ghci_args
attribute to thehaskell_toolchain
rule. See
#334.The
haskell_import
rule allowing us to make specifying dependencies more
π uniform and to deprecate theprebuilt_dependencies
attribute. See
#337.π Fixed
π Template Haskell linking against
cc_library
. See
#218.π Linking issues on MacOS. See
#221.π¦ GHC packages that correspond to targets with the same name but in
π different Bazel packages no longer clash. See
#219.π Build breakage on MacOS when XCode is not installed. See
#223.π Bug preventing Haddock generation because of missing dynamic shared
π libraries when targets have TH in them. See
#226.π¦ Hyperlinks between targets contained in different Bazel packages
π (Haddocks). See #231.π Generated source files do not cause issues now. See
#211.π
data
attributes now allow files in them. See
#236.π 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
#268.π Bug that allowed us avoid specifying certain
prebuilt_dependencies
if
π they were already specified for transitive dependencies. See
#286.π Bug that was making modules generated from
.hsc
and.chs
files and
π generated modules in general not available in the REPLs. See
#323.π 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
#225.π The
haskell_doc
rule now produces self-contained documentation bundle
π with unified index. See
#249.π
haskell_lint
now only lints direct dependencies. See
#293.β
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 todoctest
executable. See
#342.The
prebuilt_dependencies
attribute ofhaskell_binary
and
πhaskell_library
has been deprecated. See
#355.