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
libcxxabi: also install libc++abi.a #51960
Conversation
I haven't touched |
@@ -33,6 +33,7 @@ stdenv.mkDerivation { | |||
'' | |||
else '' | |||
install -d -m 755 $out/include $out/lib | |||
install -m 644 lib/libc++abi.a $out/lib |
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.
In glibc we have a static output. How about this one?
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.
I am not very supportive of static outputs. The issue is lots of things like pkgconfig hardcode the libdir. Instead, i would recommend adding an “enableStatic” argument that can be overriden.
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.
I modeled this on libstdc++
, which just bundles both static and non-static outputs into the gcc derivation.
The static library is pretty small and we were building it anyway and throwing it away. This is meant as a tiny patch that just allows us to build static libraries with libcxxStdenv
, which was previously broken. I tried not to make any architectural decisions :)
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 argument expected by makeStaticLibraries
has a double negative — it's called dontDisableStatic
. If we're going to add an argument to things, shouldn't we stick to that convention?
[twey@uruz:~/nix/nixpkgs]$ grep -Irc enableStatic | awk -F: '{ s += $2 } END { print s }'
49
[twey@uruz:~/nix/nixpkgs]$ grep -Irc dontDisableStatic | awk -F: '{ s += $2 } END { print s }'
52
There doesn't seem to be consensus 😆
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.
But there are many more files with the double negative.
[twey@uruz:~/nix/nixpkgs]$ grep -Irl dontDisableStatic | wc -l
49
[twey@uruz:~/nix/nixpkgs]$ grep -Irl enableStatic | wc -l
19
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.
Yeah dontDisableStatic would be fine as well. The double negative is kind of awkward in my opinion though.
But yeah, this sounds okay if it's consistent with how we handle gcc.
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.
I feel like it would be weird to have an enableStatic
flag just for libc++abi
. If anything it should go in libc++
— since static libc++
is useless without static libc++abi
.
Are we okay to merge this?
This should have not gone to master! |
Motivation for this change
Allows building static binaries with
libcxxStdenv
. The file is only 536K in size, so it seems a waste to throw it away after building it.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)