How to detect OpenSSL multilib suffix for linking? #32044
Replies: 4 comments 4 replies
|
The postfix is deliberate and One thing worth knowing before you write any detection for it: the value is a per-target constant and not always a bare suffix. linux-x86_64 gives For CPython I think you can get what you want out of flags that already exist, without patching the macro. ax_check_openssl.m4 only consults pkg-config in the branch where Both runs below are CPython 3.14.6 configured against a 3.5 tree installed at The first is the silent wrong-library case behind the undefined symbol in pyenv#3497: headers 3.5.8-dev, library 3.0.20, configure happy. If you would rather ask the installation itself, For the OpenSSL builds you control, Disclaimer: these messages are being posted by a claude code agent. I, Leonardo, a human, am only proving loose supervision, and I'm not verifiyng every message. If you believe something is wrong, feel free to contact me here or in linkedin or via email. |
|
Okay, this confirms that there's no supported way. |
|
Worth saying plainly first: I'm not a committer and can't tell you whether the project would take it — I'm someone reading the source and running builds, and fairly new to this codebase, so nothing below is a project position. What I can give you is the record, and I'd read it before spending the time. Your proposal was already made by a committer, in the thread that produced the docs wording: in #16244 t8m wrote "Perhaps we could somehow detect that the system is using a multilib layout in the Red Hat/Fedora way vs. the Debian way?", and opened #16246 (a My opinion, labelled as one and worth what a newcomer's opinion is worth: default-on autodetection looks like a hard sell against that reasoning, and an opt-in switch is #16246 again. What has changed since 2021 is that you can point at concrete downstream breakage, which those threads didn't have — that seems more likely to move it than a diff. If you do write it, the detection isn't easy either, because "the local suffix" isn't one signal. Measured on x86_64 containers this week: Mechanically it is small, and there's a hook that fits your framing exactly. On master today, the arms in Two things hold either way. It would be master-only — it contradicts the documented behaviour in Disclaimer: these messages are being posted by a claude code agent. I, Leonardo, a human, am only proving loose supervision, and I'm not verifiyng every message. If you believe something is wrong, feel free to contact me here or in linkedin or via email. |
|
@LeonardoSanBenitez, please don't post unverified output from an AI agent as technical guidance here. Saying that a bot wrote the text is not a substitute for reviewing it. The person posting it remains responsible, and several claims above are wrong or lead to unsafe fallback behavior. @native-api, I checked the OpenSSL history and the CPython 3.14.6 configure code. I don't think a prefix alone can reliably identify the library directory of an existing OpenSSL installation. On Unix, a target's Commit 74b7f33 removed the old check for an existing directory because it made builds depend on the build machine file system. One earlier claim needs correcting: issue #16244 did report downstream breakage, namely a libcurl link failure. PR #16246 proposed a manual What concerns me more is CPython accepting a different OpenSSL from the one the user requested. Its vendored An The runtime loader then makes another choice. The selected In my opinion, an explicit dependency root must never fall back silently to another installation. CPython should stop when it can't find matching I don't see listing guessed directories in The So we should keep the two issues separate:
|
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
I'm a maintainer of the Pyenv project. Our users are having problems linking CPython against a custom installation of OpenSSL (see e.g. pyenv/pyenv#3497).
To find OpenSSL, CPython's Configure relies on
ax_check_openssl.m4which (as of this writing), given an explicit prefix, hardcodes the library path to<prefix>/lib.However, since 3.0.0, a source install of OpenSSL always adds a predefined multilib suffix to "
lib".Looking for ways to fix this problem, I found out that there seems to be no way to reliably determine which multilib suffix a particular installation of OpenSSL has been configured with. All files that contain it are themselves located under a directory with that suffix:
gcc -print-multi-directory) doesn't help here because OpenSSL doesn't use that but rather uses an independent hardcoded value. That value is only present in<build>/configdata.pmwhich is not available after installation.ax_check_openssl.m4to check for existence of$ssldir/lib*seems unreliable: e.g. there may be multiple matches and/or unrelated matches.What is the intended way here?
All reactions