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

Redo DBus configuration #22864

Merged
merged 3 commits into from Feb 17, 2017
Merged

Redo DBus configuration #22864

merged 3 commits into from Feb 17, 2017

Conversation

abbradar
Copy link
Member

Motivation for this change

Fix #22354 (comment). We now don't use any extra configuration files. Instead we embed our configuration into the main config using XSLT. See the issue and description in commits on why this is necessary.

With this blueman starts correctly for me in a virtual machine.

Things done
  • Tested using sandboxing
    (nix.useSandbox on NixOS,
    or option build-use-sandbox in nix.conf
    on non-NixOS)
  • Built on platform(s)
    • NixOS
    • macOS
    • Linux
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nox --run "nox-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Fits CONTRIBUTING.md.

cc @layus (was interested in previous DBus changes)

XSLT solution is heavily copied frominspired by makeFontsConf -- thanks to original authors!

Use XSLT transform to modify stock dbus configuration file. This is needed
because some dbus components doesn't support <include> so we need to put our
core configuration in the main file.
@mention-bot
Copy link

@abbradar, thanks for your PR! By analyzing the history of the files in this pull request, we identified @edolstra, @wkennington and @peti to be potential reviewers.

@abbradar abbradar merged commit 8ecd5c4 into NixOS:staging Feb 17, 2017
Copy link
Member

@layus layus left a comment

Choose a reason for hiding this comment

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

This is a neat piece of code, but I am not sure this is worth it. It's a +108 −39 diff that introduces xsl scripts. I think sed is better understood by maintainers.

Anyway, having makeDbusConf at top-level needs to be changed.

@@ -7094,6 +7094,11 @@ with pkgs;
dbus_libs = dbus;
dbus_daemon = dbus.daemon;

makeDBusConf = { suidHelper, serviceDirectories }:
Copy link
Member

Choose a reason for hiding this comment

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

makeDBusConf should not be a top-level package. Maybe place it at that pkgs.dbus.makeDBusConf. It would also be specific to the dbus package on which it is called (override compatible).

Copy link
Member Author

Choose a reason for hiding this comment

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

Sounds good to me (fontconfig also does this, we may want to refactor both).

@abbradar
Copy link
Member Author

sed would be much more difficult now that we transform upstream XML instead of just inserting strings into our own in pre-defined places (like we did). Complex changes of XML with regexes (filtering <includedir>s and <servicedir>s) seems like even worse case of parsing HTML with them to me...

@layus
Copy link
Member

layus commented Feb 17, 2017

Oh, right, I did not fully understand the motivation explained in the OP. If you really need to rewrite the xml, then xsl is a good option.
Nice work !

I still think that makeDBusConfig should not be toplevel ;-)

@abbradar
Copy link
Member Author

abbradar commented Feb 17, 2017

I'll make a PR to move both this one and makeFontsConf to their parent derivations later, thanks for review!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants