-
Notifications
You must be signed in to change notification settings - Fork 442
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
"Couldn't register scheme handler" errors for tool linking (likely incorrectly?) to htslib #1600
Comments
Minutes after writing the issue, I found that the issue was resolved when dynamically linking to |
Does setting HTS_PATH help? Mentioned here. |
I did have the HTS_PATH set; when it was unset I received different error messages stating that the plugins could not be loaded. Based on my current workaround of using dynamic linking, a better title for this issue would be the requirements for statically linking to libhts and using its plugins. |
The plugins are separately compiled, so you should be able to point The plugin machinery does not use The “Couldn't register scheme handler” message appears fairly generic, but in fact it appears in one specific place in the code where sadly there is no First off, what do Next, what does the following report (with
|
If there is no update on this by the end of the week I am going to close it. |
Apologies for the long delay --
libhts.so.3 not found for the plugin w/o LD_LIBRARY_PATH (since the library is bundled and not getting installed):
Setting LD_LIBRARY_PATH, libhts.so is no longer "not found" of course. I generated a loader.log file as instructed, attached here: loader.log Thanks for your help, and apologies again for the delay. |
What we learn from your loader.log is that when each plugin uses a function like As noted in the issue title, the suspicion here is that the tool is likely being incorrectly linked — but you haven't shown us the link command that is producing the glnexus_cli executable. 😄 I suspect the problem is that you are not using At present, if enabling plugins and linking your executable against libhts.a statically, you need to use It would be possible to revise the plugin mechanism so that the plugin initialisation function was explicitly provided with a table of pointers to plugin-setup functions etc as an argument rather than calling them by name and depending on the loader symbol resolution and so requiring only one copy of hfile.o (and the |
Indeed, adding And thanks for the insight despite me not providing a the link command. I didn't mean to be cryptic, this is a fork of an open source tool after all (https://github.com/jwimberl/GLnexus, forked from https://github.com/dnanexus-rnd/GLnexus), but the building and linking is handled by a lengthy CMake config that I hadn't fully digested, let alone stripped down a MRE. I thought including it might add more noise than actual helpful info. As it turns out, there was a change in CMake from version 3.3 to 3.4 in which it stopped adding
which, while it works, has the somewhat unfortunate downside of obfuscating the setting of the "rdynamic" flag by renaming the concept to ENABLE_EXPORTS. |
Well, that's CMake for ya 😄 No worries, I should have figured it out sooner but it's been a while since anyone was immersed in this code. Your issue has prompted me to flesh out what a revised plugin mechanism that was immune to these issues would look like, and in fact it can be done while maintaining good compatibility with existing plugins and htslibs. So I'll turn that into a draft PR if the maintainers are interested. |
I wouldn't have any objections to a more robust plugin mechanism, but @daviesrob is the arbiter. |
I'd certainly be interested in an improved plug-in PR. |
I guess we can close this now the original problem has been dealt with and #1611 merged. We'll remember the bit about the plugin API separately. |
I am working to enable S3 connectivity in a fork of a tool which includes htslib as a dependency. This tool currently configuring and compiles htslib without plugins and statically links to libhts.a. I've set the configure options
--enable-libcurl --enable-plugins --enable-s3
and recompiled the tool (withhts_verbose
turned up). Setting LD_LIBRARY_PATH to the internal htslib build directory that containshfile_curl.so
andhfile_s3.so
, I first confirmed thathtsfile
(built alongside libhts by the first step in the tool's build script) can load the plugins and query from s3. However, when I run the tool itself pointing to an object in S3, I get the following errors:I saw similar error messages reported in #1176 , and though this system is an Ubuntu container inside CentOS 7, the discussion there did leave me to believe that the issue may have something to do with the conflict between the static libhts.a library that the tool's executable links in, and the shared libhts.so loaded by the plugins. I'd given a though to trying instead to dynamically libhts in the tool's executable, as a test, but I do see that
htsfile
chooses the static link option and works infe.What are the essential requirements when building and linking to htslib in order to be able to load the s3 plugins at runtime? I realize that things like
htsfile
andbcftools
do just this, and so I should only need to find the difference to how they compile against and link htslib, but I haven't been able to find any major difference. (When I have a minimal or at least concise reproduction of my issue I could share it).The text was updated successfully, but these errors were encountered: