Tracker 3 app porting

Progress is good so far with Tracker 3 and now we are at a critical point of porting apps. Although Tracker 2 and 3 can be installed on the same system, nobody wants two indexer daemons crawling the same filesystem, so we need to have all the core GNOME apps switch to Tracker 3 at the same time. We hope this can be achieved for GNOME 3.38 which enters beta in August.

We are tracking the porting work at

This thread is for anyone who can help with porting and testing apps to ask questions and collect useful information!

Tracker 3 app porting in brief

Apps that search and list content need to do two things:

  • Replace tracker_sparql_connection_get() with tracker_sparql_connection_bus_new("org.freedesktop.Tracker3.Miner.Files", NULL, NULL, &error);
  • Choose graphs for your queries and add e.g. GRAPH tracker:Video { } inside the brackets of your SELECT { } queries.

Flatpak permissions will also need to be changed. The Flatpak portal will be ready soon, until then use --talk-name=org.freedesktop.Tracker3.Miner.Files for your app.

Apps that store data with Tracker need to set up a private Tracker store. My branch of Nautilus has an example of this.

Read the full migration guide for more detailed information, and please ask about any things that are stil unclear after reading it!

Testing apps against Tracker 3

Tracker comes in 2 parts. The core of Tracker 3 is a library and it’s included in the latest (master) GNOME Flatpak SDK, so if apps can already use it.

The indexer daemons come in a package called tracker-miners and these need to run on the host, i.e. outside of any sandbox. Until tracker-miners 3 is packaged for distros you will need to build this yourself. The way I do this is documented in the README.

Tracker is designed to be automatically activated by D-Bus. This won’t work if it’s installed into /opt/tracker3 as your session D-Bus daemon won’t find the .service files. To work around this, we provide a utility called tracker-sandbox.

In order to test apps against Tracker 3, I’ve been doing something like this:

/opt/tracker3/lib/tracker-3.0/trackertestutils/tracker-sandbox --use-session-dirs -- ./my-app

This works for flatpak run invocations and running the app directly. The tracker-sandbox tool has a --debug-dbus flag that will enable verbose debug output. You can enable different TRACKER_DEBUG flags to make things more verbose still.

Like I said, you can track progress of porting here. All help with porting and testing is appreciated! :slight_smile:

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.