Host Environment
To Reproduce
Steps to reproduce the behavior:
./vcpkg install stlab
Then when you run cmake, it complains about missing boost header files, even though there is no marked boost dependency on windows or linux. Only boost variant on osx.
Failure logs
CMake Error at /usr/share/cmake-3.10/Modules/FindBoost.cmake:1947 (message):
Unable to find the requested Boost libraries.
Unable to find the Boost header files. Please set BOOST_ROOT to the root
directory containing Boost or BOOST_INCLUDEDIR to the directory containing
Boost's headers.
Call Stack (most recent call first):
/home/olafurw/vcpkg/scripts/buildsystems/vcpkg.cmake:288 (_find_package)
/usr/share/cmake-3.10/Modules/CMakeFindDependencyMacro.cmake:48 (find_package)
/home/olafurw/vcpkg/installed/x64-linux/share/stlab/stlabConfig.cmake:2 (find_dependency)
/home/olafurw/vcpkg/scripts/buildsystems/vcpkg.cmake:288 (_find_package)
CMakeLists.txt:12 (find_package)
CMake Error at /home/olafurw/vcpkg/scripts/buildsystems/vcpkg.cmake:288 (_find_package):
Found package configuration file:
/home/olafurw/vcpkg/installed/x64-linux/share/stlab/stlabConfig.cmake
but it set stlab_FOUND to FALSE so package "stlab" is considered to be NOT
FOUND. Reason given by package:
stlab could not be found because dependency Boost could not be found.
Call Stack (most recent call first):
CMakeLists.txt:12 (find_package)
-- Configuring incomplete, errors occurred!
Additional context
My best guess is if I install the boost headers it will work. But that's not something I want to install.
I have never used this packaging system. I know that it exists :-)
The point is, that you need boost only for the unit tests and on Mac, because clang on Mac still does not have std::optional support. On VS it is not needed.
If something complains that boost is missing, then it is a mistake.
I can look into it later. The upcoming ACCU conference and recently the Corona implications require all my time.
It's all good. I'm able to work around it for now. Have fun at ACCU.
@olafurw, thanks for reporting this issue.
We will take a look at this issue.
@PhoebeHui any updates?
@olafurw, sorry for my late reply.
I tried with latest vcpkg source, I can't repro this issue. from you log, it seems you still use cmake-3.10, currentlly, we have upgraded to 3.17, could you get latest source and try again?
./vcpkg install stlab
Computing installation plan...
The following packages will be built and installed:
stlab[core]:x64-linux
Starting package 1/1: stlab:x64-linux
Building package stlab[core]:x64-linux...
-- Downloading https://github.com/stlab/libraries/archive/2e411dd5c8b7eb096e9eb04c46b569c775b126c6.tar.gz...
-- Extracting source /home/phoebe/vcpkg/downloads/stlab-libraries-2e411dd5c8b7eb096e9eb04c46b569c775b126c6.tar.gz
-- Using source at /home/phoebe/vcpkg/buildtrees/stlab/src/c775b126c6-cfe82f335e
-- Configuring x64-linux-dbg
-- Configuring x64-linux-rel
-- Building x64-linux-dbg
-- Building x64-linux-rel
-- Installing: /home/phoebe/vcpkg/packages/stlab_x64-linux/share/stlab/copyright
-- Performing post-build validation
-- Performing post-build validation done
Building package stlab[core]:x64-linux... done
Installing package stlab[core]:x64-linux...
Installing package stlab[core]:x64-linux... done
Elapsed time for package stlab:x64-linux: 7.954 s
Total elapsed time: 8.048 s
The package stlab:x64-linux provides CMake targets:
find_package(stlab CONFIG REQUIRED)
target_link_libraries(main PRIVATE stlab::stlab stlab::coroutines)
It was never was about problems doing the install. It was about stlab having a dependency on boost and never pulling in that dependency.
You'll see the issue when you try to build an application using stlab on a system with no boost installed.
@olafurw, thanks for the information!
The failures looks due to the 'find_dependency(Boost 1.60.0)' in config file, however, the ports doesn't reply on boost when built the core lib, I will take a deep investiagtion and summit a PR to fix this issue.
@olafurw, I summited a PR https://github.com/microsoft/vcpkg/pull/11787 to fix this issue, could you help test if that works for you?
Hey,
1) I did a git pull and bootstrap build on vcpkg to make sure I'm using the latest version.
2) I fully removed boost and stlab.
3) Then installed only stlab
C:\vcpkg>vcpkg.exe install stlab
Computing installation plan...
The following packages will be built and installed:
stlab[core]:x64-windows
Starting package 1/1: stlab:x64-windows
Building package stlab[core]:x64-windows...
-- Downloading https://github.com/stlab/libraries/archive/2e411dd5c8b7eb096e9eb04c46b569c775b126c6.tar.gz...
-- Using source at C:/vcpkg/buildtrees/stlab/src/c775b126c6-cfe82f335e
-- Configuring x64-windows
-- Building x64-windows-dbg
-- Building x64-windows-rel
-- Installing: C:/vcpkg/packages/stlab_x64-windows/share/stlab/copyright
-- Performing post-build validation
-- Performing post-build validation done
Building package stlab[core]:x64-windows... done
Installing package stlab[core]:x64-windows...
Installing package stlab[core]:x64-windows... done
Elapsed time for package stlab:x64-windows: 4.53 s
Total elapsed time: 4.532 s
The package stlab:x64-windows provides CMake targets:
find_package(stlab CONFIG REQUIRED)
target_link_libraries(main PRIVATE stlab::stlab stlab::coroutines)
And when I try to build my project. I get errors about boost not being found.
CMake Error at C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/share/cmake-3.17/Modules/FindBoost.cmake:1602 (file):
file STRINGS file
"C:/vcpkg/installed/x64-windows/include/boost/version.hpp" cannot be read.
and
Could NOT find Boost: Found unsuitable version "0.0.0", but required is at
least "1.60.0" (found C:/vcpkg/installed/x64-windows/include)
I don't seem to have Version Version: 1.5.2-1 of the stlab ports? Why. Is doing a git pull not enough?
@olafurw, the changes haven't merged to master, so could you manually apply the fix in portfile.cmake? if it's still repro, would you mind give me the repro code?
I test the fix with below code, it works for me, it doesn't rely on boost currently.
find_package(stlab CONFIG REQUIRED)
target_include_directories(stdlibtest PRIVATE ${STLAB_INCLUDE_DIR})
target_link_libraries(stdlibtest PRIVATE stlab::stlab stlab::coroutines)
The version is 1.5.2, we append -1 to distinguish the versions.
Most helpful comment
I have never used this packaging system. I know that it exists :-)
The point is, that you need boost only for the unit tests and on Mac, because clang on Mac still does not have std::optional support. On VS it is not needed.
If something complains that boost is missing, then it is a mistake.
I can look into it later. The upcoming ACCU conference and recently the Corona implications require all my time.