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

tools.collect_libs() doesn't respect self.cpp_info.libdirs #3488

Closed
Croydon opened this issue Sep 5, 2018 · 11 comments · Fixed by #3503
Closed

tools.collect_libs() doesn't respect self.cpp_info.libdirs #3488

Croydon opened this issue Sep 5, 2018 · 11 comments · Fixed by #3503
Assignees
Milestone

Comments

@Croydon
Copy link
Contributor

Croydon commented Sep 5, 2018

Fedora is putting 64bit libraries in lib64/ not in lib/.

The collect_libs tool should look out for an existing lib64 directory to collect all libs.

@Croydon
Copy link
Contributor Author

Croydon commented Sep 5, 2018

I'm starting to realize that this is an issue in several places.

self.cpp_info.libdirs might be better to default to lib, lib64 instead of only lib.

Otherwise every single recipe needs this special treatment.

@Croydon
Copy link
Contributor Author

Croydon commented Sep 5, 2018

Yet another thought: Why is tools.collect_libs not simply using self.cpp_info.libdirs?

@lasote
Copy link
Contributor

lasote commented Sep 5, 2018

I think this is a duplicate of #3369. Also assigned for take a look for the next release.

@Croydon
Copy link
Contributor Author

Croydon commented Sep 5, 2018

Seems mostly a duplicate, yes.

But maybe it should be also an issue that tools.collect_libs() doesn't seem to respect self.cpp_info.libdirs?

@weatherhead99
Copy link
Contributor

as mentioned on the other issue, this isn't a duplicate. At least, it solves the same problem but I believe there are subtle differences in the consequences of these two different ways of solving it.

@lasote
Copy link
Contributor

lasote commented Sep 6, 2018

But maybe it should be also an issue that tools.collect_libs() doesn't seem to respect self.cpp_info.libdirs?

Sure, this is a different issue, rename the title then ;)

@lasote lasote removed the duplicate label Sep 6, 2018
@lasote lasote changed the title tools.collect_libs should also look into lib64 tools.collect_libs() doesn't seem to respect self.cpp_info.libdirs Sep 6, 2018
@lasote lasote changed the title tools.collect_libs() doesn't seem to respect self.cpp_info.libdirs tools.collect_libs() doesn't respect self.cpp_info.libdirs Sep 6, 2018
@ghost ghost assigned danimtb Sep 7, 2018
@ghost ghost added the stage: review label Sep 7, 2018
@lasote lasote added this to the 1.8 milestone Sep 21, 2018
@ghost ghost removed the stage: review label Sep 25, 2018
@Croydon
Copy link
Contributor Author

Croydon commented Oct 6, 2018

I don't believe that the changes are totally covering the issue.

AutoToolsBuildEnvironment and tools.collect_libs() may behave now in the expected way when self.cpp_info.libdirs has the correct values, but we still need to set in every single recipe manually the value of self.cpp_info.libdirs to at least lib and lib64 to cover operating systems who are putting the libs into lib64. Shouldn't this become the default for self.cpp_info.libdirs?

@danimtb
Copy link
Member

danimtb commented Oct 6, 2018

Not really, we have fixed the folder outputs of the build helpers to stick them to the Conan default layout. After Conan 1.8 output libdir will be "lib" folder for the AutoToolsBuildEnvironment helper, so no need to have lib64 as default in self.cpp_info.libdirs

@Croydon
Copy link
Contributor Author

Croydon commented Oct 6, 2018

After Conan 1.8 output libdir will be "lib" folder for the AutoToolsBuildEnvironment helper, so no need to have lib64 as default in self.cpp_info.libdirs

This only helps when the AutoToolsBuildEnvironment are used. I run into the problem while building with CMake. Actually, let me double check that again, just to be sure, but in general I guess this can happen with all build tools.

@weatherhead99
Copy link
Contributor

actually this is almost certainly a property of a "badly written" cmake file (in quotes because such a definition is very hard to come up with). If your cmake buildsystem respects the value of the CMAKE_INSTALL_LIBDIR value, then it will install libraries into the "lib" folder, because conan sets that value when using the cmake build helper. If, however, for example the cmake file uses "include(GNUInstallDirs)" (regarded by many as a good idea, and I'm not totally arguing against that), then on some distros this will cause installation into lib64 anyway. Alternatively, quite a few cmake files (most culprits I've come across are very "windows centric" ones), simply manually override installation directories directly, and these will have to either be patched, or the files (very carefully, respecting issues like rpath, any exported cmake config file locations paths, etc etc etc) moved after installation.

@danimtb
Copy link
Member

danimtb commented Oct 7, 2018

@Croydon Note there is also a PR open setting this parameters for the CMake helper aslo #3599

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

Successfully merging a pull request may close this issue.

4 participants