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

Always depend on Boost. #398

Merged
merged 1 commit into from
Jul 16, 2024

Conversation

BillyONeal
Copy link
Contributor

@BillyONeal BillyONeal commented Jul 15, 2024

Resolves the following compiler error:

[1/1] "/opt/homebrew/Cellar/cmake/3.30.0/bin/cmake" -E chdir ".." "/opt/homebrew/Cellar/cmake/3.30.0/bin/cmake" "/Users/vcpkg/Data/b/arg-router/src/v1.4.0-a16f5c5738.clean" "-G" "Ninja" "-DCMAKE_BUILD_TYPE=Release" "-DCMAKE_INSTALL_PREFIX=/Users/vcpkg/Data/p/arg-router_arm64-osx" "-DFETCHCONTENT_FULLY_DISCONNECTED=ON" "-DINSTALLATION_ONLY=ON" "-DCMAKE_MAKE_PROGRAM=/opt/homebrew/bin/ninja" "-DCMAKE_SYSTEM_NAME=Darwin" "-DBUILD_SHARED_LIBS=OFF" "-DVCPKG_CHAINLOAD_TOOLCHAIN_FILE=/Users/vcpkg/Data/work/2/s/scripts/toolchains/osx.cmake" "-DVCPKG_TARGET_TRIPLET=arm64-osx" "-DVCPKG_SET_CHARSET_FLAG=ON" "-DVCPKG_PLATFORM_TOOLSET=external" "-DCMAKE_EXPORT_NO_PACKAGE_REGISTRY=ON" "-DCMAKE_FIND_PACKAGE_NO_PACKAGE_REGISTRY=ON" "-DCMAKE_FIND_PACKAGE_NO_SYSTEM_PACKAGE_REGISTRY=ON" "-DCMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_SKIP=TRUE" "-DCMAKE_VERBOSE_MAKEFILE=ON" "-DVCPKG_APPLOCAL_DEPS=OFF" "-DCMAKE_TOOLCHAIN_FILE=/Users/vcpkg/Data/work/2/s/scripts/buildsystems/vcpkg.cmake" "-DCMAKE_ERROR_ON_ABSOLUTE_INSTALL_DESTINATION=ON" "-DVCPKG_CXX_FLAGS=" "-DVCPKG_CXX_FLAGS_RELEASE=" "-DVCPKG_CXX_FLAGS_DEBUG=" "-DVCPKG_C_FLAGS=" "-DVCPKG_C_FLAGS_RELEASE=" "-DVCPKG_C_FLAGS_DEBUG=" "-DVCPKG_CRT_LINKAGE=dynamic" "-DVCPKG_LINKER_FLAGS=" "-DVCPKG_LINKER_FLAGS_RELEASE=" "-DVCPKG_LINKER_FLAGS_DEBUG=" "-DVCPKG_TARGET_ARCHITECTURE=arm64" "-DCMAKE_INSTALL_LIBDIR:STRING=lib" "-DCMAKE_INSTALL_BINDIR:STRING=bin" "-D_VCPKG_ROOT_DIR=/Users/vcpkg/Data/work/2/s" "-D_VCPKG_INSTALLED_DIR=/Users/vcpkg/Data/installed" "-DVCPKG_MANIFEST_INSTALL=OFF" "-DCMAKE_OSX_ARCHITECTURES=arm64" FAILED: ../CMakeCache.txt
"/opt/homebrew/Cellar/cmake/3.30.0/bin/cmake" -E chdir ".." "/opt/homebrew/Cellar/cmake/3.30.0/bin/cmake" "/Users/vcpkg/Data/b/arg-router/src/v1.4.0-a16f5c5738.clean" "-G" "Ninja" "-DCMAKE_BUILD_TYPE=Release" "-DCMAKE_INSTALL_PREFIX=/Users/vcpkg/Data/p/arg-router_arm64-osx" "-DFETCHCONTENT_FULLY_DISCONNECTED=ON" "-DINSTALLATION_ONLY=ON" "-DCMAKE_MAKE_PROGRAM=/opt/homebrew/bin/ninja" "-DCMAKE_SYSTEM_NAME=Darwin" "-DBUILD_SHARED_LIBS=OFF" "-DVCPKG_CHAINLOAD_TOOLCHAIN_FILE=/Users/vcpkg/Data/work/2/s/scripts/toolchains/osx.cmake" "-DVCPKG_TARGET_TRIPLET=arm64-osx" "-DVCPKG_SET_CHARSET_FLAG=ON" "-DVCPKG_PLATFORM_TOOLSET=external" "-DCMAKE_EXPORT_NO_PACKAGE_REGISTRY=ON" "-DCMAKE_FIND_PACKAGE_NO_PACKAGE_REGISTRY=ON" "-DCMAKE_FIND_PACKAGE_NO_SYSTEM_PACKAGE_REGISTRY=ON" "-DCMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_SKIP=TRUE" "-DCMAKE_VERBOSE_MAKEFILE=ON" "-DVCPKG_APPLOCAL_DEPS=OFF" "-DCMAKE_TOOLCHAIN_FILE=/Users/vcpkg/Data/work/2/s/scripts/buildsystems/vcpkg.cmake" "-DCMAKE_ERROR_ON_ABSOLUTE_INSTALL_DESTINATION=ON" "-DVCPKG_CXX_FLAGS=" "-DVCPKG_CXX_FLAGS_RELEASE=" "-DVCPKG_CXX_FLAGS_DEBUG=" "-DVCPKG_C_FLAGS=" "-DVCPKG_C_FLAGS_RELEASE=" "-DVCPKG_C_FLAGS_DEBUG=" "-DVCPKG_CRT_LINKAGE=dynamic" "-DVCPKG_LINKER_FLAGS=" "-DVCPKG_LINKER_FLAGS_RELEASE=" "-DVCPKG_LINKER_FLAGS_DEBUG=" "-DVCPKG_TARGET_ARCHITECTURE=arm64" "-DCMAKE_INSTALL_LIBDIR:STRING=lib" "-DCMAKE_INSTALL_BINDIR:STRING=bin" "-D_VCPKG_ROOT_DIR=/Users/vcpkg/Data/work/2/s" "-D_VCPKG_INSTALLED_DIR=/Users/vcpkg/Data/installed" "-DVCPKG_MANIFEST_INSTALL=OFF" "-DCMAKE_OSX_ARCHITECTURES=arm64" -- The CXX compiler identification is AppleClang 15.0.0.15000309 -- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /Library/Developer/CommandLineTools/usr/bin/c++ - skipped -- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Configuring done (0.2s)
CMake Error at cmake/build_types/library.cmake:6 (target_link_libraries):
  The link interface of target "arg_router" contains:

    Boost::boost

  but the target was not found.  Possible reasons include:

    * There is a typo in the target name.
    * A find_package call is missing for an IMPORTED target. * An ALIAS target is missing.

Call Stack (most recent call first):
  CMakeLists.txt:159 (include)

-- Generating done (0.0s)

Resolves the following compiler error:

[1/1] "/opt/homebrew/Cellar/cmake/3.30.0/bin/cmake" -E chdir ".." "/opt/homebrew/Cellar/cmake/3.30.0/bin/cmake" "/Users/vcpkg/Data/b/arg-router/src/v1.4.0-a16f5c5738.clean" "-G" "Ninja" "-DCMAKE_BUILD_TYPE=Release" "-DCMAKE_INSTALL_PREFIX=/Users/vcpkg/Data/p/arg-router_arm64-osx" "-DFETCHCONTENT_FULLY_DISCONNECTED=ON" "-DINSTALLATION_ONLY=ON" "-DCMAKE_MAKE_PROGRAM=/opt/homebrew/bin/ninja" "-DCMAKE_SYSTEM_NAME=Darwin" "-DBUILD_SHARED_LIBS=OFF" "-DVCPKG_CHAINLOAD_TOOLCHAIN_FILE=/Users/vcpkg/Data/work/2/s/scripts/toolchains/osx.cmake" "-DVCPKG_TARGET_TRIPLET=arm64-osx" "-DVCPKG_SET_CHARSET_FLAG=ON" "-DVCPKG_PLATFORM_TOOLSET=external" "-DCMAKE_EXPORT_NO_PACKAGE_REGISTRY=ON" "-DCMAKE_FIND_PACKAGE_NO_PACKAGE_REGISTRY=ON" "-DCMAKE_FIND_PACKAGE_NO_SYSTEM_PACKAGE_REGISTRY=ON" "-DCMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_SKIP=TRUE" "-DCMAKE_VERBOSE_MAKEFILE=ON" "-DVCPKG_APPLOCAL_DEPS=OFF" "-DCMAKE_TOOLCHAIN_FILE=/Users/vcpkg/Data/work/2/s/scripts/buildsystems/vcpkg.cmake" "-DCMAKE_ERROR_ON_ABSOLUTE_INSTALL_DESTINATION=ON" "-DVCPKG_CXX_FLAGS=" "-DVCPKG_CXX_FLAGS_RELEASE=" "-DVCPKG_CXX_FLAGS_DEBUG=" "-DVCPKG_C_FLAGS=" "-DVCPKG_C_FLAGS_RELEASE=" "-DVCPKG_C_FLAGS_DEBUG=" "-DVCPKG_CRT_LINKAGE=dynamic" "-DVCPKG_LINKER_FLAGS=" "-DVCPKG_LINKER_FLAGS_RELEASE=" "-DVCPKG_LINKER_FLAGS_DEBUG=" "-DVCPKG_TARGET_ARCHITECTURE=arm64" "-DCMAKE_INSTALL_LIBDIR:STRING=lib" "-DCMAKE_INSTALL_BINDIR:STRING=bin" "-D_VCPKG_ROOT_DIR=/Users/vcpkg/Data/work/2/s" "-D_VCPKG_INSTALLED_DIR=/Users/vcpkg/Data/installed" "-DVCPKG_MANIFEST_INSTALL=OFF" "-DCMAKE_OSX_ARCHITECTURES=arm64"
FAILED: ../CMakeCache.txt
"/opt/homebrew/Cellar/cmake/3.30.0/bin/cmake" -E chdir ".." "/opt/homebrew/Cellar/cmake/3.30.0/bin/cmake" "/Users/vcpkg/Data/b/arg-router/src/v1.4.0-a16f5c5738.clean" "-G" "Ninja" "-DCMAKE_BUILD_TYPE=Release" "-DCMAKE_INSTALL_PREFIX=/Users/vcpkg/Data/p/arg-router_arm64-osx" "-DFETCHCONTENT_FULLY_DISCONNECTED=ON" "-DINSTALLATION_ONLY=ON" "-DCMAKE_MAKE_PROGRAM=/opt/homebrew/bin/ninja" "-DCMAKE_SYSTEM_NAME=Darwin" "-DBUILD_SHARED_LIBS=OFF" "-DVCPKG_CHAINLOAD_TOOLCHAIN_FILE=/Users/vcpkg/Data/work/2/s/scripts/toolchains/osx.cmake" "-DVCPKG_TARGET_TRIPLET=arm64-osx" "-DVCPKG_SET_CHARSET_FLAG=ON" "-DVCPKG_PLATFORM_TOOLSET=external" "-DCMAKE_EXPORT_NO_PACKAGE_REGISTRY=ON" "-DCMAKE_FIND_PACKAGE_NO_PACKAGE_REGISTRY=ON" "-DCMAKE_FIND_PACKAGE_NO_SYSTEM_PACKAGE_REGISTRY=ON" "-DCMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_SKIP=TRUE" "-DCMAKE_VERBOSE_MAKEFILE=ON" "-DVCPKG_APPLOCAL_DEPS=OFF" "-DCMAKE_TOOLCHAIN_FILE=/Users/vcpkg/Data/work/2/s/scripts/buildsystems/vcpkg.cmake" "-DCMAKE_ERROR_ON_ABSOLUTE_INSTALL_DESTINATION=ON" "-DVCPKG_CXX_FLAGS=" "-DVCPKG_CXX_FLAGS_RELEASE=" "-DVCPKG_CXX_FLAGS_DEBUG=" "-DVCPKG_C_FLAGS=" "-DVCPKG_C_FLAGS_RELEASE=" "-DVCPKG_C_FLAGS_DEBUG=" "-DVCPKG_CRT_LINKAGE=dynamic" "-DVCPKG_LINKER_FLAGS=" "-DVCPKG_LINKER_FLAGS_RELEASE=" "-DVCPKG_LINKER_FLAGS_DEBUG=" "-DVCPKG_TARGET_ARCHITECTURE=arm64" "-DCMAKE_INSTALL_LIBDIR:STRING=lib" "-DCMAKE_INSTALL_BINDIR:STRING=bin" "-D_VCPKG_ROOT_DIR=/Users/vcpkg/Data/work/2/s" "-D_VCPKG_INSTALLED_DIR=/Users/vcpkg/Data/installed" "-DVCPKG_MANIFEST_INSTALL=OFF" "-DCMAKE_OSX_ARCHITECTURES=arm64"
-- The CXX compiler identification is AppleClang 15.0.0.15000309
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /Library/Developer/CommandLineTools/usr/bin/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Configuring done (0.2s)
CMake Error at cmake/build_types/library.cmake:6 (target_link_libraries):
  The link interface of target "arg_router" contains:

    Boost::boost

  but the target was not found.  Possible reasons include:

    * There is a typo in the target name.
    * A find_package call is missing for an IMPORTED target.
    * An ALIAS target is missing.

Call Stack (most recent call first):
  CMakeLists.txt:159 (include)

-- Generating done (0.0s)
BillyONeal added a commit to BillyONeal/vcpkg that referenced this pull request Jul 15, 2024
@cmannett85
Copy link
Owner

There's a few things going on here - mostly my fault!

  • The error in unit_test_coverage is down to a faulty workflow which doesn't appear to work when the PR is coming from a fork (this is the first external contribution)
  • The windows_msvc_compiler_tests issue is down to the Windows runner being updated since the last time a PR has been created, giving a new raft of MSVC template issues. Nothing to do with your change
  • The documentation workflow failure is a fault of your PR though. Generating the docs doesn't rely on Boost so the runner doesn't have it installed, hence the error

I'm not sure why it's suddenly causing a problem, but I think the correct fix would be to wrap the target_link_libraries(..) in cmake/build_types/library.cmake:6 with a if(NOT INSTALLATION_ONLY) conditional. Because in principle nothing should be touching the link interface if doing an INSTALLATION_ONLY build.

It's been a while since I've looked at this project, so if your vcpkg change fixes it there, I'd like to create an issue to investigate this properly for this project.

@BillyONeal
Copy link
Contributor Author

BillyONeal commented Jul 15, 2024

I'm not sure why it's suddenly causing a problem

Our macOS runners just changed the CMake version (3.29.3 -> 3.33.0) and it now complains if nonexistent targets are in the interface of a target. It seems like you do want to export the target with a dependency on Boost::boost, so that target has to exist, even for "installation only". (Otherwise your headers that want boost won't be able to find them?)

@BillyONeal
Copy link
Contributor Author

To clarify, it comes from:

An alternative fix would be:

target_link_libraries(arg_router INTERFACE
    $<$<TARGET_EXISTS:Boost::boost>:Boost::boost>      # !!!!
    $<$<TARGET_EXISTS:nonstd::span-lite>:nonstd::span-lite>
)

?

@cmannett85
Copy link
Owner

It seems like you do want to export the target with a dependency on Boost::boost, so that target has to exist, even for "installation only". (Otherwise your headers that want boost won't be able to find them?)

Yes, you're right. I'll accept your change, and then deal with the broken/stale CI parts.

@cmannett85 cmannett85 merged commit e04ed2b into cmannett85:develop Jul 16, 2024
4 of 7 checks passed
@BillyONeal
Copy link
Contributor Author

Thanks a lot!

@BillyONeal BillyONeal deleted the always-depend-on-boost branch July 16, 2024 19:14
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 this pull request may close these issues.

2 participants