[linux][qt] Add positioning support via GeoClue2 #5823

Merged
Ferenc merged 4 commits from github/fork/Ferenc-/linux-geoclue into master 2023-09-14 19:01:11 +00:00
Ferenc commented 2023-08-25 19:02:04 +00:00 (Migrated from github.com)
Fixes https://github.com/flathub/app.organicmaps.desktop/issues/19
Ferenc commented 2023-08-25 19:02:16 +00:00 (Migrated from github.com)

requested review from @biodranik

requested review from `@biodranik`
Ferenc commented 2023-08-25 19:02:53 +00:00 (Migrated from github.com)

requested review from @pastk

requested review from `@pastk`
vng commented 2023-08-26 00:37:20 +00:00 (Migrated from github.com)

{ from the new line and usually we don't use 2-space indent after namespace:

namespace
{
// code starts here
static location::GpsInfo gpsInfoFromQGeoPositionInfo ...
}  // namespace
{ from the new line and usually we don't use 2-space indent after namespace: ``` namespace { // code starts here static location::GpsInfo gpsInfoFromQGeoPositionInfo ... } // namespace ```
vng commented 2023-08-26 00:38:15 +00:00 (Migrated from github.com)

2 spaces

2 spaces
vng commented 2023-08-26 00:39:02 +00:00 (Migrated from github.com)

return ?

return ?
vng commented 2023-08-26 00:40:27 +00:00 (Migrated from github.com)

LOG(LERROR) crashes on Debug.
So if it is a bad, but possible situation, use LOG(LWARNING) here and below.

LOG(LERROR) crashes on Debug. So if it is a bad, but possible situation, use LOG(LWARNING) here and below.
vng commented 2023-08-26 00:40:45 +00:00 (Migrated from github.com)

Review: Commented

LGTM

**Review:** Commented LGTM
biodranik commented 2023-08-26 08:21:02 +00:00 (Migrated from github.com)

Documentation should be updated with these dependencies.

Documentation should be updated with these dependencies.
biodranik commented 2023-08-26 08:22:34 +00:00 (Migrated from github.com)

This package is needed only for the app, e.g. desktop builds (and maybe for some tests). Does it make sense to use it only when necessary and avoid, for example, on server builds?

This package is needed only for the app, e.g. desktop builds (and maybe for some tests). Does it make sense to use it only when necessary and avoid, for example, on server builds?
biodranik commented 2023-08-26 08:23:30 +00:00 (Migrated from github.com)

Please name the last variable, it's not clear what is it about.

Please name the last variable, it's not clear what is it about.
biodranik commented 2023-08-26 08:23:55 +00:00 (Migrated from github.com)

Are there other services except geoclue2? Why is it made as a parameter?

Are there other services except geoclue2? Why is it made as a parameter?
biodranik commented 2023-08-26 11:52:26 +00:00 (Migrated from github.com)
    if (i.hasAttribute(QGeoPositionInfo::HorizontalAccuracy))
      info.m_horizontalAccuracy = (double)i.attribute(QGeoPositionInfo::HorizontalAccuracy);

and below for all one-liners.

```suggestion:-0+0 if (i.hasAttribute(QGeoPositionInfo::HorizontalAccuracy)) info.m_horizontalAccuracy = (double)i.attribute(QGeoPositionInfo::HorizontalAccuracy); ``` and below for all one-liners.
biodranik commented 2023-08-26 11:53:02 +00:00 (Migrated from github.com)

static_cast is a better C++ way, here and below.

static_cast is a better C++ way, here and below.
biodranik commented 2023-08-26 11:53:48 +00:00 (Migrated from github.com)

static_cast

static_cast
biodranik commented 2023-08-26 11:55:29 +00:00 (Migrated from github.com)
          return location::TLocationSource::EGeoClue2;
```suggestion:-0+0 return location::TLocationSource::EGeoClue2; ```
biodranik commented 2023-08-26 11:56:27 +00:00 (Migrated from github.com)

In our notation (RTL) should be QString const& everywhere ( a reference to a const QString).

In our notation (RTL) should be QString const& everywhere ( a reference to a const QString).
biodranik commented 2023-08-26 11:56:53 +00:00 (Migrated from github.com)

Please do not use C-style type casting in C++ code.

Please do not use C-style type casting in C++ code.
biodranik commented 2023-08-26 12:00:44 +00:00 (Migrated from github.com)

Do you really need this isConnected variable? Won't this work?

if (!connect(...))
{
  CHECK(false, ("If the goal is to immediately crash so developer can fix the error."));
  // or
  LOG(LWARNING, ("Some non-critical, recoverable error"));
  return false;
}
Do you really need this isConnected variable? Won't this work? ``` if (!connect(...)) { CHECK(false, ("If the goal is to immediately crash so developer can fix the error.")); // or LOG(LWARNING, ("Some non-critical, recoverable error")); return false; } ```
biodranik commented 2023-08-26 12:01:08 +00:00 (Migrated from github.com)

When does this function fail? Is it an abnormal situation?

When does this function fail? Is it an abnormal situation?
biodranik commented 2023-08-26 12:02:42 +00:00 (Migrated from github.com)

If a "normal" failure can happen in the constructor, and you get a half-valid object, then you need to use a different pattern: some static fabric method that will initialize everything and either fail (and return false or std::optional) or succeeds and returns a valid constructed object.

If a "normal" failure can happen in the constructor, and you get a half-valid object, then you need to use a different pattern: some static fabric method that will initialize everything and either fail (and return false or std::optional<QtLocationService>) or succeeds and returns a valid constructed object.
biodranik commented 2023-08-26 12:03:40 +00:00 (Migrated from github.com)

nit: It would be great to refactor our location service to use unique_ptr and make_unique instead of raw pointers.

nit: It would be great to refactor our location service to use unique_ptr and make_unique instead of raw pointers.
biodranik commented 2023-08-26 12:04:22 +00:00 (Migrated from github.com)

Review: Commented

Can you please also temporarily comment current mac os location implementation and enable it also via Qt?

**Review:** Commented Can you please also temporarily comment current mac os location implementation and enable it also via Qt?
Ferenc commented 2023-08-26 13:54:26 +00:00 (Migrated from github.com)

Done

Done
Ferenc commented 2023-08-26 13:54:58 +00:00 (Migrated from github.com)

Done

Done
Ferenc commented 2023-08-26 13:56:01 +00:00 (Migrated from github.com)

Done

Done
Ferenc commented 2023-08-26 14:22:49 +00:00 (Migrated from github.com)

Are there other services except geoclue2?

It's an extensible plugin system. So yes, there are many other plugins out there already besides geoclue2, some from Qt directly, some from third parties and we could also write our own.

For Linux the options that are worth listing are:

Why is it made as a parameter?

Mainly so that if we want to support any from the above list, then we can do so easily.
And theoretically for MacOS we could refactor and simplify the existing positioning to use this new qt_location_service with corelocation.
And for Windows, there might also be something out there if anyone is even interested.

> Are there other services except geoclue2? It's an extensible plugin system. So yes, there are many other plugins out there already besides `geoclue2`, some from Qt directly, some from third parties and we could also write our own. For Linux the options that are worth listing are: - Qt shipped [NMEA](https://doc.qt.io/qt-6/position-plugin-nmea.html) - Qt shipped [gypsy](https://doc.qt.io/qt-6/position-plugin-gypsy.html) - 3PP [gpsd](https://github.com/jmechnich/qtposition_gpsd) > Why is it made as a parameter? Mainly so that if we want to support any from the above list, then we can do so easily. And theoretically for MacOS we could refactor and simplify the existing positioning to use this new `qt_location_service` with [corelocation](https://doc.qt.io/qt-6/position-plugin-corelocation.html). And for Windows, there might also be something out there if anyone is even interested.
Ferenc commented 2023-08-26 14:24:39 +00:00 (Migrated from github.com)

All right, done.

All right, done.
biodranik commented 2023-08-26 14:38:50 +00:00 (Migrated from github.com)

Can several services be used at the same time for better location updates?

Can several services be used at the same time for better location updates?
Ferenc commented 2023-08-26 14:42:26 +00:00 (Migrated from github.com)

Done

Done
Ferenc commented 2023-08-26 14:44:56 +00:00 (Migrated from github.com)

Done

Done
Ferenc commented 2023-08-26 15:04:16 +00:00 (Migrated from github.com)

Done

Done
Ferenc commented 2023-08-26 15:11:56 +00:00 (Migrated from github.com)

I don't need it. For me it is even better if I eliminate the isConnected , it was simply a courtesy to the reader.
And yes the goal is to immediately crash, because it is a sign of a developer error if it is not properly connected.

I don't need it. For me it is even better if I eliminate the `isConnected` , it was simply a courtesy to the reader. And yes the goal is to immediately crash, because it is a sign of a developer error if it is not properly connected.
Ferenc commented 2023-08-26 15:14:02 +00:00 (Migrated from github.com)

Done

Done
Ferenc commented 2023-08-26 15:15:40 +00:00 (Migrated from github.com)

This is not a normal failure, this can only happen if a developer made a mistake.

This is not a normal failure, this can only happen if a developer made a mistake.
Ferenc commented 2023-08-26 15:18:59 +00:00 (Migrated from github.com)

This can happen if there is a system level issue, permission issue, files got deleted etc.
If geoclue2 or any other plugin being used is properly installed and configured, then this should not happen.
So I would not call this a "normal" failure.

This can happen if there is a system level issue, permission issue, files got deleted etc. If `geoclue2` or any other plugin being used is properly installed and configured, then this should not happen. So I would not call this a "normal" failure.
Ferenc commented 2023-08-26 15:37:04 +00:00 (Migrated from github.com)

Well yes. Perhaps one can imagine rare corner cases, in which it might make an actual difference. Let's say that geoclue2 uses the wifi device to get a street level accuracy quickly which allows the user to hit the road already, until a gpsd only high-end receiver boots up and starts providing the much more accurate positioning.

Well yes. Perhaps one can imagine rare corner cases, in which it might make an actual difference. Let's say that `geoclue2` uses the wifi device to get a street level accuracy quickly which allows the user to hit the road already, until a `gpsd` only high-end receiver boots up and starts providing the much more accurate positioning.
Ferenc commented 2023-08-26 15:38:51 +00:00 (Migrated from github.com)

LOG(LERROR) crashes on Debug.

It is intended for developers doing the debugging, because in this case if this signal is not properly connected, then it is a developer error.

> LOG(LERROR) crashes on Debug. It is intended for developers doing the debugging, because in this case if this signal is not properly connected, then it is a developer error.
Ferenc commented 2023-08-26 15:51:55 +00:00 (Migrated from github.com)

I agree. And I also think that such a refactor would impact all the platforms, and should go into a separate PR.
Is that OK?

I agree. And I also think that such a refactor would impact all the platforms, and should go into a separate PR. Is that OK?
Ferenc commented 2023-08-26 15:53:07 +00:00 (Migrated from github.com)

Now, I have made it conditional on PLATFORM_DESKTOP.

Now, I have made it conditional on `PLATFORM_DESKTOP`.
Ferenc commented 2023-08-26 15:56:49 +00:00 (Migrated from github.com)

Can you please also temporarily comment current mac os location implementation and enable it also via Qt?

You mean dropping apple_location_service.mm and using qt_location_service instead? Can it go into a separate PR?

> Can you please also temporarily comment current mac os location implementation and enable it also via Qt? You mean dropping `apple_location_service.mm` and using `qt_location_service` instead? Can it go into a separate PR?
biodranik commented 2023-08-26 16:08:45 +00:00 (Migrated from github.com)

Yes, separate PRs for both. Refactoring is a very low priority though.

Yes, separate PRs for both. Refactoring is a very low priority though.
Ferenc commented 2023-08-27 19:58:13 +00:00 (Migrated from github.com)

Done

Done
Ferenc commented 2023-08-27 19:58:21 +00:00 (Migrated from github.com)

done

done
Ferenc commented 2023-08-27 20:00:21 +00:00 (Migrated from github.com)

Done

Done
Ferenc commented 2023-08-27 21:29:48 +00:00 (Migrated from github.com)

requested review from @biodranik

requested review from `@biodranik`
Ferenc commented 2023-08-27 21:29:50 +00:00 (Migrated from github.com)

requested review from @vng

requested review from `@vng`
biodranik commented 2023-08-30 22:39:25 +00:00 (Migrated from github.com)
  1. There likely was a reason why timeout "error" was not added initially. Did you check the existing code?
  2. MWMLocationStatus should be updated if this enum is updated. But let's decide first if it is really necessary.
  3. LocationState.java also should be updated. ditto.
1. There likely was a reason why timeout "error" was not added initially. Did you check the existing code? 2. MWMLocationStatus should be updated if this enum is updated. But let's decide first if it is really necessary. 3. LocationState.java also should be updated. ditto.
biodranik commented 2023-08-30 22:40:40 +00:00 (Migrated from github.com)

Looks like it's not serialized in settings, but I wouldn't change the existing order anyway.

Looks like it's not serialized in settings, but I wouldn't change the existing order anyway.
biodranik commented 2023-08-30 22:42:21 +00:00 (Migrated from github.com)

CHECK(false, (...));
Here and below. Crash should be immediate for developers' errors, in debug and in production.

`CHECK(false, (...));` Here and below. Crash should be immediate for developers' errors, in debug and in production.
biodranik commented 2023-08-30 22:42:54 +00:00 (Migrated from github.com)

Review: Commented

Did you test it? Does it work?

**Review:** Commented Did you test it? Does it work?
Ferenc commented 2023-08-31 09:44:40 +00:00 (Migrated from github.com)

It is a developer error if this fails.

It is a developer error if this fails.
Ferenc commented 2023-08-31 09:45:02 +00:00 (Migrated from github.com)

So can we keep it?

So can we keep it?
Ferenc commented 2023-08-31 09:45:52 +00:00 (Migrated from github.com)

Did you test it? Does it work?

So far I have not found any case in which it doesn't work. That doesn't mean that there can't be any.

> Did you test it? Does it work? So far I have not found any case in which it doesn't work. That doesn't mean that there can't be any.
Ferenc commented 2023-08-31 09:55:21 +00:00 (Migrated from github.com)

There likely was a reason why timeout "error" was not added initially. Did you check the existing code?

In the Qt positioning timeout is definitely an error
And I have checked the existing code, have not found anything, have I missed something?

> There likely was a reason why timeout "error" was not added initially. Did you check the existing code? In the Qt positioning [timeout is definitely an error](https://doc.qt.io/qt-6/qgeopositioninfosource.html#Error-enum) And I have checked the existing code, have not found anything, have I missed something?
Ferenc commented 2023-09-02 21:16:54 +00:00 (Migrated from github.com)

@biodranik Can I proceed to the 2. and 3. points?

`@biodranik` Can I proceed to the `2.` and `3.` points?
biodranik commented 2023-09-02 23:29:39 +00:00 (Migrated from github.com)

Yes.

From the Qt docs it looks like timeout error can be recoverable and unrecoverable. Looks like some additional logic is needed to properly handle different cases.

It would be better to add comments with a link and text that this is used only in Qt now.

Yes. From the Qt docs it looks like timeout error can be recoverable and unrecoverable. Looks like some additional logic is needed to properly handle different cases. It would be better to add comments with a link and text that this is used only in Qt now.
Ferenc commented 2023-09-03 11:35:54 +00:00 (Migrated from github.com)

Done. PTAL

Done. PTAL
Ferenc commented 2023-09-06 05:45:46 +00:00 (Migrated from github.com)

requested review from @biodranik

requested review from `@biodranik`
Ferenc commented 2023-09-06 17:59:58 +00:00 (Migrated from github.com)

@biodranik For your kind review

`@biodranik` For your kind review
biodranik commented 2023-09-08 21:06:29 +00:00 (Migrated from github.com)

Should AUTOMOC be set on all desktop platforms?

Should AUTOMOC be set on all desktop platforms?
biodranik commented 2023-09-08 21:07:57 +00:00 (Migrated from github.com)

Didn't we merge unique_ptr support?

Didn't we merge unique_ptr support?
Ferenc commented 2023-09-09 08:38:12 +00:00 (Migrated from github.com)

Yes we have, for CreateDesktopLocationService and this is not that one, this is CreateQtLocationService.
Here the raw pointer is currently still needed because of std::vector<LocationService *> m_services; , which has not been refactored to std::vector<std::unique_ptr<LocationService>> m_services; yet.
I could do that too in a separate PR, if it is desired and there is capacity for its review.

Yes we have, for `CreateDesktopLocationService` and this is not that one, this is `CreateQtLocationService`. Here the raw pointer is currently still needed because of `std::vector<LocationService *> m_services; `, which has not been refactored to `std::vector<std::unique_ptr<LocationService>> m_services; ` yet. I could do that too in a separate PR, if it is desired and there is capacity for its review.
Ferenc commented 2023-09-09 08:52:26 +00:00 (Migrated from github.com)

It was the bsdiff_tests which made it necessary here.
So far this PR was focusing on linux only,
perhaps as a preparation for the refactoring of the MacOS code, to leverage the qt_location_service,
Perhaps as such, it could make sense, but in general, IMHO all that would belong to a separate PR.

It was the `bsdiff_tests` which made it necessary here. So far this PR was focusing on linux only, perhaps as a preparation for the refactoring of the MacOS code, to leverage the `qt_location_service`, Perhaps as such, it could make sense, but in general, IMHO all that would belong to a separate PR.
Ferenc commented 2023-09-09 09:31:51 +00:00 (Migrated from github.com)

Here is the PR for that:

Here is the PR for that: https://git.omaps.dev/organicmaps/organicmaps/pulls/5985
vng commented 2023-09-11 02:09:15 +00:00 (Migrated from github.com)

Please, rebase, I will check on MacOS.

Please, rebase, I will check on MacOS.
biodranik commented 2023-09-11 06:45:01 +00:00 (Migrated from github.com)

make_unique?

make_unique?
biodranik commented 2023-09-11 06:47:43 +00:00 (Migrated from github.com)

approved this merge request

approved this merge request
Ferenc commented 2023-09-11 09:45:45 +00:00 (Migrated from github.com)

Done

Done
Ferenc commented 2023-09-11 09:47:23 +00:00 (Migrated from github.com)

Please, rebase, I will check on MacOS.

Rebased.

> Please, rebase, I will check on MacOS. Rebased.
Ferenc commented 2023-09-14 16:09:06 +00:00 (Migrated from github.com)

@vng Is there anything else needed here?

`@vng` Is there anything else needed here?
vng commented 2023-09-14 19:00:26 +00:00 (Migrated from github.com)

Well, I tried to use yours QtLocationService in MacOS, but no luck:

-- Could NOT find Qt6Positioning (missing: Qt6Positioning_DIR)
CMake Error at CMakeLists.txt:247 (find_package):
  Found package configuration file:

    /Users/vng/Developer/Qt/6.5.2/macos/lib/cmake/Qt6/Qt6Config.cmake

  but it set Qt6_FOUND to FALSE so package "Qt6" is considered to be NOT
  FOUND.  Reason given by package:

  Failed to find required Qt component "Positioning".

  Expected Config file at
  "/Users/vng/Developer/Qt/6.5.2/macos/lib/cmake/Qt6Positioning/Qt6PositioningConfig.cmake"
  does NOT exist

There is no Qt6Positioning lib in my Qt package. Whatever ..

Well, I tried to use yours QtLocationService in MacOS, but no luck: ``` -- Could NOT find Qt6Positioning (missing: Qt6Positioning_DIR) CMake Error at CMakeLists.txt:247 (find_package): Found package configuration file: /Users/vng/Developer/Qt/6.5.2/macos/lib/cmake/Qt6/Qt6Config.cmake but it set Qt6_FOUND to FALSE so package "Qt6" is considered to be NOT FOUND. Reason given by package: Failed to find required Qt component "Positioning". Expected Config file at "/Users/vng/Developer/Qt/6.5.2/macos/lib/cmake/Qt6Positioning/Qt6PositioningConfig.cmake" does NOT exist ``` There is no Qt6Positioning lib in my Qt package. Whatever ..
vng (Migrated from github.com) merged commit into master 2023-09-14 19:01:11 +00:00
vng (Migrated from github.com) closed this pull request 2023-09-14 19:01:12 +00:00
Member

I installed all packages added to the INSTALL.md, built and launched the desktop app.
Worked fine until I tried to press the position / crosshair button:

qt.positioning.geoclue2: Unable to start the client: "org.freedesktop.DBus.Error.UnknownMethod" "No such interface 'org.freedesktop.GeoClue2.Client' on object at path /org/freedesktop/GeoClue2/Client/1"
LOG TID(1) WARNING   624.012 platform/qt_location_service.cpp:117 OnErrorOccurred(): Location error occured QGeoPositionInfoSource::Error code: 0
Segmentation fault (core dumped)

I expect it do nothing or display an error maybe, but not crashing.

A laptop w/o GPS unit, Ubuntu 18.04.

I installed all packages added to the INSTALL.md, built and launched the desktop app. Worked fine until I tried to press the position / crosshair button: ``` qt.positioning.geoclue2: Unable to start the client: "org.freedesktop.DBus.Error.UnknownMethod" "No such interface 'org.freedesktop.GeoClue2.Client' on object at path /org/freedesktop/GeoClue2/Client/1" LOG TID(1) WARNING 624.012 platform/qt_location_service.cpp:117 OnErrorOccurred(): Location error occured QGeoPositionInfoSource::Error code: 0 Segmentation fault (core dumped) ``` I expect it do nothing or display an error maybe, but not crashing. A laptop w/o GPS unit, Ubuntu 18.04.
Ferenc commented 2023-09-15 09:27:20 +00:00 (Migrated from github.com)

@pastk

qt.positioning.geoclue2: Unable to start the client: "org.freedesktop.DBus.Error.UnknownMethod" "No such interface 'org.freedesktop.GeoClue2.Client' on object at path /org/freedesktop/GeoClue2/Client/1"

This is indicative of geoclue itself being misconfigured. Is there any other application that can use geoclue on your system?
Most importantly, does geobug work well? What is in /etc/geoclue/geoclue.conf?

LOG TID(1) WARNING 624.012 platform/qt_location_service.cpp:117 OnErrorOccurred(): Location error occured QGeoPositionInfoSource::Error code: 0
Segmentation fault (core dumped)

Regardless of the first issue this might need attention.

I expect it do nothing or display an error maybe, but not crashing.

That's what I have observed so far with supported LTS OS like Ubuntu 22.04

A laptop w/o GPS unit, Ubuntu 18.04.

A GPS unit is absolutely NOT needed, the vast majority of the tests were without GPS anyway.

Ubuntu 18.04

Even Ubuntu ended the general support for that, and with the official packages, organicmaps doesn't even compile on that system, so I guess the next set of questions could been, how did you even compile it.
But before that, back to most imprtant: Is there anything (like geobug) that can work on your system?

`@pastk` > qt.positioning.geoclue2: Unable to start the client: "org.freedesktop.DBus.Error.UnknownMethod" "No such interface 'org.freedesktop.GeoClue2.Client' on object at path /org/freedesktop/GeoClue2/Client/1" This is indicative of geoclue itself being misconfigured. Is there any other application that can use geoclue on your system? Most importantly, does [geobug](https://flathub.org/apps/page.codeberg.tpikonen.geobug) work well? What is in `/etc/geoclue/geoclue.conf`? >LOG TID(1) WARNING 624.012 platform/qt_location_service.cpp:117 OnErrorOccurred(): Location error occured QGeoPositionInfoSource::Error code: 0 Segmentation fault (core dumped) Regardless of the first issue this might need attention. > I expect it do nothing or display an error maybe, but not crashing. That's what I have observed so far with supported LTS OS like Ubuntu 22.04 > A laptop w/o GPS unit, Ubuntu 18.04. A GPS unit is absolutely NOT needed, the vast majority of the tests were without GPS anyway. > Ubuntu 18.04 Even Ubuntu ended the general support for that, and with the official packages, `organicmaps` doesn't even compile on that system, so I guess the next set of questions could been, how did you even compile it. But before that, back to most imprtant: Is there anything (like [geobug](https://flathub.org/apps/page.codeberg.tpikonen.geobug)) that can work on your system?
Member

Geobug (installed from the flathub) runs and shows my approx location (IP-based I think):

$ flatpak run page.codeberg.tpikonen.geobug

(geobug:2): dbind-WARNING **: 14:26:09.523: AT-SPI: Error retrieving accessibility bus address: org.freedesktop.DBus.Error.ServiceUnknown: org.freedesktop.DBus.Error.ServiceUnknown
Fontconfig error: Cannot load config file "/run/host/font-dirs.xml": No such file: /run/host/font-dirs.xml
[14:26:10] Geobug version 0.1.5 started
[14:26:10] Connecting to GeoClue with accuracy 'Street' ...
[14:26:10] Connected to GeoClue
[14:26:10] GeoClue client is active

Maybe flatpak runtimes contain some deps which are missing on my system?

I've attached my geoclue.conf (I've changed nothing there).

pastk-geoclue.conf.txt

re Ubunutu 18.04, recently I had to install Qt6 and some related libs from some PPA, otherwise it was fine (but its been long time since I setup OM initially).

Geobug (installed from the flathub) runs and shows my approx location (IP-based I think): ``` $ flatpak run page.codeberg.tpikonen.geobug (geobug:2): dbind-WARNING **: 14:26:09.523: AT-SPI: Error retrieving accessibility bus address: org.freedesktop.DBus.Error.ServiceUnknown: org.freedesktop.DBus.Error.ServiceUnknown Fontconfig error: Cannot load config file "/run/host/font-dirs.xml": No such file: /run/host/font-dirs.xml [14:26:10] Geobug version 0.1.5 started [14:26:10] Connecting to GeoClue with accuracy 'Street' ... [14:26:10] Connected to GeoClue [14:26:10] GeoClue client is active ``` Maybe flatpak runtimes contain some deps which are missing on my system? I've attached my geoclue.conf (I've changed nothing there). [pastk-geoclue.conf.txt](/uploads/7b943e6c8381c03e7bc075388e847808/pastk-geoclue.conf.txt) re Ubunutu 18.04, recently I had to install Qt6 and some related libs from some PPA, otherwise it was fine (but its been long time since I setup OM initially).
Ferenc commented 2023-09-15 12:39:38 +00:00 (Migrated from github.com)

Maybe flatpak runtimes contain some deps which are missing on my system?

I also suspect the same.

Could you try this build?:

flatpak install --user https://dl.flathub.org/build-repo/48680/app.organicmaps.desktop.flatpakref
> Maybe flatpak runtimes contain some deps which are missing on my system? I also suspect the same. Could you try this build?: ```bash flatpak install --user https://dl.flathub.org/build-repo/48680/app.organicmaps.desktop.flatpakref ```
Member

In this build nothing happens when I press a location button.

And on startup there are following log lines:

LOG TID(2) INFO      10.9457 search/processor.cpp:340 LoadCitiesBoundaries(): Loaded cities boundaries
qt.positioning.geoclue2: Unable to start the client: "org.freedesktop.DBus.Error.UnknownMethod" "No such interface 'org.freedesktop.GeoClue2.Client' on object at path /org/freedesktop/GeoClue2/Client/1"
LOG TID(1) WARNING   11.0501 platform/qt_location_service.cpp:117 OnErrorOccurred(): Location error occured QGeoPositionInfoSource::Error code: 0
In this build nothing happens when I press a location button. And on startup there are following log lines: ``` LOG TID(2) INFO 10.9457 search/processor.cpp:340 LoadCitiesBoundaries(): Loaded cities boundaries qt.positioning.geoclue2: Unable to start the client: "org.freedesktop.DBus.Error.UnknownMethod" "No such interface 'org.freedesktop.GeoClue2.Client' on object at path /org/freedesktop/GeoClue2/Client/1" LOG TID(1) WARNING 11.0501 platform/qt_location_service.cpp:117 OnErrorOccurred(): Location error occured QGeoPositionInfoSource::Error code: 0 ```
Ferenc commented 2023-09-15 14:47:13 +00:00 (Migrated from github.com)

QGeoPositionInfoSource::Error code: 0

This means that you have incorrect privileges. Copy-paste from the docs:
The connection setup to the remote positioning backend failed because the application lacked the required privileges.

> `QGeoPositionInfoSource::Error code: 0` This means that you have incorrect privileges. Copy-paste from the [docs](https://doc.qt.io/qt-6/qgeopositioninfosource.html#Error-enum): `The connection setup to the remote positioning backend failed because the application lacked the required privileges.`
Ferenc commented 2023-09-15 14:49:09 +00:00 (Migrated from github.com)

But it is weird, that geobug was able to connect and work properly. Although geobug does not rely on Qt to connect...
Anyhow I might spin up a 18.04 later to see what is going on.

But it is weird, that geobug was able to connect and work properly. Although geobug does not rely on Qt to connect... Anyhow I might spin up a `18.04` later to see what is going on.
Member

Hm its super weird but now I run your test flatpak build again and it crashes upon location button press just like my off-the-master build (just w/o a segfault line):

qt.positioning.geoclue2: Unable to start the client: "org.freedesktop.DBus.Error.UnknownMethod" "No such interface 'org.freedesktop.GeoClue2.Client' on object at path /org/freedesktop/GeoClue2/Client/1"
LOG TID(1) WARNING   8.05071 platform/qt_location_service.cpp:117 OnErrorOccurred(): Location error occured QGeoPositionInfoSource::Error code: 0

And there are no startup log lines mentioned in anymore.

I don't know why the first run was different, I don't recall changing anything since then...

Upd: I've also tried starting it as a root (to see if extra priviliges help) - no change.

Hm its super weird but now I run your test flatpak build again and it crashes upon location button press just like my off-the-master build (just w/o a segfault line): ``` qt.positioning.geoclue2: Unable to start the client: "org.freedesktop.DBus.Error.UnknownMethod" "No such interface 'org.freedesktop.GeoClue2.Client' on object at path /org/freedesktop/GeoClue2/Client/1" LOG TID(1) WARNING 8.05071 platform/qt_location_service.cpp:117 OnErrorOccurred(): Location error occured QGeoPositionInfoSource::Error code: 0 ``` And there are no startup log lines mentioned in https://git.omaps.dev/organicmaps/organicmaps/pulls/5823#issuecomment-1721347205 anymore. I don't know why the first run was different, I don't recall changing anything since then... Upd: I've also tried starting it as a root (to see if extra priviliges help) - no change.
biodranik commented 2023-09-16 11:39:20 +00:00 (Migrated from github.com)

@Ferenc- is it possible to avoid build errors when NOT building a desktop client target with cmake?

tools/unix/build_omim.sh -d generator_tool

-- Could NOT find Qt6Positioning (missing: Qt6Positioning_DIR)
CMake Error at platform/CMakeLists.txt:173 (find_package):
  Found package configuration file:

    /usr/lib/x86_64-linux-gnu/cmake/Qt6/Qt6Config.cmake

  but it set Qt6_FOUND to FALSE so package "Qt6" is considered to be NOT
  FOUND.  Reason given by package:

  Failed to find Qt component "Positioning".

  Expected Config file at
  "/usr/lib/x86_64-linux-gnu/cmake/Qt6Positioning/Qt6PositioningConfig.cmake"
  does NOT exist

`@Ferenc-` is it possible to avoid build errors when NOT building a desktop client target with cmake? `tools/unix/build_omim.sh -d generator_tool` ``` -- Could NOT find Qt6Positioning (missing: Qt6Positioning_DIR) CMake Error at platform/CMakeLists.txt:173 (find_package): Found package configuration file: /usr/lib/x86_64-linux-gnu/cmake/Qt6/Qt6Config.cmake but it set Qt6_FOUND to FALSE so package "Qt6" is considered to be NOT FOUND. Reason given by package: Failed to find Qt component "Positioning". Expected Config file at "/usr/lib/x86_64-linux-gnu/cmake/Qt6Positioning/Qt6PositioningConfig.cmake" does NOT exist ```
Ferenc commented 2023-09-16 18:53:20 +00:00 (Migrated from github.com)

Hm its super weird but now I run your test flatpak build again and it crashes upon location button press just like my off-the-master build (just w/o a segfault line):

qt.positioning.geoclue2: Unable to start the client: "org.freedesktop.DBus.Error.UnknownMethod" "No such interface 'org.freedesktop.GeoClue2.Client' on object at path /org/freedesktop/GeoClue2/Client/1"
LOG TID(1) WARNING   8.05071 platform/qt_location_service.cpp:117 OnErrorOccurred(): Location error occured QGeoPositionInfoSource::Error code: 0

And there are no startup log lines mentioned in #5823 (comment) anymore.

I don't know why the first run was different, I don't recall changing anything since then...

Upd: I've also tried starting it as a root (to see if extra priviliges help) - no change.

Very odd, I have now installed a 18.04 for the sake of this investigation, but for me (so far) there is no crash after QGeoPositionInfoSource::Error code: 0.
And this is a fresh install.

> Hm its super weird but now I run your test flatpak build again and it crashes upon location button press just like my off-the-master build (just w/o a segfault line): > > ``` > qt.positioning.geoclue2: Unable to start the client: "org.freedesktop.DBus.Error.UnknownMethod" "No such interface 'org.freedesktop.GeoClue2.Client' on object at path /org/freedesktop/GeoClue2/Client/1" > LOG TID(1) WARNING 8.05071 platform/qt_location_service.cpp:117 OnErrorOccurred(): Location error occured QGeoPositionInfoSource::Error code: 0 > ``` > > And there are no startup log lines mentioned in [#5823 (comment)](https://git.omaps.dev/organicmaps/organicmaps/pulls/5823#issuecomment-1721347205) anymore. > > I don't know why the first run was different, I don't recall changing anything since then... > > Upd: I've also tried starting it as a root (to see if extra priviliges help) - no change. Very odd, I have now installed a `18.04` for the sake of this investigation, but for me (so far) there is no crash after `QGeoPositionInfoSource::Error code: 0`. And this is a fresh install.
Ferenc commented 2023-09-16 18:54:45 +00:00 (Migrated from github.com)

@Ferenc- is it possible to avoid build errors when NOT building a desktop client target with cmake?

tools/unix/build_omim.sh -d generator_tool

-- Could NOT find Qt6Positioning (missing: Qt6Positioning_DIR)
CMake Error at platform/CMakeLists.txt:173 (find_package):
  Found package configuration file:

    /usr/lib/x86_64-linux-gnu/cmake/Qt6/Qt6Config.cmake

  but it set Qt6_FOUND to FALSE so package "Qt6" is considered to be NOT
  FOUND.  Reason given by package:

  Failed to find Qt component "Positioning".

  Expected Config file at
  "/usr/lib/x86_64-linux-gnu/cmake/Qt6Positioning/Qt6PositioningConfig.cmake"
  does NOT exist

I will look into this.

> `@Ferenc-` is it possible to avoid build errors when NOT building a desktop client target with cmake? > > `tools/unix/build_omim.sh -d generator_tool` > > ``` > -- Could NOT find Qt6Positioning (missing: Qt6Positioning_DIR) > CMake Error at platform/CMakeLists.txt:173 (find_package): > Found package configuration file: > > /usr/lib/x86_64-linux-gnu/cmake/Qt6/Qt6Config.cmake > > but it set Qt6_FOUND to FALSE so package "Qt6" is considered to be NOT > FOUND. Reason given by package: > > Failed to find Qt component "Positioning". > > Expected Config file at > "/usr/lib/x86_64-linux-gnu/cmake/Qt6Positioning/Qt6PositioningConfig.cmake" > does NOT exist > ``` I will look into this.
Ferenc commented 2023-09-17 12:54:49 +00:00 (Migrated from github.com)

mentioned in merge request

mentioned in merge request !6054
fgaz commented 2023-09-17 17:14:39 +00:00 (Migrated from github.com)

mentioned in issue

mentioned in issue #3870
Ferenc commented 2023-09-18 07:19:46 +00:00 (Migrated from github.com)

mentioned in issue

mentioned in issue #5114
Member

mentioned in issue

mentioned in issue #6328
Ferenc commented 2024-11-25 09:54:24 +00:00 (Migrated from github.com)

mentioned in issue

mentioned in issue #9728
Ferenc commented 2025-01-28 15:59:58 +00:00 (Migrated from github.com)

mentioned in merge request

mentioned in merge request !9981
biodranik (Migrated from github.com) approved these changes 2025-03-22 17:49:44 +00:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: organicmaps/organicmaps#5823
No description provided.