runtime icon indicating copy to clipboard operation
runtime copied to clipboard

Build fails on Windows 7 Professional x64

Open masonwheeler opened this issue 10 years ago • 13 comments

After updating to the latest head of the repo, installing dependencies, and running build clean, the build fails, looking for CoreRun.exe in the wrong place:

'"D:\DEVELOPMENTDIR\coreclr\Tools/CoreRun.exe"' is not recognized as an internal or external command, operable program or batch file.

Full output from the build process can be found here, to avoid spamming up this issue report with >100 KB of stuff that may or may not be relevant. As you can see, CoreRun.exe is getting generated, just not in the directory it's looking for it in at the point of failure.

masonwheeler avatar Mar 04 '16 16:03 masonwheeler

After discussing this with @AndyAyersMS and @RichiCoder1, it appears that the problem is that the build script uses classes/assemblies that are not supported in PowerShell 2.0, the version installed by default in Windows 7, and the readme for building CoreCLR on Windows only says that PowerShell is needed, without specifying a minimum supported version.

It needs to be updated with a version requirement that will support System.IO.Compression.FileSystem (and anything else needed by the build process).

masonwheeler avatar Mar 08 '16 01:03 masonwheeler

The same problem with CoreRun.exe on recent master (0166b60325807abea17f3dd36ec729216ec7da81)

C:\git\coreclr\src\mscorlib\Tools\BclRewriter\BclRewriter.targets(27,5): error MSB3073: The command ""C:\git\coreclr\Tools/CoreRun.exe" "C:\git\coreclr\Tools/BclRewriter.exe" -in:"C:\git\coreclr\bin\obj\Windows_NT.x64.Debug\mscorlib.dll" -out:"C:\git\coreclr\bin\obj\Windows_NT.x64.Debug\BclRewriter\mscorlib.dll" -include:"C:\git\coreclr\src\mscorlib\model.xml" -platform:win -architecture:amd64 -flavor:chk ... -keepTempFiles+" exited with code 9009. [C:\git\coreclr\src\mscorlib\mscorlib.csproj]

but with powershell v.4.0:

C:\git\coreclr>powershell get-host Name : ConsoleHost Version : 4.0 InstanceId : 76109ca6-3aa2-4cf6-8480-0cd1ce1d78f5 UI : System.Management.Automation.Internal.Host.InternalHostUserInterface CurrentCulture : ru-RU CurrentUICulture : en-US PrivateData : Microsoft.PowerShell.ConsoleHost+ConsoleColorProxy IsRunspacePushed : False Runspace : System.Management.Automation.Runspaces.LocalRunspace

Probably build scripts look for CoreRun.exe in wrong place:

$ find . -iname corerun.exe ./coreclr/bin/obj/Windows_NT.x64.Debug/src/coreclr/hosts/corerun/Debug/CoreRun.exe ./coreclr/bin/Product/Windows_NT.x64.Debug/CoreRun.exe

mkborg avatar Apr 05 '16 13:04 mkborg

I have compared 'release/1.0.0-rc2' and 'master' build trees and found the difference:

$ find . -iname corerun.exe ./coreclr/bin/obj/Windows_NT.x64.Debug/src/coreclr/hosts/corerun/Debug/CoreRun.exe ./coreclr/bin/Product/Windows_NT.x64.Debug/CoreRun.exe ./coreclr/Tools/CoreRun.exe ./coreclr/Tools/dotnetcli/bin/CoreRun.exe

Looks like in case of 'master' build scripts do not install 'CoreRun.exe' into 'Tools' subdirectory.

mkborg avatar Apr 05 '16 15:04 mkborg

According to time-stamp 'CoreRun.exe' in 'Tools' subdirectory is not built but installed from external source:

$ ls -l find . -iname corerun.exe -rwxrwx---+ 1 john None 1096704 Apr 5 14:50 ./coreclr/bin/obj/Windows_NT.x64.Debug/src/coreclr/hosts/corerun/Debug/CoreRun.exe -rwxrwx---+ 1 john None 1096704 Apr 5 14:50 ./coreclr/bin/Product/Windows_NT.x64.Debug/CoreRun.exe -rwxrwx---+ 1 john None 108456 Mar 6 20:45 ./coreclr/Tools/CoreRun.exe -rwxrwx---+ 1 john None 37800 Feb 29 21:06 ./coreclr/Tools/dotnetcli/bin/CoreRun.exe

mkborg avatar Apr 05 '16 15:04 mkborg

With older powershells, the build tool restore step fails quietly, and the build then fails in a fairly obscure fashion.

The restore failure should really be more prominent.

It is extra confusing because the build tool restore downloads a prebuilt CoreCLR, so as you note there is more than one CoreCLR.exe around....

You can download more recent powershell for Win7 SP1.

AndyAyersMS avatar Apr 15 '16 18:04 AndyAyersMS

That 'hidden' download is very annoying. If it fails for any reason then the only solution is to restart build and watch how it redownloads almost everything again and again. In my case time spent for dowload several times exceeds time spent for actual build. I would prefer to explicitly download all dependencies only once and reuse them on each rebuild.

mkborg avatar Apr 15 '16 19:04 mkborg

@AndyAyersMS Having the download link there is useful. Having it in the official build process documentation would be much more useful. Right now, anyone who doesn't know to look at this specific issue has no way of knowing that the build process requires a certain minimum version of PowerShell.

masonwheeler avatar Apr 15 '16 20:04 masonwheeler

Agreed. I've started working on a patch to detect this and other issues in tools restore. Not sure I have the ability to properly test it, though.

AndyAyersMS avatar Apr 15 '16 20:04 AndyAyersMS

@mkborg can you test out this potential patch? If It works I'll update the docs too.

I'll see if I can find a Win7 box to try it on... maybe I have one lying around here somewhere.

AndyAyersMS avatar Apr 15 '16 21:04 AndyAyersMS

This is mainly to detect and flag errors, so it may not keep you from needing to repeatedly try downloads if there are network issues. But once one download succeeds it should be good for a while, until you sync a change where someone's updated the buildtools....

AndyAyersMS avatar Apr 15 '16 21:04 AndyAyersMS

Unfortunately right now I am far away from my Windows box. I will be able to test the patch only on Monday when I return back.

mkborg avatar Apr 15 '16 21:04 mkborg

I found win7 box, and verified that the powershell version check fires. Will send this out for PR.

AndyAyersMS avatar Apr 15 '16 22:04 AndyAyersMS

Addressed by https://github.com/dotnet/coreclr/pull/4374. Thank you!

sergiy-k avatar May 04 '16 20:05 sergiy-k