[WIP][vcpkg] vcpkg can link wrong libraries (issue #5540 b)#5543
[WIP][vcpkg] vcpkg can link wrong libraries (issue #5540 b)#5543Neumann-A wants to merge 132 commits intomicrosoft:masterfrom
Conversation
|
another path is working with every upstream package to export proper config file and getting in contact with Kitware to update many modules to find package and deal with release/debug libraries (which should have different names also...). I tried this path, it is very long, and very very slow. Some shortcuts would be extremely appreciated. |
|
@cenit The problem is not only to update find_package and that libraries should export configs but also consuming libraries need to update their build scripts. I think that is something which will never 100% happen so vcpkg must support a shortcut. the complete fix will probably look something like: will implement it if i have the time. |
|
@Neumann-A why do you say so? |
|
hmm can somebody get the regex correctly to also include HDF5 and possible others? something like: |
|
The procedure is to open a PR on https://gitlab.kitware.com/cmake/cmake |
|
Can somebody from the team supply me with all cmake config logs from CI after the last commit? |
|
@Neumann-A, the CI system does not keep around the logs from passing builds and the files edited are not part of the set that triggers a rebuild of ports so nothing was actually built as part of the CI test for the last commit. Supporting this kind of thing in the test system is on my backlog, but I am not sure when I will be able to make those changes. You can run the ci command on your own machine ( |
|
DECIDED:
|
this is required because of multi configuration generators like visual studio. Linkage of libraries for debug/release may not be correct if the cmake files link directly to either debug or release library files instead of targets or using optimized/debug. (old find_package style) |
|
note to #5625 (comment) |
|
@cenit: This fixes your opencv issue ... . Lets see what CI says to this one (probably needs to be triggered manually?) |
|
TODOs:
|
|
List of ports linked wrongly (marked means fixed by this PR; List will be updated and extended when my CI runs or throws errors. Currently @ 958/958):
Possible Issue (needs checking):
Note the list contains only packages where ports have dependencies of these packages. |
|
@Rastaban: Don't mind I can simply do that while updating the list above and look at the folder name where I find replacements. |
|
porbably affected libraries
This list must be checked if any of those export dependencies to any of the ports in the list #5543 (comment) |
|
@Neumann-A, I've tested this on quite a large project and it seems to do a pretty good job. I'm seeing two issues: Building with qt5 libpq |
|
@seanwarren: Can you attach the CMake configurations logs (config-triplet-(detailed-stuff).out.log) for those failing projects? There should be lines reading |
# Conflicts: # ports/libgeotiff/portfile.cmake # ports/pdal/portfile.cmake
# Conflicts: # ports/ceres/CONTROL # ports/ceres/portfile.cmake # ports/gdal/portfile.cmake
…hout debug suffix
…version. names position is sometimes not the second one. in these cases additional unused arguments are passe to find_library. Due to that the NAMES position is variable and must be found.
# Conflicts: # ports/glib/CONTROL # ports/libraw/CONTROL # scripts/buildsystems/vcpkg.cmake
# Conflicts: # ports/fizz/CONTROL # ports/folly/CONTROL # ports/libmysql/CONTROL # ports/zstd/CONTROL
|
documenting another approach:
|
# Conflicts: # ports/vtk/CONTROL
CI logs told me they were not even rebuild the last time
|
pybind11 installed cmake targets look suspicious. There seems to be a quite complicated machinery that searches for an python.exe and once found it searches for the python libraries relative to this python.exe. However vcpkg port python3 currently only builds python.dlls. So pybind11 will certainly find completely wrong .lib files in this case. It should just use the python libraries of the python3 port instead |
|
Hi @Neumann-A ! Thanks for all the work! |
|
@angelmixu. So an alternativ approach is necessary with the following attributes: fix find_library calls with variables: fix set_property on targets and target_set_properties: fix target_link_libraries and link_libraries: So I have a plan but no time to do it currently |
fixes #5540 b
Feel free to change. Is just an example how to solve part of the problem.
Overview
TODOs: #5543 (comment)
OLD FIND_PACKAGE PORTS: #5543 (comment)
AFFECTED PORTS: #5543 (comment) (not updated; too many)
CMAKE_DEBUG_SUFFIX LIST: #5543 (comment)
Some Numbers:
Number of packages which needed changed variables: around 60; (Thats somewhere around 6% of all packages)
Number of packages which consume those variables: around 120; (which is more than 10% of all packages)
Number of packages which actually fix the linkage issue in their target files: ???
Status
REMAINING ISSUES: all current regressions are errors on the package side logic to find a library and must be fixed.
CURRENT STATUS: closed due to wrong approach