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
redshift/geoclue/localtime: progress in fixing agent confusion #44820
Conversation
Oh, and FWIW I think the breaking commit in geoclue is this one, which appears in 4.9. We recently upgraded from 4.8 -> 4.10, which is presumably when this started. |
3a413b2
to
380fbad
Compare
@@ -1,24 +1,29 @@ | |||
{ fetchurl, stdenv, intltool, pkgconfig, gtk-doc, docbook_xsl, docbook_xml_dtd_412, glib, json-glib, libsoup, libnotify, gdk_pixbuf | |||
, modemmanager, avahi, glib-networking, wrapGAppsHook, gobjectIntrospection | |||
, withDemoAgent ? false | |||
# doc build currently seems to be broken |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you provide more details? The docs build for me.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If I set this to true I get the following:
> nix build -f . pkgs.geoclue
builder for '/nix/store/mgyaj5vnzg1fy2yvx16xqk11r6kiqq9v-geoclue-2.4.11.drv' failed with exit code 2; last 10 log lines:
../libgeoclue-docs.xml:77: element include: XInclude error : could not load ../xml/gclue-client-proxy.xml, and no fallback was found
warning: failed to load external entity "../xml/gclue-location-proxy.xml"
../libgeoclue-docs.xml:83: element include: XInclude error : could not load ../xml/gclue-location-proxy.xml, and no fallback was found
make[3]: *** [Makefile:750: html-build.stamp] Error 6
make[3]: Leaving directory '/build/geoclue-2.4.11/docs/lib'
make[2]: *** [Makefile:577: all-recursive] Error 1
make[2]: Leaving directory '/build/geoclue-2.4.11/docs'
make[1]: *** [Makefile:517: all-recursive] Error 1
make[1]: Leaving directory '/build/geoclue-2.4.11'
make: *** [Makefile:449: all] Error 2
[0 built (1 failed), 0.0 MiB DL]
error: build of '/nix/store/mgyaj5vnzg1fy2yvx16xqk11r6kiqq9v-geoclue-2.4.11.drv' failed
This is with sandboxing on. I don't get this in the previous version, but I couldn't figure out what the problem.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Recent master seems to have a bunch of build-related commits, so I suspect they may still be fixing things up.
, withDemoAgent ? false | ||
# doc build currently seems to be broken | ||
, enableDocs ? false | ||
, withDemoAgent ? true |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Demo agent should not be build by default, since the default use is for libraries. Override the value in the module when needed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can do that, but then we'll build it twice. As is presumably libraries can just depend on geoclue2.dev
, so I don' think this should affect closure size?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
geoclue2.dev
is only used for build, the library is still in out. Maybe we could split lib
to a separate output. Though building such a small program twice should not really matter.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okay, fine with me.
380fbad
to
96adcce
Compare
@@ -4,6 +4,10 @@ | |||
|
|||
with lib; | |||
|
|||
let | |||
# the demo agent isn't built by default, but we need it here | |||
package = pkgs.geoclue2.override { withDemoAgent = true; }; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can it be set to config.services.geoclue2.enableDemoAgent
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh sure.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
If you can work out how to fix the docs I'm up for it, but I'd really like to get redshift working again. |
Will try to bisect it later. |
You have more patience than me :D |
Builds fine from git: { fetchFromGitLab, stdenv, autoconf, automake, libtool, intltool, pkgconfig, gtk-doc, docbook_xsl, docbook_xml_dtd_412, glib, json-glib, libsoup, libnotify, gdk_pixbuf
, modemmanager, avahi, glib-networking, wrapGAppsHook, gobjectIntrospection
, withDemoAgent ? false
}:
with stdenv.lib;
stdenv.mkDerivation rec {
name = "geoclue-${version}";
version = "2.4.11";
src = fetchFromGitLab {
domain = "gitlab.freedesktop.org";
owner = "geoclue";
repo = "geoclue";
rev = version;
sha256 = "11pvw7cif1jp305qag85br9pwda5h9in9377cwzy82wfb0inyrf2";
};
outputs = [ "out" "dev" "devdoc" ];
nativeBuildInputs = [
autoconf automake libtool pkgconfig intltool gtk-doc docbook_xsl docbook_xml_dtd_412 wrapGAppsHook gobjectIntrospection
];
buildInputs = [
glib json-glib libsoup avahi
] ++ optionals withDemoAgent [
libnotify gdk_pixbuf
] ++ optionals (!stdenv.isDarwin) [ modemmanager ];
propagatedBuildInputs = [ glib glib-networking ];
configureFlags = [
"--with-systemdsystemunitdir=$(out)/etc/systemd/system"
"--enable-introspection"
"--enable-gtk-doc"
"--enable-demo-agent=${if withDemoAgent then "yes" else "no"}"
] ++ optionals stdenv.isDarwin [
"--disable-silent-rules"
"--disable-3g-source"
"--disable-cdma-source"
"--disable-modem-gps-source"
"--disable-nmea-source"
];
postPatch = ''
sed -i '/git submodule/d' autogen.sh
'';
preConfigure = "NOCONFIGURE=1 ./autogen.sh";
# https://gitlab.freedesktop.org/geoclue/geoclue/issues/73
postInstall = ''
sed -i $dev/lib/pkgconfig/libgeoclue-2.0.pc -e "s|includedir=.*|includedir=$dev/include|"
'';
meta = with stdenv.lib; {
description = "Geolocation framework and some data providers";
homepage = https://gitlab.freedesktop.org/geoclue/geoclue/wikis/home;
maintainers = with maintainers; [ raskin garbas ];
platforms = with platforms; linux ++ darwin;
license = licenses.lgpl2;
};
} Could you maybe report a bug upstream? |
I'm not sure I know what the issue is - do you think there's something missing in the release tarball? |
No idea. But maybe upstream will be wiser. |
I diffed the release tarball and the source checkout - it looks like the tarball has had some generation steps done, and is generally a bit different. I think perhaps we're not meant to build the docs from the release tarball - I think we should probably just switch to building this from git, but that can be in a different PR. |
I do not see why would not devdoc be supposed to be built from tarball. Anyway, opened https://gitlab.freedesktop.org/geoclue/geoclue/issues/77 |
I think this is ready to go, any other comments? |
I would still prefer building from git to disabling the docs. |
Updated to build from git following your patch. |
(This will probably be a bit nicer once they're done moving to meson) |
}; | ||
|
||
outputs = [ "out" "dev" "devdoc" ]; | ||
outputs = [ "out" "dev" "devdoc"]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The spacing should be consistent.
sed -i '/git submodule/d' autogen.sh | ||
''; | ||
|
||
# configure will happen durng the configure phase anyway |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
typo durng
# user who is making the requests | ||
systemd.user.services = mkIf config.services.geoclue2.enableDemoAgent { | ||
"geoclue-agent" = { | ||
description = "Geoclue agent"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Extra space
Nits fixed. |
gentle prod |
2.4.12 was released and it fixes the devdoc. Could you update to it? |
|
||
# configure will happen during the configure phase anyway | ||
preConfigure = "NOCONFIGURE=1 ./autogen.sh"; | ||
|
||
# https://gitlab.freedesktop.org/geoclue/geoclue/issues/73 | ||
postInstall = '' | ||
sed -i $dev/lib/pkgconfig/libgeoclue-2.0.pc -e "s|includedir=.*|includedir=$dev/include|" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This can be removed in 2.4.12
130f6a3
to
3891415
Compare
Thanks for chasing that up - I've removed the commit changing it to build from git, and changed the version upgrade commit to go to 2.4.12. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Few more final nits. Also could you squash bae4fa2130bba6f1020c31790ab583c31fe9e388 and 38914154ced3e2f5ba4b74901d406dd54befd7f4 into ca8bda4252214ec6d0cc0bf3ab8bd8ed7c4bc9ec:
@@ -31,7 +32,7 @@ stdenv.mkDerivation rec { | |||
configureFlags = [ | |||
"--with-systemdsystemunitdir=$(out)/etc/systemd/system" | |||
"--enable-introspection" | |||
"--enable-gtk-doc" | |||
"--enable-gtk-doc=yes" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you drop this change.
]; | ||
pkgconfig intltool wrapGAppsHook gobjectIntrospection | ||
# devdoc | ||
gtk-doc docbook_xsl docbook_xml_dtd_412 ]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you move the closing paren to the next line (like fetchurl does)?
Last nits done. |
3891415
to
80d4fa7
Compare
Actually, |
Is it not enough that it's false by default? |
Yeah, that will probably be enough. |
@GrahamcOfBorg build geoclue2 |
Success on x86_64-linux (full log) Attempted: geoclue2 Partial log (click to expand)
|
Success on x86_64-darwin (full log) Attempted: geoclue2 Partial log (click to expand)
|
Success on aarch64-linux (full log) Attempted: geoclue2 Partial log (click to expand)
|
Motivation for this change
Partially fixes #44725.
geoclue
recently started requiring an authorization agent in order for clients to get data. For example, they provide a demo agent that asks the user via a notification if they want to allow the application access to their location.DEs are supposed to provide their own agent, but only GNOME does so. However, we can use the demo agent provided by geoclue. AFAICT, this needs to run as a user service, because it is associated with the user who makes the requests.
This makes
redshift
work again (albeit with an annoying notification prompt), after a bit more wrangling because the agent also expects a valid.desktop
file and appears to check that the executable exists.However, I couldn't make
localtime
work, because it runs as a system service, and there isn't an agent for it's UID. I think the thing to do would be to make it run as a user service, but my preliminary hacking was not enough to make this work.cc @garbas @yegortimoshenko as maintainers of relevant packages.
Things done
sandbox
innix.conf
on non-NixOS)nix-shell -p nox --run "nox-review wip"
./result/bin/
)nix path-info -S
before and after)