-
Notifications
You must be signed in to change notification settings - Fork 6.4k
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
Latest Boost refactor breaks CMake Boost targets #2459
Comments
This is unfortunately due to the boost upgrade, not the refactoring. Every time boost updates, the CMake targets are broken until CMake updates to include the new version's dependency info. I personally don't like that arrangement, but that's where we are. This is also why you get warnings. As for why your main project still breaks, I'm not sure. What is broken specifically? It could be that you no longer have dependency information, so you need to manually request the |
Got it, this is indeed a bad arrangement. I will file an issue on cmake and hopefully they can release a new cmake 3.10 with a minor version bump. |
@ras0219-msft Someone already filed an issue and some are attempting to fix it https://gitlab.kitware.com/cmake/cmake/issues/17575. In the mean time I would like to temporarily downgrade boost to 1.65 in order to get my project to compile again. However, the problem is with the new boost modularization, there is no trivial way for me to downgrade it to 1.65 unless I go to every boost portfile to change the ref to 1.65 and update the SHA512 which is quite tedious. Do you have any recommendations? |
Same issue. |
To downgrade boost with modularization, I think the best approach would be to edit the powershell scripts inside To downgrade boost without modularization, you can use My personal recommendation is (unfortunately) to just use the macros ( |
@ras0219-msft I am trying to downgrade with modularization. I went into
When I look into the actual portfile of boost modules, it got downgraded to 1.65 but the SHA512 section is empty. Can you help me? |
Yeah, it seems i depend on vcpkg being on the path in the script. Adding it should fix the error. |
@ras0219-msft After I did
How to fix this? |
The immediate fix is to run |
@ras0219-msft Run
even if I update the hash manually there are new compilation errors
EDIT: Another question is how can I install all boost modules? After the EDIT2: I found the answer for my previous edit, it's simply |
The PR to support boost 1.66 is merged https://gitlab.kitware.com/cmake/cmake/merge_requests/1625. Now we just need to wait for the next minor release for cmake to come out. |
@ras0219-msft I figured out that CMake actually provides nightly builds so I tried it out and unfortunately it still doesn't work. I filed an issue here https://gitlab.kitware.com/cmake/cmake/issues/17637 but the comments below said it might be a vcpkg problem. Could you take a look? The comments from the cmake issue: The libraries cannot be found because of the missing architecture in the library name. Filename created by vcpkg: Issue might be caused by vcpkg, see https://github.com/Microsoft/vcpkg/blob/master/ports/boost-vcpkg-helpers/boost-modular.cmake#L244 |
Another guy in the cmake issue confirms that the fix works for him and his boost is not installed via vcpkg, so this error is caused by vcpkg, can someone look into it and fix it? |
Ok, given those changes the only way I can see to make Boost 1.66 compatible with CMake < 3.10 as well as this new version is to remove the version tag from the lib files. I've done this in a branch (dev/roschuma/boost-cmake-fix-2459) and made sure it still works with the current versions of CMake. Could you confirm that it fixes your issue with the new nightlies? |
@ras0219-msft I just tried your branch and I can confirm it is working for me. Would love to see it merged to master. On a side note, why is there a need to make it compatible with CMake < 3.10? Isn't the minimal CMake requirements for using vcpkg already CMake 3.10? |
No, not at all actually! We do demand the "latest" cmake internally (to make life easy for library authors), but we don't require users to use that in their own projects. Additionally, the version of CMake inside VS2017 can get up to one minor version behind because it gets updated during VS releases. |
Prior to the Boost 1.66 refactor, I can use cmake to find boost with the below without a problem
but now it shows me the error
Even if I change back to old way of using boost in cmake
I still get the below warnings in this minimal example
However in my main project it still breaks and I haven't pinpoint down on what exactly the reason is.
Can we fix it so the new boost refactor will work nicely when used by the downstream project?
The text was updated successfully, but these errors were encountered: