From 7beac8911974a0e4e3b9eea39b26d42f28f735fc Mon Sep 17 00:00:00 2001 From: Yves-Stan Le Cornec Date: Wed, 11 Jan 2023 17:34:05 +0100 Subject: [PATCH 1/8] Update stardoc --- WORKSPACE | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/WORKSPACE b/WORKSPACE index f367fcca3..8d4c9cfa5 100755 --- a/WORKSPACE +++ b/WORKSPACE @@ -491,10 +491,10 @@ haskell_package_repository_dummy( http_archive( name = "io_bazel_stardoc", - sha256 = "c9794dcc8026a30ff67cf7cf91ebe245ca294b20b071845d12c192afe243ad72", + sha256 = "3fd8fec4ddec3c670bd810904e2e33170bedfe12f90adf943508184be458c8bb", urls = [ - "https://mirror.bazel.build/github.com/bazelbuild/stardoc/releases/download/0.5.0/stardoc-0.5.0.tar.gz", - "https://github.com/bazelbuild/stardoc/releases/download/0.5.0/stardoc-0.5.0.tar.gz", + "https://mirror.bazel.build/github.com/bazelbuild/stardoc/releases/download/0.5.3/stardoc-0.5.3.tar.gz", + "https://github.com/bazelbuild/stardoc/releases/download/0.5.3/stardoc-0.5.3.tar.gz", ], ) From c5da3e34518fae54936c80090d24c1cfeda4447c Mon Sep 17 00:00:00 2001 From: Yves-Stan Le Cornec Date: Thu, 12 Jan 2023 12:43:18 +0100 Subject: [PATCH 2/8] Enable --incompatible_disallow_empty_glob --- .bazelrc | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.bazelrc b/.bazelrc index b8d0f3b79..488484b3f 100644 --- a/.bazelrc +++ b/.bazelrc @@ -13,8 +13,7 @@ startup --host_jvm_args=-Djdk.tls.client.protocols=TLSv1.2 common --incompatible_require_linker_input_cc_api -# TODO enable when using Bazel >= 5, see https://github.com/tweag/rules_haskell/pull/1828 -common --incompatible_disallow_empty_glob=false +common --incompatible_disallow_empty_glob=true # test environment does not propagate locales by default some tests reads files # written in UTF8, we need to propagate the correct environment variables, such From 445d4b48378b0a4334997d04ca44b9416a560f4a Mon Sep 17 00:00:00 2001 From: Yves-Stan Le Cornec Date: Thu, 12 Jan 2023 12:46:47 +0100 Subject: [PATCH 3/8] Remove --incompatible_load_python_rules_from_bzl This is now a no-op in bazel 5 --- .bazelrc | 1 - 1 file changed, 1 deletion(-) diff --git a/.bazelrc b/.bazelrc index 488484b3f..25d522a64 100644 --- a/.bazelrc +++ b/.bazelrc @@ -106,7 +106,6 @@ build:macos-nixpkgs --incompatible_enable_cc_toolchain_resolution #build:ci --incompatible_load_cc_rules_from_bzl # Blocked by https://github.com/bazelbuild/buildtools/issues/757 #build:ci --incompatible_load_proto_rules_from_bzl -build:ci --incompatible_load_python_rules_from_bzl # This flag will become the default in bazel 5 # https://github.com/tweag/rules_haskell/issues/1657 From f26dc4c023c4c72f3eb06c2a062cf93d425b2f77 Mon Sep 17 00:00:00 2001 From: Yves-Stan Le Cornec Date: Mon, 16 Jan 2023 09:16:29 +0100 Subject: [PATCH 4/8] Update supported bazel versions --- CHANGELOG.md | 11 +++++++++++ README.md | 2 +- haskell/private/versions.bzl | 6 +++--- start | 6 +++--- 4 files changed, 18 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 160d49f36..7b5e870e4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,17 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/). +## [Unreleased] + +### Added + +* Add support for Bazel 6 + +### Removed + +* Remove support for Bazel 4 + + ## [0.16] 2022-12-06 [0.16]: https://github.com/tweag/rules_haskell/compare/v0.15...v0.16 diff --git a/README.md b/README.md index 59cfa8c57..31f1991ce 100644 --- a/README.md +++ b/README.md @@ -23,7 +23,7 @@ The full reference documentation for rules is at https://haskell.build. ## Setup -You'll need [Bazel >= 4.0][bazel-getting-started] installed. +You'll need [Bazel >= 5.0][bazel-getting-started] installed. If you are on NixOS, skip to the [Nixpkgs](#Nixpkgs) section. diff --git a/haskell/private/versions.bzl b/haskell/private/versions.bzl index 847e984f5..25ce6dbfd 100644 --- a/haskell/private/versions.bzl +++ b/haskell/private/versions.bzl @@ -14,14 +14,14 @@ # because every bazel version tested requires a lot of space on CI # See https://github.com/tweag/rules_haskell/pull/1781#issuecomment-1187640454 SUPPORTED_BAZEL_VERSIONS = [ - "4.0.0", - "4.2.2", "5.0.0", "5.2.0", + "6.0.0", ] SUPPORTED_NIXPKGS_BAZEL_PACKAGES = [ - "bazel_4", + "bazel_5", + "bazel_6", ] def _parse_version_chunk(version_chunk): diff --git a/start b/start index f8ec4784c..e4428e08b 100755 --- a/start +++ b/start @@ -9,11 +9,11 @@ set -eu # we use the default version (currently "8.10.7"). GHC_VERSION=${GHC_VERSION:="8.10.7"} -readonly MIN_BAZEL_MAJOR=4 +readonly MIN_BAZEL_MAJOR=5 readonly MIN_BAZEL_MINOR=0 -readonly MAX_BAZEL_MAJOR=5 -readonly MAX_BAZEL_MINOR=2 +readonly MAX_BAZEL_MAJOR=6 +readonly MAX_BAZEL_MINOR=0 stderr () { >&2 echo "$*" From ce6264972fa0027116ef2fad03bb0c7fd8a336c0 Mon Sep 17 00:00:00 2001 From: Yves-Stan Le Cornec Date: Thu, 12 Jan 2023 13:00:21 +0100 Subject: [PATCH 5/8] Update comment regarding incompatible_override_toolchain_transition flag --- .bazelrc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.bazelrc b/.bazelrc index 25d522a64..dacc5bf7e 100644 --- a/.bazelrc +++ b/.bazelrc @@ -107,7 +107,7 @@ build:macos-nixpkgs --incompatible_enable_cc_toolchain_resolution # Blocked by https://github.com/bazelbuild/buildtools/issues/757 #build:ci --incompatible_load_proto_rules_from_bzl -# This flag will become the default in bazel 5 +# This flag will become the default in bazel 6 # https://github.com/tweag/rules_haskell/issues/1657 build: --incompatible_override_toolchain_transition From 3be8027a8b7cc517b0ee725347c0d9b7ba84420e Mon Sep 17 00:00:00 2001 From: Yves-Stan Le Cornec Date: Fri, 13 Jan 2023 17:01:11 +0100 Subject: [PATCH 6/8] Import "private" directory for cabal_wrapper --- haskell/cabal_wrapper.bzl | 1 + 1 file changed, 1 insertion(+) diff --git a/haskell/cabal_wrapper.bzl b/haskell/cabal_wrapper.bzl index d2693e49c..c90f206e6 100644 --- a/haskell/cabal_wrapper.bzl +++ b/haskell/cabal_wrapper.bzl @@ -9,6 +9,7 @@ def cabal_wrapper(name, **kwargs): ], srcs_version = "PY3", python_version = "PY3", + imports = ["private"], deps = [ "@bazel_tools//tools/python/runfiles", ], From 18861c4b60cfc44f13f9671ec8149201fc25f835 Mon Sep 17 00:00:00 2001 From: Yves-Stan Le Cornec Date: Thu, 12 Jan 2023 13:59:18 +0100 Subject: [PATCH 7/8] Update rules_python to 0.16.2 --- haskell/repositories.bzl | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/haskell/repositories.bzl b/haskell/repositories.bzl index 21424c357..4bce9a71e 100644 --- a/haskell/repositories.bzl +++ b/haskell/repositories.bzl @@ -49,8 +49,9 @@ def rules_haskell_dependencies(): maybe( http_archive, name = "rules_python", - url = "https://github.com/bazelbuild/rules_python/releases/download/0.5.0/rules_python-0.5.0.tar.gz", - sha256 = "cd6730ed53a002c56ce4e2f396ba3b3be262fd7cb68339f0377a45e8227fe332", + sha256 = "48a838a6e1983e4884b26812b2c748a35ad284fd339eb8e2a6f3adf95307fbcd", + strip_prefix = "rules_python-0.16.2", + url = "https://github.com/bazelbuild/rules_python/archive/refs/tags/0.16.2.tar.gz", ) maybe( From b7904c9552f5dc08aa877f1c78a0469b9b2c6db4 Mon Sep 17 00:00:00 2001 From: Yves-Stan Le Cornec Date: Tue, 17 Jan 2023 08:51:53 +0100 Subject: [PATCH 8/8] Enable --incompatible_load_proto_rules_from_bzl for ci This flag will become the default in a later version of bazel --- .bazelrc | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.bazelrc b/.bazelrc index dacc5bf7e..437b6fd2e 100644 --- a/.bazelrc +++ b/.bazelrc @@ -104,8 +104,10 @@ build:macos-nixpkgs --incompatible_enable_cc_toolchain_resolution #build:ci-windows-bindist --incompatible_enable_cc_toolchain_resolution # Blocked by https://github.com/bazelbuild/bazel/issues/11704 #build:ci --incompatible_load_cc_rules_from_bzl -# Blocked by https://github.com/bazelbuild/buildtools/issues/757 -#build:ci --incompatible_load_proto_rules_from_bzl + +# This flag will become the default in a later version of bazel +# See https://github.com/bazelbuild/bazel/issues/8922 +build:ci --incompatible_load_proto_rules_from_bzl # This flag will become the default in bazel 6 # https://github.com/tweag/rules_haskell/issues/1657