Opened 6 years ago

#12356 new Bugs

Failed build for msvc 11.0 with global setup script in combination with rewrite option

Reported by: Christian.Steinle@… Owned by:
Milestone: To Be Determined Component: Building Boost
Version: Boost 1.58.0 Severity: Problem
Keywords: msvc 11.0 global setup phone Cc:

Description

Problem: The compilation of Boost with the utilization of a global setup script, that should be cached in C:\Temp, results in the error: "error: rewriting setup script for the second time". By the way, this error would be only shown, if one adds the line:

import Errors ;

in front of the proper error line in the file msvc.jam. Nevertheless the error occurs.


Prerequisite:

  • user-config.jam:
    using msvc : 11.0 : : <setup>"C:\prepareEnvironment.bat" <rewrite-setup-scripts>always ;
    

Reason: A closer look to the file msvc.jam shows that the global setup script is used to build the cache files for the standard as well as the phone setup in C:Ttemp. Although this is not bad, the circumstance that the script argument is additionally equal for both, the situation ends then badly with two problems. The first one is identified by the impossibility to differentiate the requests in the global setup scripts, and the second one leads to the reported error, becauser the generated name of the two different cache file is equal (C:\Temp\b2_msvc_prepareEnvironment_x86.cmd). The corresponding lines of code are: msvc.jam(985):

local cpu = i386 amd64 ia64 arm
...
local global-setup = [ feature.get-values <setup> : $(options) ] ;
global-setup = $(global-setup[1]) ;
local global-setup-phone = $(global-setup) ;
...
local phone-cpu = i386 arm ;

Solution: Simply enable a second global script for the phone setup, which needs to have a different name, and/or append an additional postfix to the generated names of the cache files. This solution seems to be good, because the standard scripts in the Microsoft Visual Studio are also different (vcvarsall.bat versus vcvarsphoneall.bat).

local global-setup = [ feature.get-values <setup> : $(options) ] ;
global-setup = $(global-setup[1]) ;
local global-setup-phone = [ feature.get-values <setup-phone> : $(options) ] ;
global-setup-phone = $(global-setup-phone[1]) ;

Change History (0)

Note: See TracTickets for help on using tickets.