bazelbuild / bazel-central-registry

The central registry of Bazel modules for the Bzlmod external dependency system.
https://registry.bazel.build
Apache License 2.0
233 stars 261 forks source link

Add curl 8.8.0 #2233

Closed lalten closed 2 days ago

lalten commented 4 weeks ago

https://github.com/curl/curl/releases/tag/curl-8_8_0

❯ diff -u modules/curl/8.7.1/patches modules/curl/8.8.0/patches
diff --color -u modules/curl/8.7.1/patches/add_build_file.patch modules/curl/8.8.0/patches/add_build_file.patch
--- modules/curl/8.7.1/patches/add_build_file.patch     2024-06-11 20:41:13.006463267 +0200
+++ modules/curl/8.8.0/patches/add_build_file.patch     2024-06-15 01:07:26.441881282 +0200
@@ -1,13 +1,13 @@
 diff --git a/BUILD.bazel b/BUILD.bazel
 new file mode 100644
-index 000000000..4ec0bacf5
+index 000000000..0eaa6df71
 --- /dev/null
 +++ b/BUILD.bazel
-@@ -0,0 +1,260 @@
+@@ -0,0 +1,301 @@
 +# Copyright The OpenTelemetry Authors
 +# SPDX-License-Identifier: Apache-2.0
 +
-+load("@bazel_skylib//rules:common_settings.bzl", "bool_flag")
++load("@bazel_skylib//rules:common_settings.bzl", "bool_flag", "string_flag")
 +
 +package(features = ["no_copts_tokenization"])
 +
@@ -31,6 +31,35 @@
 +    flag_values = {":http_only": "true"},
 +)
 +
++# Curl's default CA path depends on the OS. If CURL_CA_BUNDLE/CURL_CA_PATH are not set,
++# (and you don't `curl_easy_setopt(curl_, CURLOPT_CAPATH, "/etc/ssl/certs");`), curl
++# will fail to verify server certificates.
++# The string_flag below allows the user to specify their (OS-specific) default CA path
++# like `--@curl//:ca_bundle=/etc/ssl/certs/ca-certificates.crt` on the command line or
++# in .bazelrc. See also https://github.com/curl/curl/blob/curl-8_8_0/acinclude.m4#L1202
++
++string_flag(
++    name = "ca_bundle",
++    build_setting_default = "",
++    make_variable = "CURL_CA_BUNDLE",
++)
++
++config_setting(
++    name = "ca_bundle_is_unset",
++    flag_values = {":ca_bundle": ""},
++)
++
++string_flag(
++    name = "ca_path",
++    build_setting_default = "",
++    make_variable = "CURL_CA_PATH",
++)
++
++config_setting(
++    name = "ca_path_is_unset",
++    flag_values = {":ca_path": ""},
++)
++
 +_BASE_CURL_COPTS = [
 +    "-DCURL_DISABLE_LDAP=1",
 +    "-DENABLE_IPV6=1",
@@ -46,6 +75,7 @@
 +    "-DHAVE_BOOL_T=1",
 +    "-DHAVE_CLOCK_GETTIME_MONOTONIC=1",
 +    "-DHAVE_CONNECT=1",
++    "-DHAVE_DIRENT_H=1",
 +    "-DHAVE_DLFCN_H=1",
 +    "-DHAVE_ENGINE_LOAD_BUILTIN_ENGINES=1",
 +    "-DHAVE_ERRNO_H=1",
@@ -98,6 +128,7 @@
 +    "-DHAVE_NETINET_IN_H=1",
 +    "-DHAVE_NETINET_TCP_H=1",
 +    "-DHAVE_NET_IF_H=1",
++    "-DHAVE_OPENDIR=1",
 +    "-DHAVE_PIPE=1",
 +    "-DHAVE_POLL=1",
 +    "-DHAVE_POLL_FINE=1",
@@ -246,7 +277,17 @@
 +    }) + select({
 +        ":http_only_setting": ["HTTP_ONLY"],
 +        "//conditions:default": [],
++    }) + select({
++        ":ca_bundle_is_unset": [],
++        "//conditions:default": ['CURL_CA_BUNDLE=\\"$(CURL_CA_BUNDLE)\\"'],
++    }) + select({
++        ":ca_path_is_unset": [],
++        "//conditions:default": ['CURL_CA_PATH=\\"$(CURL_CA_PATH)\\"'],
 +    }),
++    toolchains = [
++        ":ca_bundle",
++        ":ca_path",
++    ],
 +    visibility = ["//visibility:public"],
 +    deps = select({
 +        ":use_mbedtls_setting": ["@mbedtls"],
diff --color -u modules/curl/8.7.1/patches/module_dot_bazel.patch modules/curl/8.8.0/patches/module_dot_bazel.patch
--- modules/curl/8.7.1/patches/module_dot_bazel.patch   2024-06-11 20:41:13.006463267 +0200
+++ modules/curl/8.8.0/patches/module_dot_bazel.patch   2024-06-15 01:06:16.856887328 +0200
@@ -1,15 +1,15 @@
 diff --git a/MODULE.bazel b/MODULE.bazel
 new file mode 100644
-index 000000000..0719ffa8a
+index 000000000..24b6c8297
 --- /dev/null
 +++ b/MODULE.bazel
 @@ -0,0 +1,9 @@
 +module(
 +    name = "curl",
-+    version = "8.7.1",
++    version = "8.8.0",
 +    compatibility_level = 0,
 +)
 +
-+bazel_dep(name = "bazel_skylib", version = "1.5.0")
++bazel_dep(name = "bazel_skylib", version = "1.7.1")
 +bazel_dep(name = "mbedtls", version = "3.6.0")
-+bazel_dep(name = "platforms", version = "0.0.8")
++bazel_dep(name = "platforms", version = "0.0.10")
bazel-io commented 4 weeks ago

Hello @keith, modules you maintain (curl) have been updated in this PR. Please review the changes.

Vertexwahn commented 4 weeks ago

FYI: With Bazel 7.2.0 we have no support for overlays - could instead of patches offer directly BUILD.bazeland MODULE.bazel via overlay

lalten commented 4 weeks ago

FYI: With Bazel 7.2.0 we have no support for overlays - could instead of patches offer directly BUILD.bazeland MODULE.bazel via overlay

looks like that isn't quite ready yet :/ https://github.com/bazelbuild/bazel-central-registry/pull/2240

keith commented 2 days ago

submitted https://github.com/bazelbuild/bazel-central-registry/pull/2381 w/ the platform defaults

lalten commented 2 days ago

submitted #2381 w/ the platform defaults

Thanks @keith !