From 591f4e4e52be2a59c145825510d9adbc43b06be9 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Thu, 29 Aug 2024 07:49:49 +0000 Subject: [PATCH 1/5] chore(deps): update dependency com_google_protobuf to v28 --- haskell/repositories.bzl | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/haskell/repositories.bzl b/haskell/repositories.bzl index 42a44316f..54ba5557a 100644 --- a/haskell/repositories.bzl +++ b/haskell/repositories.bzl @@ -129,10 +129,10 @@ def rules_haskell_dependencies(): maybe( http_archive, name = "com_google_protobuf", - sha256 = "22fdaf641b31655d4b2297f9981fa5203b2866f8332d3c6333f6b0107bb320de", - strip_prefix = "protobuf-21.12", + sha256 = "13e7749c30bc24af6ee93e092422f9dc08491c7097efa69461f88eb5f61805ce", + strip_prefix = "protobuf-28.0", urls = [ - "https://github.com/protocolbuffers/protobuf/archive/refs/tags/v21.12.tar.gz", + "https://github.com/protocolbuffers/protobuf/archive/refs/tags/v28.0.tar.gz", ], ) From dc931d1cdf7f0209f5ba8f7678e56f6c58110ade Mon Sep 17 00:00:00 2001 From: Claudio Bley Date: Mon, 2 Sep 2024 10:02:15 +0200 Subject: [PATCH 2/5] Specify C++14 standard for nixpkgs cc toolchain --- examples/WORKSPACE | 1 + examples/arm/WORKSPACE | 1 + non_module_dev_deps.bzl | 1 + rules_haskell_tests/non_module_deps_1.bzl | 1 + rules_haskell_tests/tests/ghcWithPackages_2097/test/WORKSPACE | 1 + .../repl/haskell_module_repl_cross_library_deps_test/WORKSPACE | 1 + .../tests/haskell_module/repl/haskell_module_repl_test/WORKSPACE | 1 + .../tests/repl-targets/hs_bin_repl_test/WORKSPACE | 1 + .../tests/repl-targets/hs_lib_repl_test/WORKSPACE | 1 + .../tests/stack-snapshot-deps/hs_override_stack_test/WORKSPACE | 1 + start | 1 + tutorial/WORKSPACE | 1 + 12 files changed, 12 insertions(+) diff --git a/examples/WORKSPACE b/examples/WORKSPACE index ef867b014..0821006ec 100644 --- a/examples/WORKSPACE +++ b/examples/WORKSPACE @@ -39,6 +39,7 @@ load("@rules_nixpkgs_python//:python.bzl", "nixpkgs_python_configure") nixpkgs_cc_configure( # Don't override the default cc toolchain needed for bindist mode. name = "nixpkgs_config_cc", + cc_std = "c++14", repository = "@rules_haskell//nixpkgs:default.nix", ) diff --git a/examples/arm/WORKSPACE b/examples/arm/WORKSPACE index 935604acf..9cb4246b1 100644 --- a/examples/arm/WORKSPACE +++ b/examples/arm/WORKSPACE @@ -57,6 +57,7 @@ nixpkgs_cc_configure( nixpkgs_cc_configure( name = "nixpkgs_config_cc_arm", attribute_path = "cc-aarch64", + cc_std = "c++14", exec_constraints = [ "@platforms//cpu:x86_64", "@platforms//os:linux", diff --git a/non_module_dev_deps.bzl b/non_module_dev_deps.bzl index bf8da3c7d..cb043e39e 100644 --- a/non_module_dev_deps.bzl +++ b/non_module_dev_deps.bzl @@ -103,6 +103,7 @@ def repositories(*, bzlmod): name = "nixpkgs_config_cc", repository = "@nixpkgs_default", register = not bzlmod, + cc_std = "c++14", ) nixpkgs_package( diff --git a/rules_haskell_tests/non_module_deps_1.bzl b/rules_haskell_tests/non_module_deps_1.bzl index 8f83ee0d0..fbdb0bb72 100644 --- a/rules_haskell_tests/non_module_deps_1.bzl +++ b/rules_haskell_tests/non_module_deps_1.bzl @@ -89,6 +89,7 @@ filegroup( name = "nixpkgs_config_cc", repository = "@nixpkgs_default", register = not bzlmod, + cc_std = "c++14", ) rules_haskell_asterius_toolchains( diff --git a/rules_haskell_tests/tests/ghcWithPackages_2097/test/WORKSPACE b/rules_haskell_tests/tests/ghcWithPackages_2097/test/WORKSPACE index 67cc9699d..531c3f6a0 100644 --- a/rules_haskell_tests/tests/ghcWithPackages_2097/test/WORKSPACE +++ b/rules_haskell_tests/tests/ghcWithPackages_2097/test/WORKSPACE @@ -24,6 +24,7 @@ load( nixpkgs_cc_configure( name = "nixpkgs_config_cc", + cc_std = "c++14", 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 d6c7eddd6..d74318e25 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 @@ -40,6 +40,7 @@ load("@rules_nixpkgs_python//:python.bzl", "nixpkgs_python_configure") nixpkgs_cc_configure( name = "nixpkgs_config_cc", + cc_std = "c++14", 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 0806ebe7b..29c90eb3e 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 @@ -41,6 +41,7 @@ load("@rules_nixpkgs_python//:python.bzl", "nixpkgs_python_configure") nixpkgs_cc_configure( name = "nixpkgs_config_cc", + cc_std = "c++14", repository = "@rules_haskell//nixpkgs:default.nix", ) 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 540122332..0813b95df 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 @@ -34,6 +34,7 @@ load( nixpkgs_cc_configure( name = "nixpkgs_config_cc", + cc_std = "c++14", 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 57d439b0a..0fc42e473 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 @@ -43,6 +43,7 @@ load( nixpkgs_cc_configure( name = "nixpkgs_config_cc", + cc_std = "c++14", 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 c85df7ab0..ae20a41ad 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 @@ -34,6 +34,7 @@ load( nixpkgs_cc_configure( name = "nixpkgs_config_cc", + cc_std = "c++14", repository = "@rules_haskell//nixpkgs:default.nix", ) diff --git a/start b/start index 7e44a57b2..de1079865 100755 --- a/start +++ b/start @@ -355,6 +355,7 @@ EOF nixpkgs_cc_configure( repository = "@nixpkgs", + cc_std = "c++14", ) nixpkgs_python_configure( diff --git a/tutorial/WORKSPACE b/tutorial/WORKSPACE index 00e9b43fb..ea49813b9 100644 --- a/tutorial/WORKSPACE +++ b/tutorial/WORKSPACE @@ -37,6 +37,7 @@ load( nixpkgs_cc_configure( # Don't override the default cc toolchain needed for bindist mode. name = "nixpkgs_config_cc", + cc_std = "c++14", repository = "@rules_haskell//nixpkgs:default.nix", ) From 02a3a7d747312ec516a46a9d75abfae6557e4fe7 Mon Sep 17 00:00:00 2001 From: Claudio Bley Date: Tue, 14 May 2024 07:49:10 +0200 Subject: [PATCH 3/5] Add `com_google_absl` to dependencies It is needed by com_google_protobuf. --- haskell/repositories.bzl | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/haskell/repositories.bzl b/haskell/repositories.bzl index 54ba5557a..4ec43fe60 100644 --- a/haskell/repositories.bzl +++ b/haskell/repositories.bzl @@ -135,6 +135,15 @@ def rules_haskell_dependencies(): "https://github.com/protocolbuffers/protobuf/archive/refs/tags/v28.0.tar.gz", ], ) + maybe( + http_archive, + name = "com_google_absl", + urls = [ + "https://github.com/abseil/abseil-cpp/releases/download/20240116.0/abseil-cpp-20240116.0.tar.gz", + ], + sha256 = "338420448b140f0dfd1a1ea3c3ce71b3bc172071f24f4d9a57d59b45037da440", + strip_prefix = "abseil-cpp-20240116.0", + ) maybe( http_archive, From eeddfc19f77eb534418db5fd8f73ff32589ecf57 Mon Sep 17 00:00:00 2001 From: Claudio Bley Date: Wed, 26 Jun 2024 10:20:06 +0200 Subject: [PATCH 4/5] Add patch for com_google_protobuf See https://github.com/protocolbuffers/protobuf/issues/16844 --- .../com_google_protobuf-protoc-dbghlp.diff | 29 +++++++++++++++++++ haskell/repositories.bzl | 6 ++++ 2 files changed, 35 insertions(+) create mode 100644 haskell/private/com_google_protobuf-protoc-dbghlp.diff diff --git a/haskell/private/com_google_protobuf-protoc-dbghlp.diff b/haskell/private/com_google_protobuf-protoc-dbghlp.diff new file mode 100644 index 000000000..133593d0d --- /dev/null +++ b/haskell/private/com_google_protobuf-protoc-dbghlp.diff @@ -0,0 +1,29 @@ +diff --git a/build_defs/cpp_opts.bzl b/build_defs/cpp_opts.bzl +index f667a4088..da463ca45 100644 +--- a/build_defs/cpp_opts.bzl ++++ b/build_defs/cpp_opts.bzl +@@ -44,6 +44,11 @@ LINK_OPTS = select({ + "-lm", + "-framework CoreFoundation", + ], ++ "@platforms//os:windows": [ ++ "-ldbghelp", ++ "-lpthread", ++ "-lm", ++ ], + "//conditions:default": [ + "-lpthread", + "-lm", +diff --git a/src/google/protobuf/port_def.inc b/src/google/protobuf/port_def.inc +index 60900d215..10c41b441 100644 +--- a/src/google/protobuf/port_def.inc ++++ b/src/google/protobuf/port_def.inc +@@ -673,7 +673,7 @@ static_assert(PROTOBUF_ABSL_MIN(20230125, 3), + #error PROTOBUF_DESCRIPTOR_WEAK_MESSAGES_ALLOWED was previously defined + #endif + #if defined(__GNUC__) && defined(__clang__) && !defined(__APPLE__) && \ +- !defined(_MSC_VER) ++ !defined(_MSC_VER) && !defined(_WIN32) + #define PROTOBUF_DESCRIPTOR_WEAK_MESSAGES_ALLOWED + #endif + diff --git a/haskell/repositories.bzl b/haskell/repositories.bzl index 4ec43fe60..c05b7fcad 100644 --- a/haskell/repositories.bzl +++ b/haskell/repositories.bzl @@ -134,6 +134,12 @@ def rules_haskell_dependencies(): urls = [ "https://github.com/protocolbuffers/protobuf/archive/refs/tags/v28.0.tar.gz", ], + patches = [ + # see https://github.com/protocolbuffers/protobuf/issues/16844 + # TODO: remove for protobuf version >= 32.0 + "@rules_haskell//haskell:private/com_google_protobuf-protoc-dbghlp.diff", + ], + patch_args = ["-p1"], ) maybe( http_archive, From 9e411b24ff66128daf97076051aee1e0cbec6d7c Mon Sep 17 00:00:00 2001 From: Claudio Bley Date: Thu, 11 Sep 2025 12:05:51 +0200 Subject: [PATCH 5/5] Drop support for Bazel 6.0.0 ``` Error: no native function or rule 'package_relative_label' ``` --- haskell/private/versions.bzl | 1 - rules_haskell_tests/MODULE.bazel | 1 - 2 files changed, 2 deletions(-) diff --git a/haskell/private/versions.bzl b/haskell/private/versions.bzl index 4428f20c8..cf090f681 100644 --- a/haskell/private/versions.bzl +++ b/haskell/private/versions.bzl @@ -14,7 +14,6 @@ # because every bazel version tested requires a lot of space on CI # See https://github.com/tweag/rules_haskell/pull/1781#issuecomment-1187640454 SUPPORTED_BAZEL_VERSIONS = [ - "6.0.0", "6.3.2", "6.5.0", "7.1.0", diff --git a/rules_haskell_tests/MODULE.bazel b/rules_haskell_tests/MODULE.bazel index 7b60b7267..aa6cc85c0 100644 --- a/rules_haskell_tests/MODULE.bazel +++ b/rules_haskell_tests/MODULE.bazel @@ -119,7 +119,6 @@ use_repo( "asterius_bundle_linux_amd64", "bazel_6", "bazel_7", - "build_bazel_bazel_6_0_0", "build_bazel_bazel_6_3_2", "build_bazel_bazel_6_5_0", "build_bazel_bazel_7_1_0",