Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
${stdenv.hostPlatform.extensions.sharedLibrary}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the review @FRidh! Just to clarify, you're suggesting it should be this:
right? Or maybe a bit clearer like this:
I'm happy to do either of these, but to my eyes this makes the code more obfuscated. This whole section of code is intensely Darwin-specific, and the code has to know about both
.so
and.dylib
, so there's no generality gained.So can I just check that this is what you think would be an improvement? If so I'll happily re-test and push.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
stdenv.hostPlatform.extensions.sharedLibrary evaluates to .so on Linux and .dylib on Darwin. I doubt you need to perform an action on both .dylib and .so in the same build.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unfortunately, that is exactly the point of this patch. See #80190 for more details.
I share your intuition that there should be a better way, and would love someone to propose a superior alternative. Right now though, this is the only fix I have for the broken packages.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
BTW the Darwin nix-store in front of me (no cross-compilation) has 44421
.dylib
s and 778.so
s. Of those.so
s, there are two distinct ones thatotool -hv
reports asDYLIB
rather thanBUNDLE
:libstdbuf.so
from coreutilsliblmdb.so
from lmdb at issue hereI have no idea whether the real root cause for this issue is something to do with them, but as it stands, there definitely are dylibs with suffix
.so
on Darwin.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Turns out the liblmdb
.so
suffix was specified manually in 84bd2f4 over two years ago.I still do not understand why 8d4509e from a couple of weeks ago should trigger a breakage though.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The install_name needs to point to the full path to the final library location. Perhaps, the library got moved as a result of 8d4509e so the line
nixpkgs/pkgs/development/libraries/lmdb/default.nix
Line 26 in 82945f3
needs to be updated to reflect the move.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good thought @veprbl - I've looked, and to the best of my understanding, this isn't the diagnosis. Both working and broken builds end up depending on the exact same LMDB C package (same SHA) where
otool -L
does indeed show the full path to the final library location.