From d115cb194401e56c1078613bcd11b4ccdab3a185 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BC=A0=E5=B0=8F=E7=99=BD?= <364772080@qq.com> Date: Sat, 1 Mar 2025 22:43:10 +0800 Subject: [PATCH] windows: Use dev drive instead of `ReFS` (#25858) Closes #ISSUE Release Notes: - N/A *or* Added/Fixed/Improved ... --- script/setup-dev-driver.ps1 | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/script/setup-dev-driver.ps1 b/script/setup-dev-driver.ps1 index 2302ecfbfe..c5d39c5929 100644 --- a/script/setup-dev-driver.ps1 +++ b/script/setup-dev-driver.ps1 @@ -1,17 +1,27 @@ # Configures a drive for testing in CI. -# todo(windows) -# The current version of the Windows runner is 10.0.20348 which does not support DevDrive option. -# Ref: https://learn.microsoft.com/en-us/windows/dev-drive/ # Currently, total CI requires almost 45GB of space, here we are creating a 100GB drive. $Volume = New-VHD -Path C:/zed_dev_drive.vhdx -SizeBytes 100GB | Mount-VHD -Passthru | Initialize-Disk -Passthru | New-Partition -AssignDriveLetter -UseMaximumSize | - Format-Volume -FileSystem ReFS -Confirm:$false -Force + Format-Volume -DevDrive -Confirm:$false -Force $Drive = "$($Volume.DriveLetter):" +# Designate the Dev Drive as trusted +# See https://learn.microsoft.com/en-us/windows/dev-drive/#how-do-i-designate-a-dev-drive-as-trusted +fsutil devdrv trust $Drive + +# There is no virus on the Dev Drive! +# Windows Defender is the wolf in antivirus wool, slowing your PC like a digital fool! +# See https://learn.microsoft.com/en-us/windows/dev-drive/#how-do-i-configure-additional-filters-on-dev-drive +fsutil devdrv enable /disallowAv + +# Remount so the changes take effect +Dismount-VHD -Path C:/zed_dev_drive.vhdx +Mount-VHD -Path C:/zed_dev_drive.vhdx + # Show some debug information Write-Output $Volume Write-Output "Using Dev Drive at $Drive"