build.cmd error dotnet-install: There is not enough disk space on drive C
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
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?
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:\
What output do you get from the code I pasted above? From the other write-host line.
There is not enough disk space on drive c:
Yes, it seems like powershell isn't working. What does get-psdrive -psprovider filesystem give you?
Name Used (GB) Free (GB) Provider Root CurrentLocation
C FileSystem C:
D FileSystem D:
E FileSystem E:
F FileSystem F:
G FileSystem G:\
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:
PS C:> fsutil fsinfo drives
Drives: C:\ D:\ E:\ F:\ G:\
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
cmd /c "dir c:\ " | findstr "bytes" 1 File(s) 153 bytes 15 Dir(s) 336,224,133,120 bytes free
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?
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
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.
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
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.
I had PowerShell 5 , then installed PowerShell 7 everything is building nicely. Thanks
https://github.com/PowerShell/PowerShell/issues/12442
Had this issue just now. Manually deleting .dotnet and artifacts dirs and running build.cmd solved the problem.