conan icon indicating copy to clipboard operation
conan copied to clipboard

[bug]`AutotoolsBuildEnvironment`: libs of `build_requires` injected into `LIBS` if 1 profile

Open SpaceIm opened this issue 3 years ago • 0 comments

Environment Details (include every applicable attribute)

  • Operating System+version: Any
  • Compiler+version: Any
  • Conan version: 1.52.0
  • Python version: 3.10.6

Steps to reproduce (Include if Applicable)

  • On Linux or macOS, build an autotools based recipe (relying on AutotoolsBuildEnvironment) with libtool in build_requires, all shared, and 1 profile. For example conan install libcurl/7.85.0@#63e97620160ac0273d500d743786e4dd -o *:shared=True -b libcurl
  • You should see that libltdl (lib packaged in libtool) is added to required loadable shared lib into libcurl shared lib (and also that it may fail during configure step of libcurl on macOS), even though libltdl is not a dependency of libcurl.

Logs (Executed commands with output) (Include/Attach if Applicable)

Here a log on Linux (from https://github.com/conan-io/conan-center-index/issues/13050)

$HOME/.conan/data/libcurl/7.85.0/_/_/package/8e30aef01317ee7bcd761ed54212d56c98ca820b/lib/libcurl.so:
	linux-vdso.so.1 (0x00007ffc699aa000)
	libltdl.so.7 => /lib/x86_64-linux-gnu/libltdl.so.7 (0x00007f1e9166c000)
	libssl.so.1.1 => /home/rasmus/Projects/ds4-util/build/bin/libssl.so.1.1 (0x00007f1e915b0000)
	libcrypto.so.1.1 => /home/rasmus/Projects/ds4-util/build/bin/libcrypto.so.1.1 (0x00007f1e91251000)
	libz.so.1 => /home/rasmus/Projects/ds4-util/build/bin/libz.so.1 (0x00007f1e9122b000)
	libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f1e91003000)
	libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007f1e90ffc000)
	libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007f1e90ff7000)
	/lib64/ld-linux-x86-64.so.2 (0x00007f1e91753000)

I don't expect any fix in AutotoolsBuildEnvironment since it's fixed by 2 profiles or in new AutotoolsToolchain/AutotoolsDeps/Autotools helpers, it's just for reference since I've not found any issue here while it's a very common problem when you build an autotools based recipe with all shared. Indeed, many conan-center recipes are still relying on AutotoolsBuildEnvironment, and many users still use 1 profile. Though, several conan-center recipes have workaround against this bug (like forcing autotools.libs = [], and hope for the best when configure tries to discover dependencies).

SpaceIm avatar Sep 21 '22 09:09 SpaceIm