@@ -23,15 +23,18 @@ param(
23
23
[switch ]$Verbose
24
24
)
25
25
26
- $env: RUSTC_LOG = $null
27
- $env: RUSTFLAGS = ' -Dwarnings'
28
- $usingADO = ($null -ne $env: TF_BUILD )
29
-
30
26
trap {
31
27
Write-Error " An error occurred: $ ( $_ | Out-String ) "
32
28
exit 1
33
29
}
34
30
31
+ $env: RUSTC_LOG = $null
32
+ $env: RUSTFLAGS = ' -Dwarnings'
33
+ $usingADO = ($null -ne $env: TF_BUILD )
34
+ if ($usingADO -or $UseCFSAuth ) {
35
+ $UseCFS = $true
36
+ }
37
+
35
38
if ($Verbose ) {
36
39
$env: RUSTC_LOG = ' rustc_codegen_ssa::back::link=info'
37
40
}
@@ -171,7 +174,7 @@ if ($null -ne (Get-Command msrustup -CommandType Application -ErrorAction Ignore
171
174
if ($null -ne $packageType ) {
172
175
$SkipBuild = $true
173
176
} else {
174
- if ($UseCFS -or $UseCFSAuth -or $usingADO ) {
177
+ if ($UseCFS ) {
175
178
Write-Host " Using CFS for cargo source replacement"
176
179
${env: CARGO_SOURCE_crates-io_REPLACE_WITH} = $null
177
180
$env: CARGO_REGISTRIES_CRATESIO_INDEX = $null
@@ -262,7 +265,11 @@ if ($null -ne $packageType) {
262
265
# # Test if tree-sitter is installed
263
266
if ($null -eq (Get-Command tree- sitter - ErrorAction Ignore)) {
264
267
Write-Verbose - Verbose " tree-sitter not found, installing..."
265
- cargo install tree- sitter- cli -- config .cargo/ config.toml
268
+ if ($UseCFS ) {
269
+ cargo install tree- sitter- cli -- config .cargo/ config.toml
270
+ } else {
271
+ cargo install tree- sitter- cli
272
+ }
266
273
if ($LASTEXITCODE -ne 0 ) {
267
274
throw " Failed to install tree-sitter-cli"
268
275
}
@@ -380,7 +387,11 @@ if (!$SkipBuild) {
380
387
else {
381
388
if ($Audit ) {
382
389
if ($null -eq (Get-Command cargo- audit - ErrorAction Ignore)) {
383
- cargo install cargo- audit -- features= fix -- config .cargo/ config.toml
390
+ if ($UseCFS ) {
391
+ cargo install cargo- audit -- features= fix -- config .cargo/ config.toml
392
+ } else {
393
+ cargo install cargo- audit -- features= fix
394
+ }
384
395
}
385
396
386
397
cargo audit fix
@@ -413,7 +424,11 @@ if (!$SkipBuild) {
413
424
else {
414
425
if ($Audit ) {
415
426
if ($null -eq (Get-Command cargo- audit - ErrorAction Ignore)) {
416
- cargo install cargo- audit -- features= fix -- config .cargo/ config.toml
427
+ if ($UseCFS ) {
428
+ cargo install cargo- audit -- features= fix -- config .cargo/ config.toml
429
+ } else {
430
+ cargo install cargo- audit -- features= fix
431
+ }
417
432
}
418
433
419
434
cargo audit fix
0 commit comments