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

SONAMEs follow different scheme than upstream (e.g. so.13.5.2 vs so.18) #69

Open
1 task done
Tracked by #277
jaimergp opened this issue Jun 10, 2022 · 6 comments
Open
1 task done
Tracked by #277
Labels

Comments

@jaimergp
Copy link
Member

jaimergp commented Jun 10, 2022

Solution to issue cannot be found in the documentation.

  • I checked the documentation.

Issue

libarchive, as packaged on conda-forge, follows a different SONAME scheme than the one suggested in upstream:

# INTERFACE_VERSION increments with every release
# libarchive 2.7 == interface version 9 = 2 + 7
# libarchive 2.8 == interface version 10 = 2 + 8
# libarchive 2.9 == interface version 11 = 2 + 9
# libarchive 3.0 == interface version 12
# libarchive 3.1 == interface version 13
math(EXPR INTERFACE_VERSION  "13 + ${_minor}")

# Set SOVERSION == Interface version
# ?? Should there be more here ??
SET(SOVERSION "${INTERFACE_VERSION}")

For 3.5.2, this means 13+5=18, so libarchive.so.18. However, the contents of the tarballs list libarchive.so.13.5.2 (?!) and, most importantly, it includes a symlink from libarchive.so.13 -> libarchive.so.13.5.2, which would make this version collide with a (correctly SONAMEd) libarchive 3.1.

Compare this to defaults:

conda-forge

libarchive-3.5.2-hb890918_2.tar.bz2
-rw-rw-r--  0 1001   1001  1818396 May 18 09:00 lib/libarchive.a
-rw-rw-r--  0 1001   1001      871 May 18 09:00 lib/pkgconfig/libarchive.pc
-rwxrwxr-x  0 1001   1001   921896 May 18 09:00 lib/libarchive.so.13.5.2
lrwxrwxrwx  0 1001   1001        0 May 18 09:00 lib/libarchive.so -> libarchive.so.13.5.2
lrwxrwxrwx  0 1001   1001        0 May 18 09:00 lib/libarchive.so.13 -> libarchive.so.13.5.2
libarchive-3.5.2-hccf745f_0.tar.bz2
lrwxrwxrwx  0 1001   1001        0 Aug 27  2021 lib/libarchive.so -> libarchive.so.13.5.2
-rw-rw-r--  0 1001   1001      871 Aug 27  2021 lib/pkgconfig/libarchive.pc
-rwxrwxr-x  0 1001   1001   916664 Aug 27  2021 lib/libarchive.so.13.5.2
lrwxrwxrwx  0 1001   1001        0 Aug 27  2021 lib/libarchive.so.13 -> libarchive.so.13.5.2
-rw-rw-r--  0 1001   1001  1808436 Aug 27  2021 lib/libarchive.a
libarchive-3.5.2-hccf745f_1.tar.bz2
lrwxrwxrwx  0 1001   1001        0 Sep 25  2021 lib/libarchive.so.13 -> libarchive.so.13.5.2
-rw-rw-r--  0 1001   1001  1808436 Sep 25  2021 lib/libarchive.a
lrwxrwxrwx  0 1001   1001        0 Sep 25  2021 lib/libarchive.so -> libarchive.so.13.5.2
-rw-rw-r--  0 1001   1001      871 Sep 25  2021 lib/pkgconfig/libarchive.pc
-rwxrwxr-x  0 1001   1001   916664 Sep 25  2021 lib/libarchive.so.13.5.2

defaults

libarchive-3.5.2-h5de8990_0.tar.bz2
-rw-rw-r--  0 0      0         930 Jun  3 13:21 lib/pkgconfig/libarchive.pc
lrwxrwxrwx  0 0      0           0 Jun  3 13:22 lib/libarchive.so -> libarchive.so.18
-rw-rw-r--  0 0      0     1813266 Jun  3 13:22 lib/libarchive.a
-rwxrwxr-x  0 0      0      912576 Jun  3 13:22 lib/libarchive.so.18

Looks like defaults relies on CMake while conda-forge uses autotools, which might explain the difference. I think the bug is that what should be an arithmetical addition (13 + 5) is being treated as a string concatenation (13 + "5.2").

Fixing this would involve rebuilding downstream packages I guess.

Installed packages

N/A

Environment info

N/A
@jaimergp jaimergp added the bug label Jun 10, 2022
@jaimergp jaimergp changed the title Linux SONAMEs follow different scheme than upstream (so.13.5.2 vs so.18) SONAMEs follow different scheme than upstream (e.g. so.13.5.2 vs so.18) Jun 10, 2022
@jaimergp
Copy link
Member Author

This is also a problem in macOS, but even worse. On macOS, the dylibs are versioned only with the base version (13, which is equivalent to 3.1), so we can't technically symlink to the correct one, because that'd be ABI breaking. It's true though that conda-forge never packaged libarchive 3.1, so... it could work as long as we never do it :D

@jaimergp
Copy link
Member Author

Details:

Defaults

$ tar -tvf libarchive-3.5.2-ha0e9c3a_0.tar.bz2| grep lib/ 
-rw-rw-r--  0 502    20    1231616 Jun  3 11:41 lib/libarchive.a
-rw-rw-r--  0 502    20        611 Jun  3 11:41 lib/pkgconfig/libarchive.pc
lrwxrwxr-x  0 502    20          0 Jun  3 11:41 lib/libarchive.dylib -> libarchive.18.dylib
-rwxrwxr-x  0 502    20     837124 Jun  3 11:41 lib/libarchive.18.dylib

conda-forge

$ tar -tvf libarchive-3.5.2-hbf7dfe4_2.tar.bz2 | grep lib/ 
-rw-rw-r--  0 501    20    1244152 May 18 09:06 lib/libarchive.a
-rw-rw-r--  0 501    20        872 May 18 09:06 lib/pkgconfig/libarchive.pc
lrwxrwxr-x  0 501    20          0 May 18 09:06 lib/libarchive.dylib -> libarchive.13.dylib
-rwxrwxr-x  0 501    20     841024 May 18 09:06 lib/libarchive.13.dylib

@jakirkham
Copy link
Member

jakirkham commented Jun 14, 2022

Think we are just using autotools to build here. So not sure why they differ

That said, know in some cases moving to CMake hasn't worked for other packages in place of autotools ( conda-forge/zeromq-feedstock#25 ) ( conda-forge/yaml-feedstock#21 ) ( conda-forge/libprotobuf-feedstock#48 )

Think we should get a better understanding of why they differ

@jaimergp
Copy link
Member Author

The same issue reported upstream libarchive/libarchive#1857

@jaimergp
Copy link
Member Author

jaimergp commented Sep 15, 2023

This keeps coming up as people mix conda-forge and defaults, and will be more prominent when libmamba becomes the solver default. I can even reproduce it with a fairly barebones setup-miniconda input (conda-incubator/setup-miniconda#291), so I'd like to come up with a solution here.

I am going to revamp #70 and see what we have to do.

@jaimergp jaimergp linked a pull request Sep 18, 2023 that will close this issue
5 tasks
@jaimergp
Copy link
Member Author

jaimergp commented Sep 18, 2023

After checking with Isuru (thanks a bunch!), we can't just use symlinks for this because ABI compatibility is not guaranteed. Instead, we'll have to:

  1. autotool/libtool's versioning was right all along, CMake was the buggy one! I sent a PR upstream to fix their CMake config (Fix SOVERSION computation logic in CMake to match libtool's libarchive/libarchive#1976).
  2. On the next minor release, change to CMake or have defaults change to autotools, but the end result is that we need to use the same system.

vbraun pushed a commit to vbraun/sage that referenced this issue Oct 19, 2023
    
<!-- ^^^^^
Please provide a concise, informative and self-explanatory title.
Don't put issue numbers in there, do this in the PR body below.
For example, instead of "Fixes sagemath#1234" use "Introduce new method to
calculate 1+1"
-->
<!-- Describe your changes here in detail -->

<!-- Why is this change required? What problem does it solve? -->
<!-- If this PR resolves an open issue, please link to it here. For
example "Fixes sagemath#12345". -->
<!-- If your change requires a documentation PR, please link it
appropriately. -->

Mamba currently has problems with dependencies installed from other
channels (libarchive/libarchive#1857,
conda-incubator/setup-miniconda#292,
conda-forge/libarchive-feedstock#69), see eg h
ttps://github.com/sagemath/sage/actions/runs/6525067702/job/17717363515.

As workaround we use miniforge now (which comes with a preinstalled
mamba from conda-forge)

### 📝 Checklist

<!-- Put an `x` in all the boxes that apply. -->
<!-- If your change requires a documentation PR, please link it
appropriately -->
<!-- If you're unsure about any of these, don't hesitate to ask. We're
here to help! -->
<!-- Feel free to remove irrelevant items. -->

- [ ] The title is concise, informative, and self-explanatory.
- [ ] The description explains in detail what this PR is about.
- [ ] I have linked a relevant issue or discussion.
- [ ] I have created tests covering the changes.
- [ ] I have updated the documentation accordingly.

### ⌛ Dependencies

<!-- List all open PRs that this PR logically depends on
- sagemath#12345: short description why this is a dependency
- sagemath#34567: ...
-->

<!-- If you're unsure about any of these, don't hesitate to ask. We're
here to help! -->
    
URL: sagemath#36468
Reported by: Tobias Diez
Reviewer(s): Isuru Fernando, Matthias Köppe
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants