From cce89802b3e2935a2de7943bef888140ce2373a5 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Thu, 14 Aug 2025 10:50:08 +0000 Subject: [PATCH 01/13] chore(deps): update dependency rules_cc to v0.2.0 --- examples/MODULE.bazel | 2 +- haskell/repositories.bzl | 6 +++--- rules_haskell_tests/MODULE.bazel | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/examples/MODULE.bazel b/examples/MODULE.bazel index ddea32506..788c0ad13 100644 --- a/examples/MODULE.bazel +++ b/examples/MODULE.bazel @@ -27,7 +27,7 @@ bazel_dep( bazel_dep( name = "rules_cc", - version = "0.0.9", + version = "0.2.0", ) bazel_dep( name = "rules_sh", diff --git a/haskell/repositories.bzl b/haskell/repositories.bzl index 7937c2fcc..64cd79e92 100644 --- a/haskell/repositories.bzl +++ b/haskell/repositories.bzl @@ -50,9 +50,9 @@ def rules_haskell_dependencies(): maybe( http_archive, name = "rules_cc", - urls = ["https://github.com/bazelbuild/rules_cc/releases/download/0.0.9/rules_cc-0.0.9.tar.gz"], - sha256 = "2037875b9a4456dce4a79d112a8ae885bbc4aad968e6587dca6e64f3a0900cdf", - strip_prefix = "rules_cc-0.0.9", + urls = ["https://github.com/bazelbuild/rules_cc/releases/download/0.2.0/rules_cc-0.2.0.tar.gz"], + sha256 = "ae244f400218f4a12ee81658ff246c0be5cb02c5ca2de5519ed505a6795431e9", + strip_prefix = "rules_cc-0.2.0", ) maybe( diff --git a/rules_haskell_tests/MODULE.bazel b/rules_haskell_tests/MODULE.bazel index e79fe7e78..6423032ee 100644 --- a/rules_haskell_tests/MODULE.bazel +++ b/rules_haskell_tests/MODULE.bazel @@ -49,7 +49,7 @@ bazel_dep( ) bazel_dep( name = "rules_cc", - version = "0.0.9", + version = "0.2.0", ) bazel_dep( name = "rules_sh", From 5ebe8c187025704005a481369ea5f3da0a1dacd3 Mon Sep 17 00:00:00 2001 From: Claudio Bley Date: Thu, 14 Aug 2025 13:31:13 +0200 Subject: [PATCH 02/13] Add rules_cc workspace setup code --- WORKSPACE | 10 ++++++++++ examples/WORKSPACE | 10 ++++++++++ examples/arm/WORKSPACE | 10 ++++++++++ rules_haskell_tests/WORKSPACE | 10 ++++++++++ tutorial/WORKSPACE | 10 ++++++++++ 5 files changed, 50 insertions(+) diff --git a/WORKSPACE b/WORKSPACE index e11dabb35..e84ca3884 100755 --- a/WORKSPACE +++ b/WORKSPACE @@ -15,6 +15,16 @@ rules_shell_dependencies() rules_shell_toolchains() +load("@rules_cc//cc:repositories.bzl", "rules_cc_dependencies", "rules_cc_toolchains") + +rules_cc_dependencies() + +rules_cc_toolchains() + +load("@rules_cc//cc:extensions.bzl", "compatibility_proxy_repo") + +compatibility_proxy_repo() + load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") http_archive( diff --git a/examples/WORKSPACE b/examples/WORKSPACE index 0821006ec..9f8989e06 100644 --- a/examples/WORKSPACE +++ b/examples/WORKSPACE @@ -14,6 +14,16 @@ load("@rules_haskell//haskell:repositories.bzl", "rules_haskell_dependencies") rules_haskell_dependencies() +load("@rules_cc//cc:repositories.bzl", "rules_cc_dependencies", "rules_cc_toolchains") + +rules_cc_dependencies() + +rules_cc_toolchains() + +load("@rules_cc//cc:extensions.bzl", "compatibility_proxy_repo") + +compatibility_proxy_repo() + load("@rules_haskell//haskell:nixpkgs.bzl", "haskell_register_ghc_nixpkgs") GHC_VERSION = "9.4.8" diff --git a/examples/arm/WORKSPACE b/examples/arm/WORKSPACE index 9cb4246b1..179bf3480 100644 --- a/examples/arm/WORKSPACE +++ b/examples/arm/WORKSPACE @@ -16,6 +16,16 @@ load( rules_haskell_dependencies() +load("@rules_cc//cc:repositories.bzl", "rules_cc_dependencies", "rules_cc_toolchains") + +rules_cc_dependencies() + +rules_cc_toolchains() + +load("@rules_cc//cc:extensions.bzl", "compatibility_proxy_repo") + +compatibility_proxy_repo() + load( "@rules_haskell//haskell:cabal.bzl", "stack_snapshot", diff --git a/rules_haskell_tests/WORKSPACE b/rules_haskell_tests/WORKSPACE index 9f4774da6..2b73b63c8 100644 --- a/rules_haskell_tests/WORKSPACE +++ b/rules_haskell_tests/WORKSPACE @@ -14,6 +14,16 @@ load("@rules_haskell//haskell:repositories.bzl", "rules_haskell_dependencies") rules_haskell_dependencies() +load("@rules_cc//cc:repositories.bzl", "rules_cc_dependencies", "rules_cc_toolchains") + +rules_cc_dependencies() + +rules_cc_toolchains() + +load("@rules_cc//cc:extensions.bzl", "compatibility_proxy_repo") + +compatibility_proxy_repo() + load("//:non_module_deps.bzl", "repositories") repositories(bzlmod = False) diff --git a/tutorial/WORKSPACE b/tutorial/WORKSPACE index ea49813b9..58ba30e37 100644 --- a/tutorial/WORKSPACE +++ b/tutorial/WORKSPACE @@ -9,6 +9,16 @@ load("@rules_haskell//haskell:repositories.bzl", "rules_haskell_dependencies") rules_haskell_dependencies() +load("@rules_cc//cc:repositories.bzl", "rules_cc_dependencies", "rules_cc_toolchains") + +rules_cc_dependencies() + +rules_cc_toolchains() + +load("@rules_cc//cc:extensions.bzl", "compatibility_proxy_repo") + +compatibility_proxy_repo() + load("@rules_haskell//haskell:nixpkgs.bzl", "haskell_register_ghc_nixpkgs") GHC_VERSION = "9.4.8" From d4f192509c7583f4ca99062451c2954c4f54f04e Mon Sep 17 00:00:00 2001 From: Claudio Bley Date: Thu, 14 Aug 2025 13:43:41 +0200 Subject: [PATCH 03/13] Add bazel_features Seems like rules_cc fails to define it in `rules_cc_dependencies`. --- haskell/repositories.bzl | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/haskell/repositories.bzl b/haskell/repositories.bzl index 64cd79e92..4fce019fd 100644 --- a/haskell/repositories.bzl +++ b/haskell/repositories.bzl @@ -47,6 +47,14 @@ def rules_haskell_dependencies(): sha256 = "6e78f0e57de26801f6f564fa7c4a48dc8b36873e416257a92bbb0937eeac8446", ) + maybe( + http_archive, + name = "bazel_features", + sha256 = "bdc12fcbe6076180d835c9dd5b3685d509966191760a0eb10b276025fcb76158", + strip_prefix = "bazel_features-1.17.0", + url = "https://github.com/bazel-contrib/bazel_features/releases/download/v1.17.0/bazel_features-v1.17.0.tar.gz", + ) + maybe( http_archive, name = "rules_cc", From 2e78084b4293dd425f50916e3b37e06132a37afc Mon Sep 17 00:00:00 2001 From: Claudio Bley Date: Thu, 14 Aug 2025 13:53:57 +0200 Subject: [PATCH 04/13] Initialize bazel_features --- WORKSPACE | 4 ++++ rules_haskell_tests/WORKSPACE | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/WORKSPACE b/WORKSPACE index e84ca3884..ae3aff501 100755 --- a/WORKSPACE +++ b/WORKSPACE @@ -21,6 +21,10 @@ rules_cc_dependencies() rules_cc_toolchains() +load("@bazel_features//:deps.bzl", "bazel_features_deps") + +bazel_features_deps() + load("@rules_cc//cc:extensions.bzl", "compatibility_proxy_repo") compatibility_proxy_repo() diff --git a/rules_haskell_tests/WORKSPACE b/rules_haskell_tests/WORKSPACE index 2b73b63c8..621824a36 100644 --- a/rules_haskell_tests/WORKSPACE +++ b/rules_haskell_tests/WORKSPACE @@ -20,6 +20,10 @@ rules_cc_dependencies() rules_cc_toolchains() +load("@bazel_features//:deps.bzl", "bazel_features_deps") + +bazel_features_deps() + load("@rules_cc//cc:extensions.bzl", "compatibility_proxy_repo") compatibility_proxy_repo() From 1bb43b17c796d0bea1490e8f7ee8e7c4cfb2e7f2 Mon Sep 17 00:00:00 2001 From: Claudio Bley Date: Thu, 14 Aug 2025 14:20:42 +0200 Subject: [PATCH 05/13] Define `host_platform` repository --- WORKSPACE | 4 ++++ rules_haskell_tests/WORKSPACE | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/WORKSPACE b/WORKSPACE index ae3aff501..54cff5daf 100755 --- a/WORKSPACE +++ b/WORKSPACE @@ -15,6 +15,10 @@ rules_shell_dependencies() rules_shell_toolchains() +load("@platforms//host:extension.bzl", "host_platform_repo") + +host_platform_repo(name = "host_platform") + load("@rules_cc//cc:repositories.bzl", "rules_cc_dependencies", "rules_cc_toolchains") rules_cc_dependencies() diff --git a/rules_haskell_tests/WORKSPACE b/rules_haskell_tests/WORKSPACE index 621824a36..666e944fb 100644 --- a/rules_haskell_tests/WORKSPACE +++ b/rules_haskell_tests/WORKSPACE @@ -14,6 +14,10 @@ load("@rules_haskell//haskell:repositories.bzl", "rules_haskell_dependencies") rules_haskell_dependencies() +load("@platforms//host:extension.bzl", "host_platform_repo") + +host_platform_repo(name = "host_platform") + load("@rules_cc//cc:repositories.bzl", "rules_cc_dependencies", "rules_cc_toolchains") rules_cc_dependencies() From 15dae473a5c8d3be88b419e274cb1ea1ea4630cd Mon Sep 17 00:00:00 2001 From: Claudio Bley Date: Mon, 18 Aug 2025 13:09:53 +0200 Subject: [PATCH 06/13] docs: Add reference to cc rules --- docs/BUILD.bazel | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/docs/BUILD.bazel b/docs/BUILD.bazel index 518ab88d4..3345c7097 100644 --- a/docs/BUILD.bazel +++ b/docs/BUILD.bazel @@ -62,6 +62,8 @@ bzl_library( deps = [ ":haskell_nix", "//haskell", + "@rules_cc//cc:find_cc_toolchain_bzl", + "@rules_cc//cc/common", "@rules_shell//shell:rules_bzl", ], ), @@ -79,6 +81,8 @@ bzl_library( deps = [ ":haskell_nix", "//haskell", + "@rules_cc//cc:find_cc_toolchain_bzl", + "@rules_cc//cc/common", "@rules_shell//shell:rules_bzl", ], ), From 2bb28cc20b15cdf0ed758365e0c31c7b8a10c26c Mon Sep 17 00:00:00 2001 From: Claudio Bley Date: Tue, 19 Aug 2025 11:33:21 +0200 Subject: [PATCH 07/13] Add rules_cc setup to start script --- start | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/start b/start index de1079865..50c6bc70e 100755 --- a/start +++ b/start @@ -282,6 +282,24 @@ load( # Setup all Bazel dependencies required by rules_haskell. rules_haskell_dependencies() +load("@platforms//host:extension.bzl", "host_platform_repo") + +host_platform_repo(name = "host_platform") + +load("@rules_cc//cc:repositories.bzl", "rules_cc_dependencies", "rules_cc_toolchains") + +rules_cc_dependencies() + +rules_cc_toolchains() + +load("@bazel_features//:deps.bzl", "bazel_features_deps") + +bazel_features_deps() + +load("@rules_cc//cc:extensions.bzl", "compatibility_proxy_repo") + +compatibility_proxy_repo() + load( "@rules_haskell//haskell:toolchain.bzl", "rules_haskell_toolchains", From 7a8d795b8ff3ac34f45a62d69edde6ec7496d51c Mon Sep 17 00:00:00 2001 From: Claudio Bley Date: Wed, 10 Sep 2025 17:39:29 +0200 Subject: [PATCH 08/13] Bump rules_cc minimal required version to 0.0.15 --- MODULE.bazel | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/MODULE.bazel b/MODULE.bazel index 96ace8fe7..4cfcb127c 100644 --- a/MODULE.bazel +++ b/MODULE.bazel @@ -22,7 +22,7 @@ bazel_dep( ) bazel_dep( name = "rules_cc", - version = "0.0.9", + version = "0.0.15", ) bazel_dep( name = "rules_nodejs", From d5cc1a68f6a2549cf3039e1dc4761ae2c7b79fca Mon Sep 17 00:00:00 2001 From: Claudio Bley Date: Thu, 20 Nov 2025 09:53:39 +0100 Subject: [PATCH 09/13] fixup! Initialize bazel_features --- examples/WORKSPACE | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/examples/WORKSPACE b/examples/WORKSPACE index 9f8989e06..04ee7cd55 100644 --- a/examples/WORKSPACE +++ b/examples/WORKSPACE @@ -20,6 +20,10 @@ rules_cc_dependencies() rules_cc_toolchains() +load("@bazel_features//:deps.bzl", "bazel_features_deps") + +bazel_features_deps() + load("@rules_cc//cc:extensions.bzl", "compatibility_proxy_repo") compatibility_proxy_repo() From 80616330028c71e4bed67ae4433713947bde8481 Mon Sep 17 00:00:00 2001 From: Claudio Bley Date: Thu, 20 Nov 2025 10:43:46 +0100 Subject: [PATCH 10/13] fixup! Define `host_platform` repository --- examples/WORKSPACE | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/examples/WORKSPACE b/examples/WORKSPACE index 04ee7cd55..6a7ae9bd6 100644 --- a/examples/WORKSPACE +++ b/examples/WORKSPACE @@ -14,6 +14,10 @@ load("@rules_haskell//haskell:repositories.bzl", "rules_haskell_dependencies") rules_haskell_dependencies() +load("@platforms//host:extension.bzl", "host_platform_repo") + +host_platform_repo(name = "host_platform") + load("@rules_cc//cc:repositories.bzl", "rules_cc_dependencies", "rules_cc_toolchains") rules_cc_dependencies() From 7c3aa2022dc96e970ed5241c60871cade0601fd4 Mon Sep 17 00:00:00 2001 From: Claudio Bley Date: Thu, 20 Nov 2025 11:18:57 +0100 Subject: [PATCH 11/13] debug --- .github/workflows/workflow.yaml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/workflow.yaml b/.github/workflows/workflow.yaml index d834b3ba3..e97161115 100644 --- a/.github/workflows/workflow.yaml +++ b/.github/workflows/workflow.yaml @@ -324,6 +324,11 @@ jobs: run: | # Quote the package specifier so that it works on Windows bazelisk test "//..." + - name: Setup tmate session + if: ${{ failure() }} + uses: mxschmitt/action-tmate@v3 + with: + limit-access-to-actor: true all_ci_tests: runs-on: ubuntu-24.04 From f1f85aa59756c4ae50ca1d7530da182494898e18 Mon Sep 17 00:00:00 2001 From: Claudio Bley Date: Thu, 20 Nov 2025 12:11:46 +0100 Subject: [PATCH 12/13] tests: Configure compat proxy and bazel features repos --- .../tests/ghcWithPackages_2097/test/WORKSPACE | 8 ++++++++ .../haskell_module_repl_cross_library_deps_test/WORKSPACE | 8 ++++++++ .../repl/haskell_module_repl_test/WORKSPACE | 8 ++++++++ .../tests/recompilation/recompilation_workspace/WORKSPACE | 8 ++++++++ .../tests/repl-targets/hs_bin_repl_test/WORKSPACE | 8 ++++++++ .../tests/repl-targets/hs_lib_repl_test/WORKSPACE | 8 ++++++++ .../stack-snapshot-deps/hs_override_stack_test/WORKSPACE | 8 ++++++++ 7 files changed, 56 insertions(+) diff --git a/rules_haskell_tests/tests/ghcWithPackages_2097/test/WORKSPACE b/rules_haskell_tests/tests/ghcWithPackages_2097/test/WORKSPACE index 531c3f6a0..0bc649cc5 100644 --- a/rules_haskell_tests/tests/ghcWithPackages_2097/test/WORKSPACE +++ b/rules_haskell_tests/tests/ghcWithPackages_2097/test/WORKSPACE @@ -28,6 +28,14 @@ nixpkgs_cc_configure( repository = "@rules_haskell//nixpkgs:default.nix", ) +load("@bazel_features//:deps.bzl", "bazel_features_deps") + +bazel_features_deps() + +load("@rules_cc//cc:extensions.bzl", "compatibility_proxy_repo") + +compatibility_proxy_repo() + nixpkgs_python_configure( repository = "@rules_haskell//nixpkgs:default.nix", ) diff --git a/rules_haskell_tests/tests/haskell_module/repl/haskell_module_repl_cross_library_deps_test/WORKSPACE b/rules_haskell_tests/tests/haskell_module/repl/haskell_module_repl_cross_library_deps_test/WORKSPACE index d74318e25..a5ff7049e 100644 --- a/rules_haskell_tests/tests/haskell_module/repl/haskell_module_repl_cross_library_deps_test/WORKSPACE +++ b/rules_haskell_tests/tests/haskell_module/repl/haskell_module_repl_cross_library_deps_test/WORKSPACE @@ -44,6 +44,14 @@ nixpkgs_cc_configure( repository = "@rules_haskell//nixpkgs:default.nix", ) +load("@bazel_features//:deps.bzl", "bazel_features_deps") + +bazel_features_deps() + +load("@rules_cc//cc:extensions.bzl", "compatibility_proxy_repo") + +compatibility_proxy_repo() + nixpkgs_python_configure( repository = "@rules_haskell//nixpkgs:default.nix", ) diff --git a/rules_haskell_tests/tests/haskell_module/repl/haskell_module_repl_test/WORKSPACE b/rules_haskell_tests/tests/haskell_module/repl/haskell_module_repl_test/WORKSPACE index 29c90eb3e..62dbe62b5 100644 --- a/rules_haskell_tests/tests/haskell_module/repl/haskell_module_repl_test/WORKSPACE +++ b/rules_haskell_tests/tests/haskell_module/repl/haskell_module_repl_test/WORKSPACE @@ -45,6 +45,14 @@ nixpkgs_cc_configure( repository = "@rules_haskell//nixpkgs:default.nix", ) +load("@bazel_features//:deps.bzl", "bazel_features_deps") + +bazel_features_deps() + +load("@rules_cc//cc:extensions.bzl", "compatibility_proxy_repo") + +compatibility_proxy_repo() + nixpkgs_python_configure( repository = "@rules_haskell//nixpkgs:default.nix", ) diff --git a/rules_haskell_tests/tests/recompilation/recompilation_workspace/WORKSPACE b/rules_haskell_tests/tests/recompilation/recompilation_workspace/WORKSPACE index 187640caa..2f9a38f81 100644 --- a/rules_haskell_tests/tests/recompilation/recompilation_workspace/WORKSPACE +++ b/rules_haskell_tests/tests/recompilation/recompilation_workspace/WORKSPACE @@ -33,3 +33,11 @@ nixpkgs_cc_configure( name = "nixpkgs_config_cc", repository = "@rules_haskell//nixpkgs:default.nix", ) + +load("@bazel_features//:deps.bzl", "bazel_features_deps") + +bazel_features_deps() + +load("@rules_cc//cc:extensions.bzl", "compatibility_proxy_repo") + +compatibility_proxy_repo() diff --git a/rules_haskell_tests/tests/repl-targets/hs_bin_repl_test/WORKSPACE b/rules_haskell_tests/tests/repl-targets/hs_bin_repl_test/WORKSPACE index 0813b95df..cb12089e4 100644 --- a/rules_haskell_tests/tests/repl-targets/hs_bin_repl_test/WORKSPACE +++ b/rules_haskell_tests/tests/repl-targets/hs_bin_repl_test/WORKSPACE @@ -38,6 +38,14 @@ nixpkgs_cc_configure( repository = "@rules_haskell//nixpkgs:default.nix", ) +load("@bazel_features//:deps.bzl", "bazel_features_deps") + +bazel_features_deps() + +load("@rules_cc//cc:extensions.bzl", "compatibility_proxy_repo") + +compatibility_proxy_repo() + nixpkgs_python_configure( repository = "@rules_haskell//nixpkgs:default.nix", ) diff --git a/rules_haskell_tests/tests/repl-targets/hs_lib_repl_test/WORKSPACE b/rules_haskell_tests/tests/repl-targets/hs_lib_repl_test/WORKSPACE index 0fc42e473..6a74f74e9 100644 --- a/rules_haskell_tests/tests/repl-targets/hs_lib_repl_test/WORKSPACE +++ b/rules_haskell_tests/tests/repl-targets/hs_lib_repl_test/WORKSPACE @@ -47,6 +47,14 @@ nixpkgs_cc_configure( repository = "@rules_haskell//nixpkgs:default.nix", ) +load("@bazel_features//:deps.bzl", "bazel_features_deps") + +bazel_features_deps() + +load("@rules_cc//cc:extensions.bzl", "compatibility_proxy_repo") + +compatibility_proxy_repo() + nixpkgs_python_configure( repository = "@rules_haskell//nixpkgs:default.nix", ) diff --git a/rules_haskell_tests/tests/stack-snapshot-deps/hs_override_stack_test/WORKSPACE b/rules_haskell_tests/tests/stack-snapshot-deps/hs_override_stack_test/WORKSPACE index ae20a41ad..4f272070f 100644 --- a/rules_haskell_tests/tests/stack-snapshot-deps/hs_override_stack_test/WORKSPACE +++ b/rules_haskell_tests/tests/stack-snapshot-deps/hs_override_stack_test/WORKSPACE @@ -38,6 +38,14 @@ nixpkgs_cc_configure( repository = "@rules_haskell//nixpkgs:default.nix", ) +load("@bazel_features//:deps.bzl", "bazel_features_deps") + +bazel_features_deps() + +load("@rules_cc//cc:extensions.bzl", "compatibility_proxy_repo") + +compatibility_proxy_repo() + nixpkgs_python_configure( repository = "@rules_haskell//nixpkgs:default.nix", ) From 1f80663bb73479e18c85fd399dcce20ee27c75d6 Mon Sep 17 00:00:00 2001 From: Claudio Bley Date: Thu, 20 Nov 2025 14:12:13 +0100 Subject: [PATCH 13/13] fixup! Add rules_cc workspace setup code --- tutorial/WORKSPACE | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/tutorial/WORKSPACE b/tutorial/WORKSPACE index 58ba30e37..4f5133202 100644 --- a/tutorial/WORKSPACE +++ b/tutorial/WORKSPACE @@ -9,12 +9,20 @@ load("@rules_haskell//haskell:repositories.bzl", "rules_haskell_dependencies") rules_haskell_dependencies() +load("@platforms//host:extension.bzl", "host_platform_repo") + +host_platform_repo(name = "host_platform") + load("@rules_cc//cc:repositories.bzl", "rules_cc_dependencies", "rules_cc_toolchains") rules_cc_dependencies() rules_cc_toolchains() +load("@bazel_features//:deps.bzl", "bazel_features_deps") + +bazel_features_deps() + load("@rules_cc//cc:extensions.bzl", "compatibility_proxy_repo") compatibility_proxy_repo()