Skip to content

Cannot seem to provoke genuinely necessary overlinking warning #2192

@h-vetinari

Description

@h-vetinari

Overlinking and overdepending are opposites of each other (I'd be the first to agree that the naming isn't great BTW). In short: overlinking is when the package is linking to a library that is not found in a direct runtime dependency; overdepending is if you have runtime dependencies that aren't actually being linked by anything (obviously there's a good amount of stuff that causes false positives here)

I was actually writing some docs related to this and realized that I can't seem to manage to get rattler-build to actually produce an overlinking warning for lodepng corresponding to conda-build's

   INFO: sysroot: '/home/conda/feedstock_root/build_artifacts/mujoco_1749065357629/_build_env/x86_64-conda-linux-gnu/sysroot/' files: '['usr/share/zoneinfo', 'usr/share/locale/zh_TW/LC_MESSAGES/libc.mo', 'usr/share/locale/zh_CN/LC_MESSAGES/libc.mo', 'usr/share/locale/vi/LC_MESSAGES/libc.mo']'
   INFO (mujoco-simulate,bin/mujoco-simulate): Needed DSO lib/libmujoco.so.3.3.2 found in local/linux-64::libmujoco==3.3.2=hebd7970_1
WARNING (mujoco-simulate,bin/mujoco-simulate): Needed DSO lib/liblodepng.so found in ['conda-forge/linux-64::lodepng==20220109=h924138e_0']
WARNING (mujoco-simulate,bin/mujoco-simulate): .. but ['conda-forge/linux-64::lodepng==20220109=h924138e_0'] not in reqs/run, (i.e. it is overlinking) (likely) or a missing dependency (less likely)
   INFO (mujoco-simulate,bin/mujoco-simulate): Needed DSO lib/libglfw.so.3 found in conda-forge/linux-64::glfw==3.4=hd590300_0
   INFO (mujoco-simulate,bin/mujoco-simulate): Needed DSO x86_64-conda-linux-gnu/sysroot/lib64/libpthread.so.0 found in CDT/compiler package conda-forge/noarch::sysroot_linux-64==2.17=h0157908_18
   INFO (mujoco-simulate,bin/mujoco-simulate): Needed DSO lib/libstdc++.so.6 found in conda-forge/linux-64::libstdcxx==15.1.0=h8f9b012_2
   INFO (mujoco-simulate,bin/mujoco-simulate): Needed DSO x86_64-conda-linux-gnu/sysroot/lib64/libm.so.6 found in CDT/compiler package conda-forge/noarch::sysroot_linux-64==2.17=h0157908_18
   INFO (mujoco-simulate,bin/mujoco-simulate): Needed DSO lib/libgcc_s.so.1 found in conda-forge/linux-64::libgcc==15.1.0=h767d61c_2
   INFO (mujoco-simulate,bin/mujoco-simulate): Needed DSO x86_64-conda-linux-gnu/sysroot/lib64/libc.so.6 found in CDT/compiler package conda-forge/noarch::sysroot_linux-64==2.17=h0157908_18
WARNING (mujoco-simulate): dso library package conda-forge/linux-64::libgl==1.7.0=ha4b6fd6_2 in requirements/run but it is not used (i.e. it is overdepending or perhaps statically linked? If that is what you want then add it to `build/ignore_run_exports`)

Even if I purposefully ignore the liblodepng run-export (so it's present in host: to build, but not present in run:, which should lead to a warning), rattler-build gives me a pristine-looking

 │ │ [bin/mujoco-simulate] links against:
 │ │  ├─ lib/liblodepng.so (lodepng)
 │ │  ├─ lib/libmujoco.so.3.3.6 (libmujoco)
 │ │  ├─ lib/libgcc_s.so.1 (libgcc)
 │ │  ├─ lib/libstdc++.so.6.0.34 (libstdcxx)
 │ │  ├─ libc.so.6 (system)
 │ │  ├─ libpthread.so.0 (system)
 │ │  ├─ lib/libglfw.so.3.4 (glfw)
 │ │  └─ libm.so.6 (system)
 │ │  ⚠ warning Overdepending against libgl

Originally posted by @h-vetinari in #1949

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions