From a8cfa2346c39eb4da1c9e00d84b6d2b431e8c87a Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Thu, 2 Apr 2026 22:00:52 +0000 Subject: [PATCH 1/2] chore(deps): update dependency bazel_features to v1.45.0 --- .../tests/repl-targets/hs_lib_repl_test/WORKSPACE | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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..8898af0da 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 @@ -151,9 +151,9 @@ register_toolchains( 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", + sha256 = "adfdb3cffab3a99a63363d844d559a81965d2b61a6062dd51a3d2478d416768f", + strip_prefix = "bazel_features-1.45.0", + url = "https://github.com/bazel-contrib/bazel_features/releases/download/v1.45.0/bazel_features-v1.45.0.tar.gz", ) load("@bazel_features//:deps.bzl", "bazel_features_deps") From be04f84d621b8cb042487ebe460c46e714c428bb Mon Sep 17 00:00:00 2001 From: Claudio Bley Date: Wed, 15 Apr 2026 10:38:41 +0200 Subject: [PATCH 2/2] Assume cc_shared_library is available Going forward, we rely on cc_shared_library to be available. It is experimental in Bazel 6.x but generally available in later Bazel versions. Remove bazel_features dependency again and simply use cc_shared_library directly in repl-targets/hs_lib_repl_test. --- .bazelrc.common | 1 + .../integration_testing/IntegrationTesting.hs | 2 +- .../repl-targets/hs_lib_repl_test/BUILD.bazel | 8 +++++--- .../tests/repl-targets/hs_lib_repl_test/WORKSPACE | 11 ----------- .../hs_lib_repl_test/maybe_cc_shared_library.bzl | 15 --------------- 5 files changed, 7 insertions(+), 30 deletions(-) delete mode 100644 rules_haskell_tests/tests/repl-targets/hs_lib_repl_test/maybe_cc_shared_library.bzl diff --git a/.bazelrc.common b/.bazelrc.common index 6d8fa4fd1..81dfc396e 100644 --- a/.bazelrc.common +++ b/.bazelrc.common @@ -16,6 +16,7 @@ startup --host_jvm_args=-Djdk.tls.client.protocols=TLSv1.2 common --incompatible_require_linker_input_cc_api common --incompatible_disallow_empty_glob=true +common --experimental_cc_shared_library # test environment does not propagate locales by default some tests reads files # written in UTF8, we need to propagate the correct environment variables, such diff --git a/rules_haskell_tests/tests/integration_testing/IntegrationTesting.hs b/rules_haskell_tests/tests/integration_testing/IntegrationTesting.hs index fdec589b8..c4ddc8708 100644 --- a/rules_haskell_tests/tests/integration_testing/IntegrationTesting.hs +++ b/rules_haskell_tests/tests/integration_testing/IntegrationTesting.hs @@ -78,7 +78,7 @@ generateBazelRc dir = do \ build:linux-bindist --incompatible_enable_cc_toolchain_resolution \n\ \ build:macos-bindist --incompatible_enable_cc_toolchain_resolution \n\ \ build:windows-bindist --incompatible_enable_cc_toolchain_resolution \n\ -\ common --enable_platform_specific_config \n\ +\ common --enable_platform_specific_config --experimental_cc_shared_library \n\ \ common:macos --repo_env=BAZEL_USE_CPP_ONLY_TOOLCHAIN=1 \n\ \ common:windows --repo_env=BAZEL_DO_NOT_DETECT_CPP_TOOLCHAIN=1 \n\ \ ") diff --git a/rules_haskell_tests/tests/repl-targets/hs_lib_repl_test/BUILD.bazel b/rules_haskell_tests/tests/repl-targets/hs_lib_repl_test/BUILD.bazel index dea4818d8..2727ff5a3 100644 --- a/rules_haskell_tests/tests/repl-targets/hs_lib_repl_test/BUILD.bazel +++ b/rules_haskell_tests/tests/repl-targets/hs_lib_repl_test/BUILD.bazel @@ -4,7 +4,6 @@ load( "haskell_library", "haskell_toolchain_library", ) -load(":maybe_cc_shared_library.bzl", "maybe_cc_shared_library") [ haskell_toolchain_library(name = name) @@ -43,7 +42,10 @@ cc_library( visibility = ["//visibility:public"], ) -library_name = maybe_cc_shared_library(name = "ourclibrary") +cc_shared_library( + name = "ourclibrary_shared", + deps = ["ourclibrary"], +) config_setting( name = "nix", @@ -75,7 +77,7 @@ haskell_library( deps = [ ":array", ":base", + ":ourclibrary_shared", ":zlib", - library_name, ], ) 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 8898af0da..68e1dc09f 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 @@ -148,14 +148,3 @@ stack_snapshot( register_toolchains( ":c2hs-toolchain", ) - -http_archive( - name = "bazel_features", - sha256 = "adfdb3cffab3a99a63363d844d559a81965d2b61a6062dd51a3d2478d416768f", - strip_prefix = "bazel_features-1.45.0", - url = "https://github.com/bazel-contrib/bazel_features/releases/download/v1.45.0/bazel_features-v1.45.0.tar.gz", -) - -load("@bazel_features//:deps.bzl", "bazel_features_deps") - -bazel_features_deps() diff --git a/rules_haskell_tests/tests/repl-targets/hs_lib_repl_test/maybe_cc_shared_library.bzl b/rules_haskell_tests/tests/repl-targets/hs_lib_repl_test/maybe_cc_shared_library.bzl deleted file mode 100644 index 2d9078911..000000000 --- a/rules_haskell_tests/tests/repl-targets/hs_lib_repl_test/maybe_cc_shared_library.bzl +++ /dev/null @@ -1,15 +0,0 @@ -load("@bazel_features//:features.bzl", "bazel_features") - -def maybe_cc_shared_library(name, **kwargs): - if _has_cc_shared_library(): - shared_name = "%s_shared" % name - native.cc_shared_library( - name = shared_name, - deps = [name], - **kwargs - ) - return shared_name - return name - -def _has_cc_shared_library(): - return bazel_features.globals.CcSharedLibraryInfo != None