@@ -20,44 +20,99 @@ Analyzing code with
20
20
"@
21
21
22
22
if ($CheckWasm ) {
23
- Invoke-LoggedCommand " rustup target add wasm32-unknown-unknown"
23
+ # Temporary fix to exit immediately on failure. LogError should Write-Error
24
+ # instead
25
+ $command = " rustup target add wasm32-unknown-unknown"
26
+ Invoke-LoggedCommand $command
27
+ if ($LastExitCode ) {
28
+ Write-Error " Failed to execute $command "
29
+ }
24
30
}
25
31
26
32
if ($Deny ) {
27
- Invoke-LoggedCommand " cargo install cargo-deny --locked"
33
+ # Temporary fix to exit immediately on failure. LogError should Write-Error
34
+ # instead
35
+ $command = " cargo install cargo-deny --locked"
36
+ Invoke-LoggedCommand $command
37
+ if ($LastExitCode ) {
38
+ Write-Error " Failed to execute $command "
39
+ }
28
40
}
29
41
30
- Invoke-LoggedCommand " cargo check --package azure_core --all-features --all-targets --keep-going"
42
+ # Temporary fix to exit immediately on failure. LogError should Write-Error
43
+ # instead
44
+ $command = " cargo check --package azure_core --all-features --all-targets --keep-going"
45
+ Invoke-LoggedCommand $command
46
+ if ($LastExitCode ) {
47
+ Write-Error " Failed to execute $command "
48
+ }
31
49
32
- Invoke-LoggedCommand " cargo fmt --all -- --check"
50
+ # Temporary fix to exit immediately on failure. LogError should Write-Error
51
+ # instead
52
+ $command = " cargo fmt --all -- --check"
53
+ Invoke-LoggedCommand $command
54
+ if ($LastExitCode ) {
55
+ Write-Error " Failed to execute $command "
56
+ }
33
57
34
- Invoke-LoggedCommand " cargo clippy --workspace --all-features --all-targets --keep-going --no-deps"
58
+ # Temporary fix to exit immediately on failure. LogError should Write-Error
59
+ # instead
60
+ $command = " cargo clippy --workspace --all-features --all-targets --keep-going --no-deps"
61
+ Invoke-LoggedCommand $command
62
+ if ($LastExitCode ) {
63
+ Write-Error " Failed to execute $command "
64
+ }
35
65
36
66
if ($CheckWasm ) {
37
67
# Save the original RUSTFLAGS to restore later
38
68
$OriginalRustFlags = $env: RUSTFLAGS
39
69
# This is needed to ensure that the `getrandom` crate uses the `wasm_js` backend
40
70
$env: RUSTFLAGS = ${env: RUSTFLAGS} + ' --cfg getrandom_backend="wasm_js"'
41
71
42
- Invoke-LoggedCommand " cargo clippy --target=wasm32-unknown-unknown --workspace --keep-going --no-deps"
72
+ # Temporary fix to exit immediately on failure. LogError should Write-Error
73
+ # instead
74
+ $command = " cargo clippy --target=wasm32-unknown-unknown --workspace --keep-going --no-deps"
75
+ Invoke-LoggedCommand $command
76
+ if ($LastExitCode ) {
77
+ Write-Error " Failed to execute $command "
78
+ }
43
79
44
80
# Restore the original RUSTFLAGS, since the getrandom config option can only be set for wasm32-unknown-unknown builds.
45
81
$env: RUSTFLAGS = $OriginalRustFlags
46
82
}
47
83
48
84
if ($Deny ) {
49
- Invoke-LoggedCommand " cargo deny --all-features check"
85
+ # Temporary fix to exit immediately on failure. LogError should Write-Error
86
+ # instead
87
+ $command = " cargo deny --all-features check"
88
+ Invoke-LoggedCommand $command
89
+ if ($LastExitCode ) {
90
+ Write-Error " Failed to execute $command "
91
+ }
50
92
}
51
93
52
- Invoke-LoggedCommand " cargo doc --workspace --no-deps --all-features"
94
+ # Temporary fix to exit immediately on failure. LogError should Write-Error
95
+ # instead
96
+ $command = " cargo doc --workspace --no-deps --all-features"
97
+ Invoke-LoggedCommand $command
98
+ if ($LastExitCode ) {
99
+ Write-Error " Failed to execute $command "
100
+ }
53
101
54
102
# Verify package dependencies
55
103
$verifyDependenciesScript = Join-Path $RepoRoot ' eng' ' scripts' ' verify-dependencies.rs' - Resolve
56
104
57
105
if (! $SkipPackageAnalysis ) {
58
106
if (! (Test-Path $PackageInfoDirectory )) {
59
107
Write-Host " Analyzing workspace`n "
60
- return Invoke-LoggedCommand " &$verifyDependenciesScript $RepoRoot /Cargo.toml"
108
+ # Temporary fix to exit immediately on failure. LogError should Write-Error
109
+ # instead
110
+ $command = " &$verifyDependenciesScript $RepoRoot /Cargo.toml"
111
+ $result = Invoke-LoggedCommand $command
112
+ if ($LastExitCode ) {
113
+ Write-Error " Failed to execute $command "
114
+ }
115
+ return $result
61
116
}
62
117
63
118
$packagesToTest = Get-ChildItem $PackageInfoDirectory - Filter " *.json" - Recurse
@@ -66,6 +121,12 @@ if (!$SkipPackageAnalysis) {
66
121
67
122
foreach ($package in $packagesToTest ) {
68
123
Write-Host " Analyzing package '$ ( $package.Name ) ' in directory '$ ( $package.DirectoryPath ) '`n "
69
- Invoke-LoggedCommand " &$verifyDependenciesScript $ ( $package.DirectoryPath ) /Cargo.toml"
124
+ # Temporary fix to exit immediately on failure. LogError should Write-Error
125
+ # instead
126
+ $command = " &$verifyDependenciesScript $ ( $package.DirectoryPath ) /Cargo.toml"
127
+ Invoke-LoggedCommand $command
128
+ if ($LastExitCode ) {
129
+ Write-Error " Failed to execute $command "
130
+ }
70
131
}
71
132
}
0 commit comments