runtime icon indicating copy to clipboard operation
runtime copied to clipboard

build.cmd error dotnet-install: There is not enough disk space on drive C

Open Kwirirai opened this issue 6 years ago • 17 comments

I am trying to run the build script on Windows 10 as per instruction from https://github.com/dotnet/runtime/blob/master/docs/workflow/README.md and I am getting this error below (I have enough disk space of about 300 Gigs) What is the correct step/command for building, I would like to build as per the docs :"This builds the product (in the default debug configuration), but not the tests." Below is the error I am getting: C:\open_source\dotnet\runtime>build.cmd dotnet-install: There is not enough disk space on drive C: at Exec-Process, C:\open_source\dotnet\runtime\eng\common\tools.ps1: line 81 at MSBuild-Core, C:\open_source\dotnet\runtime\eng\common\tools.ps1: line 635 at InitializeToolset, C:\open_source\dotnet\runtime\eng\common\tools.ps1: line 547 at Build, C:\open_source\dotnet\runtime\eng\common\build.ps1: line 85 at , C:\open_source\dotnet\runtime\eng\common\build.ps1: line 145 at , : line 1 at , C:\open_source\dotnet\runtime\eng\build.ps1: line 147 at , : line 1 Exception calling "Start" with "0" argument(s): "The system cannot find the file specified" Some builds failed: Configuration: Debug, Architecture: x64

Kwirirai avatar Apr 22 '20 18:04 Kwirirai

This is odd, the code is plain: https://github.com/dotnet/sdk/blob/392ad3cc8fe0a79a1bb638ac93bcfdcc7af164ed/scripts/obtain/dotnet-install.ps1#L620

Can you please open a powershell prompt and run this:

$installDrive = "c"
$diskInfo = Get-PSDrive -Name $installDrive
write-host "There is $($diskInfo.Free) space on drive ${installDrive}:"
if ($diskInfo.Free / 1MB -le 100) {
    write-host "There is not enough disk space on drive ${installDrive}:"
}

What output do you get?

danmoseley avatar Apr 23 '20 03:04 danmoseley

There is not enough disk space on drive c:

Running powershell command I get(I think there is something wrong with my powershell setup) : PS C:\scripts> Get-PSDrive C

Name Used (GB) Free (GB) Provider Root CurrentLocation


C FileSystem C:\

Kwirirai avatar Apr 23 '20 03:04 Kwirirai

What output do you get from the code I pasted above? From the other write-host line.

danmoseley avatar Apr 23 '20 03:04 danmoseley

There is not enough disk space on drive c:

Kwirirai avatar Apr 23 '20 03:04 Kwirirai

Yes, it seems like powershell isn't working. What does get-psdrive -psprovider filesystem give you?

danmoseley avatar Apr 23 '20 03:04 danmoseley

Name Used (GB) Free (GB) Provider Root CurrentLocation


C FileSystem C:
D FileSystem D:
E FileSystem E:
F FileSystem F:
G FileSystem G:\

Kwirirai avatar Apr 23 '20 04:04 Kwirirai

I get

PS C:\> get-psdrive -psprovider filesystem

Name           Used (GB)     Free (GB) Provider      Root                                                                                                                        CurrentLocation
----           ---------     --------- --------      ----                                                                                                                        ---------------
C                 200.06         36.50 FileSystem    C:\
D                                      FileSystem    D:\

What about these?

PS C:\> fsutil fsinfo drives

Drives: C:\ D:\
PS C:\> wmic logicaldisk get deviceid "," volumename "," description
Description       DeviceID  VolumeName
Local Fixed Disk  C:        OSDisk
Removable Disk    D:

danmoseley avatar Apr 23 '20 04:04 danmoseley

PS C:> fsutil fsinfo drives

Drives: C:\ D:\ E:\ F:\ G:\

Kwirirai avatar Apr 23 '20 04:04 Kwirirai

What about this (twisted syntax, assuming powershell window)

PS C:\> cmd /c "dir c:\ " | findstr "bytes"
               1 File(s)         77,820 bytes
              41 Dir(s)  39,190,056,960 bytes free

danmoseley avatar Apr 23 '20 04:04 danmoseley

cmd /c "dir c:\ " | findstr "bytes" 1 File(s) 153 bytes 15 Dir(s) 336,224,133,120 bytes free

Kwirirai avatar Apr 23 '20 04:04 Kwirirai

Last one: fsutil fsinfo volumeinfo c: (you have to do this from an admin prompt)

But just to be sure (since I'm not clear from above) what does $(Get-PSDrive -Name 'c').Free give? blank?

danmoseley avatar Apr 23 '20 04:04 danmoseley

PS C:> $(Get-PSDrive -Name 'c')

Name Used (GB) Free (GB) Provider Root CurrentLocation


C FileSystem C:\

Volume Name :

Volume Serial Number : fooo bar Max Component Length : 255 File System Name : NTFS Is ReadWrite Not Thinly-Provisioned Supports Case-sensitive filenames Preserves Case of filenames Supports Unicode in filenames Preserves & Enforces ACL's Supports file-based Compression Supports Disk Quotas Supports Sparse files Supports Reparse Points Returns Handle Close Result Information Supports POSIX-style Unlink and Rename Supports Object Identifiers Supports Encrypted File System Supports Named Streams Supports Transactions Supports Hard Links Supports Extended Attributes Supports Open By FileID Supports USN Journal

Kwirirai avatar Apr 23 '20 04:04 Kwirirai

I actually asked you to run $(Get-PSDrive -Name 'c').Free

Anyway -- I'm pretty confident this is something for powershell to investigate. Please open an issue here https://github.com/PowerShell/PowerShell/issues/new/choose and show them that Get-PSDrive -Name 'c' is producing blank even though the drive exists in the legacy Windows shell.

danmoseley avatar Apr 23 '20 04:04 danmoseley

PS C:> $(Get-PSDrive -Name 'c').Free PS C:>

Thanks for your trouble I do believe it must be my installation or something, will open an issue on powershell

Kwirirai avatar Apr 23 '20 04:04 Kwirirai

Cool - good luck! Link the issue so I can see what happens. When your machine is fixed please come back and try our repo again.

danmoseley avatar Apr 23 '20 04:04 danmoseley

I had PowerShell 5 , then installed PowerShell 7 everything is building nicely. Thanks

https://github.com/PowerShell/PowerShell/issues/12442

Kwirirai avatar Apr 23 '20 16:04 Kwirirai

Had this issue just now. Manually deleting .dotnet and artifacts dirs and running build.cmd solved the problem.

Rattenkrieg avatar Oct 21 '20 11:10 Rattenkrieg