conan: Cannot build boost/1.85.0 recipe with latest Visual Studio 2022 build tools (version 17.10) due to known issue with b2/4.10.1
Describe the bug
When attempting to build boost/1.85.0 using an invocation of conan install ... in a Windows docker build step (which has access to the latest Visual Studio 2022 build tools at version 17.10) the build fails with the error message:
…
boost/1.85.0: ERROR:
Package ‘5b206d5bc0af0b57e57d2785127443f36883ffbb’ build failed
boost/1.85.0: WARN: Build folder C:\Users\ContainerAdministrator.conan2\p\b\booste815830283dfd\b\build-release
ERROR: boost/1.85.0: Error in build() method, line 1130
self.run(full_command)
ConanException: Error 1 while executing
How to reproduce it
The docker file is as follows:
# escape=`
# Copyright (C) Microsoft Corporation. All rights reserved.
# Licensed under the MIT license. See LICENSE.txt in the project root for license information.
FROM mcr.microsoft.com/windows/servercore:10.0.20348.1249
# Reset the shell.
SHELL ["cmd", "/S", "/C"]
# Set up environment to collect install errors.
COPY .\docker\Install.cmd C:\TEMP\
ADD https://aka.ms/vscollect.exe C:\TEMP\collect.exe
# Download channel for fixed install.
ARG CHANNEL_URL=https://aka.ms/vs/17/release/channel
ADD ${CHANNEL_URL} C:\TEMP\VisualStudio.chman
# Download and install Build Tools for Visual Studio 2022 for native desktop workload.
ADD https://aka.ms/vs/17/release/vs_buildtools.exe C:\TEMP\vs_buildtools.exe
RUN C:\TEMP\Install.cmd C:\TEMP\vs_buildtools.exe --quiet --wait --norestart --nocache `
--channelUri C:\TEMP\VisualStudio.chman `
--installChannelUri C:\TEMP\VisualStudio.chman `
--add Microsoft.VisualStudio.Workload.ManagedDesktopBuildTools `
--add Microsoft.VisualStudio.Workload.VCTools `
--add Microsoft.VisualStudio.Component.VC.ATLMFC `
--includeRecommended `
--installPath C:\BuildTools
# Reset the shell.
SHELL ["powershell.exe", "-Command"]
# Install chocolatey...
RUN Set-ExecutionPolicy Bypass -Scope Process -Force; `
[System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072; `
iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))
# Install git using chocolatey...
RUN choco install git.install -y
# Install cmake using chocolatey and add it to system path...
RUN choco install cmake.install --installargs '"ADD_CMAKE_TO_PATH=System"' -y
ARG PYTHON_VERSION=3.12.3
# Install pyenv...
RUN Invoke-WebRequest -UseBasicParsing -Uri "https://raw.githubusercontent.com/pyenv-win/pyenv-win/master/pyenv-win/install-pyenv-win.ps1" -OutFile "./install-pyenv-win.ps1"; `
./install-pyenv-win.ps1
# Install Python using pyenv...
RUN pyenv install $Env:PYTHON_VERSION; `
pyenv global $Env:PYTHON_VERSION
ARG CONAN_VERSION=2.4.1
# Install conan from Python...
RUN python -m pip install --upgrade pip; `
pip install conan==$Env:CONAN_VERSION; `
conan profile detect
COPY .\conan\profiles\windows-x86_64-msvc194-release C:\TEMP\
RUN conan config install C:\TEMP\windows-x86_64-msvc194-release --type=file --target-folder=profiles; `
Remove-Item -Path C:\TEMP\windows-x86_64-msvc194-release
RUN Import-Module C:\BuildTools\Common7\Tools\Microsoft.VisualStudio.DevShell.dll; `
Enter-VsDevShell -VsInstallPath C:\BuildTools -SkipAutomaticLocation -DevCmdArguments '"-arch=x64 -no_logo"'; `
conan install `
--requires=boost/1.85.0 `
--profile:all=windows-x86_64-msvc194-release `
--options:all='*:shared=False' `
--build='missing:*'
# Define the entry point for the docker container.
# This entry point starts the developer command prompt and launches the PowerShell shell.
ENTRYPOINT ["C:\\BuildTools\\Common7\\Tools\\VsDevCmd.bat", "&&", "powershell.exe", "-NoLogo", "-ExecutionPolicy", "Bypass"]
The windows-x86_64-msvc194-release conan profile that is installed and used is simply:
[settings]
arch=x86_64
build_type=Release
compiler=msvc
compiler.cppstd=20
compiler.runtime=dynamic
compiler.version=194
os=Windows
The final failing step in the docker build log is:
Step 20/21 : RUN Import-Module C:\BuildTools\Common7\Tools\Microsoft.VisualStudio.DevShell.dll; Enter-VsDevShell -VsInstallPath C:\BuildTools -SkipAutomaticLocation -DevCmdArguments '"-arch=x64 -no_logo"'; conan install --requires=boost/1.85.0 --profile:all=windows-x86_64-msvc194-release --options:all='*:shared=False' --build='missing:*'
---> Running in ee385ca10aac
...
boost/1.85.0: Sources downloaded from 'conancenter'
boost/1.85.0: Calling source() in C:\Users\ContainerAdministrator\.conan2\p\boostf75e2cd16815f\s\src
boost/1.85.0: Downloading 124.0MB boost_1_85_0.tar.bz2
boost/1.85.0: Apply patch (conan): Optional flag to specify iconv from either libc of libiconv
-------- Installing package boost/1.85.0 (4 of 4) --------
boost/1.85.0: Building from source
boost/1.85.0: Package boost/1.85.0:5b206d5bc0af0b57e57d2785127443f36883ffbb
boost/1.85.0: Building your package in C:\Users\ContainerAdministrator\.conan2\p\b\booste815830283dfd\b
boost/1.85.0: Calling generate()
boost/1.85.0: Generators folder: C:\Users\ContainerAdministrator\.conan2\p\b\booste815830283dfd\b\build-release\conan
boost/1.85.0: Generating aggregated env files
boost/1.85.0: Generated aggregated env files: ['conanbuild.bat', 'conanrun.bat']
boost/1.85.0: Calling build()
boost/1.85.0: WARN: replace_in_file didn't find pattern '/* thread_local */' in 'C:\Users\ContainerAdministrator\.conan2\p\boostf75e2cd16815f\s\src\boost\stacktrace\detail\libbacktrace_impls.hpp' file.
boost/1.85.0: WARN: replace_in_file didn't find pattern '/* static __thread */' in 'C:\Users\ContainerAdministrator\.conan2\p\boostf75e2cd16815f\s\src\boost\stacktrace\detail\libbacktrace_impls.hpp' file.
boost/1.85.0: WARN: replace_in_file didn't find pattern 'local generic-os = [ set.difference $(all-os) : aix darwin vxworks solaris osf hpux ] ;' in 'C:\Users\ContainerAdministrator\.conan2\p\boostf75e2cd16815f\s\src\tools\build\src\tools\gcc.jam' file.
boost/1.85.0: WARN: replace_in_file didn't find pattern 'local no-threading = android beos haiku sgi darwin vxworks ;' in 'C:\Users\ContainerAdministrator\.conan2\p\boostf75e2cd16815f\s\src\tools\build\src\tools\gcc.jam' file.
boost/1.85.0: WARN: Patching user-config.jam
boost/1.85.0: WARN:
using zlib : 1.3.1 : <include>"C:/Users/ContainerAdministrator/.conan2/p/b/zlib912a6d980884f/p/include" <search>"C:/Users/ContainerAdministrator/.conan2/p/b/zlib912a6d980884f/p/lib" <name>zlib ;
using bzip2 : 1.0.8 : <include>"C:/Users/ContainerAdministrator/.conan2/p/b/bzip2d198e062ae404/p/include" <search>"C:/Users/ContainerAdministrator/.conan2/p/b/bzip2d198e062ae404/p/lib" <name>bz2 ;
using "msvc" : 14.3 : :
;
boost/1.85.0: WARN: b2 -q target-os=windows architecture=x86 address-model=64 binary-format=pe abi=ms --layout=system --user-config=C:\Users\ContainerAdministrator\.conan2\p\boostf75e2cd16815f\s\src\tools\build\user-config.jam -sNO_ZLIB=0 -sNO_BZIP2=0 -sNO_LZMA=1 -sNO_ZSTD=1 boost.locale.icu=off --disable-icu boost.locale.iconv=off --disable-iconv runtime-link=shared runtime-debugging=off threading=multi visibility=hidden link=static variant=release --with-atomic --with-charconv --with-chrono --with-cobalt --with-container --with-context --with-contract --with-coroutine --with-date_time --with-exception --with-filesystem --with-graph --with-iostreams --with-json --with-locale --with-log --with-math --with-nowide --with-program_options --with-random --with-regex --with-serialization --with-stacktrace --with-system --with-test --with-thread --with-timer --with-type_erasure --with-url --with-wave toolset=msvc cxxstd=20 pch=on linkflags="" cxxflags="-fPIC" install --prefix=C:\Users\ContainerAdministrator\.conan2\p\b\booste815830283dfd\p -j16 --abbreviate-paths -d0 --debug-configuration --build-dir="C:\Users\ContainerAdministrator\.conan2\p\b\booste815830283dfd\b\build-release"
boost/1.85.0: RUN: b2 -q target-os=windows architecture=x86 address-model=64 binary-format=pe abi=ms --layout=system --user-config=C:\Users\ContainerAdministrator\.conan2\p\boostf75e2cd16815f\s\src\tools\build\user-config.jam -sNO_ZLIB=0 -sNO_BZIP2=0 -sNO_LZMA=1 -sNO_ZSTD=1 boost.locale.icu=off --disable-icu boost.locale.iconv=off --disable-iconv runtime-link=shared runtime-debugging=off threading=multi visibility=hidden link=static variant=release --with-atomic --with-charconv --with-chrono --with-cobalt --with-container --with-context --with-contract --with-coroutine --with-date_time --with-exception --with-filesystem --with-graph --with-iostreams --with-json --with-locale --with-log --with-math --with-nowide --with-program_options --with-random --with-regex --with-serialization --with-stacktrace --with-system --with-test --with-thread --with-timer --with-type_erasure --with-url --with-wave toolset=msvc cxxstd=20 pch=on linkflags="" cxxflags="-fPIC" install --prefix=C:\Users\ContainerAdministrator\.conan2\p\b\booste815830283dfd\p -j16 --abbreviate-paths -d0 --debug-configuration --build-dir="C:\Users\ContainerAdministrator\.conan2\p\b\booste815830283dfd\b\build-release"
conanvcvars.bat: Activating environment Visual Studio 17 - amd64 - winsdk_version=None - vcvars_ver=14.4
[vcvarsall.bat] Environment initialized for: 'x64'
notice: found boost-build.jam at C:/Users/ContainerAdministrator/.conan2/p/boostf75e2cd16815f/s/src/boost-build.jam
notice: loading B2 from C:/Users/ContainerAdministrator/.conan2/p/b282792f1d1bde7/p/bin/.b2/kernel/bootstrap.jam
notice: Searching 'C:\Windows' 'C:\Users\ContainerAdministrator' 'C:/Users/ContainerAdministrator/.conan2/p/b282792f1d1bde7/p/bin/.b2/kernel' 'C:/Users/ContainerAdministrator/.conan2/p/b282792f1d1bde7/p/bin/.b2/util' 'C:/Users/ContainerAdministrator/.conan2/p/b282792f1d1bde7/p/bin/.b2/build' 'C:/Users/ContainerAdministrator/.conan2/p/b282792f1d1bde7/p/bin/.b2/tools' 'C:/Users/ContainerAdministrator/.conan2/p/b282792f1d1bde7/p/bin/.b2/contrib' 'C:/Users/ContainerAdministrator/.conan2/p/b282792f1d1bde7/p/bin/.b2/.' for site-config configuration file 'site-config.jam'.
notice: Configuration file 'site-config.jam' not found in 'C:\Windows' 'C:\Users\ContainerAdministrator' 'C:/Users/ContainerAdministrator/.conan2/p/b282792f1d1bde7/p/bin/.b2/kernel' 'C:/Users/ContainerAdministrator/.conan2/p/b282792f1d1bde7/p/bin/.b2/util' 'C:/Users/ContainerAdministrator/.conan2/p/b282792f1d1bde7/p/bin/.b2/build' 'C:/Users/ContainerAdministrator/.conan2/p/b282792f1d1bde7/p/bin/.b2/tools' 'C:/Users/ContainerAdministrator/.conan2/p/b282792f1d1bde7/p/bin/.b2/contrib' 'C:/Users/ContainerAdministrator/.conan2/p/b282792f1d1bde7/p/bin/.b2/.'.
notice: Loading explicitly specified user configuration file:
C:\Users\ContainerAdministrator\.conan2\p\boostf75e2cd16815f\s\src\tools\build\user-config.jam
notice: Searching 'C:\Users\ContainerAdministrator\.conan2\p\boostf75e2cd16815f\s\src\tools\build' for user-config configuration file 'user-config.jam'.
notice: Loading user-config configuration file 'user-config.jam' from 'C:/Users/ContainerAdministrator/.conan2/p/boostf75e2cd16815f/s/src/tools/build'.
notice: [zlib] Using pre-installed library
notice: [zlib] Condition
notice: [bzip2] Using pre-installed library
notice: [bzip2] Condition
notice: [msvc-cfg] msvc-14.3 detected, command: 'C:\BuildTools\VC\Tools\MSVC\14.40.3[380](https://gitlab.corp.five.ai/pipelines/scenario-database-and-sdl/scenario-definition-cpp/-/jobs/9792942#L380)7\bin\Hostx64\x64\cl.exe'
notice: will use 'C:\BuildTools\VC\Tools\MSVC\14.40.33807\bin\Hostx64\x64\cl.exe' for msvc, condition <toolset>msvc-14.3
notice: [msvc-cfg] condition: '<toolset>msvc-14.3/<architecture>x86/<address-model>32', setup: 'C:/BuildTools/VC/Tools/MSVC/14.40.33807/bin/Hostx64/vcvarsall.bat'
notice: [msvc-cfg] condition: '<toolset>msvc-14.3/<architecture>/<address-model>32', setup: 'C:/BuildTools/VC/Tools/MSVC/14.40.33807/bin/Hostx64/vcvarsall.bat'
notice: [msvc-cfg] condition: '<toolset>msvc-14.3/<architecture>x86/<address-model>64', setup: 'C:/BuildTools/VC/Tools/MSVC/14.40.33807/bin/Hostx64/vcvarsall.bat'
notice: [msvc-cfg] condition: '<toolset>msvc-14.3/<architecture>/<address-model>64', setup: 'C:/BuildTools/VC/Tools/MSVC/14.40.33807/bin/Hostx64/vcvarsall.bat'
notice: [msvc-cfg] condition: '<toolset>msvc-14.3/<architecture>x86/<address-model>', setup: 'C:/BuildTools/VC/Tools/MSVC/14.40.33807/bin/Hostx64/vcvarsall.bat'
notice: [msvc-cfg] condition: '<toolset>msvc-14.3/<architecture>/<address-model>', setup: 'C:/BuildTools/VC/Tools/MSVC/14.40.33807/bin/Hostx64/vcvarsall.bat'
notice: [msvc-cfg] condition: '<toolset>msvc-14.3/<architecture>ia64/<address-model>64', setup: 'C:/BuildTools/VC/Tools/MSVC/14.40.33807/bin/Hostx64/vcvarsall.bat'
notice: [msvc-cfg] condition: '<toolset>msvc-14.3/<architecture>ia64/<address-model>', setup: 'C:/BuildTools/VC/Tools/MSVC/14.40.33807/bin/Hostx64/vcvarsall.bat'
notice: [msvc-cfg] condition: '<toolset>msvc-14.3/<architecture>arm/<address-model>32', setup: 'C:/BuildTools/VC/Tools/MSVC/14.40.33807/bin/Hostx64/vcvarsall.bat'
notice: [msvc-cfg] condition: '<toolset>msvc-14.3/<architecture>arm/<address-model>64', setup: 'C:/BuildTools/VC/Tools/MSVC/14.40.33807/bin/Hostx64/vcvarsall.bat'
notice: [zlib] zlib is already configured
notice: [bzip2] bzip is already configured
notice: iostreams: not using lzma compression
notice: iostreams: not using zstd compression
notice: [python-cfg] Configuring python...
notice: [python-cfg] Checking interpreter command "python"...
notice: [python-cfg] running command 'DIR /-C /A:S "C:\Users\ContainerAdministrator\.pyenv\pyenv-win\versions\3.12.3\python.exe" 2>&1'
notice: [python-cfg] running command 'python -c "from sys import *; print('version=%d.%d\nplatform=%s\nprefix=%s\nexec_prefix=%s\nexecutable=%s' % (version_info[0],version_info[1],platform,prefix,exec_prefix,executable))" 2>&1'
notice: [python-cfg] ...requested configuration matched!
notice: [python-cfg] Details of this Python configuration:
notice: [python-cfg] interpreter command: "python"
notice: [python-cfg] include path: "C:\Users\ContainerAdministrator\.pyenv\pyenv-win\versions\3.12.3\Include"
notice: [python-cfg] library path: "C:\Users\ContainerAdministrator\.pyenv\pyenv-win\versions\3.12.3\libs"
notice: [python-cfg] DLL search path: "C:\Users\ContainerAdministrator\.pyenv\pyenv-win\versions\3.12.3"
notice: [python-cfg] Checking for NumPy...
notice: [python-cfg] running command 'python -c "import sys; sys.stderr = sys.stdout; import numpy; print(numpy.get_include())"'
notice: [python-cfg] NumPy disabled. Reason:
notice: [python-cfg] python -c "import sys; sys.stderr = sys.stdout; import numpy; print(numpy.get_include())" aborted with
notice: [python-cfg] Traceback (most recent call last):
File "<string>", line 1, in <module>
ModuleNotFoundError: No module named 'numpy'
Performing configuration checks
- default address-model : none [1]
- default architecture : none [1]
- compiler supports SSE2 : no [2]
- compiler supports SSE4.1 : no [2]
- cxx11_static_assert : no [2]
- compiler supports SSE2 : no [3]
- compiler supports SSE4.1 : no [3]
- cxx11_static_assert : no [3]
- cxx11_variadic_templates : no [2]
- cxx11_variadic_templates : no [3]
- cxx11_hdr_ratio : no [2]
- cxx11_hdr_ratio : no [3]
- cxx20_hdr_concepts : no [2]
- cxx20_hdr_concepts : no [3]
- has std::atomic_ref : no [2]
- has statx : no [2]
- has statx syscall : no [2]
- has BCrypt API : no [2]
- is Windows CE : no [2]
- has init_priority attribute : no [2]
- has stat::st_blksize : no [2]
- has stat::st_mtim : no [2]
- has stat::st_mtimensec : no [2]
- has stat::st_mtimespec : no [2]
- has stat::st_birthtim : no [2]
- has stat::st_birthtimensec : no [2]
- has stat::st_birthtimespec : no [2]
- has fdopendir(O_NOFOLLOW) : no [2]
- has dirent::d_type : no [2]
- has POSIX *at APIs : no [2]
- has fallocate : no [2]
- cxx11_rvalue_references : no [2]
- has std::atomic_ref : no [3]
- has statx : no [3]
- has statx syscall : no [3]
- has BCrypt API : no [3]
- is Windows CE : no [3]
- cxx11_rvalue_references : no [3]
- has_icu builds : no [2]
- zlib : no [4]
- bzip2 : no [4]
- cxx11_constexpr : no [2]
- cxx11_constexpr : no [3]
- cxx11_auto_declarations : no [2]
- cxx11_auto_declarations : no [3]
- native atomic int32 supported : no [2]
- has message compiler : no [2]
- native syslog supported : no [2]
- pthread supports robust mutexes : no [2]
- Boost.Regex is header-only : no [2]
- compiler supports SSSE3 : no [2]
- compiler supports AVX2 : no [2]
- compiler supports SSSE3 : no [3]
- compiler supports AVX2 : no [3]
- native atomic int32 supported : no [3]
- has message compiler : no [3]
- native syslog supported : no [3]
- pthread supports robust mutexes : no [3]
- cxx11_lambdas : no [2]
- cxx11_lambdas : no [3]
- gcc visibility : no [2]
- cxx11_noexcept : no [2]
- gcc visibility : no [3]
- cxx11_noexcept : no [3]
- std_wstreambuf builds : no [2]
- std_wstreambuf : no [2]
- std_wstreambuf : no [3]
- BOOST_COMP_GNUC >= 4.3.0 : no [2]
[1] msvc-14.3
[2] msvc-14.3/rls/adrs-mdl-64/archt-x86/bst.l-off/bst.l-off/cxstd-20-iso/lnk-sttc/pythn-3.12/thrdp-wn32/thrd-mlt/vsblt-hdn
[3] msvc-14.3/rls/adrs-mdl-64/archt-x86/bst.l-off/bst.l-off/bld-no/cxstd-20-iso/lnk-sttc/pythn-3.12/thrdp-wn32/thrd-mlt/vsblt-hdn
[4] lnk-sttc
Component configuration:
- atomic : building
- charconv : building
- chrono : building
- cobalt : building
- container : building
- context : building
- contract : building
- coroutine : building
- date_time : building
- exception : building
- fiber : not building
- filesystem : building
- graph : building
- graph_parallel : not building
- headers : not building
- iostreams : building
- json : building
- locale : building
- log : building
- math : building
- mpi : not building
- nowide : building
- program_options : building
- python : not building
- random : building
- regex : building
- serialization : building
- stacktrace : building
- system : building
- test : building
- thread : building
- timer : building
- type_erasure : building
- url : building
- wave : building
...
boost/1.85.0: ERROR:
Package '5b206d5bc0af0b57e57d2785127443f36883ffbb' build failed
boost/1.85.0: WARN: Build folder C:\Users\ContainerAdministrator\.conan2\p\b\booste815830283dfd\b\build-release
ERROR: boost/1.85.0: Error in build() method, line 1130
self.run(full_command)
ConanException: Error 1 while executing
The command 'powershell.exe -Command Import-Module C:\BuildTools\Common7\Tools\Microsoft.VisualStudio.DevShell.dll; Enter-VsDevShell -VsInstallPath C:\BuildTools -SkipAutomaticLocation -DevCmdArguments '"-arch=x64 -no_logo"'; conan install --requires=boost/1.85.0 --profile:all=windows-x86_64-msvc194-release --options:all='*:shared=False' --build='missing:*'' returned a non-zero code: 1
Cleaning up project directory and file based variables
00:00
ERROR: Job failed: exit status 1
It looks to me that the msvc toolset isn’t being properly identified by b2 since all of the compiler sanity checks performed by b2 above return no (or none) I suspect it has to do with the b2 issues fixed here (https://github.com/bfgroup/b2/pull/394).
My question is how do I work around this in the short term - until the b2 fix makes its way into the conan boost recipe? Everything is working fine with the Visual Studio 2022 build tools version 17.9.7, but it seems very involved to try to specify a non-latest version of the Visual Studio vs_buildtools.exe bootstrapper in my docker file (I am looking into it) and so it seems I am stuck with version 17.10+ (what I get when using the https://aka.ms/vs/17/release/channel and https://aka.ms/vs/17/release/vs_buildtools.exe URLs in the docker file) for now unfortunately. I would think this will affect a good number of users in any case, so should probably be addressed as part of the boost conan recipe anyway (if possible). Unfortunately, it seems b2/5.0.0 is the next release after b2/4.10.1 and that seems to drop backwards compatibility in some way - not sure if that is a problem for building boost or not and not yet sure whether that release contains the necessary patch anyway (I will take a quick look now).
Any suggestions gratefully received. Thanks.
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Reactions: 1
- Comments: 16 (10 by maintainers)
I’m not aware of B2 changes that would affect binary compatibility. Such incompatible changes would be in the Boost jamfiles instead of the B2 tool itself.
Yes, the difference is that
Installs the tool-requires for yourself but not for boost, while the profile
[tool_requires]inject the tool-requires in all packages, including boost.Okay, I’m taking back those words. Turns out there’s one possible change only in b2/5.2.0 that may cause binary compat issues… https://github.com/bfgroup/b2/commit/376470fadd3ecad2b5cf5aa86a261281d479567c#diff-9a030b36fd0e7f9598dc36b4c932695bdf86ea75ae303f1b6d01e63de97d9f95R1935
That change will affect the ABI of the msvc stdlib. This might only be a problem if people disable exception handling with msvc. But I don’t see anything in the Boost recipe that would allow for building Boost with exception handling off. But figured I’d point it out just in case. 😉