Community Packages

Please read this before reporting a bug:
https://wiki.archlinux.org/title/Bug_reporting_guidelines

Do NOT report bugs when a package is just outdated, or it is in the AUR. Use the 'flag out of date' link on the package page, or the Mailing List.

REPEAT: Do NOT report bugs for outdated packages!
Tasklist

FS#78928 - julia links to wrong mbedtls version

Attached to Project: Community Packages
Opened by George Tsiamasiotis (gtsiam) - Thursday, 29 June 2023, 19:46 GMT
Last edited by Antonio Rojas (arojas) - Thursday, 29 June 2023, 21:30 GMT
Task Type Bug Report
Category Packages
Status Closed
Assigned To No-one
Architecture All
Severity Medium
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No

Details

Description:

Julia's stdlib depends on mbedtls2, however mbedtls was recently upgraded to version 3. However, julia still depends on the original mbedtls package.

The julia PKGBUILD applies a patch that completely ignores versioning. So, despite the so-bump, julia is now loading `libmbedtls.so.19` (mbedtls v3) instead of `libmbedtls.so.14` (mbedtls v2), for which the bindings where generated. Weirdly it doesn't instantly crash, but it breaks Pluto.jl, a julia package I use.

Upstream bug: https://github.com/fonsp/Pluto.jl/issues/2581 (closed as in there is a workaround. Not fixed.).

Additional info:
* julia 2:1.9.1-2
* mbedtls 3.4.0-3
* mbedtls2 2.28.3-3

Steps to reproduce:

1. Install & run julia
2. In the repl, run `import Pkg; Pkg.add("Pluto")`. This will take a while.
3. Again, in the repl: `import Pluto; Pluto.run()`. A browser window should pop up.
4. In the browser, open the dev tools > console. You will see errors along the lines of "Socket did an oopsie" (firefox)
This task depends upon

Closed by  Antonio Rojas (arojas)
Thursday, 29 June 2023, 21:30 GMT
Reason for closing:  Fixed
Additional comments about closing:  Fixed in 1.9.1-3, thanks for the patch
Comment by George Tsiamasiotis (gtsiam) - Thursday, 29 June 2023, 20:36 GMT
Ok, I managed to patch the julia PKGBUILD locally to fix this. I was going to link to a fork of julia in the archlinux gitlab but I cannot push yet it seems :P.

Modifying LD_LIBRARY_PATH makes libwhich (used by the julia makefiles) search in /usr/lib/mbedtls2 and a symlink is created to the corresponding library in /usr/lib/julia.

Building locally gives some errors about libfakeroot.so? Does makepkg use LD_LIBRARY_PATH?
ERROR: ld.so: object 'libfakeroot.so' from LD_PRELOAD cannot be preloaded (cannot open shared object file): ignored.

No idea what that is about, but the patch should at least help you get started. I assume you know more about makepkg than I do :)

Anyway, with the patched PKBUILD I get:
```
ls -l /usr/lib/julia/libmbed*
lrwxrwxrwx 1 root root 39 Ιουν 29 23:14 /usr/lib/julia/libmbedcrypto.so -> /usr/lib/mbedtls2/../libmbedcrypto.so.7
lrwxrwxrwx 1 root root 37 Ιουν 29 23:14 /usr/lib/julia/libmbedtls.so -> /usr/lib/mbedtls2/../libmbedtls.so.14
lrwxrwxrwx 1 root root 37 Ιουν 29 23:14 /usr/lib/julia/libmbedx509.so -> /usr/lib/mbedtls2/../libmbedx509.so.1
```

And pluto works just fine.

Loading...