Skip to content
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

libchtslib.cpython-34m.so contains RUNPATH relative to current working directory #347

Closed
mbakke opened this issue Sep 22, 2016 · 4 comments
Assignees

Comments

@mbakke
Copy link

mbakke commented Sep 22, 2016

Hi, after updating pysam 0.8.4 -> 0.9.1.4 in GNU Guix, we noticed the RUNPATH of libchtslib.cpython-34m.so contains a path that refers to the python build directory.

Readelf output for 0.8.4:

0x000000000000001d (RUNPATH) Library runpath: [/gnu/store/m4gc2wx4q9if1vrhgclpspdil7rqsn21-python-3.4.3/lib:/gnu/store/m9vxvhdj691bq1f85lpflvnhcvrdilih-glibc-2.23/lib:/gnu/store/9nifwk709wajpyfwa0jzaa3p6mf10vxs-gcc-4.9.3-lib/lib:/gnu/store/xl19qrfzga52vrvp4ncccwjlnrjqwj95-ncurses-6.0/lib:/gnu/store/5992iq1v7arqa14ym3di58n4la0893nv-zlib-1.2.8/lib:/gnu/store/9nifwk709wajpyfwa0jzaa3p6mf10vxs-gcc-4.9.3-lib/lib/gcc/x86_64-unknown-linux-gnu/4.9.3/../../..]

And 0.9.1.4 (please ignore the added htslib, since we now compile against external):
0x000000000000001d (RUNPATH) Library runpath: [/gnu/store/m4gc2wx4q9if1vrhgclpspdil7rqsn21-python-3.4.3/lib:/gnu/store/ba22myqvxccwmmjwwq665rc43hanycxy-htslib-1.3.1/lib:build/lib.linux-x86_64-3.4/pysam:$ORIGIN:/gnu/store/m9vxvhdj691bq1f85lpflvnhcvrdilih-glibc-2.23/lib:/gnu/store/9nifwk709wajpyfwa0jzaa3p6mf10vxs-gcc-4.9.3-lib/lib:/gnu/store/xl19qrfzga52vrvp4ncccwjlnrjqwj95-ncurses-6.0/lib:/gnu/store/5992iq1v7arqa14ym3di58n4la0893nv-zlib-1.2.8/lib:/gnu/store/9nifwk709wajpyfwa0jzaa3p6mf10vxs-gcc-4.9.3-lib/lib/gcc/x86_64-unknown-linux-gnu/4.9.3/../../..]

The superfluous RUNPATH is the one between htslib and the newly added $ORIGIN. With the default shipped htslib, RUNPATH also included . and pysam.

@AndreasHeger
Copy link
Contributor

Thanks! The offending line is in setup.py:

    htslib_library_dirs = [
        'pysam',
        ".",
        os.path.join("build",
                     distutils_dir_name("lib"),
                     "pysam")]

I don't recall at the moment why each one was added (some combination of linux|OSX/install|develop) and need to review this.

At the minimum, for security reasons, these should be absolute path names.

@AndreasHeger AndreasHeger self-assigned this Sep 26, 2016
@bioinformed
Copy link
Member

@mbakke: Please check again with pysam 0.10.0

@mbakke
Copy link
Author

mbakke commented Jan 26, 2017

I can confirm that build/lib.linux-x86_64-3.5/pysam is still in the RUNPATH of libchtslib.cpython-35m-x86_64-linux-gnu.so.

@AndreasHeger
Copy link
Contributor

Thanks, I am looking into this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants