Skip to content

Comments

systemd: add musl patches#141980

Merged
yu-re-ka merged 1 commit intoNixOS:stagingfrom
yu-re-ka:feature/systemd-musl
Oct 20, 2021
Merged

systemd: add musl patches#141980
yu-re-ka merged 1 commit intoNixOS:stagingfrom
yu-re-ka:feature/systemd-musl

Conversation

@yu-re-ka
Copy link
Contributor

@yu-re-ka yu-re-ka commented Oct 17, 2021

Motivation for this change

Fixes build of pkgsMusl.systemdMinimal and pkgsMusl.systemd.

This might be controversial, but it would be a big step towards building full NixOS systems against musl.

These patches are applied conditionally on purpose: They are not checked to be properly guarded. They should not block future systemd upgrades.

Also see the original RFC discussion around musl systemd: https://github.com/NixOS/rfcs/blob/master/rfcs/0023-musl-libc.md#systemd

Things done
  • Built on platform(s)
    • x86_64-linux
    • aarch64-linux
    • x86_64-darwin
    • aarch64-darwin
  • For non-Linux: Is sandbox = true set in nix.conf? (See Nix manual)
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all packages that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • 21.11 Release Notes (or backporting 21.05 Release notes)
    • (Package updates) Added a release notes entry if the change is major or breaking
    • (Module updates) Added a release notes entry if the change is significant
    • (Module addition) Added a release notes entry if adding a new NixOS module
  • Fits CONTRIBUTING.md.

@github-actions github-actions bot added the 6.topic: systemd Software suite that provides an array of system components for Linux operating systems. label Oct 17, 2021
@andir
Copy link
Member

andir commented Oct 17, 2021

Who will be in charge of rebasing these? I certainly won't be doing that. A regular Systemd upgrade is already very involved for us.

@yu-re-ka
Copy link
Contributor Author

Who will be in charge of rebasing these? I certainly won't be doing that. A regular Systemd upgrade is already very involved for us.

"They should not block future systemd upgrades."

Just like with many other packages this will break regularly on systemd upgrades, but that's fine. You don't have to care about these patches at all. Some musl user (most of which are already very involved with distro development) will submit an update once the rebased patchset is available in OpenEmbedded.

@ofborg ofborg bot added 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin. 10.rebuild-linux: 0 This PR does not cause any packages to rebuild on Linux. labels Oct 17, 2021
@yu-re-ka
Copy link
Contributor Author

@ofborg build pkgsMusl.systemdMinimal

@alyssais
Copy link
Member

This is excellent work, thank you. It'll be especially helpful for users relying on static binaries with systemd/udev dependencies. I'll be more than happy to help maintain it going forward, and as you've noted, it won't create any extra work for systemd/glibc maintainers. It shouldn't be too much work for Nixpkgs musl users, either, since the patchset is maintained by another project.

A couple of questions:

@yu-re-ka
Copy link
Contributor Author

yu-re-ka commented Oct 17, 2021

It'll be especially helpful for users relying on static binaries with systemd/udev dependencies.

This currently only fixes pkgsMusl.systemdMinimal. pkgsStatic.systemdMinimal will need some additional work because of how we patch dlopens.

Is Yocto the right upstream to use for these? I thought it was OpenEmbedded

Good point, even though I have worked with yocto/OE stuff for quite some time, the distinction is not completely clear to me. I will check which is the initial source and update this accordingly.

What's musl.diff? Why are the changes in there not taken care of by the OpenEmbedded/Yocto musl patchset?

These changes were made by me because I could not find anything for the compiler warnings/errors in OE or other distros.

One of the changes might not be handled by OE because it only fixes a warning and maybe OE ignores compiler warnings?
They also build with different features enabled, even though I tried to get the build flags for musl to match the OE config.

@yu-re-ka
Copy link
Contributor Author

yu-re-ka commented Oct 17, 2021

From the Yocto poky repository readme

Poky is an integration repository (built using a tool called combo-layer),

The whole meta/ subtree matches between the OE-core and Yocto poky repositories, but according to the quote above OE-core seems to be the proper source.

@yu-re-ka yu-re-ka mentioned this pull request Oct 18, 2021
12 tasks
@yu-re-ka yu-re-ka changed the base branch from master to staging October 18, 2021 07:25
@yu-re-ka
Copy link
Contributor Author

Rebased to staging to prevent future merge conflicts.

@yu-re-ka yu-re-ka requested a review from alyssais October 18, 2021 10:04
@flokli
Copy link
Member

flokli commented Oct 18, 2021

This needs another rebase, due to the 249.5 bump.

Fixes build of pkgsMusl.systemdMinimal (and pkgsMusl.systemd if combined with
other fixes).
These patches are applied conditionally on purpose: They are not checked to
be properly guarded. They should not block future systemd upgrades.
Also see the original RFC section around musl systemd:
https://github.com/NixOS/rfcs/blob/master/rfcs/0023-musl-libc.md#systemd
@yu-re-ka
Copy link
Contributor Author

yu-re-ka commented Oct 18, 2021

This needs another rebase, due to the 249.5 bump.

Done.

@alyssais alyssais requested a review from flokli October 18, 2021 17:56
@yu-re-ka yu-re-ka merged commit 6ac494f into NixOS:staging Oct 20, 2021
@nixos-discourse
Copy link

This pull request has been mentioned on NixOS Discourse. There might be relevant details there:

https://discourse.nixos.org/t/libudev-as-static-library/16272/7

@flokli flokli mentioned this pull request Dec 14, 2021
11 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

6.topic: systemd Software suite that provides an array of system components for Linux operating systems. 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin. 10.rebuild-linux: 0 This PR does not cause any packages to rebuild on Linux.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants