Skip to content
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

meson.build: allow overriding sysusers.d dir #430

Closed
wants to merge 1 commit into from

Conversation

tmuehlbacher
Copy link

fixes builds for non-FHS systems like Nix.

fixes builds for non-FHS systems like Nix.
@bluca
Copy link
Member

bluca commented Mar 12, 2024

This is read from pkgconf exactly for this use case, so that distribution can ship a custom pc file with their preferred locations, what's the reason why nix is not using that?

@tmuehlbacher
Copy link
Author

This is read from pkgconf exactly for this use case, so that distribution can ship a custom pc file with their preferred locations, what's the reason why nix is not using that?

In Nix, the resulting files from a build are installed into one (or more) unique store paths that includes the hash of the package and all of its build inputs/parameters. So systemd cannot know ahead of time where polkit will have to install its outputs to.

Some examples paths:

/nix/store/jbc0ga700chv62qr7q5x28bxrpmxk04g-polkit-124/lib/sysusers.d/polkit.conf
/nix/store/n85xhkvxv8vhbshyqwwk5l5aiq4xldcc-systemd-minimal-255.2/share/polkit-1/actions/org.freedesktop.systemd1.policy

I've specifically implemented this change to be similar to the already existing systemdsystemunitdir meson option. There technically is still a programming error in the meson file because systemd_dep is defined inside of an if condition but then used unconditionally in this code path. With this fix you can at least work around this error by specifying both the system unit dir and the sysusers dir as meson options.

@bluca
Copy link
Member

bluca commented Mar 12, 2024

It has nothing to do with the systemd build though, pkgconfig is simply key/value pair and you can override it as needed. It doesn't make sense to me to reimplement all the hundreds of variables defined in the pc file, across all thousands of projects using it, all with custom config options. This is why we have pkgconfig in the first place. Just rewrite the pc file as needed.

@bluca
Copy link
Member

bluca commented Mar 12, 2024

This is how cross compilation already does it btw, and it works just fine for that case, so I am pretty sure you can do the same in nix too.

@tmuehlbacher
Copy link
Author

Ok, using a different approach now, see NixOS/nixpkgs#295087
I am closing this PR as it seems that you already have a separate one to fix the build failure with #417

@tmuehlbacher tmuehlbacher deleted the override-sysusers branch March 12, 2024 19:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants