Subject: [Boost-bugs] [Boost C++ Libraries] #12356: Failed build for msvc 11.0 with global setup script in combination with rewrite option
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2016-07-28 15:04:56
#12356: Failed build for msvc 11.0 with global setup script in combination with
rewrite option
--------------------------------+------------------------------------------
Reporter: | Type: Bugs
Christian.Steinle@⦠| Milestone: To Be Determined
Status: new | Version: Boost 1.58.0
Component: Building Boost | Keywords: msvc 11.0 global setup phone
Severity: Problem |
--------------------------------+------------------------------------------
'''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]) ;
}}}
-- Ticket URL: <https://svn.boost.org/trac/boost/ticket/12356> Boost C++ Libraries <http://www.boost.org/> Boost provides free peer-reviewed portable C++ source libraries.
This archive was generated by hypermail 2.1.7 : 2017-02-16 18:50:20 UTC