Skip to content

more flexible libcurl depext on debian/ubuntu - #30360

Open
madroach wants to merge 2 commits into
ocaml:masterfrom
madroach:libcurl-depext
Open

more flexible libcurl depext on debian/ubuntu#30360
madroach wants to merge 2 commits into
ocaml:masterfrom
madroach:libcurl-depext

Conversation

@madroach

Copy link
Copy Markdown
Contributor

libcurl4-openssl-dev works as well as the gnutls variant. Therefore depend only on the libcurl-dev virtual package, which makes sure that any variant of libcurl4-*-dev is installed.

@madroach

Copy link
Copy Markdown
Contributor Author

Hmm, the tests show this does not always work without help of the user.
Opam will now detect any installed libcurl variant.
But when libcurl is not yet installed apt-get install libcurl-dev will fail and ask the user to provide a specific package that will provide libcurl-dev.
This might be desirable behaviour. I don't know.

@avsm

avsm commented Jul 29, 2026

Copy link
Copy Markdown
Member

It's probably better from a UI perspective to have two conf packages (which depend on the variants) and let the opam solver just pick one. A user can select a concrete one to override if they have a preference, then.

@madroach

Copy link
Copy Markdown
Contributor Author

Sounds good, but how do I depend on alternatives?

@avsm

avsm commented Jul 30, 2026

Copy link
Copy Markdown
Member

Just a a | b in the depends string works

@madroach
madroach force-pushed the libcurl-depext branch 5 times, most recently from 7906b52 to 8fa1f10 Compare August 1, 2026 05:10
["sh" {os = "win32" & os-distribution != "cygwinports"} "curl-config" "--libs"]
]
depexts: [
["libcurl4-gnutls-dev"] {os-family = "debian"}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just one last request is to rename conf-libcurl.2 to a new conf-libcurl.3 (with the current content), so that existing locked packages wont be affected.

@avsm

avsm commented Aug 10, 2026

Copy link
Copy Markdown
Member

This is causing a lot of temp failures, i've restarted:


+ /usr/bin/sudo "apt-get" "install" "-qq" "-yy" "libcurl4-openssl-dev"
- E: Failed to fetch http://deb.debian.org/debian/pool/main/c/curl/libcurl4-openssl-dev_8.14.1-2%2bdeb13u4_amd64.deb  Temporary failure resolving 'deb.debian.org'
- E: Unable to fetch some archives, maybe run apt-get update or try with --fix-missing?
[ERROR] System package install failed with exit code 100 at command:
            sudo apt-get install -qq -yy libcurl4-openssl-dev
[ERROR] These packages are still missing: libcurl4-openssl-dev

[NOTE] You can retry with '--assume-depexts' to skip this check, or run 'opam option depext=false' to permanently disable handling of system packages.

@madroach
madroach force-pushed the libcurl-depext branch 5 times, most recently from 5086729 to af2e0b5 Compare September 4, 2026 02:26
Add two conf- packages depending on the OpenSSL and GnuTLS variants of libcurl.
This lets the opam resolver use whatever is available.

# Conflicts:
#	packages/conf-libcurl/conf-libcurl.3/opam
@madroach

madroach commented Sep 5, 2026

Copy link
Copy Markdown
Contributor Author

Those network failures were caused by attempts to fetch deb packages in a sandbox without network. The problem was that opam tried to switch between the openssl and gnutls variants without realizing that the underlying debian packages conflict. Noting this conflict in the opam conf- packages fixes most of the failures.

The only remaining additional CI failure in comparison to the state of the repository before this PR (af2e0b5) is a failure in testing opentelemetry-client-ocurl.0.6. This is caused by an attempt to upgrade ocurl from version 0.9.2 to transition (deprecated). All other versions of opentelemetry-client-ocurl build and test just fine. This seems to happen because opentelemetry-client-ocurl.0.6 is the only version which depends on opentelemetry-client-cohttp-lwt for testing.

However that may be — all those failures are caused by attempts to download sources in a sandbox and not by a problem with this PR. Therefore to me it seems this is ready to commit now.

@madroach
madroach force-pushed the libcurl-depext branch 2 times, most recently from da0b721 to e95ea08 Compare September 5, 2026 21:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants