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
nixos/networking: do not copy /etc/rpc on non-glibc systems #49311
Conversation
nixos/modules/config/networking.nix
Outdated
@@ -251,6 +248,9 @@ in | |||
"resolv.conf".source = "${pkgs.systemd}/lib/systemd/resolv.conf"; | |||
} // optionalAttrs (config.services.resolved.enable && dnsmasqResolve) { | |||
"dnsmasq-resolv.conf".source = "/run/systemd/resolve/resolv.conf"; | |||
} // optionalAttrs (!pkgs.stdenv.hostPlatform.isMusl) { |
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 would put hostPlatform.libc == “glibc” to be more specific.
ldd corresponds to the ldd command on most linux systems. Right now we have two implementations of it in glibc & musl. This should handle both of those cases.
glibc needs /etc/rpc but apparently musl doesn’t.
These binaries are provided by glibc, but we don’t want to pull them directly from glibc in case another libc is being used. Instead, we can use some indirect packages that will use whatever libc you are linking against: - getent - getconf - ldd
Just pushed commits with system-path fixes. |
See comment on previous PR: #49218 (comment) (probably should have posted it here instead, sorry). Although currently AFAIK NFS doesn't work w/musl (since we upgraded it), but that shouldn't be especially hard to fix. The major blocker for many things is librsvg -> rust, which mostly needs someone to create+host a musl-based rust bootstrap tarball -- possibly starting with those available in various musl-based distributions, and applying and fixes to rust that may be needed (not sure which these are for latest versions). |
Those commits I pushed might not be helpful if so definitely feel free to drop them.
This should just effect native built Musl though right? The cross built stuff should be able to cross compile librsvg (someone was working on cross support for rust recently). Not to completely discourage the effort of getting Rust-based Musl bootstrap but it can become a maintenance burden over time. We have a couple of self-hosted compilers in Nixpkgs now and I'm hoping we can find a better solution than making double bootstrap tools for each one. |
@@ -9739,6 +9739,12 @@ with pkgs; | |||
|
|||
libcCross = assert stdenv.targetPlatform != stdenv.buildPlatform; libcCrossChooser stdenv.targetPlatform.libc; | |||
|
|||
ldd = { |
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.
Wouldn't it just be easier to set this to stdenv.hostPlatform.stdenv.cc.libc
? All libcs should provide ldd, if I'm not mistaken.
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 that sounds like a good idea.
@dtzWill I'll take a look at the branch. I'm using nixos as a base off of which to build an embedded ARM-based home server appliance, and I've mostly got everything I want working (although it seems like NFS may be out of the question). Now, I'm contributing back the patches I think would make sense in mainline nixpkgs (should I work off your branch instead?). I've had to make substantial changes to nixpkgs, but I now have a musl-based ARM board that boots and gives me a getty. I've switched out systemd with runit to make it work of course, because systemd does not support musl, and I'm not going to fight that battle :) |
@dtzWill what issues are you seeing on your branch? If you could collect together the safe commits I think we can get those merged (some of the systemd stuff might be too much). |
Merged in #49504 |
Motivation for this change
Mandating using /etc/rpc from glibc means we may pull in an unnecessary dependency on non-glibc systems. This gets rid of that, allowing for alternate C libraries to provide their own in the future.
Scoped down version of #49218
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)