Skip to content

Commit b39649b

Browse files
authored
Always set RUSTFLAGS=-Dwarnings (#2260)
* Always set RUSTFLAGS=-Dwarnings Also removes some old scripts that no longer apply (for old legacy directory structure). * Use correct Azure Pipelines syntax I was thinking of GitHub Actions. Also adds dummy file like in #2253. * Refactor into top-level pipeline All CI and PR pipelines extend from this, so this should work as global variables. Also emits some info in relevant scripts. * Remove -Dwarnings test Also moves `azure_data_cosmos`'s `default` feature last given what @hallipr found with Tomlyn, which PSToml uses, which we use for publishing scripts currently.
1 parent f736f5d commit b39649b

File tree

13 files changed

+27
-106
lines changed

13 files changed

+27
-106
lines changed

eng/pipelines/templates/stages/archetype-rust-release.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ stages:
2929
variables:
3030
- template: /eng/pipelines/templates/variables/globals.yml
3131
- template: /eng/pipelines/templates/variables/image.yml
32+
- template: /eng/pipelines/templates/variables/rust.yml
3233

3334
pool:
3435
name: $(LINUXPOOL)

eng/pipelines/templates/stages/archetype-sdk-client.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ extends:
1919
- stage: Build
2020
variables:
2121
- template: /eng/pipelines/templates/variables/image.yml
22+
- template: /eng/pipelines/templates/variables/rust.yml
2223
jobs:
2324
- template: /eng/pipelines/templates/jobs/ci.yml
2425
parameters:
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
variables:
2+
RUSTFLAGS: "-Dwarnings"
3+
RUSTDOCFLAGS: "-Dwarnings"

eng/scripts/Analyze-Code.ps1

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,12 @@ Set-StrictMode -Version 2.0
1313

1414
. (Join-Path $PSScriptRoot '..' 'common' 'scripts' 'common.ps1')
1515

16-
Write-Host "Analyzing code with
17-
Toolchain: '$Toolchain'`n"
18-
19-
$env:RUSTDOCFLAGS = "-D warnings"
20-
$env:RUSTFLAGS = "-Dwarnings"
16+
Write-Host @"
17+
Analyzing code with
18+
Toolchain: '$Toolchain'
19+
RUSTFLAGS: '${env:RUSTFLAGS}'
20+
RUSTDOCFLAGS: '${env:RUSTDOCFLAGS}'
21+
"@
2122

2223
if ($CheckWasm) {
2324
Invoke-LoggedCommand "rustup target add --toolchain $Toolchain wasm32-unknown-unknown"

eng/scripts/Pack-Crates.ps1

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,11 @@ $ErrorActionPreference = 'Stop'
1313

1414
. (Join-Path $PSScriptRoot '..' 'common' 'scripts' 'common.ps1')
1515

16+
Write-Host @"
17+
Packing crates with
18+
RUSTFLAGS: '${env:RUSTFLAGS}'
19+
"@
20+
1621
if ($OutputPath) {
1722
$OutputPath = New-Item -ItemType Directory -Path $OutputPath -Force | Select-Object -ExpandProperty FullName
1823
}
@@ -76,7 +81,7 @@ function Get-PackagesToBuild() {
7681

7782
# We start with output packages, then recursively add unreleased dependencies to the list of packages that need to be built
7883
[array]$packagesToBuild = $packages | Where-Object { $outputPackageNames.Contains($_.name) }
79-
84+
8085
$toProcess = $packagesToBuild
8186
while ($toProcess.Length -gt 0) {
8287
$package = $toProcess[0]
@@ -89,14 +94,14 @@ function Get-PackagesToBuild() {
8994
}
9095
}
9196
}
92-
97+
9398
$buildOrder = @()
9499

95100
# Then we order the packages to that dependencies are built first
96101
while ($packagesToBuild.Count -gt 0) {
97102
# Pick any package with no unreleased dependencies, add it to the build order and remove it from the list of other packages' unreleased dependencies
98103
$package = $packagesToBuild | Where-Object { $_.UnreleasedDependencies.Count -eq 0 } | Select-Object -First 1
99-
104+
100105
if (-not $package) {
101106
Write-Error "These packages cannot be built because they depend on unreleased dependencies that aren't being built." -ErrorAction Continue
102107
foreach ($package in $packagesToBuild) {
@@ -150,7 +155,7 @@ function Add-PathVersions($packages) {
150155

151156
foreach ($name in $toml.dependencies.Keys) {
152157
# we want to look at the dependency as it was resolved by `cargo metadata`
153-
# this will resolve workspace depdencies, but retain their path/no-version state
158+
# this will resolve workspace depdencies, but retain their path/no-version state
154159
$dependency = $package.dependencies | Where-Object -Property name -EQ -Value $name | Select-Object -First 1
155160
# If the dependency is a path dependency, set the version to the version of the package in the workspace
156161
if ($dependency.path -and !$dependency.version) {

eng/scripts/Test-Packages.ps1

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,13 @@ Set-StrictMode -Version 2.0
1111

1212
. "$PSScriptRoot\..\common\scripts\common.ps1"
1313

14-
Write-Host "Testing packages with
14+
Write-Host @"
15+
Testing packages with
1516
Toolchain: '$Toolchain'
16-
PackageInfoDirectory: '$PackageInfoDirectory'"
17+
PackageInfoDirectory: '$PackageInfoDirectory'
18+
RUSTFLAGS: '${env:RUSTFLAGS}'
19+
RUSTDOCFLAGS: '${env:RUSTDOCFLAGS}'
20+
"@
1721

1822
if ($PackageInfoDirectory) {
1923
if (!(Test-Path $PackageInfoDirectory)) {
@@ -34,9 +38,6 @@ foreach ($package in $packagesToTest) {
3438
Write-Host " '$($package.Name)' in '$($package.DirectoryPath)'"
3539
}
3640

37-
Write-Host "Setting RUSTFLAGS to '-Dwarnings'"
38-
$env:RUSTFLAGS = "-Dwarnings"
39-
4041
foreach ($package in $packagesToTest) {
4142
Push-Location ([System.IO.Path]::Combine($RepoRoot, $package.DirectoryPath))
4243
try {

eng/scripts/clippy_all.sh

Lines changed: 0 additions & 5 deletions
This file was deleted.

eng/scripts/code_style.sh

Lines changed: 0 additions & 15 deletions
This file was deleted.

eng/scripts/github-disk-cleanup.sh

Lines changed: 0 additions & 15 deletions
This file was deleted.

eng/scripts/publish_all.sh

Lines changed: 0 additions & 10 deletions
This file was deleted.

0 commit comments

Comments
 (0)