Boost C++ Libraries: Ticket #13433: b2 emits strange error message when building 1.66.0 on windows 10 against very new visual studio https://svn.boost.org/trac10/ticket/13433 <p> Hello, I am try to build boost against the latest version of visual studio (15.5.5, I know that 15.5.6 is out though, shouldn't be too different) and I am getting this error </p> <p> failed to write command file! </p> <p> when running this command </p> <p> b2.exe --hash address-model=32 debug --stagedir=bin\v141\Win32\ -a --toolset=msvc-14.1 cxxflags="/D"_WIN32_WINNT=0x0600" /std:c++17 /Qspectre /D"_HAS_AUTO_PTR_ETC=1"" </p> <p> It has passed sometimes however it frequently doesn't. Its unclear what exactly I am doing that causes this error </p> <p> Here are the things I've done step by step </p> <p> 1: Download boost source code and unzip it </p> <p> 2: run bootstrap.bat </p> <p> 3: run above cmd line from the visual studio developer command prompt (this has failed when using powershell too) </p> <p> this was the last few things that were printed Info: Boost.Config is older than your compiler version - probably nothing bad will happen - but you may wish to look for an update Boost version. Define BOOST_CONFIG_SUPPRESS_OUTDATED_MESSAGE to suppress this message. msvc.archive bin.v2\libs\date_time\build\a1668ad3e8cba9b190515cabd106a4cf\libboost_date_time-vc141-mt-gd-x32-1_66.lib common.copy bin\v141\Win32\lib\libboost_date_time-vc141-mt-gd-x32-1_66.lib bin.v2\libs\date_time\build\a1668ad3e8cba9b190515cabd106a4cf\libboost_date_time-vc141-mt-gd-x32-1_66.lib </p> <blockquote> <p> 1 file(s) copied. </p> </blockquote> <p> compile-c-c++ bin.v2\libs\exception\build\a1668ad3e8cba9b190515cabd106a4cf\clone_current_exception_non_intrusive.obj clone_current_exception_non_intrusive.cpp Info: Boost.Config is older than your compiler version - probably nothing bad will happen - but you may wish to look for an update Boost version. Define BOOST_CONFIG_SUPPRESS_OUTDATED_MESSAGE to suppress this message. failed to write command file! </p> <p> I am unsure what is causing this. I don't think I am passing in parameters to the cxx flags incorrectly. I am filing a ticket because I suspect there might be a bug in b2 or bjam. </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/13433 Trac 1.4.3 ivandavid14@… Thu, 01 Feb 2018 03:14:44 GMT <link>https://svn.boost.org/trac10/ticket/13433#comment:1 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/13433#comment:1</guid> <description> <p> So, I did more digging and found a file called execnt.c and modified the err_printf in prepare_command_file() to be this </p> <p> err_printf("failed to write command file!\n %s\n %s\n", strerror(errno), cmdtab[ slot ].command_file-&gt;value); </p> <p> and this was the output </p> <p> failed to write command file! Permission denied C:\Users\divan\<a class="missing wiki">AppData</a>\Local\Temp\jam2188-00-19.bat </p> <p> I've ran b2 a couple of times with this and the last two digits are always 19. The contents of the bat file are always different. I change the permissions on my temp folder and that didn't fix anything. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Kohei Takahashi</dc:creator> <pubDate>Fri, 02 Feb 2018 00:59:41 GMT</pubDate> <title>component changed; owner set https://svn.boost.org/trac10/ticket/13433#comment:2 https://svn.boost.org/trac10/ticket/13433#comment:2 <ul> <li><strong>owner</strong> set to <span class="trac-author">Vladimir Prus</span> </li> <li><strong>component</strong> <span class="trac-field-old">None</span> → <span class="trac-field-new">build</span> </li> </ul> Ticket ivandavid14@… Fri, 02 Feb 2018 18:30:56 GMT <link>https://svn.boost.org/trac10/ticket/13433#comment:3 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/13433#comment:3</guid> <description> <p> Hello, after modified the execnt.c a bit more </p> <p> err_printf("failed to write command file!\n %u\n %s\n",<a class="missing wiki">GetLastError</a>(), cmdtab[ slot ].command_file-&gt;value); </p> <p> The result of the <a class="missing wiki">GetLastError</a>() was 32 which is ERROR_SHARING_VIOLATION, which has the description "The process cannot access the file because it is being used by another process." </p> <p> I found that antimalware software (such as windows defender) can cause fopen to do fail. I observed that small cpp files are usually what cause the problem (like a lot of the math ones). My assumption is that they compile very quickly so the time between create a bat file, running it, then going on to the next one is very small. This creates a lot of bat files in a short amount of time, potentially triggering the antimalware software to lock the file or something like that. </p> <p> I modified my command line by removing '-a' from the b2 call and I wrote a script to just keep trying to build boost and just continue from where it left off. Sorry for the rather unsatisfactory answer and I hope I didn't waste your guys time. </p> </description> <category>Ticket</category> </item> </channel> </rss>