Re: [Boost-bugs] [Boost C++ Libraries] #2141: (Windows) in tools/jam/src "build.bat toolset" does not recognize toolset

Subject: Re: [Boost-bugs] [Boost C++ Libraries] #2141: (Windows) in tools/jam/src "build.bat toolset" does not recognize toolset
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2008-10-21 22:05:08


#2141: (Windows) in tools/jam/src "build.bat toolset" does not recognize toolset
------------------------------------------------------------+---------------
  Reporter: Arnaud Cheritat <cheritat_at_[hidden]> | Owner:
      Type: Bugs | Status: new
 Milestone: Boost 1.36.0 | Component: Building Boost
   Version: Boost 1.35.0 | Severity: Problem
Resolution: | Keywords: building bjam windows
------------------------------------------------------------+---------------

Comment(by Mateusz Czapliński <czapkofan_at_[hidden]>):

 I have the same problem, with Boost 1.36. From what I've managed to debug,
 apparently the "set _error_=" idiom has ceased to work in Vista. I've
 created a following simple batch file to test it:

 {{{
 @echo off

 call :v a
 call :test1
 call :v b
 call :test2
 call :v c
 call :test1
 call :v d
 call :test2
 call :v e
 call :test3
 call :v f
 call :test2
 call :v g

 goto :eof

 :v
 if errorlevel 1 (
  echo %1=1
 ) else (
  echo %1=0
 )
 goto :eof


 :test1
 setlocal & endlocal
 setlocal
 echo in test 1...
 set _error_=
 endlocal
 goto :eof

 :test2
 setlocal & endlocal
 setlocal
 echo in test 2...
 endlocal
 goto :eof

 :test3
 setlocal & endlocal
 setlocal
 echo in test 3...
 color 00
 endlocal
 goto :eof
 }}}

 which results in the following output on Vista:
 {{{
 a=0
 in test 1...
 b=0
 in test 2...
 c=0
 in test 1...
 d=0
 in test 2...
 e=0
 in test 3...
 f=1
 in test 2...
 g=0
 }}}

 in comparison to XP's:
 {{{
 a=0
 in test 1...
 b=1
 in test 2...
 c=0
 in test 1...
 d=1
 in test 2...
 e=0
 in test 3...
 f=1
 in test 2...
 g=0
 }}}

 Therefore, I suggest to change the "set _error_=" idiom mentioned above to
 the '''"color 00"''' one (found on http://www.ss64.com/nt/if.html ), which
 seems to still work on Vista, or perhaps to a more explicit sequence of
 commands similar to that below:
 {{{
 setlocal
 if fooblah set _error_=1
 endlocal & set _Result=%_error_%
 if %_Result%==1 ( blahblah )
 }}}

-- 
Ticket URL: <http://svn.boost.org/trac/boost/ticket/2141#comment:2>
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:49:59 UTC