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
libredirect: misc changes #50302
libredirect: misc changes #50302
Conversation
reduces a bit of duplication and can also be used from the outside: export LD_PRELOAD=${libredirect}/lib/${libredirect.libName}
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)
|
Success on x86_64-darwin (full log) Attempted: libredirect Partial log (click to expand)
|
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.
👍 Maybe it makes sense to also add a way to make it easy to add those environment variables to makeWrapper
, as it's used in that way throughout nixpkgs.
@@ -8,30 +8,40 @@ stdenv.mkDerivation { | |||
cp ${./test.c} test.c | |||
''; | |||
|
|||
shlibext = stdenv.targetPlatform.extensions.sharedLibrary; | |||
libName = "libredirect" + stdenv.targetPlatform.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.
👍
@LnL7 addressed your comment as well |
@aszlig good idea about { libredirect, myprogram, iana-etc }:
libredirect.wrapWith {
bin = "${myprogram}";
redirects = {
"/etc/protocols" = "${iana-etc}/etc/protocols";
};
} but then it's not very composable |
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)
|
Success on x86_64-darwin (full log) Attempted: libredirect Partial log (click to expand)
|
Failure 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)
|
Success on x86_64-linux (full log) Attempted: libredirect Partial log (click to expand)
|
c36ea37
to
82bea76
Compare
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)
|
This allows to simplify the usage of libredirect inside of nix build sandboxes. Add "libredirect.hook" to the build inputs to get everything linked in automaticall. All that's left is to set NIX_REDIRECTS and call the target program.
82bea76
to
d04a126
Compare
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)
|
Success on x86_64-linux (full log) Attempted: libredirect Partial log (click to expand)
|
Motivation for this change
Make libredirect a bit more easy to use
Things done
sandbox
innix.conf
on non-NixOS)nix-shell -p nox --run "nox-review wip"
./result/bin/
)nix path-info -S
before and after)