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

Darwin GSettings support #54007

Merged
merged 3 commits into from Jan 20, 2019
Merged

Darwin GSettings support #54007

merged 3 commits into from Jan 20, 2019

Conversation

jtojnar
Copy link
Contributor

@jtojnar jtojnar commented Jan 15, 2019

Motivation for this change

See #53307

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 nox --run "nox-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)
  • Assured whether relevant documentation is up to date
  • Fits CONTRIBUTING.md.

Running dconf daemon on Darwin is probably not trivial since it requires DBus.
We are probably better of relying on GNextstepSettingsBackend.
@jtojnar
Copy link
Contributor Author

jtojnar commented Jan 16, 2019

For some reason, meson does not detect Darwin and passes -Wl,-O1 to the compiler:

https://github.com/mesonbuild/meson/blob/bbcf80d7348135e0590622a7b85c30429f005c07/mesonbuild/compilers/compilers.py#L1479

@jtojnar
Copy link
Contributor Author

jtojnar commented Jan 16, 2019

Both C and ObjC compilers used are

clang version 5.0.2 (tags/RELEASE_502/final)
Target: x86_64-apple-darwin17.7.0
Thread model: posix
InstalledDir: /nix/store/frq6nffl9iszwlznlha23jyv2p1rrgc9-clang-5.0.2/bin

which causes CompilerType.CLANG_STANDARD to be selected for ObjC compiler, causing the -O1 flag being passed to the linker. C compiler works fine since it detects Darwin with mesonlib.for_darwin(want_cross, self). As a stopgap, we could add the same check for ObjC but in the long term, meson should probably check the linker version.

@jtojnar
Copy link
Contributor Author

jtojnar commented Jan 16, 2019

Opened an upstream issue with Meson: mesonbuild/meson#4784

@7c6f434c
Copy link
Member

@jtojnar it looks like ofborg Darwin build of glib has actualy failed?

To support GNextstepSettingsBackend and Cocoa notifications, certain libraries
need to be added on Darwin.
@jtojnar jtojnar added this to In Progress in GNOME Jan 17, 2019
@jtojnar jtojnar merged commit ef14a22 into NixOS:master Jan 20, 2019
GNOME automation moved this from In Progress to Done Jan 20, 2019
@jtojnar jtojnar deleted the darwin-gsettings branch January 20, 2019 12:53
@matthewbauer
Copy link
Member

Are there any other dconf uses we need to get rid of? We can also make dconf an optional propagated input of glib to reduce duplication.

@jtojnar
Copy link
Contributor Author

jtojnar commented Jan 21, 2019

In general, packages should not depend on dconf (unless they explicitly need libdconf for low-level access). Instead, they should pick up the dconf-based GSettings backend module from the environment (passed by wrapGAppsHook). We should probably add the !isDarwin condition to all manual wrapProgram invocations (or change them to wrapGAppsHook).

I am not sure what duplication do you mean but dconf depends on glib so we definitely cannot propagate it from there.

@hedning
Copy link
Contributor

hedning commented Jan 21, 2019

I think this broke glibmm on darwin: https://hydra.nixos.org/build/87684380

Complains about not finding a header file:

desktopappinfo.cc:27:10: fatal error: 'gio/gdesktopappinfo.h' file not found
#include <gio/gdesktopappinfo.h>
^~~~~~~~~~~~~~~~~~~~~~~
1 error generated.

There's similar failures in other darwin derivations.

Needed by inkscape: https://hydra.nixos.org/job/nixpkgs/trunk/unstable#tabs-constituents

@jtojnar
Copy link
Contributor Author

jtojnar commented Jan 21, 2019

Yeah, glib does not build them on Darwin: https://gitlab.gnome.org/GNOME/glib/blob/be10f19752223f2607ba1fe00408c75920792aba/gio/meson.build#L412-429

It previously did build them because it detects Mac by the presence of Cocoa. Maybe we need to convince glibmm glibmm it is on Darwin in a same way? Or report a bug?

@jtojnar jtojnar mentioned this pull request Jan 21, 2019
10 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
GNOME
  
Done
Development

Successfully merging this pull request may close these issues.

None yet

5 participants