Closed Nischi85 closed 5 years ago
Thanks for the issue report. Unfortunately it lacks a bit of complementary information. First of all, is it a typo or did you actually get an error message about 5.6.1, not 5.8.1? I also need some information about exactly in what way you "replaced" the unrar version? Did you actually rebuild rar2fs or only replaced the unrar library on your system? By default rar2fs builds statically with unrar source, which means it should never even try to look for the shared object file (.so). So I need to know if the rar2fs binary came from some specific distro or not.
It was version 5.8.1 of unrar, and the error message mentions 5.6.1(it's copy pasted from the terminal). When rolling back to unrar 5.6.1 the error is gone and rar2fs works again.
I'm using it with Unraid(it's slackware based) through the Nerdpack plugin, so when I replaced/upgraded it(unrar), it was through the update process of the Nerdpack plugin. I'm not technical enough to know all the details of the update process, but I think each "program" is updated separately, in other words, when unrar is updated, nothing of rar2fs is touched or rebuilt. The files downloaded through Nerdpack are named such as unrar-5.6.1-x86_64-1.txz and rar2fs-1.27.2-x86_64-1_SBo.txz
Not sure if it's of interest or not. but the Nerdpack's github is available here along with the files: https://github.com/dmacias72/unRAID-NerdPack
You have just hit the drawback of using shared libraries. This is not really a problem in rar2fs itself but a build/packaging thing. This is not unique to rar2fs in any way. Whoever/whatever built rar2fs explicitly instructed it to link to version 5.6.1 of the shared library. This information is "burnt" into the binary and thus it will try to find that version specifically. Since you upgraded unrar (and by that also the library I guess) the run-time linker (ld) will no longer be able to find the required library for rar2fs. Normally when you build/link towards shared libraries you add a certain level of compatibility, i.e. link to libunrar.so.5 to allow any major version 5 to be used. Normally how this works is that to be able to use binaries linked to older library version you need to make sure to keep multiple version on your system, version 5.8.1 is in this case not a drop-in replacement for 5.6.1 so you need to keep both. For rar2fs it is even more complicated due to that it actually inherits some code from the library itself which means not only the external API must be kept compatible but it must also be binary compatible with respect to internal structures etc. That is the reason why I by default made rar2fs link statically instead which work around these problems. For some reason the distro in this case did not leave it with the default behavior but explicitly requested it to link to a shared library of a specific version. So short term your options here are rather limited I am afraid. You can either a) make sure to keep the old version of the library on your system or b) build rar2fs yourself and do not depend on the package manager at all.
I do not know the reason to why you had to upgrade unrar, but I believe your best long term option here is to contact the maintainer of the rar2fs package in the distro to possibly change strategy in the future. I suggest using static linkage of libunrar (default) to avoid the problem with incompatibility. In the case that you need some new specific feature in libunrar that unrar is using then the rar2fs package must also be re-compiled and shipped as a new distro specific version (e.g. rar2fs-1.27.2-2). Thus the rar2fs package needs a dependency to the unrar package. This is true for both static and shared builds though.
Issue have been fixed now with the help of your explanation. Thank you hasse69. rar2fs was recompiled and it fixed the issue.
Ok, that was good to hear. However the root cause still remains, the maintainer of the package must change strategy or you will certainly not be alone getting stuck on this one.
Closing.
When using unrar version 5.8.1 with rar2fs 1.27.2 one gets the error: rar2fs: error while loading shared libraries: libunrar.so.5.6.1: cannot open shared object file: No such file or directory.
It would be good if rar2fs got updated to support the newer version of unrar.