Skip to content

Conversation

@juhp
Copy link
Contributor

@juhp juhp commented Sep 15, 2025

Maybe this is more acceptable? It makes the soversion equal to the nix version.

See discussions in #13960 and #13979 etc

@github-actions github-actions bot added fetching Networking with the outside (non-Nix) world, input locking c api Nix as a C library with a stable interface labels Sep 15, 2025
@juhp juhp changed the title meson: add soversion of .version to add SONAME to libs meson: add soversion with nix version to give SONAME to libs Sep 15, 2025
@juhp
Copy link
Contributor Author

juhp commented Sep 15, 2025

Hmm not good enough for MacOS: ld: malformed 32-bit x.y.z version number: 2.32.0pre

@juhp
Copy link
Contributor Author

juhp commented Sep 15, 2025

A simple workaround would be to remove the pre suffix. Do you have any others?

@Mic92
Copy link
Member

Mic92 commented Sep 15, 2025

What's the use case for having a more fine grined version here?

@juhp
Copy link
Contributor Author

juhp commented Sep 15, 2025

People were complaining that an integer SONAME version was misleading or giving expectations of API stability.
With this PR there is no such expectation, since SONAME will change with every minor release.

…3960, NixOS#13979)

remove 'pre' version suffix for non-releases (chokes Darwin ld)
@juhp juhp marked this pull request as ready for review September 15, 2025 16:14
@juhp
Copy link
Contributor Author

juhp commented Sep 15, 2025

Fedora test build: https://koji.fedoraproject.org/koji/taskinfo?taskID=137146842

An alternative to .replace() could be .strip() - I am not fluent in meson.

Copy link
Member

@Mic92 Mic92 left a comment

Choose a reason for hiding this comment

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

Tested and macOS / Linux look as expected.

% ls -la /nix/store/jk51fi97yrwl3grj97pv7gnl3ks3hxq0-nix-util-2.32.0pre/lib/
lrwxrwxrwx    - root 55 years  [libnixutil.so](http://libnixutil.so/) -> [libnixutil.so](http://libnixutil.so/).2.32.0
.r-xr-xr-x 2.0M root 55 years  [libnixutil.so](http://libnixutil.so/).2.32.0
 0x000000000000000e (SONAME)             Library soname: [[libnixutil.so](http://libnixutil.so/).2.32.0]
% ls -la
.r-xr-xr-x 4.8M root 55 years  libnixstore.2.32.0.dylib
lrwxrwxrwx    - root 55 years  libnixstore.dylib -> libnixstore.2.32.0.dylib

Copy link
Contributor

@xokdvium xokdvium left a comment

Choose a reason for hiding this comment

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

SGTM. Would be nice to deduplicate some of the code into nix-meson-build-support though

@Mic92 Mic92 merged commit 0b401e2 into NixOS:master Sep 15, 2025
14 checks passed
@juhp
Copy link
Contributor Author

juhp commented Sep 16, 2025

SGTM. Would be nice to deduplicate some of the code into nix-meson-build-support though

Okay I try a followup PR for that - good point

edit: see PR #14001

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

c api Nix as a C library with a stable interface fetching Networking with the outside (non-Nix) world, input locking

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants