Symlinks make addon crashes ?

  • Hi guys,

    I made an addon that includes 'py-sonic' as a git submodule.
    The advantage of this is that I can easily update the submodule from the original Github repo.

    The library I want to include in my addon is in a subdirectory of that submodule, py-sonic/libsonic
    I think python won't let me load a path with a dash in it, and anyway, the py-sonic directory does not have an __init__.py file in it, so unless I make changes in the py-sonic files, I'm not able to load the library.
    And I don't want to make changes since I loose al the benefits of the submodule thing :)

    Anyway, there is a simple solution for that : symlinks.
    I made a symlink libsonic in /lib/ that links to py-sonic/libsonic.

    So I can load the library in python with

    Code
    import libsonic

    and keep the original submodule structure.

    It work great on KODI under Mac OS X; but when I try it in LibreELEC, it crashes, saying that libsonic cannot be found.
    If I replace the libsonic symlink with the libsonic directory, it works fine.

    Any ideas about that bug ?

    plugin.audio.subsonic with symlink (crashes)
    plugin.audio.subsonic without symlink (works)

    Thanks !

    Edited once, last by grosbouff (October 1, 2016 at 1:25 AM).

  • It works for me

    I tried it both ways

    Code
    libsonic -> /storage/.kodi/addons/plugin.audio.subsonic/lib/py-sonic/libsonic/
    Code
    libsonic -> py-sonic/libsonic

    Edited once, last by lrusak (October 1, 2016 at 5:49 AM).