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

julia: stop hardcoding mbedtls sonames. #30061

Closed
wants to merge 1 commit into from

Conversation

non-Jedi
Copy link
Contributor

@non-Jedi non-Jedi commented Apr 7, 2021

When julia 1.6.0 vendors in mbedtls, it uses v2.26.0 which provides a
different set of sonames than the version provided by Void. We need to
patch where the library sonames are hardcoded to allow julia to properly
call into libraries provided by mbedtls.

Closes #29964

See JuliaLang/julia#40198 for the upstream
bug.

This patch is directly copied from Arch Linux.

General

Have the results of the proposed changes been tested?

  • I use the packages affected by the proposed changes on a regular basis and confirm this PR works for me
  • I generally don't use the affected packages but briefly tested this PR

- const libmbedtls = "libmbedtls.so.13"
- const libmbedx509 = "libmbedx509.so.1"
+ const libmbedcrypto = "libmbedcrypto.so"
+ const libmbedtls = "libmbedtls.so"
Copy link
Member

Choose a reason for hiding this comment

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

This only works on Arch because they don't have devel packages. The unversioned sonames are all in our -devel packages, not the normal ones - this solution isn't portable across distros.

For that matter, if they're using dlopen, they should very much care about the soname version: ABI mismatches cause all sorts of bugs. If my understanding of this patch is correct, I am against it. Will look at the upstream bugs to see if I can add anything there.

Copy link
Contributor Author

@non-Jedi non-Jedi Apr 7, 2021

Choose a reason for hiding this comment

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

It works for us as well; I've confirmed things work locally without mbedtls-devel installed. Julia appears to use these variables to generate the symbolic links in /usr/lib/julia.

❮ ls -l /usr/lib/julia/libmbedcrypto.so 
lrwxrwxrwx 1 root root 29 Apr  6 19:03 /usr/lib/julia/libmbedcrypto.so -> /usr/lib64/libmbedcrypto.so.3

EDIT: I clearly have no idea what I'm talking about here, but this patch definitely makes the things that don't currently work work.

Copy link
Member

Choose a reason for hiding this comment

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

I agree that forcing -devel dependencies just to drop versions from shared libraries is not desirable.

As for dlopen, the question is how Julia handles these libraries after they are loaded. If the runtime handles the possibility of missing symbols gracefully, maybe this isn't such a big deal. If not, this could be a huge deal.

@non-Jedi
Copy link
Contributor Author

non-Jedi commented Apr 7, 2021

(For reference, to test the problem this patch fixes, simply run julia -e "using MbedTLS_jll".)

When julia 1.6.0 vendors in mbedtls, it uses v2.26.0 which provides a
different set of sonames than the version provided by Void. We need to
patch where the library sonames are hardcoded to allow julia to properly
call into libraries provided by mbedtls.

Closes void-linux#29964

See <JuliaLang/julia#40198> for the upstream
bug.
non-Jedi added a commit to non-Jedi/void-packages that referenced this pull request May 6, 2021
Also change to using vendored llvm to reduce maintenance burden from julia depending on
versions of llvm which are quickly obsoleted (closes void-linux#30490); this should also fix julia's
build being broken on i686. This doesn't address void-linux#29964, and a decision should still be made
on whether to accept void-linux#30061.

[ci skip] for building llvm
@non-Jedi non-Jedi mentioned this pull request May 6, 2021
8 tasks
non-Jedi added a commit to non-Jedi/void-packages that referenced this pull request May 11, 2021
Also change to using vendored llvm to reduce maintenance burden from julia depending on
versions of llvm which are quickly obsoleted (closes void-linux#30490); this should also fix julia's
build being broken on i686.

When julia 1.6.0 vendors in mbedtls, it uses v2.26.0 which provides a different set of
sonames than the version provided by Void. We need to patch where the library sonames are
hardcoded to allow julia to properly call into libraries provided by mbedtls.

Closes void-linux#29964 and void-linux#30061

See <JuliaLang/julia#40198> for the upstream
bug.
@ahesford ahesford closed this in 93268a2 May 16, 2021
hazayan pushed a commit to hazayan/void-packages that referenced this pull request May 21, 2021
Also change to using vendored llvm to reduce maintenance burden from
julia depending on versions of llvm which are quickly obsoleted; this
should also fix julia's build being broken on i686.

When julia 1.6.0 vendors in mbedtls, it uses v2.26.0 which provides a
different set of sonames than the version provided by Void. We need to
patch where the library sonames are hardcoded to allow julia to properly
call into libraries provided by mbedtls.

[Ed.: internal references to unversioned shlibs in this patch appear to
refer to symlnks that the julia package creates in /usr/lib/julia rather
than symlinks in /usr/lib that would require -devel dependencies.]

Upstream issue: JuliaLang/julia#40198

Closes: void-linux#30703 [via git-merge-pr]
Closes: void-linux#30490
Closes: void-linux#30061
Closes: void-linux#29964
gbrlsnchs pushed a commit to gbrlsnchs/void-packages that referenced this pull request May 24, 2021
Also change to using vendored llvm to reduce maintenance burden from
julia depending on versions of llvm which are quickly obsoleted; this
should also fix julia's build being broken on i686.

When julia 1.6.0 vendors in mbedtls, it uses v2.26.0 which provides a
different set of sonames than the version provided by Void. We need to
patch where the library sonames are hardcoded to allow julia to properly
call into libraries provided by mbedtls.

[Ed.: internal references to unversioned shlibs in this patch appear to
refer to symlnks that the julia package creates in /usr/lib/julia rather
than symlinks in /usr/lib that would require -devel dependencies.]

Upstream issue: JuliaLang/julia#40198

Closes: void-linux#30703 [via git-merge-pr]
Closes: void-linux#30490
Closes: void-linux#30061
Closes: void-linux#29964
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 14, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Patch julia to no longer hardcode libmbedcrypto.so.5
3 participants