Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.
Sign uprustc need a way to generate versioned libraries #22399
Comments
steveklabnik
added
the
C-enhancement
label
Feb 16, 2015
This comment has been minimized.
This comment has been minimized.
|
This is effectively part of rust-lang/rfcs#600 . Right now, you need to have the exact same SHA of the compiler to use a shared library, which is why it's done this way. |
steveklabnik
closed this
Feb 16, 2015
This comment has been minimized.
This comment has been minimized.
|
I'm not 100% sure this is dependent on having a stable ABI... AIUI, this issue more related to being able to match the file format packagers expect. That is, we do currently version libraries and binaries via the included hash (it should change as versions change), but packagers expect the file format to include the trailing version numbers instead. (Maybe some are flexible enough to work with alternate versioning schemes?) Having a non-stable ABI means one cannot easily release patches for already released dynamic libraries, but I suspect we're not intending to do so for the compiler, given the short 6 week release schedule and it doesn't mean we can't be able to conform to the file format expected. That said, the lack of a non-stable ABI means that release dynamically linked Rust programs is slightly pointless. |
huonw
reopened this
Feb 16, 2015
This comment has been minimized.
This comment has been minimized.
|
A simple way to accomodate could be to having a codegen option Packagers will be able to follow their file format without too much effort. |
This comment has been minimized.
This comment has been minimized.
|
If there's an ELF Then on top of this you can have symbol versions, which lets you safely extend an SONAME and even replace old symbols with better ones. See Ulrich Drepper's How To Write Shared Libraries, especially section 3 on ABIs. That's what library versioning is really about, IMO. But Rust doesn't set any SONAME right now anyway, and shouldn't bother until there's a stable ABI. And even then, the developer has to really commit to maintaining a stable interface themselves too. |
brson
added
T-compiler
T-tools
P-low
O-linux
labels
Apr 4, 2017
Mark-Simulacrum
added
T-dev-tools
and removed
T-tools
labels
May 24, 2017
This comment has been minimized.
This comment has been minimized.
|
Triage: no movement. |
semarie commentedFeb 16, 2015
The traditionnal way for a package distribution system (think
dpkgfor Debian, orportsunder OpenBSD) to copte with upgrade of shared libraries is to have libraries with versioned number likelibfoo.so.MAJOR.MINOR.The rational for OpenBSD could be found here: http://www.openbsd.org/faq/ports/specialtopics.html#SharedLibs
It is designed for OpenBSD specifically, but it spots several issues and invalids solutions (like renaming the file after linking).
To resume the problem is (in the example of packaging
rustcprogram):libstd-4e7c5e5c.sofor example).libstd-4e7c5e5c.so(the file will change, some functions will changes, or be added or be removed).Having versioned libraries permit the package distribution system to have, at the same time, multiple version of the same library (
libstd-4e7c5e5c.so.1.0andlibstd-4e7c5e5c.so.3.1for example), and having binaries that depend of differents versions.