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 index a738c3b6d..fd51cdfa8 100644 --- 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 @@ -1,4 +1,5 @@ load("@bazel_features//:features.bzl", "bazel_features") +load("@rules_cc//cc/common:cc_common.bzl", "cc_common") def maybe_cc_shared_library(name, **kwargs): if _has_cc_shared_library(): @@ -6,12 +7,12 @@ def maybe_cc_shared_library(name, **kwargs): native.cc_shared_library( name = shared_name, deps = [name], - **kwargs, + **kwargs ) return shared_name return name - - def _has_cc_shared_library(): + if hasattr(cc_common, "check_experimental_cc_shared_library"): + return cc_common.check_experimental_cc_shared_library() return bazel_features.globals.CcSharedLibraryInfo != None