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

[boost-exception] build failure #15232

Closed
playgithub opened this issue Dec 21, 2020 · 9 comments · Fixed by #15385
Closed

[boost-exception] build failure #15232

playgithub opened this issue Dec 21, 2020 · 9 comments · Fixed by #15385
Assignees
Labels
category:port-bug The issue is with a library, which is something the port should already support

Comments

@playgithub
Copy link
Contributor

playgithub commented Dec 21, 2020

Host Environment

  • OS: Windows
  • Compiler: Microsoft (R) C/C++ Optimizing Compiler Version 19.28.29335 for x64

To Reproduce
Steps to reproduce the behavior:

x64-Windows-cpp17.cmake

set(VCPKG_TARGET_ARCHITECTURE x64)
set(VCPKG_CRT_LINKAGE dynamic)
set(VCPKG_LIBRARY_LINKAGE dynamic)
set(VCPKG_CXX_FLAGS "/std:c++17")
set(VCPKG_C_FLAGS "/std:c17")

./vcpkg install boost:x64-Windows-cpp17

Failure logs
console message

Call Stack (most recent call first):
  installed/x64-windows-cpp17/share/boost-build/boost-modular-build.cmake:346 (vcpkg_execute_required_process)
  ports/boost-exception/portfile.cmake:12 (boost_modular_build)
  scripts/ports.cmake:136 (include)


Error: Building package boost-exception:x64-windows-cpp17 failed with: BUILD_FAILED

build-x64-windows-cpp17-rel-out.log

...
msvc.write-setup-script D:\vcpkg\buildtrees\boost-exception\x64-windows-cpp17-rel\boost\standalone\msvc\999faa3b40e90a2a5abbbc32b31cdb11\msvc-setup.bat
compile-c-c++ D:\vcpkg\buildtrees\boost-exception\x64-windows-cpp17-rel\boost\build\6d04714fc9fd8b46418a491bbf63a921\clone_current_exception_non_intrusive.obj
cl : Command line error D8016 : '/std:c++17' and '/std:c17' command-line options are incompatible

    call "D:\vcpkg\buildtrees\boost-exception\x64-windows-cpp17-rel\boost\standalone\msvc\999faa3b40e90a2a5abbbc32b31cdb11\msvc-setup.bat" amd64 >nul
 cl @"D:\vcpkg\buildtrees\boost-exception\x64-windows-cpp17-rel\boost\build\6d04714fc9fd8b46418a491bbf63a921\clone_current_exception_non_intrusive.obj.rsp" 

...failed compile-c-c++ D:\vcpkg\buildtrees\boost-exception\x64-windows-cpp17-rel\boost\build\6d04714fc9fd8b46418a491bbf63a921\clone_current_exception_non_intrusive.obj...
...skipped <pD:\vcpkg\buildtrees\boost-exception\x64-windows-cpp17-rel\boost\build\6d04714fc9fd8b46418a491bbf63a921>libboost_exception-vc142-mt-x64-1_74.lib for lack of <pD:\vcpkg\buildtrees\boost-exception\x64-windows-cpp17-rel\boost\build\6d04714fc9fd8b46418a491bbf63a921>clone_current_exception_non_intrusive.obj...
...failed updating 1 target...
...skipped 1 target...
...updated 10 targets...
...
@PhoebeHui PhoebeHui added the category:question This issue is a question label Dec 21, 2020
@playgithub
Copy link
Contributor Author

It's blocking my job.
Any way to fix it quickly?

@PhoebeHui
Copy link
Contributor

PhoebeHui commented Dec 22, 2020

@playgithub, the 2 options are incompatible, I also check boost, the 2 options correctly set to cflags and cxxflags, so I think this is not vcpkg issues. The problem is why both flags applied when build the source, it might relate to the build tool?

@yurybura, do you know more about this?

https://boostorg.github.io/build/manual/develop/index.html

cflags
Specifies additional compiler flags that will be used when compiling C sources.

cxxflags
Specifies additional compiler flags that will be used when compiling C++ sources.

@playgithub
Copy link
Contributor Author

playgithub commented Dec 22, 2020

@PhoebeHui

The problem is why both flags applied when build the source?

Because in x64-Windows-cpp17.cmake, both flags are required, if only one is set, vcpkg reports an error that says both should be set.

BTW, many other libs are build successfully using the triplet.

@PhoebeHui
Copy link
Contributor

PhoebeHui commented Dec 24, 2020

@playgithub, as a workaround, you can comment out https://github.com/microsoft/vcpkg/blob/master/scripts/cmake/vcpkg_configure_cmake.cmake#L203, and only set VCPKG_CXX_FLAGS instead.

BTW, this should relate to boost build, could you report an issue to boost build instead?

@playgithub
Copy link
Contributor Author

this should relate to boost build, could you report an issue to boost build instead?

ok

@playgithub
Copy link
Contributor Author

It has been fixed in develop, the commit boostorg/build@ab34158

Need a patch for 1.74.0, thanks.

@PhoebeHui PhoebeHui added category:port-bug The issue is with a library, which is something the port should already support and removed category:question This issue is a question labels Dec 28, 2020
@PhoebeHui
Copy link
Contributor

PhoebeHui commented Dec 28, 2020

@playgithub, does the fix works for you? have you tried that?

I try to apply the patch, it solves the issue that you mentioned, however, it cause post-build valiadation failed when build with boost-exception

-- Performing post-build validation
Expected Debug,Dynamic crt linkage, but the following libs had invalid crt linkage:

    E:/vcpkg/packages/boost-exception_x64-windows/debug/lib/boost_exception-vc140-mt-gd.lib: Release,Static

To inspect the lib files, use:
    dumpbin.exe /directives mylibfile.lib
Expected Release,Dynamic crt linkage, but the following libs had invalid crt linkage:

    E:/vcpkg/packages/boost-exception_x64-windows/lib/boost_exception-vc140-mt.lib: Release,Static

To inspect the lib files, use:
    dumpbin.exe /directives mylibfile.lib
Found 2 error(s). Please correct the portfile:
    E:\vcpkg\ports\boost-exception\portfile.cmake
-- Performing post-build validation done
Error: Building package boost-exception:x64-windows failed with: POST_BUILD_CHECKS_FAILED

@playgithub
Copy link
Contributor Author

playgithub commented Dec 29, 2020

@PhoebeHui

does the fix works for you? have you tried that?

Not yet, I'm very busy now.

@PhoebeHui
Copy link
Contributor

@playgithub, I have submitted PR ##15385 to fix this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
category:port-bug The issue is with a library, which is something the port should already support
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants