color 00

#1
Hello.

There is an issue with "Color 00" command.

Some code
Code:
@Echo off
*Set ok=OK
*Color %1 2>nul
If ErrorLevel=1 Set ok=FAIL
color
echo %1 %ok
Some calls:
Code:
c.btm 01
01 OK
Good

Code:
c.btm 11
11 FAIL
Good

Code:
c.btm 00
00 OK
Not good

Why this issue is important for me?
Building boost library (any version) under TCC fails due to mentioned issue.
Example invocation of boost script: "bootstrap.bat mingw" - parameter mingw is not recognized and default (empty value) is used.
Inside the build.bat "color 00" is used to set non-zero value of errorlevel, under TCC it is not set.
 
#3
Fresh copy of boost 1.57
Using TCC17:
take a look at window title: bootstrap uses cl instead of gcc
bootstrap1.png


and after the process:
bootstrap2.png

And the log is attached (renamed as bootstrap.txt; .log is not allowed extension).

--------------------------------------------------------------
The same process using TCC/LE, (again: fresh copy of boost 1.57), everything else is the same.
Build process: in the title there is gcc:
bootstrap1ok.png

and after bootstrapping:
bootstrap2ok.png


Everything is OK.
 

Attachments

#5
Code near the line 12 of tools\build\src\engine\build.bat:
Code:
[11] :Set_Error
[12] color 00
[13] goto :eof
Bootstrapping goes fine if it would be modified to
Code:
color 11 2>nul
 
#6
I don't see that, but I don't use mingw, I use VS 2013 to build Boost.

The bootstrapping may be working on your system, but the "color 00" turns off the output.
1. bootstrap fails - see attached log.
2. bootstrap ignores "mingw" parameter, guesses compiler and assumes VS. And then - build boost for visual studio
 

rconn

Administrator
Staff member
May 14, 2008
10,772
97
#8
Code near the line 12 of tools\build\src\engine\build.bat:
Code:
[11] :Set_Error
[12] color 00
[13] goto :eof
Bootstrapping goes fine if it would be modified to
Code:
color 11 2>nul
Even for the Boost developers ("if it works under Linux, we don't need to test anything else"), that's a remarkably stupid script.

Are you saying that you have *two* problems -- one with recognizing "mingw" and another with "color 00"?
 
#9
A can agree - the script is extremely complicated, without any real reason.

There is only one issue: "color 00 doesn't set errorlovel"

It is extracted from boost script: "why boost doesn't build for libraries mingw under TCC, while under cmd.exe everything is fine"

In the tools\build\src\engine\build.bat, very strange code tests if parameter "mingw" == "". Strange code gets strange results, because "color 00" doesn't set errorlevel in subroutine :Set_Error (shown in the previous post).

----

To replicate the problem: installation of mingw is not required. Just download latest boost and trace execution:
"bdebugger bootstrap.bat mingw"
It leads to the issue very early