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

musl support for polkit, add elogind #72057

Merged
merged 2 commits into from Oct 31, 2019
Merged

Conversation

nh2
Copy link
Contributor

@nh2 nh2 commented Oct 27, 2019

Motivation for this change

Being able to build musl-based static applications, like for static-haskell-nix, that depend on polkit.

systemd does not build with musl; it depends on a logind, and elogind is one that explicitly supports musl.

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nix-review --run "nix-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Determined the impact on package closure size (by running nix path-info -S before and after)
  • Ensured that relevant documentation is up to date
  • Fits CONTRIBUTING.md.
Notify maintainers

no maintainers in file!


meta = {
homepage = https://github.com/elogind/elogind/releases;
description = ''The systemd project's "logind", extracted to a standalone package'';
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we just escape " with \ here?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is that better?

I thought one purpose (as per nix manual) of '' quotes is to not have to do so much escaping.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is that in the nix manual? I just think it's weird to use when it isn't multi-line, perhaps it's just my style preference.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I prefer to use English quotes and apostrophes (u+201c, u+201d, u+2019) in human readable texts, which bypasses the need for escaping altogether.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is that in the nix manual?

Yes here:

Indented strings are primarily useful in that they allow multi-line string literals to follow the indentation of the enclosing Nix expression, and that less escaping is typically necessary for strings representing languages such as shell scripts and configuration files because '' is much less common than ".

For what it's worth, I just copied the description verbatim from the Github repo description on https://github.com/elogind/elogind and using '' made it possible to do that without having to mess with the description.

@FRidh FRidh added this to WIP in Staging Oct 29, 2019
@ofborg ofborg bot requested a review from worldofpeace October 30, 2019 13:19
@nh2 nh2 force-pushed the polkit-musl-elogind branch 2 times, most recently from 8d5b2c7 to 6bd7015 Compare October 30, 2019 13:52
@nh2 nh2 mentioned this pull request Oct 30, 2019
10 tasks
@nh2
Copy link
Contributor Author

nh2 commented Oct 30, 2019

I've extracted the mass-rebuliding patch stability commit into staging: #72301

@GrahamcOfBorg eval

@worldofpeace
Copy link
Contributor

It does concern me that a lot of the things I maintain have musl support added which I now have to maintain. And I don't really know a thing about musl so I may end up breaking this regularly if you don't co-maintain this. Thoughts?

@worldofpeace
Copy link
Contributor

@GrahamcOfBorg build pkgsMusl.elogind pkgsMusl.polkit polkit elogind

@nh2
Copy link
Contributor Author

nh2 commented Oct 31, 2019

It does concern me that a lot of the things I maintain have musl support added which I now have to maintain. And I don't really know a thing about musl so I may end up breaking this regularly if you don't co-maintain this. Thoughts?

@worldofpeace I understand your concern. I'm happy to help co-maintain the musl parts.

If you have some changes that need to go through that break musl support, that is also OK (given that it isn't currently expected to have top-tier support); you can ping me and I will fix the fallout.

@matthewbauer, @Ericson2314 and @dtzWill are also interested in having good musl support because it makes our use cases of static binaries and cross compilation easier, so there will be multiple people around to help with musl-related things.

For #43795 and https://github.com/nh2/static-haskell-nix I am building out CI that can notice when any of the musl stuff I use breaks, to make maintaining them in good state easier. I will also be working in the future to make ofborg and/or Hydra help with that.

@worldofpeace
Copy link
Contributor

It does concern me that a lot of the things I maintain have musl support added which I now have to maintain. And I don't really know a thing about musl so I may end up breaking this regularly if you don't co-maintain this. Thoughts?

@worldofpeace I understand your concern. I'm happy to help co-maintain the musl parts.

If you have some changes that need to go through that break musl support, that is also OK (given that it isn't currently expected to have top-tier support); you can ping me and I will fix the fallout.

@matthewbauer, @Ericson2314 and @dtzWill are also interested in having good musl support because it makes our use cases of static binaries and cross compilation easier, so there will be multiple people around to help with musl-related things.

For #43795 and https://github.com/nh2/static-haskell-nix I am building out CI that can notice when any of the musl stuff I use breaks, to make maintaining them in good state easier. I will also be working in the future to make ofborg and/or Hydra help with that.

Ah ok, thank goodness actually 😄 That's precisely what I hoped was going on.

From my purview it was a lot of changes going through and I wasn't involved in the discussion behind them, so I was a bit concerned. But it sounds perfectly reasonable.

Copy link
Contributor

@worldofpeace worldofpeace left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure if the base branch has the required commits for this to pass CI, but it's a LGTM.

@nh2
Copy link
Contributor Author

nh2 commented Oct 31, 2019

I'm not sure if the base branch has the required commits for this to pass CI, but it's a LGTM.

I think it should have, it built fine for me locally.

I'll have a look if I can do something short term that makes ofborg successfully build pkgsMusl stuff -- that doesn't always seem to work.

@nh2 nh2 merged commit 62fbcea into NixOS:master Oct 31, 2019
dtzWill pushed a commit to dtzWill/nixpkgs that referenced this pull request Nov 1, 2019
musl support for polkit, add elogind

(cherry picked from commit 62fbcea)
@FRidh FRidh moved this from WIP to Merged in Staging Nov 3, 2019
@nh2 nh2 mentioned this pull request Nov 14, 2019
10 tasks
@nh2
Copy link
Contributor Author

nh2 commented Nov 14, 2019

I realised in #73376 (comment) this change added an elogind dependency on Darwin, which doesn't make sense.

We should if that out.

@nh2
Copy link
Contributor Author

nh2 commented Nov 20, 2019

We should if that out.

Fixing in #73837.

nh2 added a commit to nh2/nixpkgs that referenced this pull request Nov 20, 2019
In NixOS#72057 I added support for elogind when systemd is not supported,
but it occurred to me that it probably doens't make sense to have
either of systemd or elogind on Darwin.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Staging
  
Done
Development

Successfully merging this pull request may close these issues.

None yet

3 participants