Skip to content
This repository has been archived by the owner on May 6, 2022. It is now read-only.

Fixes builds where environment variable has backslashes #3

Merged
merged 1 commit into from
Jan 8, 2015

Conversation

seecrypt
Copy link

@seecrypt seecrypt commented Jan 2, 2015

If an environment variable such as PATH contains a backslash Visual Studio interprets the next line as part of the comment. When a user attempts to build the .sln he or she will see errors relating to a missing brace "}".

Before fix, the following code is generated in winrtcomponent.cpp and Visual Studio does not recognize the brace in the line }//end:ms\test.bat

...
    end_0:
    echo("end_0:");
    //PATH=C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\IDE\CommonExtensions\Microsoft\TestWindow;C:\Program Files (x86)\Microsoft SDKs\F#\3.1\Framework\v4.0\;C:\Program Files (x86)\MSBuild\12.0\bin;C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\IDE\;C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\BIN;C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\Tools;C:\Windows\Microsoft.NET\Framework\v4.0.30319;C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\VCPackages;C:\Program Files (x86)\HTML Help Workshop;C:\Program Files (x86)\Microsoft Visual Studio 12.0\Team Tools\Performance Tools;C:\Program Files (x86)\Windows Kits\8.1\bin\x86;C:\Program Files (x86)\Microsoft SDKs\Windows\v8.1A\bin\NETFX 4.5.1 Tools\;C:\Perl64\site\bin;C:\Perl64\bin;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files\Intel\WiFi\bin\;C:\Program Files\Common Files\Intel\WirelessCommon\;C:\Program Files (x86)\Windows Kits\8.1\Windows Performance Toolkit\;C:\Program Files\Microsoft SQL Server\110\Tools\Binn\;C:\Program Files (x86)\Microsoft SDKs\TypeScript\1.0\;C:\Program Files\Microsoft SQL Server\120\Tools\Binn\;C:\Program Files\Perforce;C:\Program Files\Intel\WiFi\bin\;C:\Program Files\Common Files\Intel\WirelessCommon\
}//end:ms\test.bat
...

The user will see error messages of this type:

...
Error   75  error C1075: end of file found before the left brace '{' at 'C:\Users\Seecrypt\git\openssl\vsout\\winrtcomponent.cpp(105)' was matched  C:\Users\Seecrypt\git\openssl\vsout\\winrtcomponent.cpp 1412    1   NT-Phone-8.1-Dll-Unicode-winrtcomponent
...

By encapsulating the environment variable contents in quotation marks we can prevent Visual Studio from marking the brace in "}//end:ms\test.bat" as being a comment. Generated code with fix:

...
    end_0:
        echo("end_0:");
        //PATH="C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\IDE\CommonExtensions\Microsoft\TestWindow;C:\Program Files (x86)\Microsoft SDKs\F#\3.1\Framework\v4.0\;C:\Program Files (x86)\MSBuild\12.0\bin;C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\IDE\;C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\BIN;C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\Tools;C:\Windows\Microsoft.NET\Framework\v4.0.30319;C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\VCPackages;C:\Program Files (x86)\HTML Help Workshop;C:\Program Files (x86)\Microsoft Visual Studio 12.0\Team Tools\Performance Tools;C:\Program Files (x86)\Windows Kits\8.1\bin\x86;C:\Program Files (x86)\Microsoft SDKs\Windows\v8.1A\bin\NETFX 4.5.1 Tools\;C:\Users\Dino\ConEmuPack.141206;C:\Users\Dino\ConEmuPack.141206\ConEmu;C:\Perl64\site\bin;C:\Perl64\bin;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files\Intel\WiFi\bin\;C:\Program Files\Common Files\Intel\WirelessCommon\;C:\Program Files (x86)\Windows Kits\8.1\Windows Performance Toolkit\;C:\Program Files\Microsoft SQL Server\110\Tools\Binn\;C:\Program Files (x86)\Microsoft SDKs\TypeScript\1.0\;C:\Program Files\Microsoft SQL Server\120\Tools\Binn\;C:\Program Files\Perforce;C:\Program Files\Intel\WiFi\bin\;C:\Program Files\Common Files\Intel\WirelessCommon\"
    }//end:ms\test.bat
...

khouzam added a commit that referenced this pull request Jan 8, 2015
Fixes builds where environment variable has backslashes
@khouzam khouzam merged commit c20688d into microsoft:WinRT Jan 8, 2015
khouzam pushed a commit that referenced this pull request Jun 18, 2018
Merge pull request #56 from Project-Nagisa/OpenSSL_1_0_2_WinRT-stable
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants