After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 709703 - rules files not noarch
rules files not noarch
Status: RESOLVED FIXED
Product: tracker
Classification: Core
Component: Extractor
unspecified
Other Linux
: Normal normal
: ---
Assigned To: tracker-extractor
Depends on:
Blocks:
 
 
Reported: 2013-10-09 03:08 UTC by Matthias Clasen
Modified: 2013-10-11 15:35 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Add a newline at the end of file (757 bytes, patch)
2013-10-10 14:11 UTC, Debarshi Ray
committed Details | Review
libtracker-extract, tracker-extract: Remove $modulesdir from *.rules (20.50 KB, patch)
2013-10-10 14:11 UTC, Debarshi Ray
committed Details | Review
Use $(MKDIR_P) instead of $(mkdir_p) (737 bytes, patch)
2013-10-10 14:12 UTC, Debarshi Ray
committed Details | Review
tracker-extract: Rename *.rules.in to *.rules (26.87 KB, patch)
2013-10-11 15:06 UTC, Debarshi Ray
committed Details | Review

Description Matthias Clasen 2013-10-09 03:08:55 UTC
The rules files that are installed in /usr/share/tracker/extract-rules are not architecture-neutral, since they include a full path to the module, like

/usr/lib64/tracker-0.16/extract-modules/libextract-gstreamer.so

This causes problem for multilib installations.

I would suggest to simply allow relative paths here, and prepend

${libdir}/tracker-0.16/extract-modules 

if the ModulePath does not start with a /
Comment 1 Martyn Russell 2013-10-09 16:18:16 UTC
(In reply to comment #0)
> The rules files that are installed in /usr/share/tracker/extract-rules are not
> architecture-neutral, since they include a full path to the module, like
> 
> /usr/lib64/tracker-0.16/extract-modules/libextract-gstreamer.so
> 
> This causes problem for multilib installations.
> 
> I would suggest to simply allow relative paths here, and prepend
> 
> ${libdir}/tracker-0.16/extract-modules 
> 
> if the ModulePath does not start with a /

Hi Matthias, just so I understand:

Do you mean the content of the .rules files should be something like:

  ModulePath=../../../lib64/tracker-0.16/extract-modules/libextract-gstreamer.so

and at runtime we use a simple check like:

  if (g_str_has_prefix(modulepath, "/")) {
    modulepath = g_build_filename(libdir, modulepath, NULL);
  }

perhaps?

--

Also, we currently use ${libdir} at build time in Makefile.am and I wonder why this itself doesn't point to the right place (/usr/lib64) already? From what I've researched, /usr/lib should be used over /usr/lib64 anyway - which raises some questions here (unless it's specifically stated with autogen.sh or configure of course).

Finally, would you prefer the prefix for ModulePath to be configurable at build time instead of relying on ${libdir} as it is now using something like ./configure --foo-dir=/bar?

Thanks :)
Comment 2 Matthias Clasen 2013-10-09 23:14:03 UTC
No, I would suggest that the rule file just contains

ModulePath=libextract-gstreamer.so

and the runtime does

  if (g_str_has_prefix(modulepath, "/")) {
    modulepath = g_build_filename(libdir, "tracker-0.16", "extract-modules", modulepath, NULL);
  }

The important part is to get the 'lib64' out of the rules files, since that will give you a lib<>lib64 difference on rh-style multilib systems
Comment 3 Martyn Russell 2013-10-10 09:38:29 UTC
(In reply to comment #2)
> No, I would suggest that the rule file just contains
> 
> ModulePath=libextract-gstreamer.so
> 
> and the runtime does
> 
>   if (g_str_has_prefix(modulepath, "/")) {
>     modulepath = g_build_filename(libdir, "tracker-0.16", "extract-modules",
> modulepath, NULL);
>   }
> 
> The important part is to get the 'lib64' out of the rules files, since that
> will give you a lib<>lib64 difference on rh-style multilib systems

I see. That makes sense.

I do wonder why this would be any different in reality though. The ${libdir} which is passed at build time shouldn't change at runtime right? And libdir in the g_build_filename() example above is actually taken from build time variables. Forgive the persistence here, I just wonder how this can ever be different and where the problem really comes from :)

All of that aside, it does make sense to have less information in those rules files (regarding the path), I agree.

In a sense we do already have this feature by allowing the env var TRACKER_EXTRACTOR_RULES_DIR so it should be trivial to work this in.
Comment 4 Debarshi Ray 2013-10-10 11:29:08 UTC
(In reply to comment #3)
> I do wonder why this would be any different in reality though. The ${libdir}
> which is passed at build time shouldn't change at runtime right? And libdir in
> the g_build_filename() example above is actually taken from build time
> variables. Forgive the persistence here, I just wonder how this can ever be
> different and where the problem really comes from :)

Based on my limited understanding of multilib, I think it would matter if you were to have the tracker libraries installed for multiple architectures at the same time. RPM would see that the shared content in /usr/share/tracker is different for each architecture and freak out.
Comment 5 Debarshi Ray 2013-10-10 14:11:03 UTC
Created attachment 256912 [details] [review]
Add a newline at the end of file
Comment 6 Debarshi Ray 2013-10-10 14:11:51 UTC
Created attachment 256914 [details] [review]
libtracker-extract, tracker-extract: Remove $modulesdir from *.rules
Comment 7 Debarshi Ray 2013-10-10 14:12:46 UTC
Created attachment 256915 [details] [review]
Use $(MKDIR_P) instead of $(mkdir_p)
Comment 8 Martyn Russell 2013-10-10 15:55:20 UTC
Comment on attachment 256914 [details] [review]
libtracker-extract, tracker-extract: Remove $modulesdir from *.rules

Superb patch thanks Rishi :)
Comment 9 Martyn Russell 2013-10-10 15:58:30 UTC
The only thing I would add is, I wonder if it makes sense to have .in files at
all now. The sed call is also no longer useful AFAICS.

I might look to cleaning this up later on unless you fancy doing that too
Rishi?

Thanks again for the superb patches here :)
Comment 10 Debarshi Ray 2013-10-10 16:04:28 UTC
(In reply to comment #9)
> The only thing I would add is, I wonder if it makes sense to have .in files at
> all now. The sed call is also no longer useful AFAICS.

Yes, you are right. I will change them to *.rules.

Thanks for the review.
Comment 11 Debarshi Ray 2013-10-11 15:06:47 UTC
Created attachment 257007 [details] [review]
tracker-extract: Rename *.rules.in to *.rules
Comment 12 Martyn Russell 2013-10-11 15:23:10 UTC
Comment on attachment 257007 [details] [review]
tracker-extract: Rename *.rules.in to *.rules

Looks good thanks Rishi