-
Notifications
You must be signed in to change notification settings - Fork 989
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
[build system] AutoToolsBuildEnvironment on linux distros with default "lib64" libdir #3369
Comments
But if the library directory is |
you are correct, of course, but at present this means modifying just about every conan recipe which uses AutoTools when there isn't a pre-built package for my system. In comparison, even though this otherwise would also happen with the cmake generator, it doesn't, because conan goes to great pains to set up all the relevant cmake variables. Note: the exact same buildsystem (same compiler, same arch) will produce library directory "lib" on a debian system, but "lib64" on suse. |
I see. I don't know exactly what can we do without breaking behavior but we will think about it. |
I take the point, but I have so far not found a single recipe that does work. lib_str = "lib64" if distro_uses_lib64() else "lib" and this would break those recipes. Perhaps it would be better instead to provide more functionality in the linux distro specific tools of conan? I.e. being able to get this information from conan without having to hard code it all the time... |
But this is not only a |
I think I haven't expressed my intent clearly here: I am asking if we can make the AutotoolsBuildEnvironment pass the flags to autotools such that it outputs libraries into the "lib" dir, even on platforms where it otherwise would use "lib64". Thus, collect_libs wouldn't need to be altered. There is no difference in the built package, the change is happening at package build time. It's not that pre-built packages would change at all, it would just enable recipes to be build on platforems which use "lib64" without modification of the recipe. |
I am afraid this is not doable without breaking. I am aware of enterprise users using those distros and they already coded their recipes to account for the "lib64" folder. If conan changes the I understand most of the open source conan packages out there might not be prepared for this, and it is natural that you don't find many of breaking cases because those enterprise users are not contributing their recipes as open source. I wouldn't oppose to some opt-in solution that would make trivially easy to define that behavior, which would benefit to open-source packagers as well. |
ok, would it be a good idea to add extra logic into somewhere nearby to "systemPackageTool", as there are similar issues there (in fact i was going to / will open a separate issue about it), namely: "dev extension", on ubuntu/debian etc, development packages are named "-dev", whereas on suse/redhat/fedora they are "-devel". On debian, 32 bit packages are named ":i686" whereas on suse they are "-32bit". Including some tools like this would really make it easier to actually get a systempackagetool dependency to work across distros. And the "lib" / "lib64" issue is in a similar category. But at the same time, it doesn't quite make sense to actually be in systempckagetool because it isn't related functionality |
This issue should likely be renamed to be more clear. This is a general issue (see #3488) - not limited to AutoToolsBuildEnvironment. |
in principle agree, but the thrust of this suggestion was to have all libs installed in "lib" folder, even on platforms where it would by default be "lib64". Changing collect_libs() would solve the problem also, I guess, but it introduces some complications: what happens if I build the exact same recipe using AutoToolsBuildEnvironment with the same settings, compiler etc on ubuntu, and then on fedora? I will get two packages with the same hash, but where the libraries are in different places. If you've fixed "collect_libs" such that it now finds stuff in lib64 as well, fair enough, but nevertheless the binary output of the same package built on different platforms will be different. Not that we're aiming for fully "reproducible build" level consistency, but consider the following situation, which isn't that contrived, it happens for example when using the protoc binary from a shared build of the protobuf package on linux (and presumably OSX) - when I call the protoc binary from the package, it can't find libprotoc.so because LD_LIBRARY_PATH isn't set. OK, so now I have to either - build the package from a conanfile.py, which appropriately uses RunEnvironment to make that binary work in subsequent builds, or adapt my own buildsystem (e.g. cmake or autotools) downstream of conan to use that. In the situation in general with the collect_libs solution we now have to always, unconditionally append two things to all those path variables, because we can never know (and have no knowledge from the package, because it isn't a change in settings or options) where the libraries will actually be. On the other hand, if we can gently herd the packages to be more homogeneous by using "lib" in the AutotoolBuildEnvironment, issues like this don't go away but become less complicated. It is also as I mentioned previously quite consistent with e.g. the cmake build helper, which sets things like CMAKE_OUTPUT_LIBRARY_DIR to "lib", thus the same package built on ubuntu or fedora using a cmake build helper will always put the libraries in lib, regardless of platform. So, a solution based on collect-libs for those packages will in fact erroneously add the "lib64" directory where it isn't needed. As with everything conan, it's these seemingly small but ultimately really frustrating issues that are teasing out the actual problem of attempting to do a c++ binary package manager with different buildsystems |
Totally agree, very very weird. I think the less bad fix is to default the |
Seems the --libdir parameter is handled under each gcc package for each distribution loading a default spec file that defines those gcc parameters and AutoTools just picks up the default values. In SUSE:
In Ubuntu:
In Fedora: Seems not
I know those are different versions of GCC, but this gives another reason to make this change in the Autotools build helper as those default specs may change from one version to another. Another issue might be adjusting |
To help us debug your issue please explain:
On some linux distributions (for example, suse & derivatives), the default libdir for installations is "lib64" on x64 systems, rather than "lib". This prevents nearly every package that uses AutoToolsBuildEnvironment and tools.collect_libs(), because they mostly assume the directory for libraries is "lib".
This could be fixed in many cases, for example, by adding the "--libdir" flag with an appropriate value to "./configure", when we call AutoToolsBuildEnvironment.configure(). I realise this might be controversial, since it might break existing packages that do assume "/lib64" directory. However, my experience in installing conan packages is that essentially none of them currently do this, and I have to patch in the "lib64" directory to the folder= argument in tools.collect_libs on most recipes I use that use autotools.
Note the similar problem doesn't occur in (most) cmake build systems because we do pass -DCMAKE_INSTALL_LIBDIR=lib to the cmake configuration command. So in the spirit of that behaviour, I would see doing it for autotools as well to be simply a matter of consistency.
The text was updated successfully, but these errors were encountered: