Why don't Unix/Linux systems traverse through directories until they find the required version of a linked library? The 2019 Stack Overflow Developer Survey Results Are InConfusion about linking boost library while compilationIs it possible to configure dynamic loader for an executableI am getting an error while loading shared libraries libXm.so.3Satisfying lib dependencyError while building snipersim: “relocation R_X86_64_32S against `.rodata.str1.1' can not be used when making a shared object; recompile with -fPIC”How do I find the libraries this program needs for its environment variable?How to regain access to the lost user , linux3 , of two side by side Ubuntu 16.04 instances?Where do C# executables running on an Ubuntu Linux 16.04 desktop which use source code that DLLImport's shared objects look for them at runtime?Cannot find shared object file even though it's in library pathPlaced library in /usr/lib, but ldconfig doesn't put it in cache

Why are there uneven bright areas in this photo of black hole?

Keeping a retro style to sci-fi spaceships?

Correct punctuation for showing a character's confusion

If I score a critical hit on an 18 or higher, what are my chances of getting a critical hit if I roll 3d20?

How do you keep chess fun when your opponent constantly beats you?

How can I add encounters in the Lost Mine of Phandelver campaign without giving PCs too much XP?

How to charge AirPods to keep battery healthy?

Did the UK government pay "millions and millions of dollars" to try to snag Julian Assange?

What is the meaning of Triage in Cybersec world?

Ubuntu Server install with full GUI

How did passengers keep warm on sail ships?

Kerning for subscripts of sigma?

Why can't devices on different VLANs, but on the same subnet, communicate?

For what reasons would an animal species NOT cross a *horizontal* land bridge?

Getting crown tickets for Statue of Liberty

What do these terms in Caesar's Gallic wars mean?

What's the name of these plastic connectors

How to obtain a position of last non-zero element

Can a flute soloist sit?

Pokemon Turn Based battle (Python)

The phrase "to the numbers born"?

If I can cast sorceries at instant speed, can I use sorcery-speed activated abilities at instant speed?

How can I define good in a religion that claims no moral authority?

Is it possible for absolutely everyone to attain enlightenment?



Why don't Unix/Linux systems traverse through directories until they find the required version of a linked library?



The 2019 Stack Overflow Developer Survey Results Are InConfusion about linking boost library while compilationIs it possible to configure dynamic loader for an executableI am getting an error while loading shared libraries libXm.so.3Satisfying lib dependencyError while building snipersim: “relocation R_X86_64_32S against `.rodata.str1.1' can not be used when making a shared object; recompile with -fPIC”How do I find the libraries this program needs for its environment variable?How to regain access to the lost user , linux3 , of two side by side Ubuntu 16.04 instances?Where do C# executables running on an Ubuntu Linux 16.04 desktop which use source code that DLLImport's shared objects look for them at runtime?Cannot find shared object file even though it's in library pathPlaced library in /usr/lib, but ldconfig doesn't put it in cache



.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;








16















I have a binary executable named "alpha" that requires a linked library (libz.so.1.2.7) which is placed at /home/username/myproduct/lib/libz.so.1.2.7



I export the same to my terminal instance before spawning my binary executable by executing the following command.



export LD_LIBRARY_PATH=/home/username/myproduct/lib/:$LD_LIBRARY_PATH


Now, when I spawn another application "bravo" that requires the same library but of different version, i.e (libz.so.1.2.8) which is available in
/lib/x86_64-linux-gnu/libz.so.1.2.8, system throws the following error.



version `ZLIB_1.2.3.3' not found (required by /usr/lib/x86_64-linux-gnu/libxml2.so.2)


If I unset the LD_LIBRARY_PATH, "bravo" starts up fine. I understand that the above behaviour is because LD_LIBRARY_PATH takes precedence over the directory paths defined in /etc/ld.so.conf while looking for linked libraries and consequently the above error occurred. I am just curious about why have not the developers of UNIX/LINUX designed the OS to search for linked libraries in other directories according to the hierarchy if the first instance of library is of different version.



Simply put, UNIX/LINUX systems traverse through a set of directories until it finds the required library. But why does it not do the same until it finds the expected version rather than accepting the first instance of library irrespective of its version?










share|improve this question









New contributor




daedalus_hamlet is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.




















  • I'm not quite sure, but I'd guess for security. I personally would rather not have to worry about a sym-link anywhere on my machines

    – Joe
    2 days ago











  • @Joe Many of the libraries themselves have symlinks pointing to them. libz.so.1 is a symlink to libz.so.1.2.8

    – Nasir Riley
    2 days ago

















16















I have a binary executable named "alpha" that requires a linked library (libz.so.1.2.7) which is placed at /home/username/myproduct/lib/libz.so.1.2.7



I export the same to my terminal instance before spawning my binary executable by executing the following command.



export LD_LIBRARY_PATH=/home/username/myproduct/lib/:$LD_LIBRARY_PATH


Now, when I spawn another application "bravo" that requires the same library but of different version, i.e (libz.so.1.2.8) which is available in
/lib/x86_64-linux-gnu/libz.so.1.2.8, system throws the following error.



version `ZLIB_1.2.3.3' not found (required by /usr/lib/x86_64-linux-gnu/libxml2.so.2)


If I unset the LD_LIBRARY_PATH, "bravo" starts up fine. I understand that the above behaviour is because LD_LIBRARY_PATH takes precedence over the directory paths defined in /etc/ld.so.conf while looking for linked libraries and consequently the above error occurred. I am just curious about why have not the developers of UNIX/LINUX designed the OS to search for linked libraries in other directories according to the hierarchy if the first instance of library is of different version.



Simply put, UNIX/LINUX systems traverse through a set of directories until it finds the required library. But why does it not do the same until it finds the expected version rather than accepting the first instance of library irrespective of its version?










share|improve this question









New contributor




daedalus_hamlet is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.




















  • I'm not quite sure, but I'd guess for security. I personally would rather not have to worry about a sym-link anywhere on my machines

    – Joe
    2 days ago











  • @Joe Many of the libraries themselves have symlinks pointing to them. libz.so.1 is a symlink to libz.so.1.2.8

    – Nasir Riley
    2 days ago













16












16








16


1






I have a binary executable named "alpha" that requires a linked library (libz.so.1.2.7) which is placed at /home/username/myproduct/lib/libz.so.1.2.7



I export the same to my terminal instance before spawning my binary executable by executing the following command.



export LD_LIBRARY_PATH=/home/username/myproduct/lib/:$LD_LIBRARY_PATH


Now, when I spawn another application "bravo" that requires the same library but of different version, i.e (libz.so.1.2.8) which is available in
/lib/x86_64-linux-gnu/libz.so.1.2.8, system throws the following error.



version `ZLIB_1.2.3.3' not found (required by /usr/lib/x86_64-linux-gnu/libxml2.so.2)


If I unset the LD_LIBRARY_PATH, "bravo" starts up fine. I understand that the above behaviour is because LD_LIBRARY_PATH takes precedence over the directory paths defined in /etc/ld.so.conf while looking for linked libraries and consequently the above error occurred. I am just curious about why have not the developers of UNIX/LINUX designed the OS to search for linked libraries in other directories according to the hierarchy if the first instance of library is of different version.



Simply put, UNIX/LINUX systems traverse through a set of directories until it finds the required library. But why does it not do the same until it finds the expected version rather than accepting the first instance of library irrespective of its version?










share|improve this question









New contributor




daedalus_hamlet is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.












I have a binary executable named "alpha" that requires a linked library (libz.so.1.2.7) which is placed at /home/username/myproduct/lib/libz.so.1.2.7



I export the same to my terminal instance before spawning my binary executable by executing the following command.



export LD_LIBRARY_PATH=/home/username/myproduct/lib/:$LD_LIBRARY_PATH


Now, when I spawn another application "bravo" that requires the same library but of different version, i.e (libz.so.1.2.8) which is available in
/lib/x86_64-linux-gnu/libz.so.1.2.8, system throws the following error.



version `ZLIB_1.2.3.3' not found (required by /usr/lib/x86_64-linux-gnu/libxml2.so.2)


If I unset the LD_LIBRARY_PATH, "bravo" starts up fine. I understand that the above behaviour is because LD_LIBRARY_PATH takes precedence over the directory paths defined in /etc/ld.so.conf while looking for linked libraries and consequently the above error occurred. I am just curious about why have not the developers of UNIX/LINUX designed the OS to search for linked libraries in other directories according to the hierarchy if the first instance of library is of different version.



Simply put, UNIX/LINUX systems traverse through a set of directories until it finds the required library. But why does it not do the same until it finds the expected version rather than accepting the first instance of library irrespective of its version?







libraries dynamic-linking shared-library ld






share|improve this question









New contributor




daedalus_hamlet is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.











share|improve this question









New contributor




daedalus_hamlet is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.









share|improve this question




share|improve this question








edited 2 days ago









Stephen Kitt

181k25414492




181k25414492






New contributor




daedalus_hamlet is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.









asked 2 days ago









daedalus_hamletdaedalus_hamlet

865




865




New contributor




daedalus_hamlet is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.





New contributor





daedalus_hamlet is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.






daedalus_hamlet is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.












  • I'm not quite sure, but I'd guess for security. I personally would rather not have to worry about a sym-link anywhere on my machines

    – Joe
    2 days ago











  • @Joe Many of the libraries themselves have symlinks pointing to them. libz.so.1 is a symlink to libz.so.1.2.8

    – Nasir Riley
    2 days ago

















  • I'm not quite sure, but I'd guess for security. I personally would rather not have to worry about a sym-link anywhere on my machines

    – Joe
    2 days ago











  • @Joe Many of the libraries themselves have symlinks pointing to them. libz.so.1 is a symlink to libz.so.1.2.8

    – Nasir Riley
    2 days ago
















I'm not quite sure, but I'd guess for security. I personally would rather not have to worry about a sym-link anywhere on my machines

– Joe
2 days ago





I'm not quite sure, but I'd guess for security. I personally would rather not have to worry about a sym-link anywhere on my machines

– Joe
2 days ago













@Joe Many of the libraries themselves have symlinks pointing to them. libz.so.1 is a symlink to libz.so.1.2.8

– Nasir Riley
2 days ago





@Joe Many of the libraries themselves have symlinks pointing to them. libz.so.1 is a symlink to libz.so.1.2.8

– Nasir Riley
2 days ago










1 Answer
1






active

oldest

votes


















27















But why does it not do the same until it finds the expected version rather than accepting the first instance of library irrespective of its version?




It does, as far as it’s aware. zlib.so.1.2.7 and zlib.so.1.2.8 both have an soname of zlib.so.1, so your alpha and bravo binaries say they need zlib.so.1. The dynamic loader loads the first matching library it finds; it doesn’t know that version 1.2.8 provides additional symbols which bravo needs. (This is why distributions take pains to specify additional dependency information, such as zlib1g (>= 1.2.8) for bravo.)



You might think this should be easy to fix, but it isn’t, not least because binaries and libraries list the symbols they need separately from the libraries they need, so the loader can’t check that a given library provides all the symbols that are needed from it. Symbols can be provided in a variety of ways, and introducing a link between symbols and the libraries providing them could break existing binaries. There’s also the added fun of symbol interposition to complicate things (and make security-sensitive developers tear their hair out).



Some libraries provide version information which ends up being stored in .gnu.version_r, with a link to the providing library, which would help here, but libz isn’t one of them.



(Given the sonames, I’d expect your alpha binary to work fine with zlib.so.1.2.8.)






share|improve this answer

























  • And one should note as well that GNU-style library versioning is different from the semantic(-ish) versioning with which we are most accustomed. Since they have the same "current" number, 1, zlib.so.1.2.8 should not provide any features that zlib.so.1.2.7 does not, hence it ought not to matter (from an ABI perspective) which one is found. That it does matter should be considered a flaw.

    – John Bollinger
    2 days ago







  • 4





    @John no, the only guarantee is that libraries with the same soname are backwards-compatible; newer libraries can add features, they can’t remove any or change any in a backwards-incompatible fashion. That is to say, a binary built against zlib 1.2.7 will work with that or any newer zlib 1; but a binary built against zlib 1.2.8 won’t necessarily work with an older zlib 1. (And semantic versioning allows that; but soname handling isn’t semantic versioning.)

    – Stephen Kitt
    2 days ago







  • 1





    I'm talking specifically about GNU conventions, as I said, and I guess about libtool in particular. Not every project follows that convention, so perhaps it's too strong to call zlib flawed, but on the other hand, even a semantic-versioning interpretation of the library version numbers involved would come to the same conclusion. Forwards (binary) compatibility in such cases is not a promise inherent in the soname, but it is a reasonable expectation in this case.

    – John Bollinger
    2 days ago







  • 1





    Yes, I well understand the relationship between CRA numbers and SOVERSION, which comes back around to my original point: the situation described by the OP seems to be inconsistent with correct usage of the CRA scheme. Avoiding problems such as the OP's is one of the key objectives of that scheme. If zlib adds a new (version of a) binary interface, then its C number ought to be increased. That such a bump may lead to a soversion bump as well is secondary.

    – John Bollinger
    2 days ago







  • 2





    @John right, I suspect we’re in violent agreement and that I misunderstood the point you were making. zlib doesn’t use libtool anyway, except on Darwin where it’s ar ;-).

    – Stephen Kitt
    2 days ago











Your Answer








StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "106"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);

else
createEditor();

);

function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);



);






daedalus_hamlet is a new contributor. Be nice, and check out our Code of Conduct.









draft saved

draft discarded


















StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f511380%2fwhy-dont-unix-linux-systems-traverse-through-directories-until-they-find-the-re%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown

























1 Answer
1






active

oldest

votes








1 Answer
1






active

oldest

votes









active

oldest

votes






active

oldest

votes









27















But why does it not do the same until it finds the expected version rather than accepting the first instance of library irrespective of its version?




It does, as far as it’s aware. zlib.so.1.2.7 and zlib.so.1.2.8 both have an soname of zlib.so.1, so your alpha and bravo binaries say they need zlib.so.1. The dynamic loader loads the first matching library it finds; it doesn’t know that version 1.2.8 provides additional symbols which bravo needs. (This is why distributions take pains to specify additional dependency information, such as zlib1g (>= 1.2.8) for bravo.)



You might think this should be easy to fix, but it isn’t, not least because binaries and libraries list the symbols they need separately from the libraries they need, so the loader can’t check that a given library provides all the symbols that are needed from it. Symbols can be provided in a variety of ways, and introducing a link between symbols and the libraries providing them could break existing binaries. There’s also the added fun of symbol interposition to complicate things (and make security-sensitive developers tear their hair out).



Some libraries provide version information which ends up being stored in .gnu.version_r, with a link to the providing library, which would help here, but libz isn’t one of them.



(Given the sonames, I’d expect your alpha binary to work fine with zlib.so.1.2.8.)






share|improve this answer

























  • And one should note as well that GNU-style library versioning is different from the semantic(-ish) versioning with which we are most accustomed. Since they have the same "current" number, 1, zlib.so.1.2.8 should not provide any features that zlib.so.1.2.7 does not, hence it ought not to matter (from an ABI perspective) which one is found. That it does matter should be considered a flaw.

    – John Bollinger
    2 days ago







  • 4





    @John no, the only guarantee is that libraries with the same soname are backwards-compatible; newer libraries can add features, they can’t remove any or change any in a backwards-incompatible fashion. That is to say, a binary built against zlib 1.2.7 will work with that or any newer zlib 1; but a binary built against zlib 1.2.8 won’t necessarily work with an older zlib 1. (And semantic versioning allows that; but soname handling isn’t semantic versioning.)

    – Stephen Kitt
    2 days ago







  • 1





    I'm talking specifically about GNU conventions, as I said, and I guess about libtool in particular. Not every project follows that convention, so perhaps it's too strong to call zlib flawed, but on the other hand, even a semantic-versioning interpretation of the library version numbers involved would come to the same conclusion. Forwards (binary) compatibility in such cases is not a promise inherent in the soname, but it is a reasonable expectation in this case.

    – John Bollinger
    2 days ago







  • 1





    Yes, I well understand the relationship between CRA numbers and SOVERSION, which comes back around to my original point: the situation described by the OP seems to be inconsistent with correct usage of the CRA scheme. Avoiding problems such as the OP's is one of the key objectives of that scheme. If zlib adds a new (version of a) binary interface, then its C number ought to be increased. That such a bump may lead to a soversion bump as well is secondary.

    – John Bollinger
    2 days ago







  • 2





    @John right, I suspect we’re in violent agreement and that I misunderstood the point you were making. zlib doesn’t use libtool anyway, except on Darwin where it’s ar ;-).

    – Stephen Kitt
    2 days ago















27















But why does it not do the same until it finds the expected version rather than accepting the first instance of library irrespective of its version?




It does, as far as it’s aware. zlib.so.1.2.7 and zlib.so.1.2.8 both have an soname of zlib.so.1, so your alpha and bravo binaries say they need zlib.so.1. The dynamic loader loads the first matching library it finds; it doesn’t know that version 1.2.8 provides additional symbols which bravo needs. (This is why distributions take pains to specify additional dependency information, such as zlib1g (>= 1.2.8) for bravo.)



You might think this should be easy to fix, but it isn’t, not least because binaries and libraries list the symbols they need separately from the libraries they need, so the loader can’t check that a given library provides all the symbols that are needed from it. Symbols can be provided in a variety of ways, and introducing a link between symbols and the libraries providing them could break existing binaries. There’s also the added fun of symbol interposition to complicate things (and make security-sensitive developers tear their hair out).



Some libraries provide version information which ends up being stored in .gnu.version_r, with a link to the providing library, which would help here, but libz isn’t one of them.



(Given the sonames, I’d expect your alpha binary to work fine with zlib.so.1.2.8.)






share|improve this answer

























  • And one should note as well that GNU-style library versioning is different from the semantic(-ish) versioning with which we are most accustomed. Since they have the same "current" number, 1, zlib.so.1.2.8 should not provide any features that zlib.so.1.2.7 does not, hence it ought not to matter (from an ABI perspective) which one is found. That it does matter should be considered a flaw.

    – John Bollinger
    2 days ago







  • 4





    @John no, the only guarantee is that libraries with the same soname are backwards-compatible; newer libraries can add features, they can’t remove any or change any in a backwards-incompatible fashion. That is to say, a binary built against zlib 1.2.7 will work with that or any newer zlib 1; but a binary built against zlib 1.2.8 won’t necessarily work with an older zlib 1. (And semantic versioning allows that; but soname handling isn’t semantic versioning.)

    – Stephen Kitt
    2 days ago







  • 1





    I'm talking specifically about GNU conventions, as I said, and I guess about libtool in particular. Not every project follows that convention, so perhaps it's too strong to call zlib flawed, but on the other hand, even a semantic-versioning interpretation of the library version numbers involved would come to the same conclusion. Forwards (binary) compatibility in such cases is not a promise inherent in the soname, but it is a reasonable expectation in this case.

    – John Bollinger
    2 days ago







  • 1





    Yes, I well understand the relationship between CRA numbers and SOVERSION, which comes back around to my original point: the situation described by the OP seems to be inconsistent with correct usage of the CRA scheme. Avoiding problems such as the OP's is one of the key objectives of that scheme. If zlib adds a new (version of a) binary interface, then its C number ought to be increased. That such a bump may lead to a soversion bump as well is secondary.

    – John Bollinger
    2 days ago







  • 2





    @John right, I suspect we’re in violent agreement and that I misunderstood the point you were making. zlib doesn’t use libtool anyway, except on Darwin where it’s ar ;-).

    – Stephen Kitt
    2 days ago













27












27








27








But why does it not do the same until it finds the expected version rather than accepting the first instance of library irrespective of its version?




It does, as far as it’s aware. zlib.so.1.2.7 and zlib.so.1.2.8 both have an soname of zlib.so.1, so your alpha and bravo binaries say they need zlib.so.1. The dynamic loader loads the first matching library it finds; it doesn’t know that version 1.2.8 provides additional symbols which bravo needs. (This is why distributions take pains to specify additional dependency information, such as zlib1g (>= 1.2.8) for bravo.)



You might think this should be easy to fix, but it isn’t, not least because binaries and libraries list the symbols they need separately from the libraries they need, so the loader can’t check that a given library provides all the symbols that are needed from it. Symbols can be provided in a variety of ways, and introducing a link between symbols and the libraries providing them could break existing binaries. There’s also the added fun of symbol interposition to complicate things (and make security-sensitive developers tear their hair out).



Some libraries provide version information which ends up being stored in .gnu.version_r, with a link to the providing library, which would help here, but libz isn’t one of them.



(Given the sonames, I’d expect your alpha binary to work fine with zlib.so.1.2.8.)






share|improve this answer
















But why does it not do the same until it finds the expected version rather than accepting the first instance of library irrespective of its version?




It does, as far as it’s aware. zlib.so.1.2.7 and zlib.so.1.2.8 both have an soname of zlib.so.1, so your alpha and bravo binaries say they need zlib.so.1. The dynamic loader loads the first matching library it finds; it doesn’t know that version 1.2.8 provides additional symbols which bravo needs. (This is why distributions take pains to specify additional dependency information, such as zlib1g (>= 1.2.8) for bravo.)



You might think this should be easy to fix, but it isn’t, not least because binaries and libraries list the symbols they need separately from the libraries they need, so the loader can’t check that a given library provides all the symbols that are needed from it. Symbols can be provided in a variety of ways, and introducing a link between symbols and the libraries providing them could break existing binaries. There’s also the added fun of symbol interposition to complicate things (and make security-sensitive developers tear their hair out).



Some libraries provide version information which ends up being stored in .gnu.version_r, with a link to the providing library, which would help here, but libz isn’t one of them.



(Given the sonames, I’d expect your alpha binary to work fine with zlib.so.1.2.8.)







share|improve this answer














share|improve this answer



share|improve this answer








edited 2 days ago

























answered 2 days ago









Stephen KittStephen Kitt

181k25414492




181k25414492












  • And one should note as well that GNU-style library versioning is different from the semantic(-ish) versioning with which we are most accustomed. Since they have the same "current" number, 1, zlib.so.1.2.8 should not provide any features that zlib.so.1.2.7 does not, hence it ought not to matter (from an ABI perspective) which one is found. That it does matter should be considered a flaw.

    – John Bollinger
    2 days ago







  • 4





    @John no, the only guarantee is that libraries with the same soname are backwards-compatible; newer libraries can add features, they can’t remove any or change any in a backwards-incompatible fashion. That is to say, a binary built against zlib 1.2.7 will work with that or any newer zlib 1; but a binary built against zlib 1.2.8 won’t necessarily work with an older zlib 1. (And semantic versioning allows that; but soname handling isn’t semantic versioning.)

    – Stephen Kitt
    2 days ago







  • 1





    I'm talking specifically about GNU conventions, as I said, and I guess about libtool in particular. Not every project follows that convention, so perhaps it's too strong to call zlib flawed, but on the other hand, even a semantic-versioning interpretation of the library version numbers involved would come to the same conclusion. Forwards (binary) compatibility in such cases is not a promise inherent in the soname, but it is a reasonable expectation in this case.

    – John Bollinger
    2 days ago







  • 1





    Yes, I well understand the relationship between CRA numbers and SOVERSION, which comes back around to my original point: the situation described by the OP seems to be inconsistent with correct usage of the CRA scheme. Avoiding problems such as the OP's is one of the key objectives of that scheme. If zlib adds a new (version of a) binary interface, then its C number ought to be increased. That such a bump may lead to a soversion bump as well is secondary.

    – John Bollinger
    2 days ago







  • 2





    @John right, I suspect we’re in violent agreement and that I misunderstood the point you were making. zlib doesn’t use libtool anyway, except on Darwin where it’s ar ;-).

    – Stephen Kitt
    2 days ago

















  • And one should note as well that GNU-style library versioning is different from the semantic(-ish) versioning with which we are most accustomed. Since they have the same "current" number, 1, zlib.so.1.2.8 should not provide any features that zlib.so.1.2.7 does not, hence it ought not to matter (from an ABI perspective) which one is found. That it does matter should be considered a flaw.

    – John Bollinger
    2 days ago







  • 4





    @John no, the only guarantee is that libraries with the same soname are backwards-compatible; newer libraries can add features, they can’t remove any or change any in a backwards-incompatible fashion. That is to say, a binary built against zlib 1.2.7 will work with that or any newer zlib 1; but a binary built against zlib 1.2.8 won’t necessarily work with an older zlib 1. (And semantic versioning allows that; but soname handling isn’t semantic versioning.)

    – Stephen Kitt
    2 days ago







  • 1





    I'm talking specifically about GNU conventions, as I said, and I guess about libtool in particular. Not every project follows that convention, so perhaps it's too strong to call zlib flawed, but on the other hand, even a semantic-versioning interpretation of the library version numbers involved would come to the same conclusion. Forwards (binary) compatibility in such cases is not a promise inherent in the soname, but it is a reasonable expectation in this case.

    – John Bollinger
    2 days ago







  • 1





    Yes, I well understand the relationship between CRA numbers and SOVERSION, which comes back around to my original point: the situation described by the OP seems to be inconsistent with correct usage of the CRA scheme. Avoiding problems such as the OP's is one of the key objectives of that scheme. If zlib adds a new (version of a) binary interface, then its C number ought to be increased. That such a bump may lead to a soversion bump as well is secondary.

    – John Bollinger
    2 days ago







  • 2





    @John right, I suspect we’re in violent agreement and that I misunderstood the point you were making. zlib doesn’t use libtool anyway, except on Darwin where it’s ar ;-).

    – Stephen Kitt
    2 days ago
















And one should note as well that GNU-style library versioning is different from the semantic(-ish) versioning with which we are most accustomed. Since they have the same "current" number, 1, zlib.so.1.2.8 should not provide any features that zlib.so.1.2.7 does not, hence it ought not to matter (from an ABI perspective) which one is found. That it does matter should be considered a flaw.

– John Bollinger
2 days ago






And one should note as well that GNU-style library versioning is different from the semantic(-ish) versioning with which we are most accustomed. Since they have the same "current" number, 1, zlib.so.1.2.8 should not provide any features that zlib.so.1.2.7 does not, hence it ought not to matter (from an ABI perspective) which one is found. That it does matter should be considered a flaw.

– John Bollinger
2 days ago





4




4





@John no, the only guarantee is that libraries with the same soname are backwards-compatible; newer libraries can add features, they can’t remove any or change any in a backwards-incompatible fashion. That is to say, a binary built against zlib 1.2.7 will work with that or any newer zlib 1; but a binary built against zlib 1.2.8 won’t necessarily work with an older zlib 1. (And semantic versioning allows that; but soname handling isn’t semantic versioning.)

– Stephen Kitt
2 days ago






@John no, the only guarantee is that libraries with the same soname are backwards-compatible; newer libraries can add features, they can’t remove any or change any in a backwards-incompatible fashion. That is to say, a binary built against zlib 1.2.7 will work with that or any newer zlib 1; but a binary built against zlib 1.2.8 won’t necessarily work with an older zlib 1. (And semantic versioning allows that; but soname handling isn’t semantic versioning.)

– Stephen Kitt
2 days ago





1




1





I'm talking specifically about GNU conventions, as I said, and I guess about libtool in particular. Not every project follows that convention, so perhaps it's too strong to call zlib flawed, but on the other hand, even a semantic-versioning interpretation of the library version numbers involved would come to the same conclusion. Forwards (binary) compatibility in such cases is not a promise inherent in the soname, but it is a reasonable expectation in this case.

– John Bollinger
2 days ago






I'm talking specifically about GNU conventions, as I said, and I guess about libtool in particular. Not every project follows that convention, so perhaps it's too strong to call zlib flawed, but on the other hand, even a semantic-versioning interpretation of the library version numbers involved would come to the same conclusion. Forwards (binary) compatibility in such cases is not a promise inherent in the soname, but it is a reasonable expectation in this case.

– John Bollinger
2 days ago





1




1





Yes, I well understand the relationship between CRA numbers and SOVERSION, which comes back around to my original point: the situation described by the OP seems to be inconsistent with correct usage of the CRA scheme. Avoiding problems such as the OP's is one of the key objectives of that scheme. If zlib adds a new (version of a) binary interface, then its C number ought to be increased. That such a bump may lead to a soversion bump as well is secondary.

– John Bollinger
2 days ago






Yes, I well understand the relationship between CRA numbers and SOVERSION, which comes back around to my original point: the situation described by the OP seems to be inconsistent with correct usage of the CRA scheme. Avoiding problems such as the OP's is one of the key objectives of that scheme. If zlib adds a new (version of a) binary interface, then its C number ought to be increased. That such a bump may lead to a soversion bump as well is secondary.

– John Bollinger
2 days ago





2




2





@John right, I suspect we’re in violent agreement and that I misunderstood the point you were making. zlib doesn’t use libtool anyway, except on Darwin where it’s ar ;-).

– Stephen Kitt
2 days ago





@John right, I suspect we’re in violent agreement and that I misunderstood the point you were making. zlib doesn’t use libtool anyway, except on Darwin where it’s ar ;-).

– Stephen Kitt
2 days ago










daedalus_hamlet is a new contributor. Be nice, and check out our Code of Conduct.









draft saved

draft discarded


















daedalus_hamlet is a new contributor. Be nice, and check out our Code of Conduct.












daedalus_hamlet is a new contributor. Be nice, and check out our Code of Conduct.











daedalus_hamlet is a new contributor. Be nice, and check out our Code of Conduct.














Thanks for contributing an answer to Unix & Linux Stack Exchange!


  • Please be sure to answer the question. Provide details and share your research!

But avoid


  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.

To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f511380%2fwhy-dont-unix-linux-systems-traverse-through-directories-until-they-find-the-re%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

Distance measures on a map of a game The 2019 Stack Overflow Developer Survey Results Are Inmin distance in a graphShortest distance path on contour plotHow to plot a tilted map?Finding points outside of a diskDelaunay link distanceAnnulus from GeoDisks: drawing a ring on a mapNegative Correlation DistanceFind distance along a path (GPS coordinates)Finding position at given distance in a GeoPathMathematics behind distance estimation using camera

How to get a smooth, uniform ParametricPlot of a 2D Region?How to plot a complicated Region?How to exclude a region from ParametricPlotHow discretize a region placing vertices on a specific non-uniform gridHow to transform a Plot or a ParametricPlot into a RegionHow can I get a smooth plot of a bounded region?Smooth ParametricPlot3D with RegionFunction?Smooth border of a region ParametricPlotSmooth region boundarySmooth region plot from list of pointsGet minimum y of a certain x in a region

Genealogie vun de Merowenger Vum Merowech bis zum Chilperich I. | Navigatiounsmenü