Menu

#147 Handle Tracker 3.x API changes

None
closed
nobody
None
1
2023-02-12
2021-02-05
No

I am attaching a patch to make Netatalk able to optionally build and run with Tracker (miners) 3.x, while preserving compatibility with older versions. From the patch commit subject:

Spotlight: Allow building with Tracker 3.x

This recent Tracker series contain some changes wrt the older versions,
notably to netatalk:
  - The TrackerSparqlConnection constructor changed, it is no longer
    a singleton.
  - The topology of the data graph is slightly different (even though
    it conforms to the same ontology/schema). Tracker data is now split
    between "physical" (e.g. a file in a filesystem) and "logical" (e.g.
    a representation of the content) interrelated with each other. Before,
    both aspects would be conflated in a single resource.

For the former, handle this new constructor if built with Tracker 3.x,
accessing the tracker-miner-fs instance specifically. For the latter,
adapt the SPARQL query so it works correctly on both 3.x and prior
versions, despite the difference.
1 Attachments

Related

Patches: #147

Discussion

  • knight-of-ni

    knight-of-ni - 2021-03-12

    I am attempting to use this patch for netatalk package in fedora repos, but the build fails:

    make[4]: Leaving directory '/builddir/build/BUILD/netatalk-3.1.12/etc/spotlight'
    In file included from sparql_parser.y:14:
    ../../include/atalk/spotlight.h:32:10: fatal error: libtracker-miner/tracker-miner.h: No such file or directory
       32 | #include <libtracker-miner/tracker-miner.h>
    

    tracker-miner.h is not part of tracker3-devel package. I am not familiar with the tracker API so any help to fix this would be appreciated.

     
  • Carlos Garnacho

    Carlos Garnacho - 2021-03-12

    Oops, thanks for spotting! That #include can be safely removed, I'll update the patch doing that.

     
  • Carlos Garnacho

    Carlos Garnacho - 2021-03-12

    Indeed, I missed the .m4 checks :). I have included your changes in the patch, I hope you don't mind. The new patch is attached.

     
  • knight-of-ni

    knight-of-ni - 2021-03-12

    OK, almost have it. With a few more changes, I got the patch to build.

    This line in the patch fails:
    AC_DEFINE(HAVE_TRACKER3, [test x"$ac_cv_tracker_pkg_version" = x"3.0"], [Define if Tracker3 is used])

    Autotools takes that test and stuffs it into config.h verbatim:
    #define HAVE_TRACKER3 test x"$ac_cv_tracker_pkg_version" = x"3.0"

    Gcc doesn't know how to handle this and throws an error.

    The following change allows the build to complete:
    AX_COMPARE_VERSION([$ac_cv_tracker_pkg_version], [ge], [3.0], AC_DEFINE(HAVE_TRACKER3, 1, [Define if Tracker3 is used]),)

    However, that uses an additional AX_COMPARE_VERSION macro. There might be a better/simpler way. My autotools is rusty.

    There are two places that use HAVE_TRACKER3:
    #if HAVE_TRACKER3

    should be changed to:
    #ifdef HAVE_TRACKER3

    It keeps the compiler from throwing warnings.

     
  • knight-of-ni

    knight-of-ni - 2021-03-13

    I reworked the patch again. This time I didn't use AX_COMPARE_VERSION and after further testing here is what works for me:
    https://github.com/knight-of-ni/Netatalk/commit/a7ff155b4a907af0cb979863758137aa5f8dce3f

    This patch was tested on Fedora 33 and then on CentOS 7 to verify backwards compatibility.

    I'm running into a different problem on fedora rawhide, but it might not have anything to do with this patch...

     
  • knight-of-ni

    knight-of-ni - 2021-03-13

    The problem on fedora rawhide was unrelated and has been resolved. A new netatalk package has been built for fedora rawhide repos: https://koji.fedoraproject.org/koji/taskinfo?taskID=63712482

    Thanks for your initial patch and followup.

     
  • Daniel Markstedt

    Thanks for contributing the patch! I've raised a PR on github: https://github.com/Netatalk/Netatalk/pull/202

     
    • knight-of-ni

      knight-of-ni - 2023-02-11

      Ah, right. That's the patch I re-worked and have been using for netatalk in fedora branches.
      Seems I forgot to submit it upstream. Thanks for catching that.

      Thanks,
      Andy

      No Trees were killed in the sending of this message.
      However, a large number of electrons were terribly inconvenienced.


      From: patches@netatalk.p.re.sourceforge.net patches@netatalk.p.re.sourceforge.net on behalf of Daniel Markstedt himasaram@users.sourceforge.net
      Sent: Saturday, February 11, 2023 3:45 PM
      To: [netatalk:patches] 147@patches.netatalk.p.re.sourceforge.net
      Subject: [netatalk:patches] #147 Handle Tracker 3.x API changes

      Thanks for contributing the patch! I've raised a PR on github: https://github.com/Netatalk/Netatalk/pull/202


      [patches:#147]https://sourceforge.net/p/netatalk/patches/147/ Handle Tracker 3.x API changes

      Status: open
      Group:
      Created: Fri Feb 05, 2021 06:50 PM UTC by Carlos Garnacho
      Last Updated: Sat Mar 13, 2021 08:39 PM UTC
      Owner: nobody
      Attachments:

      I am attaching a patch to make Netatalk able to optionally build and run with Tracker (miners) 3.x, while preserving compatibility with older versions. From the patch commit subject:

      Spotlight: Allow building with Tracker 3.x

      This recent Tracker series contain some changes wrt the older versions,
      notably to netatalk:
      - The TrackerSparqlConnection constructor changed, it is no longer
      a singleton.
      - The topology of the data graph is slightly different (even though
      it conforms to the same ontology/schema). Tracker data is now split
      between "physical" (e.g. a file in a filesystem) and "logical" (e.g.
      a representation of the content) interrelated with each other. Before,
      both aspects would be conflated in a single resource.

      For the former, handle this new constructor if built with Tracker 3.x,
      accessing the tracker-miner-fs instance specifically. For the latter,
      adapt the SPARQL query so it works correctly on both 3.x and prior
      versions, despite the difference.


      Sent from sourceforge.net because you indicated interest in https://sourceforge.net/p/netatalk/patches/147/

      To unsubscribe from further messages, please visit https://sourceforge.net/auth/subscriptions/

       

      Related

      Patches: #147

      • Daniel Markstedt

        My pleasure! I've been doing some housekeeping on the tracker and stumbled on this ticket.

        So you're saying that this patch has been part of the downstream Fedora packages for a few years, right?

         
        • knight-of-ni

          knight-of-ni - 2023-02-12

          Hi Daniel,
          Yes, I have been using that patch with Netatalk since Fedora 33. If I recall that is when tracker 3 was introduced to Fedora. I am fairly sure netatalk would not build without that patch.

          Thanks,
          Andy

          No Trees were killed in the sending of this message.
          However, a large number of electrons were terribly inconvenienced.


          From: patches@netatalk.p.re.sourceforge.net patches@netatalk.p.re.sourceforge.net on behalf of Daniel Markstedt himasaram@users.sourceforge.net
          Sent: Saturday, February 11, 2023 7:23 PM
          To: [netatalk:patches] 147@patches.netatalk.p.re.sourceforge.net
          Subject: [netatalk:patches] Re: #147 Handle Tracker 3.x API changes

          My pleasure! I've been doing some housekeeping on the tracker and stumbled on this ticket.

          So you're saying that this patch has been part of the downstream Fedora packages for a few years, right?


          [patches:#147]https://sourceforge.net/p/netatalk/patches/147/ Handle Tracker 3.x API changes

          Status: open
          Group:
          Created: Fri Feb 05, 2021 06:50 PM UTC by Carlos Garnacho
          Last Updated: Sat Feb 11, 2023 09:45 PM UTC
          Owner: nobody
          Attachments:

          I am attaching a patch to make Netatalk able to optionally build and run with Tracker (miners) 3.x, while preserving compatibility with older versions. From the patch commit subject:

          Spotlight: Allow building with Tracker 3.x

          This recent Tracker series contain some changes wrt the older versions,
          notably to netatalk:
          - The TrackerSparqlConnection constructor changed, it is no longer
          a singleton.
          - The topology of the data graph is slightly different (even though
          it conforms to the same ontology/schema). Tracker data is now split
          between "physical" (e.g. a file in a filesystem) and "logical" (e.g.
          a representation of the content) interrelated with each other. Before,
          both aspects would be conflated in a single resource.

          For the former, handle this new constructor if built with Tracker 3.x,
          accessing the tracker-miner-fs instance specifically. For the latter,
          adapt the SPARQL query so it works correctly on both 3.x and prior
          versions, despite the difference.


          Sent from sourceforge.net because you indicated interest in https://sourceforge.net/p/netatalk/patches/147/

          To unsubscribe from further messages, please visit https://sourceforge.net/auth/subscriptions/

           

          Related

          Patches: #147

  • Carlos Garnacho

    Carlos Garnacho - 2023-02-12

    Thank you @himasaram and @knnniggett for following up!

    I also have the user handle "@garnacho" at github, if there's any questions about this patch, or Tracker integration generally.

     
  • Daniel Markstedt

    The patch has been merged to upstream 3.1. Closing this ticket!

     
  • Daniel Markstedt

    • status: open --> closed
    • Group: -->
     

Log in to post a comment.