Commit be030a14 authored by Sumaid Syed's avatar Sumaid Syed

Merge branch 'master' of

parents 9d7a0c23 f27cef56
Pipeline #84819 failed with stage
in 2 minutes and 5 seconds
......@@ -15,7 +15,7 @@ test-fedora-latest:
# screenful of junk each time unless we strip these.
unset $(env|grep -o '^CI_[^=]*')
su tracker -c 'cd build; dbus-run-session -- env LANG=en_US.UTF8 meson test --print-errorlogs'
su tracker -c 'cd build; meson test --print-errorlogs'
when: always
# Tracker
Tracker is a search engine and that allows the user to find their
data as fast as possible. Users can search for their files and
search for content in their files too.
Tracker is an efficient search engine and
[triplestore]( for desktop, embedded
and mobile.
Tracker is a semantic data storage for desktop and mobile devices.
Tracker uses W3C standards for RDF ontologies using Nepomuk with
SPARQL to query and update the data.
The Tracker project is divided into two main repositories:
Tracker is a central repository of user information, that provides
two big benefits for the desktop; shared data between applications
and information which is relational to other information (for
example: mixing contacts with files, locations, activities and
* [Tracker core]( contains the database
(*tracker-store*), the database ontologies, the commandline user
interface (`tracker`), and several support libraries.
This central repository works with a well defined data model that
applications can rely on to store and recover their information.
That data model is defined using a semantic web artifact called
ontology. An ontology defines the relationships between the
information stored in the repository.
* [Tracker Miners]( contains
the indexer daemon (*tracker-miner-fs*) and tools to extract metadata
from many different filetypes.
An EU-funded project called Nepomuk was started to define some of
the core ontologies to be modeled on the Desktop. Tracker uses this
to define the data's relationships in a database.
More information on Tracker can be found at:
All discussion related to tracker happens on the Tracker
mailing list
* <>
Source code and issue tracking:
IRC channel #tracker on:
Bugs and feature requests should be filed at:
More infomation on Tracker can be found at:
Repository can be found at:
The official RoadMap (aka TODO) can be found at:
## Use Cases
Tracker is the most powerful open source metadata database and
indexer framework currently available and because it is built
around a combination indexer and SQL database and not a
dedicated indexer, it has much more powerful use cases:
* Provide search and indexing facilities similar to those on
other systems (Windows Vista and Mac OS X).
* <>
* Common database storage for all first class objects (e.g. a
common music/photo/contacts/email/bookmarks/history database)
complete with additional metadata and tags/keywords.
All discussion related to Tracker happens on:
* Comprehensive one stop solution for all applications needing
an object database, powerful search (via RDF Query), first class
methods, related metadata and user-definable metadata/tags.
* <>
* Can provide a full semantic desktop with metadata everywhere.
* Can provide powerful criteria-based searching suitable for
creating smart file dialogs and vfolder systems.
* Can provide a more intelligent desktop using statistical
## Features
* Desktop-neutral design (it's a freedesktop product built
around other freedesktop technologies like D-Bus and XDGMime
but contains no GNOME-specific dependencies besides GLib).
* Very memory efficient. Unlike some other indexers, Tracker is
designed and built to run well on mobile and desktop systems with
lower memory (256MB or less).
* Non-bloated and written in C for maximum efficiency.
* Small size and minimal dependencies makes it easy to bundle
into various distros, including live CDs.
* Provides option to disable indexing when running on battery.
* Provides option to index removable devices.
* Implements the freedesktop specification for metadata
* Extracts embedded File, Image, Document and Audio type
metadata from files.
IRC channel #tracker on:
* Supports the WC3's RDF Query syntax for querying metadata.
* [](irc://
* Provides support for both free text search (like Beagle/Google)
as well as structured searches using RDF Query.
Related projects:
* Responds in real time to file system changes to keep its
metadata database up to date and in sync.
* [GNOME Online Miners](
extends Tracker to allow searching and indexing some kinds of online
* Fully extensible with custom metadata - you can store,
retrieve, register and search via RDF Query all your own custom
# Developing Tracker
* Can extract a file's contents as plain text and index them.
If you want to help develop and improve Tracker, great! Remember that Tracker
is a middleware component, designed to be integrated into larger codebases. To
fully test a change you may need to build and test Tracker as part of another
* Can provide thumbnailing on the fly.
For the GNOME desktop, consider using the documented [Building a System
Component]( workflow.
* It auto-pauses indexing when running low on diskspace.
It's also possible to build Tracker on its own and install it inside your home
directory for testing purposes. Read on for instructions on how to do this.
## Compilation
To setup the project for compilation after checking it out from
the git repository, use:
meson build --prefix=/usr --sysconfdir=/etc
Tracker uses the [Meson build system](, which you must
have installed in order to build Tracker.
To start compiling the project use:
We recommend that you build tracker core as a subproject of tracker-miners.
You can do this by cloning both repos, then creating a symlink in the
`subprojects/` directory of tracker-miners.git to the tracker.git checkout.
ninja -C build
ninja install
git clone
git clone
If you install using any other prefix, you might have problems
with files not being installed correctly. (You may need to copy
and amend the dbus service file to the correct directory and/or
might need to update ld_conf if you install into non-standard
mkdir tracker-miners/subprojects
ln -s ../../tracker tracker-miners/subprojects/
## Running Tracker
Now you can run the commands below to build Tracker and install it in a
new, isolated prefix named `opt/tracker` inside your home folder.
### Usage
> NOTE: If you see 'dependency not found' errors from Meson, that means there
> is a package missing on your computer that you need to install so you can
> compile Tracker. On Ubuntu/Debian, you can run `apt build-dep tracker-miners`
> and on Fedora `dnf build-dep tracker-miners` to install all the necessary
> packages.
Tracker normally starts itself when users log in. You can indexing by running:
cd tracker-miners
meson ./build --prefix=$HOME/opt/tracker -Dtracker_core=subproject
cd build
ninja install
## Running the testsuite
You can configure how this works using:
At this point you can run the Tracker test suite from the `build` directory:
meson test --print-errorlogs
You can monitor data miners using:
## Developing with tracker-sandbox
Tracker normally runs automatically, indexing content in the background so that
search results are available quickly when needed.
You can do simple searching using an applet:
When developing and testing Tracker you will normally want it to run in the
foreground instead. The `tracker-sandbox` tool exists to help with this.
You can run the tool directly from the tracker.git source tree. Ensure you are
in the top of the tracker source tree and type this to see the --help output:
You can do more extensive searching using:
./utils/sandbox/ --help
You should always pass the `--prefix` option, which should be the same as the
--prefix argument you passed to Meson. You also need to use `--index` which
controls where internal state files like the database are kept. You may also
want to pass `--debug` to see detailed log output.
### Setting Inotify Watch Limit
Now you can index some files using `--update` mode. Here's how to index files
in `~/Documents` for example:
When watching large numbers of folders, its possible to exceed
the default number of inotify watches. In order to get real time
updates when this value is exceeded it is necessary to increase
the number of allowed watches. This can be done as follows:
./utils/sandbox/ --prefix ~/opt/tracker --index ~/tracker-content \
--update --content ~/Documents
1. Add this line to /etc/sysctl.conf:
"fs.inotify.max_user_watches = (number of folders to be
watched; default used to be 8192 and now is 524288)"
You can then list the files that have been indexed...
2. Reboot the system OR (on a Debian-like system) run
"sudo /etc/init.d/procps restart"
./utils/sandbox/ --prefix ~/opt/tracker --index ~/tracker-content \
## Further Help
... run a full-text search ...
### Man pages
./utils/sandbox/ --prefix ~/opt/tracker --index ~/tracker-content \
--search "bananas"
Every config file and every binary has a man page. If you start with
tracker-store, you should be able to find out about most other
commands on the SEE ALSO section.
... or run a SPARQL query on the content:
### Utilities
./utils/sandbox/ --prefix ~/opt/tracker --index ~/tracker-content \
--sparql "SELECT ?url { ?resource a nfo:FileDataObject ; nie:url ?url . }"
There are a range of tracker utilities that help you query for data.
You can also open a shell inside the sandbox environment. From here you can run
the `tracker` commandline tool, and you can run the Tracker daemons manually
under a debugger such as GDB.
For more information about developing Tracker, look at
project('tracker', 'c', 'vala',
version: '2.2.2',
version: '2.3.0',
meson_version: '>=0.47')
gnome = import('gnome')
......@@ -270,6 +270,7 @@ conf.set('TRACKER_INTERFACE_AGE', 0)
conf.set('TRACKER_BINARY_AGE', 100 * tracker_minor_version + tracker_micro_version)
# Config that goes in some other generated files (.desktop, .pc, etc)
conf.set('abs_top_builddir', meson.current_build_dir())
conf.set('exec_prefix', get_option('prefix'))
conf.set('bindir', join_paths(get_option('prefix'), get_option('bindir')))
conf.set('datadir', datadir)
......@@ -331,6 +332,7 @@ vapi_dir = join_paths(get_option('prefix'), get_option('datadir'), 'vala', 'vapi
glib_mkenums = find_program('glib-mkenums')
g_ir_compiler = find_program('g-ir-compiler', gobject_introspection.get_pkgconfig_variable('g_ir_compiler'))
g_ir_merge = find_program('g-ir-merge', join_paths(meson.current_source_dir(), 'utils', 'g-ir-merge', 'g-ir-merge'))
dbus_run_session = find_program('dbus-run-session')
gir_dir = gobject_introspection.get_pkgconfig_variable('girdir',
define_variable: [ 'datadir', datadir ])
test_runner = find_program('')
test_runner = configure_file(
input: '',
output: '',
configuration: conf)
test_runner = find_program(test_runner)
config_json = configure_file(
input: '',
......@@ -4,8 +4,6 @@
set -e
export TEMP_DIR=`mktemp --tmpdir -d tracker-test-XXXX`
# We need to use the actual home directory for some tests because
......@@ -17,6 +15,6 @@ export REAL_HOME=`echo ~`
echo "Running $@"
dbus-run-session -- "$@"
dbus-run-session --config-file=@abs_top_builddir@/tests/test-bus.conf -- "$@"
......@@ -4,4 +4,7 @@ gvdb_test = executable('gvdb-test',
include_directories: configinc,
test('gvdb', gvdb_test)
tests += {
'name': 'gvdb',
'exe': gvdb_test,
......@@ -20,7 +20,10 @@ foreach base_name: libtracker_common_tests
dependencies: libtracker_common_test_deps,
c_args: test_c_args)
test(test_name, binary)
tests += {
'name': test_name,
'exe': binary
# This is a manual test case
......@@ -11,10 +11,6 @@ libtracker_data_slow_tests = [
libtracker_data_test_environment = environment()
libtracker_data_test_environment.set('TRACKER_LANGUAGE_STOP_WORDS_DIR', '@0@/src/libtracker-common/stop-words'.format(source_root))
libtracker_data_test_environment.set('GSETTINGS_SCHEMA_DIR', join_paths(meson.build_root(), 'data'))
libtracker_data_test_deps = [tracker_common_dep, tracker_data_dep, tracker_sparql_dep]
foreach base_name: libtracker_data_tests
......@@ -26,8 +22,11 @@ foreach base_name: libtracker_data_tests
dependencies: libtracker_data_test_deps,
c_args: test_c_args)
test(test_name, binary,
env: libtracker_data_test_environment)
tests += {
'name': test_name,
'exe': binary,
'requires_dbus': true,
foreach base_name: libtracker_data_slow_tests
......@@ -39,7 +38,10 @@ foreach base_name: libtracker_data_slow_tests
dependencies: libtracker_data_test_deps,
c_args: test_c_args)
test(test_name, binary,
timeout: 180,
env: libtracker_data_test_environment)
tests += {
'name': test_name,
'exe': binary,
'requires_dbus': true,
'timeout': 180
libtracker_fts_test_environment = environment()
libtracker_fts_test_environment.set('GSETTINGS_SCHEMA_DIR', join_paths(meson.build_root(), 'data'))
fts_test = executable('tracker-fts-test',
dependencies: [tracker_common_dep, tracker_sparql_dep, tracker_data_dep, tracker_testcommon_dep],
c_args: test_c_args
test('fts', fts_test,
env: libtracker_fts_test_environment)
tests += {
'name': 'fts',
'exe': fts_test,
'requires_dbus': true,
......@@ -22,10 +22,6 @@ libtracker_miner_test_c_args = [
libtracker_miner_test_environment = environment()
libtracker_miner_test_environment.set('TRACKER_LANGUAGE_STOP_WORDS_DIR', '@0@/src/libtracker-common/stop-words'.format(source_root))
libtracker_miner_test_environment.set('GSETTINGS_SCHEMA_DIR', join_paths(meson.build_root(), 'data'))
libtracker_miner_test_deps = [tracker_common_dep, tracker_miner_dep, tracker_sparql_dep]
foreach base_name: libtracker_miner_tests
......@@ -38,8 +34,10 @@ foreach base_name: libtracker_miner_tests
c_args: libtracker_miner_test_c_args,
link_with: [libtracker_miner_private])
test(test_name, binary,
env: libtracker_miner_test_environment)
tests += {
'name': test_name,
'exe': binary
foreach base_name: libtracker_miner_slow_tests
......@@ -52,7 +50,9 @@ foreach base_name: libtracker_miner_slow_tests
c_args: libtracker_miner_test_c_args,
link_with: [libtracker_miner_private])
test(test_name, binary,
env: libtracker_miner_test_environment,
timeout: 180)
tests += {
'name': test_name,
'exe': binary,
'timeout': 180
libtracker_sparql_tests = [
libtracker_sparql_test_c_args = tracker_c_args + [
......@@ -13,19 +8,24 @@ libtracker_sparql_test_deps = [
tracker_common_dep, tracker_sparql_dep
libtracker_sparql_test_environment = environment()
libtracker_sparql_test_environment.set('TRACKER_LANGUAGE_STOP_WORDS_DIR', '@0@/src/libtracker-common/stop-words'.format(source_root))
libtracker_sparql_test_environment.set('GSETTINGS_SCHEMA_DIR', join_paths(meson.build_root(), 'data'))
tracker_resource_test = executable('tracker-resource-test',
dependencies: libtracker_sparql_test_deps,
c_args: libtracker_sparql_test_c_args)
foreach base_name: libtracker_sparql_tests
source = 'tracker-@0@-test.c'.format(base_name)
binary_name = 'tracker-@0@-test'.format(base_name)
test_name = 'sparql-@0@'.format(base_name)
tests += {
'name': 'tracker-resource-test',
'exe': tracker_resource_test,
binary = executable(binary_name, source,
dependencies: libtracker_sparql_test_deps,
c_args: libtracker_sparql_test_c_args)
tracker_sparql_test = executable('tracker-sparql-test',
dependencies: libtracker_sparql_test_deps,
c_args: libtracker_sparql_test_c_args)
test(test_name, binary,
env: libtracker_sparql_test_environment)
tests += {
'name': 'tracker-sparql-test',
'exe': tracker_sparql_test,
'is_parallel': false,
'requires_dbus': true,
tests = []
......@@ -15,3 +17,47 @@ subdir('tracker-steroids')
if get_option('functional_tests')
test_bus_conf_file = configure_file(
input: '',
output: 'test-bus.conf',
configuration: conf)
foreach t: tests
test_name = t.get('name')
test_exe = t.get('exe')
test_timeout = t.get('timeout', 30)
# This flag marks unit tests which can't run alongside other unit tests. It
# generally indicates a bug or design flaw in that test.
test_is_parallel = t.get('is_parallel', true)
# This flag marks unit tests which need to contact a D-Bus session bus. This
# is a sign of a bad unit test -- anything which uses D-Bus belongs in the
# functional-tests directory.
test_requires_dbus = t.get('requires_dbus', false)
test_env = environment()
test_env.set('GSETTINGS_SCHEMA_DIR', join_paths(build_root, 'data'))
test_env.set('TRACKER_LANGUAGE_STOP_WORDS_DIR', join_paths(source_root, 'src', 'libtracker-common', 'stop-words'))
test_env.set('TRACKER_TEST_DOMAIN_ONTOLOGY_RULE', join_paths(source_root, 'src', 'tracker-store', 'default.rule'))
test_env.set('TRACKER_DB_ONTOLOGIES_DIR', join_paths(source_root, 'src', 'ontologies', 'nepomuk'))
test_env.set('LANG', 'en_US.UTF8')
if test_requires_dbus
test (test_name, dbus_run_session,
env: test_env,
args: ['--config-file=@0@'.format(join_paths(meson.current_build_dir(), 'test-bus.conf')),
timeout: test_timeout,
is_parallel: test_is_parallel)
test (test_name, test_exe,
env: test_env,
timeout: test_timeout,
is_parallel: test_is_parallel)
test_dbus_service_file = configure_file(
input: '',
output: 'org.freedesktop.Tracker1.service',
configuration: conf)
[D-BUS Service]
<!DOCTYPE busconfig PUBLIC "-//freedesktop//DTD D-BUS Bus Configuration 1.0//EN"
<!-- Our well-known bus type, don't change this -->
<policy context="default">
<!-- Allow everything to be sent -->
<allow send_destination="*"/>
<!-- Allow everything to be received -->
<allow eavesdrop="true"/>
<!-- Allow anyone to own anything -->
<allow own="*"/>
......@@ -7,4 +7,8 @@ steroids_test = executable('tracker-steroids-test',
dependencies: [tracker_common_dep, tracker_sparql_dep],
c_args: [tracker_c_args, test_c_args])
test('steroids', steroids_test)
tests += {
'name': 'steroids',
'exe': steroids_test,
'requires_dbus': true,
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment