Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What does (set PATH=...;%PATH:)=^)%) mean in a Windows shell script, and how can I overcome failure of this line in the context of a Qt5 nmake build?

In the context of an obstacle-ridden process of attempting to build Qt5 (32-bit) with VS 2012, I have run into yet another build error.

It is:

(set PATH=C:\Users\daniel347x\Desktop\Backup\__Dan_Root\qt5\qtbase\lib;%PATH:)=^)%) & C:\Users\daniel347x\Desktop\Backup__Dan_Root\qt5\qtbase\bin\uic.exe dialogs\qfiledialog.ui -o ui_qfiledialog.h

NMAKE : fatal error U1077: '(set' : return code '0xc0000135'

Stop.

I cannot find anything relevant about the (set PATH=...;%PATH:)=^)%) failure issue (returning error code 0xc0000135) when I perform a detailed Google/StackOverflow search.

Note that nmake proceeds for a long time (more than 1 hour) happily switching directories, running intermediate .exe's, and both compiling and linking code files.

I am running nmake (as well as having run configure) in the 32-bit Visual Studio 2012 Tools command prompt; and as far as I know, all of my path variables are properly set (they include the paths to 32-bit Perl and to 32-bit Python, although I don't think that is relevant here).

I have restarted my computer, and I ran the VS 2012 Tools Command Prompt with Administrator privileges (in case it is a permissions error), attempting to run nmake, and the same error occurs.

I then attempted to try to figure out what the error actually is. At that point, I became stumped by the syntax of this command-line statement that is apparently being executed within a Makefile-triggered shell script:

(set PATH=...;%PATH:)=^)%)
                   ^^^^^^ // What do the symbols :)=^)% mean?

I do not understand the symbols :)=^)% in the context of this script.

Can somebody tell me what these symbols mean in the context of a Windows shell script (that is being executed in the context of an nmake Makefile (building 32-bit Qt5 with VS 2012))?

As an added optional question, what can I do to overcome this error and continue to build Qt5 without this error blocking progress?

like image 562
Dan Nissenbaum Avatar asked Apr 11 '13 15:04

Dan Nissenbaum


1 Answers

The (set PATH=...;%PATH:)=^)%) is a string substitution. Look up 'environment variable substitution' in the help set command output for more information.

The script prepends the PATH variable, but during the substitution it escapes the right parens so the whole line is correctly formatted. For example, the %PATH% might contain a substring "Program Files (x86)" that will break the set syntax upon expansion. The ^ symbol before the paren is just a batch escaping symbol.

Second, the (...) & ... is a grouping operator that allows multiple commands to be written on the same line. Why the script author decided to place those two commands on the same line is unknown to me, but it has definitely helped to obscure the error.

Third, though NMAKE reports an error for the '(set' command, quick checking proved that the return code (%ERRORLEVEL%) is set by the last command of the group, so there is no use of googling the 0xc0000135 error for the SET and NMAKE commands.

The actual source of the error is the 'uic.exe', that is located in:

C:\Users\daniel347x\Desktop\Backup__Dan_Root\qt5\qtbase\bin\uic.exe

Regarding the error, 0xc0000135 - this is The application failed to initialize properly error. My guess is either that the 'uic.exe' was built with the incompatible toolchain/SDK, or requires some missing dlls.

P.S. An alternative solution: the similar problem has been solved by using jom instead of nmake.

like image 58
Vladimir Sinenko Avatar answered Sep 23 '22 20:09

Vladimir Sinenko