Skip to content

Commit 45f1f48

Browse files
committed
Updated install.ps1 and installer.ps1
1 parent be575b7 commit 45f1f48

2 files changed

Lines changed: 3 additions & 47 deletions

File tree

install.ps1

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -90,14 +90,7 @@ function Fix-CargoIssues {
9090
Remove-Item $registryPath -Recurse -Force -ErrorAction SilentlyContinue
9191
}
9292

93-
# 2. Clear git database cache
94-
$gitPath = "$cargoHome\git"
95-
if (Test-Path $gitPath) {
96-
Write-Host " Clearing Cargo git cache..." -ForegroundColor Gray
97-
Remove-Item $gitPath -Recurse -Force -ErrorAction SilentlyContinue
98-
}
99-
100-
# 3. Create or update Cargo config with better network settings
93+
# 2. Create or update Cargo config with better network settings
10194
if (-not (Test-Path $cargoHome)) {
10295
New-Item -ItemType Directory -Path $cargoHome -Force | Out-Null
10396
}

installer.ps1

Lines changed: 2 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -80,14 +80,7 @@ function Fix-CargoIssues {
8080
Remove-Item $registryPath -Recurse -Force -ErrorAction SilentlyContinue
8181
}
8282

83-
# 2. Clear git database cache
84-
$gitPath = "$cargoHome\git"
85-
if (Test-Path $gitPath) {
86-
Write-Host " Clearing Cargo git cache..." -ForegroundColor Gray
87-
Remove-Item $gitPath -Recurse -Force -ErrorAction SilentlyContinue
88-
}
89-
90-
# 3. Create or update Cargo config with better network settings
83+
# 2. Create or update Cargo config with better network settings
9184
if (-not (Test-Path $cargoHome)) {
9285
New-Item -ItemType Directory -Path $cargoHome -Force | Out-Null
9386
}
@@ -96,7 +89,6 @@ function Fix-CargoIssues {
9689
$configContent = @"
9790
[net]
9891
retry = 3
99-
git-fetch-with-cli = true
10092
offline = false
10193
10294
[http]
@@ -111,12 +103,6 @@ jobs = 1 # Reduce parallel jobs to avoid overwhelming slow connections
111103
Write-Host " Creating optimized Cargo configuration..." -ForegroundColor Gray
112104
Set-Content -Path $configFile -Value $configContent -Force
113105

114-
# 4. Update Git configuration for Cargo
115-
Write-Host " Configuring Git for Cargo..." -ForegroundColor Gray
116-
& git config --global http.postBuffer 524288000 # 500MB buffer
117-
& git config --global http.lowSpeedLimit 0
118-
& git config --global http.lowSpeedTime 999999
119-
120106
Write-Host "SUCCESS: Cargo configuration reset complete!" -ForegroundColor Green
121107
Write-Host " Try running the installer again without -FixCargo" -ForegroundColor Gray
122108

@@ -144,16 +130,13 @@ function Configure-RustEnvironment {
144130
# Optimized Cargo configuration for Windows builds
145131
[net]
146132
retry = 5 # Retry failed network operations up to 5 times
147-
git-fetch-with-cli = true # Use system Git instead of libgit2 (more reliable on Windows)
148133
offline = false # Allow network access
149-
check-revoke = false # Skip certificate revocation checks (faster, corporate networks)
150134
151135
[http]
152136
timeout = 600 # 10 minute timeout for large downloads
153137
low-speed-limit = 1024 # Minimum 1KB/s (fail if slower)
154138
low-speed-time = 30 # Allow slow speeds for up to 30 seconds
155139
multiplexing = false # Disable HTTP/2 multiplexing (avoids some Windows issues)
156-
ssl-version = "tlsv1.2" # Force TLS 1.2 for compatibility
157140
158141
[build]
159142
jobs = 2 # Limit parallel compilation jobs (reduces memory usage)
@@ -174,9 +157,6 @@ split-debuginfo = "packed" # Keep debug info in single file on Windows
174157
[registries.crates-io]
175158
protocol = "sparse" # Use sparse registry protocol (faster, less bandwidth)
176159
177-
[cargo-new]
178-
vcs = "none" # Don't initialize git by default in new projects
179-
180160
[term]
181161
verbose = false # Reduce noise in output
182162
color = "auto" # Auto-detect color support
@@ -185,26 +165,10 @@ color = "auto" # Auto-detect color support
185165
Write-Host " Creating optimized Cargo configuration..." -ForegroundColor Gray
186166
Set-Content -Path $configFile -Value $configContent -Force
187167

188-
# 3. Configure Git for optimal Cargo usage
189-
Write-Host " Configuring Git for Cargo compatibility..." -ForegroundColor Gray
190-
191-
# Git network settings
192-
& git config --global http.postBuffer 1048576000 # 1GB buffer for large repos
193-
& git config --global http.lowSpeedLimit 1024 # 1KB/s minimum
194-
& git config --global http.lowSpeedTime 30 # 30 second timeout
195-
& git config --global http.sslVerify true # Verify SSL certificates
196-
& git config --global http.version HTTP/1.1 # Use HTTP/1.1 (more compatible)
197-
198-
# Git performance settings
199-
& git config --global core.preloadindex true # Preload index for performance
200-
& git config --global core.fscache true # Enable filesystem cache on Windows
201-
& git config --global gc.auto 256 # Auto garbage collect less frequently
202-
203-
# 4. Set up environment variables for this session
168+
# 3. Set up environment variables for this session
204169
Write-Host " Configuring environment variables..." -ForegroundColor Gray
205170

206171
# Cargo environment variables
207-
$env:CARGO_NET_GIT_FETCH_WITH_CLI = "true"
208172
$env:CARGO_NET_RETRY = "5"
209173
$env:CARGO_HTTP_TIMEOUT = "600"
210174
$env:CARGO_HTTP_LOW_SPEED_LIMIT = "1024"
@@ -296,7 +260,6 @@ clap = { version = "4.0", features = ["derive"] }
296260
Write-Host " - Network retry and timeout settings" -ForegroundColor Gray
297261
Write-Host " - Optimized compilation profiles" -ForegroundColor Gray
298262
Write-Host " - Windows Defender exclusions (if admin)" -ForegroundColor Gray
299-
Write-Host " - Git compatibility settings" -ForegroundColor Gray
300263
Write-Host " - Memory and CPU optimization" -ForegroundColor Gray
301264

302265
} catch {

0 commit comments

Comments
 (0)