From 97963ec2f5c55fbb6dbad14c7024bf36d8387f6c 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/12] chore(deps): update dependency rules_cc to v0.2.0 --- examples/MODULE.bazel | 2 +- haskell/repositories.bzl | 3 +++ rules_haskell_tests/MODULE.bazel | 2 +- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/examples/MODULE.bazel b/examples/MODULE.bazel index 14229de8b..5e33dc93d 100644 --- a/examples/MODULE.bazel +++ b/examples/MODULE.bazel @@ -31,7 +31,7 @@ bazel_dep( bazel_dep( name = "rules_cc", - version = "0.1.1", + version = "0.2.0", ) bazel_dep( name = "rules_sh", diff --git a/haskell/repositories.bzl b/haskell/repositories.bzl index 7a1af3c44..9531d7484 100644 --- a/haskell/repositories.bzl +++ b/haskell/repositories.bzl @@ -80,6 +80,9 @@ def rules_haskell_dependencies(): urls = [ "https://github.com/bazelbuild/rules_java/releases/download/6.3.0/rules_java-6.3.0.tar.gz", ], + 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 1071d500a..074fd8956 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.1.1", + version = "0.2.0", ) bazel_dep( name = "rules_sh", From d02fc5bf333377f928a6b2912f59eebd3ad7108a Mon Sep 17 00:00:00 2001 From: Claudio Bley Date: Thu, 14 Aug 2025 13:31:13 +0200 Subject: [PATCH 02/12] 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 0d7779d9d..60b7aac44 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 60e3ed3ae..a1c4d9dbc 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 1557839efa76dbeae2bb968737355e038f1389bd Mon Sep 17 00:00:00 2001 From: Claudio Bley Date: Thu, 14 Aug 2025 13:43:41 +0200 Subject: [PATCH 03/12] Add bazel_features Seems like rules_cc fails to define it in `rules_cc_dependencies`. From 7fc757931a77532615b6180dc91ab5c1510de6ee Mon Sep 17 00:00:00 2001 From: Claudio Bley Date: Thu, 14 Aug 2025 13:53:57 +0200 Subject: [PATCH 04/12] Initialize bazel_features --- WORKSPACE | 4 ++++ rules_haskell_tests/WORKSPACE | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/WORKSPACE b/WORKSPACE index 60b7aac44..48623f9bb 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 a1c4d9dbc..40573618c 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 0ef277a368ae20cd781ab6ddfb2375e61ca79ba7 Mon Sep 17 00:00:00 2001 From: Claudio Bley Date: Thu, 14 Aug 2025 14:20:42 +0200 Subject: [PATCH 05/12] Define `host_platform` repository --- WORKSPACE | 4 ++++ rules_haskell_tests/WORKSPACE | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/WORKSPACE b/WORKSPACE index 48623f9bb..fae911b3a 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 40573618c..d5cddab58 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 1e577249cb4bdfad337ce5b3c8716eacaadd5ddc Mon Sep 17 00:00:00 2001 From: Claudio Bley Date: Mon, 18 Aug 2025 13:09:53 +0200 Subject: [PATCH 06/12] docs: Add reference to cc rules --- docs/BUILD.bazel | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/docs/BUILD.bazel b/docs/BUILD.bazel index 0e5cbb7e1..076a16093 100644 --- a/docs/BUILD.bazel +++ b/docs/BUILD.bazel @@ -30,7 +30,7 @@ libraries = { "@com_google_protobuf//bazel:cc_proto_library_bzl", "@com_google_protobuf//bazel/common:proto_info_bzl", "@rules_cc//cc/common", - "@rules_cc//cc/toolchains:srcs", + "@rules_cc//cc/toolchains:toolchain_rules", "@rules_java//java:rules", "@rules_shell//shell:rules_bzl", "//haskell", @@ -39,7 +39,7 @@ libraries = { "@com_google_protobuf//bazel:cc_proto_library_bzl", "@com_google_protobuf//bazel/common:proto_info_bzl", "@rules_cc//cc/common", - "@rules_cc//cc/toolchains:srcs", + "@rules_cc//cc/toolchains:toolchain_rules", "@rules_java//java:rules", "//haskell", ], @@ -47,7 +47,7 @@ libraries = { "@com_google_protobuf//bazel:cc_proto_library_bzl", "@com_google_protobuf//bazel/common:proto_info_bzl", "@rules_cc//cc/common", - "@rules_cc//cc/toolchains:srcs", + "@rules_cc//cc/toolchains:toolchain_rules", "@rules_proto//proto:defs", "//haskell", ], @@ -61,7 +61,7 @@ libraries = { "@com_google_protobuf//bazel:cc_proto_library_bzl", "@com_google_protobuf//bazel/common:proto_info_bzl", "@rules_cc//cc/common", - "@rules_cc//cc/toolchains:srcs", + "@rules_cc//cc/toolchains:toolchain_rules", "@rules_java//java:rules", "@rules_proto//proto:defs", "//haskell", @@ -69,7 +69,7 @@ libraries = { "c2hs": [ "@com_google_protobuf//bazel:cc_proto_library_bzl", "@rules_cc//cc/common", - "@rules_cc//cc/toolchains:srcs", + "@rules_cc//cc/toolchains:toolchain_rules", "//haskell", ], } From c7cf5d78368132404e807a79acb79992c4490ce8 Mon Sep 17 00:00:00 2001 From: Claudio Bley Date: Tue, 19 Aug 2025 11:33:21 +0200 Subject: [PATCH 07/12] Add rules_cc setup to start script --- start | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/start b/start index faf25c704..e80bba28c 100755 --- a/start +++ b/start @@ -280,6 +280,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 098346e4f04d621c72bda29001f9c2f67272d686 Mon Sep 17 00:00:00 2001 From: Claudio Bley Date: Thu, 20 Nov 2025 09:53:39 +0100 Subject: [PATCH 08/12] 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 9ce27a04c752cd9b5d5779bc617d8126aaf53536 Mon Sep 17 00:00:00 2001 From: Claudio Bley Date: Thu, 20 Nov 2025 10:43:46 +0100 Subject: [PATCH 09/12] 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 22baf275b1fd981fbbd05e507b1dfb451e112250 Mon Sep 17 00:00:00 2001 From: Claudio Bley Date: Thu, 20 Nov 2025 11:18:57 +0100 Subject: [PATCH 10/12] debug --- .github/workflows/workflow.yaml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/workflow.yaml b/.github/workflows/workflow.yaml index 845ef6450..e8f580eaf 100644 --- a/.github/workflows/workflow.yaml +++ b/.github/workflows/workflow.yaml @@ -342,6 +342,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 32e073a4702e459512546ef8f17661eacf2c27c0 Mon Sep 17 00:00:00 2001 From: Claudio Bley Date: Thu, 20 Nov 2025 12:11:46 +0100 Subject: [PATCH 11/12] 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 5fda6b280..44d8679ef 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 @@ -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/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 68e1dc09f..005c0306f 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 97701bf880af0a396c6ed12749c9dacba5d26690 Mon Sep 17 00:00:00 2001 From: Claudio Bley Date: Thu, 20 Nov 2025 14:12:13 +0100 Subject: [PATCH 12/12] 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()