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 0fc42e473..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 = "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", -) - -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