-
-
Notifications
You must be signed in to change notification settings - Fork 14.6k
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
Remove wrapper scripts from musl causing a glibc dependency #106940
Conversation
Requiring bash here meant requiring glibc No one wants glibc with their musl
How about moving them to a separate output, such as |
I don't think musl-gcc and the like are spurious junk we can just get rid of. |
Fixes #75476 for me |
@symphorien can you show how you'd get a pure musl package without glibc given the sample project in #75476 without this change? |
@r-burns possibly a decent solution, I'll see if I can't split it off. Ideally though the musl scripts would use a bash built against musl, but that seems impossible without moving the scripts to their own derivation? I'm still new-ish to writing nix but hard to see how it'd be possible otherwise. |
let
musl = (import <nixpkgs/lib>).systems.examples.musl64;
musl-pkgs = (import <nixpkgs> {}).pkgsMusl;
host-pkgs = import <nixpkgs> {};
build = pkgs:
let
inherit (pkgs) stdenv;
in
stdenv.mkDerivation {
name = "hello";
src = ./.;
buildPhase = ''
$CXX hello.cc
'';
installPhase = ''
mkdir -p $out/bin
cp a.out $out/bin
'';
};
in
{
host = build host-pkgs;
musl = build musl-pkgs;
}
As I said, if you want a pure musl artifact, the most direct solution is to use a pure musl toolchain, that is pkgsMusl. Anyway, I think removing musl-gcc is a regression and thus not an acceptable solution. |
@symphorien fair enough, I didn't like it either to be quite honest, but was confused entirely by the musl -> bash -> glibc dep chain going on, which seems... wrong. Even if you do depend on the musl-dev shouldn't that avoid relying on glibc as it may inherently blow up closure size in some cases where the -dev related stuff is needed still? My ultimate goal with this work is to be able to cross compile, with musl, to multiple target archs as well so I'm not sure if that changes the outcome here |
If you insist on cross compiling and not having glibc in the build-platform compiler, then you should cross compile from a musl build platform. Untested, but pkgsMusl.pkgsCross might do that. |
I do think -dev shouldn't depend on bash and glibc by default, but I agree with comments that removing the scripts isn't the right path. Closing |
Requiring bash here meant requiring glibc
No one wants glibc with their musl