tag:help.appveyor.com,2012-11-13:/discussions/problems/29255-trying-to-override-the-phantom-alias-executable-cl-microsoft-callAppVeyor: Discussion 2021-04-06T17:52:59Ztag:help.appveyor.com,2012-11-13:Comment/491266412021-04-06T09:27:11Z2021-04-06T09:27:11ZTrying to override the phantom alias executable "cl" - Microsoft "call"<div><p>Hello,</p>
<p>In Microsoft Visual Studio, "cl" is the compiler.</p>
<pre>
<code>C:\Program Files (x86)\Microsoft Visual Studio\2017\Community>cl /?
Microsoft (R) C/C++ Optimizing Compiler Version 19.10.25027 for x64
. . .
etc
. . .
/favor:<blend|AMD64|INTEL64|ATOM> select processor to optimize for, one of:</code>
</pre>
<p>However, in appveyor, "cl" is mapped to the windows batch "call" command.<br>
I tried to find where "cl" is. The answer is nowhere.<br>
But in appveyor it exists as <code>some sort of alias</code>.</p>
<p>See here "cl" in Appveyor:<br>
<a href="https://ci.appveyor.com/project/AndreMikulec/appveyortest2/builds/38566488">https://ci.appveyor.com/project/AndreMikulec/appveyortest2/builds/3...</a></p>
<pre>
<code>cl /?
Calls one batch program from another.
CALL [drive:][path]filename [batch-parameters]</code>
</pre>
<p>I tried to find the path (line 66 of the same output)<br>
However, cl, is not in the path anywhere . . .<br>
<a href="https://ci.appveyor.com/project/AndreMikulec/appveyortest2/builds/38566488#L66">https://ci.appveyor.com/project/AndreMikulec/appveyortest2/builds/3...</a><br></p>
<pre>
<code>which cl
which: no cl in (/c/Program Files/Docker/Docker/Resources/bin:/c/Program Files (x86)/Microsoft SDKs/Azure/CLI2/wbin:/c/Perl/site/bin:/c/Perl/bin:/c/Windows/system32:/c/Windows:/c/Windows/System32/Wbem:/c/Windows/System32/WindowsPowerShell/v1.0:/c/Program Files/7-Zip:/c/Tools/GitVersion:/c/Tools/NuGet:/c/Program Files/Microsoft/Web Platform Installer:/c/Tools/PsTools:/c/Program Files/Git LFS:/c/Program Files/Mercurial:/c/Program Files (x86)/Subversion/bin:/c/Tools/WebDriver:/c/Tools/Coverity/bin:/c/Tools/MSpec:/c/Tools/NUnit/bin:/c/Tools/NUnit3:/c/Tools/xUnit:/c/Program Files/nodejs:/c/Program Files (x86)/iojs:/c/Program Files/iojs:/c/Program Files/Microsoft SQL Server/120/Tools/Binn:/c/Program Files/Microsoft SQL Server/Client SDK/ODBC/110/Tools/Binn:/c/Program Files (x86)/Microsoft SQL Server/120/Tools/Binn:/c/Program Files/Microsoft SQL Server/120/DTS/Binn:/c/Program Files (x86)/Microsoft SQL Server/120/Tools/Binn/ManagementStudio:/c/Program Files (x86)/Microsoft SQL Server/120/DTS/Binn:/c/Program Files (x86)/Microsoft SQL Server/130/Tools/Binn:/c/Program Files/Microsoft SQL Server/130/Tools/Binn:/c/Program Files (x86)/Microsoft SQL Server/130/DTS/Binn:/c/Program Files/Microsoft SQL Server/130/DTS/Binn:/c/Program Files/Microsoft SQL Server/Client SDK/ODBC/130/Tools/Binn:/c/Ruby193/bin:/c/go/bin:/c/Program Files/Java/jdk1.8.0/bin:/c/Program Files (x86)/Apache/Maven/bin:/c/Python27:/c/Python27/Scripts:/c/Program Files (x86)/CMake/bin:/c/Tools/curl/bin:/c/Program Files/Microsoft DNX/Dnvm:/c/Program Files (x86)/Microsoft Visual Studio/2017/Community/MSBuild/15.0/Bin:/c/Program Files (x86)/Microsoft Visual Studio/2017/Community/Common7/IDE/Extensions/Microsoft/SQLDB/DAC/130:/c/Program Files/dotnet:/c/Tools/vcpkg:/c/Program Files (x86)/dotnet:/c/Program Files (x86)/Microsoft SQL Server/140/Tools/Binn:/c/Program Files/Microsoft SQL Server/140/Tools/Binn:/c/Program Files/Microsoft SQL Server/140/DTS/Binn:/c/Program Files (x86)/Microsoft Visual Studio/2017/Community/Common7/IDE/Extensions/TestPlatform:/c/Program Files (x86)/Microsoft SQL Server/110/DTS/Binn:/c/Program Files (x86)/Microsoft SQL Server/140/DTS/Binn:/c/Program Files/erl9.2/bin:/c/Program Files (x86)/NSIS:/c/Tools/Octopus:/c/Program Files/Microsoft Service Fabric/bin/Fabric/Fabric.Code:/c/Program Files/Microsoft SDKs/Service Fabric/Tools/ServiceFabricLocalClusterManager:/c/Program Files/Docker/Docker/resources:/c/Program Files/LLVM/bin:/c/Users/appveyor/AppData/Roaming/npm:/c/Program Files (x86)/Windows Kits/10/Windows Performance Toolkit:/c/Program Files/PowerShell/6:/c/Program Files (x86)/nodejs:/cmd:/usr/bin:/c/Program Files/Meson:/c/ProgramData/chocolatey/bin:/c/Program Files/Amazon/AWSCLI:/c/Program Files (x86)/Yarn/bin:/c/Users/appveyor/AppData/Local/Microsoft/WindowsApps:/c/Users/appveyor/.dotnet/tools:/c/Users/appveyor/AppData/Roaming/npm:/c/Users/appveyor/AppData/Local/Yarn/bin:/c/Program Files/AppVeyor/BuildAgent)</code>
</pre>
<p>Here is my appeyor.yml (comments have been removed).<br>
<a href="https://github.com/AndreMikulec/appveyortest2/blob/b5bca5089eed96b9992cae21ac639296eeb9c9d6/appveyor.yml">https://github.com/AndreMikulec/appveyortest2/blob/b5bca5089eed96b9...</a><br></p>
<pre>
<code>image: Visual Studio 2015<br><br>
<br>environment:
matrix:
- PlatformToolset: v141
configuration: Release
platform: x64
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017</code>
</pre>
install:
<p>build_script:<br>
- cl /? - which cl</p>
<pre>
<code>
I am trying to remove call-cl or put the compiler-cl in front of call-cl, so that when
I execute "cl /?" it shows me the Microsoft compiler help, compiler-cl (like it should).<br><br>
<br>This important because, I am trying to build a 32bit PostgreSQL extension, (yes, still 32bit),
and PostgreSQL, exclusively, only uses "cl /?" to determine the platform x64 or x86(Win32).<br><br>
<br>Here is the exact code that does the determination.<br><br>
<br>https://github.com/postgres/postgres/blob/REL_13_0/src/tools/msvc/Solution.pm#L68</code>
</pre>
($output =~ /^\/favor:<.+AMD64/m) ? 'x64' : 'Win32';
<pre>
<code>This outputs to the running log, this line exactly<br><br>
<br>https://github.com/postgres/postgres/blob/REL_13_0/src/tools/msvc/Solution.pm#L74</code>
</pre>
print "Detected hardware platform: $self->{platform}\n";
<pre>
<code>
I thought that perl may be the problem. So I used a better perl.
So I tested
1.</code>
</pre>
<p>C:\Program Files (x86)\Microsoft Visual Studio\2017\Community>C:\APPLICATIONS\strawberry-perl-5.32.1.1-64bit-portable\perl\bin\perl -e "my $output = <code>cl /help 2>&1</code>; $val = ($output =~ /^\/favor:<.+AMD64/m) ? 'x64' : 'Win32'; print $val;"<br>
x64<br>
C:\Program Files (x86)\Microsoft Visual Studio\2017\Community><br></p>
<pre>
<code>
2.</code>
</pre>
C:\Program Files (x86)\Microsoft Visual Studio\2017\Community>C:\APPLICATIONS\strawberry-perl-5.32.1.1-32bit-portable\perl\bin\perl -e "my $output = <code>cl /help 2>&1</code>; $val = ($output =~ /^\/favor:<.+AMD64/m) ? 'x64' : 'Win32'; print $val;"<br>
Win32<br>
<pre>
<code>
So, I ran and looked for ""Detected hardware platform: Win32" in the output. (see below: I did not find: Win32)<br><br>
<br>https://github.com/AndreMikulec/plr/blob/34ae62b8c361a28318630ac660ff886cb3312f6d/appveyor.yml</code>
</pre>
image: Visual Studio 2015
<ul>
<li>pg: REL_13_0 # tag - static commit PlatformToolset: v141 configuration: Release platform: x86 APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017 rversion: 4.0.3 # githubcache: true</li>
</ul>
<p>install:<br>
- if %PLATFORM%==x64 (set BIT=64) else set BIT=32 - set betterperlurl=<a href="https://strawberryperl.com/download/5.32.1.1/strawberry-perl-5.32.1.1-%BIT%bit-portable.zip">https://strawberryperl.com/download/5.32.1.1/strawberry-perl-5.32.1...</a> - set betterperl=strawberry%BIT% - if not exist %betterperl%.zip curl -o %betterperl%.zip %betterperlurl% - 7z x %betterperl%.zip -oc:\%betterperl% - set Path=c:\%betterperl%\perl\bin;%Path% - which perl - set Path=%Path%;c:\%betterperl%\c\bin</p>
<pre>
<code>
It ran my perl.<br><br>
<br>https://ci.appveyor.com/project/AndreMikulec/plr/builds/38566914?fullLog=true#L53
https://ci.appveyor.com/project/AndreMikulec/plr/builds/38566914?fullLog=true#L54</code>
</pre>
which perl<br>
/c/strawberry32/perl/bin/perl
<pre>
<code>
However, the output still shows up as "Detected hardware platform: x64".
That was the wrong answer.<br><br>
<br>https://ci.appveyor.com/project/AndreMikulec/plr/builds/38566914?fullLog=true#L2501</code>
</pre>
Detected hardware platform: x64<br>
<pre>
<code>
I need "Detected hardware platform: Win32".<br><br>
<br>When I try to call cl directly I still get call-cl.<br><br>
<br>https://ci.appveyor.com/project/AndreMikulec/appveyortest2/builds/38568282#L484</code>
</pre>
"C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin\cl" /? Calls one batch program from another.<br>
CALL [drive:][path]filename [batch-parameters]
<p>``</p>
<p>Following<br>
VsDevCmd.bat is new with Visual Studio 2017<br>
and replaces vsvars32.bat that came with Visual Studio 2015 and earlier<br>
<a href="https://renenyffenegger.ch/notes/Windows/dirs/Program-Files-x86/Microsoft-Visual-Studio/version/edition/Common7/Tools/VsDevCmd_bat">https://renenyffenegger.ch/notes/Windows/dirs/Program-Files-x86/Mic...</a></p>
<p>After setting the environment, I still am getting call-cl instead of compile-cl.</p>
<p><a href="https://ci.appveyor.com/project/AndreMikulec/appveyortest2/builds/38569248#L833">https://ci.appveyor.com/project/AndreMikulec/appveyortest2/builds/3...</a><br>
<a href="https://ci.appveyor.com/project/AndreMikulec/appveyortest2/builds/38569248#L834">https://ci.appveyor.com/project/AndreMikulec/appveyortest2/builds/3...</a><br></p>
<pre>
<code>"C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\Tools\VsDevCmd.bat" -arch=x86
cl /?
Calls one batch program from another.
CALL [drive:][path]filename [batch-parameters</code>
</pre>
<p>Any ideas?</p>
<p>Please help. Is there a command somewhere,<br>
that I can use to turn call-cl off?</p>
<p>Thanks.</p>
<p>Andre</p></div>andre_mikulectag:help.appveyor.com,2012-11-13:Comment/491266412021-04-06T17:52:57Z2021-04-06T17:52:57ZTrying to override the phantom alias executable "cl" - Microsoft "call"<div><p>What I am saying is that cl seems to be always aliased to</p>
<p>cl /?<br></p>
<pre>
<code>Calls one batch program from another.
CALL [drive:][path]filename [batch-parameters</code>
</pre>
Maybe cl is something like a Powershell alias. Or something else?</div>andre_mikulec