Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: curl module provides non-functional http_only flag #2332

Closed
coryan opened this issue Jun 29, 2024 · 1 comment · Fixed by #2398
Closed

[Bug]: curl module provides non-functional http_only flag #2332

coryan opened this issue Jun 29, 2024 · 1 comment · Fixed by #2398
Labels
bug Something isn't working

Comments

@coryan
Copy link
Contributor

coryan commented Jun 29, 2024

What happened?

I want to use the curl module with https. But default this module disables https support, but it provides a http_only flag:

+bool_flag(
+ name = "http_only",
+ build_setting_default = True,
+)
+
+config_setting(
+ name = "http_only_setting",
+ flag_values = {":http_only": "true"},
+)

However, the flag has no effect. Whatever its setting https support is disabled.

Version

Development (host) and target OS/architectures:

For now Linux on x86. Eventually I need this to work on Windows, macOS, and many Linux variants.

Output of bazel --version:

bazel 7.2.1

Version of relevant rules from the WORKSPACE or MODULE.bazel file:

Language(s) and/or frameworks involved:

C++

How to reproduce

This program should work, but returns an error:

#include <iostream>
#include <curl/curl.h>

int main() {
  auto* curl = curl_easy_init();
  if (curl == nullptr) {
    std::cerr << "Error in curl_easy_init()\n";
    return 1;
  }

  curl_easy_setopt(curl, CURLOPT_URL, "https://pki.google.com/roots.pem");
    curl_easy_setopt(curl, CURLOPT_VERBOSE, 1L);

  auto res = curl_easy_perform(curl);
  if (res != CURLE_OK) {
    std::cerr << "Error in curl_easy_perform()\n";
  }
  curl_easy_cleanup(curl);
}

You also need a BUILD file:

package(default_visibility = ["//visibility:public"])

licenses(["notice"])  # Apache 2.0

cc_binary(
    name = "hello",
    srcs = ["hello.cc"],
    deps = ["@curl//:curl"]
)

And a MODULE.bazel file

module(name = "bzlmod-test")

bazel_dep(name = "curl", version = "8.7.1")

Any other information?

It seems to me that this module should have a dependency on boringssl to get https support. The BCR patch should also add USE_OPENSSL and HAVE_BORINGSSL and probably may another macros to local_defines.

@coryan coryan added the bug Something isn't working label Jun 29, 2024
@keith
Copy link
Member

keith commented Jun 30, 2024

The current issue should be fixed by either:

#2233
#1943
or #1917

the http_only flag is about disabling things like ftp, not about http vs https

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants