conda-forge / cdt-builds

conda-forge cdt builds
BSD 3-Clause "New" or "Revised" License
4 stars 22 forks source link

Qt-based build broke after merging #23, rpath is not set #24

Closed gabm closed 4 years ago

gabm commented 4 years ago

Issue: A build that depends on qt and worked before merging #23 broke on linux-64 for me. The recipe looks like this:

requirements:
  build:
    - {{ compiler("c") }}
    - {{ compiler("cxx") }}
    - {{ cdt('mesa-libgl-devel') }} # [linux]
    - {{ cdt('mesa-dri-drivers') }} # [linux]
    - {{ cdt('libselinux') }} # [linux]
    - {{ cdt('libxdamage') }} # [linux]
    - {{ cdt('libxfixes') }} # [linux]
    - {{ cdt('libxxf86vm') }} # [linux]
    - libxcb # [linux]
    - xorg-libxext # [linux]
    - cmake
    - make # [unix]

  host:
    - qt

  run:
    - qt

The build fails with:

/builds/test-gui/builds/test-gui_1595492796512/_build_env/bin/../lib/gcc/x86_64-conda_cos6-linux-gnu/7.5.0/../../../../x86_64-conda_cos6-linux-gnu/bin/ld: warning: libXext.so.6, needed by /builds/test-gui/builds/test-gui_1595492796512/_build_env/bin/../x86_64-conda_cos6-linux-gnu/sysroot/usr/lib64/libGL.so.1, not found (try using -rpath or -rpath-link)

The resolved envrionment between yesterday (when it worked) and today (that it failed) differes in

<     libdrm-cos6-x86_64:            2.4.65-hdf0574f_102     conda-forge
---
>     libdrm-cos6-x86_64:            2.4.65-ha826a6f_103     conda-forge
21,22c21,22
<     libselinux-cos6-x86_64:        2.0.94-hdf0574f_102     conda-forge
<     libsepol-cos6-x86_64:          2.0.41-hdf0574f_102     conda-forge
---
>     libselinux-cos6-x86_64:        2.0.94-ha826a6f_103     conda-forge
>     libsepol-cos6-x86_64:          2.0.41-ha826a6f_103     conda-forge
26,27c26,27
<     libx11-common-cos6-x86_64:     1.6.4-hdf0574f_102      conda-forge
<     libx11-cos6-x86_64:            1.6.4-hdf0574f_102      conda-forge
---
>     libx11-common-cos6-x86_64:     1.6.4-ha826a6f_103      conda-forge
>     libx11-cos6-x86_64:            1.6.4-ha826a6f_103      conda-forge
29,31c29,31
<     libxdamage-cos6-x86_64:        1.1.3-hdf0574f_102      conda-forge
<     libxfixes-cos6-x86_64:         5.0.3-hdf0574f_102      conda-forge
<     libxxf86vm-cos6-x86_64:        1.1.3-hdf0574f_102      conda-forge
---
>     libxdamage-cos6-x86_64:        1.1.3-ha826a6f_103      conda-forge
>     libxfixes-cos6-x86_64:         5.0.3-ha826a6f_103      conda-forge
>     libxxf86vm-cos6-x86_64:        1.1.3-ha826a6f_103      conda-forge
33,36c33,36
<     mesa-dri-drivers-cos6-x86_64:  11.0.7-hdf0574f_102     conda-forge
<     mesa-dri1-drivers-cos6-x86_64: 7.11-hdf0574f_102       conda-forge
<     mesa-libgl-cos6-x86_64:        11.0.7-hdf0574f_102     conda-forge
<     mesa-libgl-devel-cos6-x86_64:  11.0.7-hdf0574f_102     conda-forge
---
>     mesa-dri-drivers-cos6-x86_64:  11.0.7-ha826a6f_103     conda-forge
>     mesa-dri1-drivers-cos6-x86_64: 7.11-ha826a6f_103       conda-forge
>     mesa-libgl-cos6-x86_64:        11.0.7-ha826a6f_103     conda-forge
>     mesa-libgl-devel-cos6-x86_64:  11.0.7-ha826a6f_103     conda-forge


Environment (conda list):

``` $ conda list ```


Details about conda and system ( conda info ):

``` $ conda info ```
gabm commented 4 years ago

Basically the rpath is not set for libGL.so and others

on build 102:

objdump -x libGL.so | grep RPATH
  RPATH                $ORIGIN/../../../../lib

but on build 103 its empty

objdump -x libGL.so | grep RPATH
beckermr commented 4 years ago

@isuruf Should we turn binary relocation back on?

isuruf commented 4 years ago

No. the recipe is wrong. - xorg-libxext # [linux] should be turned in to a CDT.

beckermr commented 4 years ago

Ok. We have that one already built so should be an easy fix.

Can you explain why here or what is going on or how that fixes it?

beckermr commented 4 years ago

I guess the general rule is to not link stuff in the sysroot to builds outside of the sysroot?

gabm commented 4 years ago

Yeah, a bit of clarification might be useful here.

I suppose @beckermr is right, link nothing from sysroot to outside, it should be self-contained...

So the rule would be:

Is that so? @isuruf

isuruf commented 4 years ago

CDT packages should link with CDT packages. Qt was relying on CDT packages linking with conda packages which is not guaranteed to work.

gabm commented 4 years ago

Meanwhile I confirmed your fix: with the following recipe it works:

requirements:
  build:
    - {{ compiler("c") }}
    - {{ compiler("cxx") }}
    - {{ cdt('mesa-libgl-devel') }} # [linux]
    - {{ cdt('mesa-dri-drivers') }} # [linux]
    - {{ cdt('libselinux') }} # [linux]
    - {{ cdt('libxdamage') }} # [linux]
    - {{ cdt('libxfixes') }} # [linux]
    - {{ cdt('libxxf86vm') }} # [linux]
    - {{ cdt('libxext') }} # [linux]
    - cmake
    - make # [unix]

  host:
    - qt

  run:
    - qt
gabm commented 4 years ago

Okay, thank you for clarification!

beckermr commented 4 years ago

I just remembered this docs page exists too: https://conda-forge.org/docs/maintainer/knowledge_base.html#libgl

looks like we have converged on the correct solution