Conan-center-index: [package] boost/1.72.0: Build failure, Visual Studio 2017

Created on 13 Feb 2020  路  6Comments  路  Source: conan-io/conan-center-index

Package and Environment Details (include every applicable attribute)

  • Package Name/Version: boost/1.72.0
  • Operating System+version: Windows 10 1803
  • Compiler+version: Visual Studio 2017 v15.9.20
  • Docker image: n/a
  • Conan version: conan 1.22.1
  • Python version: Python 3.6.7

Note: This problem started when RREV 98625d3ee856ce5020b7b74cded93fcf hit our system. If I force it to fb172ee71c4f6eab2c23b1ec1781ef01, it works.

Pinning the RREV is impractical, because if I pin it in our problem project, Conan complains that the version is different from boost/1.72.0 as used in requirements.

$ conan search -r conan-center-virtual 'boost/1.72.0@' -rev
Revisions for 'boost/1.72.0' at remote 'conan-center-virtual':
98625d3ee856ce5020b7b74cded93fcf (2020-02-11 09:47:21 UTC)
fb172ee71c4f6eab2c23b1ec1781ef01 (2020-02-05 20:33:40 UTC)
cd9a117751c1780db2e4107e55a96893 (2020-02-05 13:08:27 UTC)
1a89a2caf9cecf010acc949e84032851 (2020-01-31 10:09:08 UTC)
65bf1d6b91bdc49ec202f9baae1299a4 (2020-01-15 17:57:53 UTC)

Conan profile (output of conan profile show default or conan profile show <profile> if custom profile is in use)

Configuration for profile default:

[settings]
os=Windows
os_build=Windows
arch=x86_64
arch_build=x86_64
compiler=Visual Studio
compiler.version=15
build_type=Release
[options]
[build_requires]
[env]

Steps to reproduce (Include if Applicable)

$ conan install -if build boost/1.72.0@ -s os=Windows -s arch=x86_64 -s compiler="Visual Studio" -s compiler.version=15 -s build_type=Release -s compiler.runtime=MT --build missing

Logs (Include/Attach if Applicable)

See https://gist.github.com/datalogics-kam/45d33174d562d4d5b98efd73fa8248c8

bug

All 6 comments

I searched that log so many times, and finally found this:

c1xx: error C3859: Failed to create virtual memory for PCH

c1xx: note: PCH: Unable to get the requested block of memory

c1xx: note: please visit https://aka.ms/pch-help for more details

c1xx: fatal error C1076: compiler limit: internal heap limit reached

I think I also face this issue when trying to compile boost from sources in my machine, but not sure. Maybe @SSE4 has some idea of the recent changes in the recipe

such kinds of errors happen from time to time on certain systems. particularly, if system cannot allocate enough memory needed for the compiler. situation quickly gets worse on parallel builds. also, it's more noticable with C++ code, especially if it uses lots of templates (like boost), which have to be instantiated numerous times, consuming the memory rapidly.

few things you can try:

  1. disable parallel builds, e.g. by setting CONAN_CPU_COUNT=1
  2. disable precompiled headers, e.g. by passing boost:extra_b2_flags=pcf=off option
  3. try to get more available memory (increase page file size, close some applications not needed during the build)
  4. try to specify the Zm compiler flag to increase compiler heap (as noted in C1076)

if none of these helps, I'd say you need to submit an issue to the Visual Studio bug tracker (but first ensure you have installed all updates for Visual Studio).

such kinds of errors happen from time to time on certain systems

Yes, some of our engineers have reported this on previous versions of the recipe, and it seems quite random, or at least subject to small changes to the build or the build environment. We've been pushing prebuilt binaries to help them.

  1. Tried CONAN_CPU_COUNT=1 and that didn't help.
  2. -o boost:extra_b2_flags=pch=off _did_ help, and we will be adding that to our global profiles for Visual Studio builds. (note, it's "pch", not "pcf")
  3. Increasing the page file to 32 GB and killing extra apps didn't help. I watched the memory in Task Manager, and I'm nowhere near running out. At this point I'm pretty sure it's a compiler limitation rather than a system resource problem.
  4. Increasing /Zm is an interesting idea, but that would require patching tools/build/src/tools/msvc.jam, where it's already set at /Zm800. On the other hand, if it turns out it helps people, maybe it could become an option in the conanfile.py, and dynamically fix up those 2 lines.

It turns out that setting boost:extra_b2_flags=pch=off tickles RTFACT-19943, causing Artifactory to not be able to search or download packages that use that setting. The indexing fails:

2020-02-14 21:27:47,796 [http-nio-8081-exec-102] [ERROR] (o.j.r.c.r.u.LocalUpDownConanHandler:122) - Error parsing file company/product/version/nightly/e2ba0f44c07a9745726aeae9198a1172/package/9eb3f62611392009de1c42f52ec056650123d00b/583ce789a04046dc4846fbeb9488f2fb/conaninfo.txt: Exception: Invalid conaninfo.txt format: boost:extra_b2_flags=pch=off

Would you entertain a patch to make pch an option without having to use extra_b2_flags with an = in it?

feel free to submit pull requests you need (e.g. for pcf option, or for setting /Zm).
in the past, I've already seen boost didn't compile properly with pch on Mac, for instance.
so it's worth to expose it as an option, as we know that pch might be problematic to use.

Was this page helpful?
0 / 5 - 0 ratings