-
-
Notifications
You must be signed in to change notification settings - Fork 15.5k
libredirect: Add support for Darwin #50246
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
Conversation
The library can be used also on Darwin using it like this: NIX_REDIRECTS='foo=bar' \ DYLD_INSERT_LIBRARIES=${libredirect}/lib/libredirect.so \ DYLD_FORCE_FLAT_NAMESPACE=1 \ some_program So let's actually not hardcade gcc and add Darwin to meta.platforms. No other changes seem to be required. Signed-off-by: aszlig <aszlig@nix.build>
Success on aarch64-linux (full log) Attempted: libredirect Partial log (click to expand)
|
Success on x86_64-darwin (full log) Attempted: libredirect Partial log (click to expand)
|
Success on x86_64-linux (full log) Attempted: libredirect Partial log (click to expand)
|
@GrahamcOfBorg build libredirect |
Success on aarch64-linux (full log) Attempted: libredirect Partial log (click to expand)
|
Success on x86_64-darwin (full log) Attempted: libredirect Partial log (click to expand)
|
Success on x86_64-linux (full log) Attempted: libredirect Partial log (click to expand)
|
Success on x86_64-linux (full log) Attempted: libredirect Partial log (click to expand)
|
Success on x86_64-darwin (full log) Attempted: libredirect Partial log (click to expand)
|
Success on aarch64-linux (full log) Attempted: libredirect Partial log (click to expand)
|
This is to make sure we get the correct shared library suffix of the target platform. While for example on Darwin it would even work with the hardcoded .so prefix it's IMHO a bit nicer to have the actual native extension. Signed-off-by: aszlig <aszlig@nix.build>
This is just a sanity check on whether the library correctly wraps the syscalls and it's using the "true" executable for posix_spawn() and execv(). The installCheckPhase is not executed if we are cross-compiling, so this shouldn't break cross-compilation. One thing I'm not actually sure is whether ${coreutils}/bin/true is universally available on all the platforms, nor whether all the functions we use in the test are available, but we can still fix that after we've found out about that. Signed-off-by: aszlig <aszlig@nix.build>
29579fa
to
34dd1c6
Compare
Success on x86_64-linux (full log) Attempted: libredirect Partial log (click to expand)
|
Success on aarch64-linux (full log) Attempted: libredirect Partial log (click to expand)
|
Failure on x86_64-darwin (full log) Attempted: libredirect Partial log (click to expand)
|
Pull request NixOS#50246 was merged a bit too quickly and it was supposed to fix libredirect on Darwin. However it still fails on Darwin because I was using ofborg to check Darwin builds as I don't have Apple hardware. Providing a symbol for stat shouldn't hurt on GNU/Linux but might work on Darwin, because it probably doesn't have __xstat*() but might have a stat() symbol. Signed-off-by: aszlig <aszlig@nix.build>
Pull request #50246 was merged a bit too quickly and it was supposed to fix libredirect on Darwin. However it still failed on Darwin and this was missed by the person merging the pull request. The reason this was failing was that there is no __xstat* on Darwin. So I'm adding a wrapper for stat() as well as it works on Darwin and it still doesn't hurt on GNU/Linux. Signed-off-by: aszlig <aszlig@nix.build> Cc: @edolstra, @zimbatm
I am going to back-port this to 18.09 unless there are objections |
The
|
The library can be used also on Darwin using it like this:
So let's actually not hardcade gcc and add Darwin to
meta.platforms
.No other changes seem to be required.
Cc: @zimbatm, @edolstra, @dezgeg, @copumpkin