Skip to content

Commit 2670097

Browse files
authored
Fix warning breaking official build, enable warningAsError in all pipelines (#6988)
* Workaround assembly downgrade in SemanticKernel packages * Enable warning as error in pipelines And make source-index step use similar build entrypoint. * Consistently apply warnAsError in BuildAndTest.yml * Keep warnAsError disabled for PR validation This allows folks to get test results without being blocked by warnings. Make sure the job testing for warnings runs on windows to ensure it builds a superset of targets.
1 parent 44f6484 commit 2670097

File tree

5 files changed

+16
-10
lines changed

5 files changed

+16
-10
lines changed

azure-pipelines-public.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -237,10 +237,10 @@ stages:
237237

238238
pool:
239239
name: $(DncEngPublicBuildPool)
240-
demands: ImageOverride -equals build.ubuntu.2004.amd64.open
240+
demands: ImageOverride -equals windows.vs2022preview.amd64.open
241241

242242
variables:
243-
- _buildScript: $(Build.SourcesDirectory)/build.sh --ci
243+
- _buildScript: $(Build.SourcesDirectory)/build.cmd -ci -NativeToolsOnMachine
244244

245245
preSteps:
246246
- checkout: self
@@ -257,4 +257,4 @@ stages:
257257
repoTestResultsPath: $(Build.Arcade.TestResultsPath)
258258
skipTests: true
259259
skipQualityGates: true
260-
isWindows: false
260+
isWindows: true

azure-pipelines-unofficial.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,6 @@ extends:
132132
repoTestResultsPath: $(Build.Arcade.TestResultsPath)
133133
skipQualityGates: ${{ eq(variables['SkipQualityGates'], 'true') }}
134134
isWindows: true
135-
warnAsError: 0
136135

137136
# ----------------------------------------------------------------
138137
# This job build and run tests on Ubuntu
@@ -163,7 +162,6 @@ extends:
163162
repoTestResultsPath: $(Build.Arcade.TestResultsPath)
164163
skipQualityGates: ${{ eq(variables['SkipQualityGates'], 'true') }}
165164
isWindows: false
166-
warnAsError: 0
167165

168166
# ----------------------------------------------------------------
169167
# This stage performs quality gates enforcements

azure-pipelines.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,8 @@ variables:
117117
- ${{ if and(ne(variables['runAsPublic'], 'true'), notin(variables['Build.Reason'], 'PullRequest'), eq(variables['Build.SourceBranch'], 'refs/heads/main')) }}:
118118
- name: enableSourceIndex
119119
value: true
120+
- name: sourceIndexBuildCommand
121+
value: $(Build.SourcesDirectory)/build.cmd -ci -NativeToolsOnMachine
120122
- ${{ else }}:
121123
- name: enableSourceIndex
122124
value: false
@@ -206,7 +208,6 @@ extends:
206208
repoTestResultsPath: $(Build.Arcade.TestResultsPath)
207209
skipQualityGates: ${{ eq(variables['SkipQualityGates'], 'true') }}
208210
isWindows: true
209-
warnAsError: 0
210211

211212
# ----------------------------------------------------------------
212213
# This job build and run tests on Ubuntu
@@ -237,7 +238,6 @@ extends:
237238
repoTestResultsPath: $(Build.Arcade.TestResultsPath)
238239
skipQualityGates: ${{ eq(variables['SkipQualityGates'], 'true') }}
239240
isWindows: false
240-
warnAsError: 0
241241

242242
# ----------------------------------------------------------------
243243
# This stage performs quality gates enforcements

eng/pipelines/templates/BuildAndTest.yml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ steps:
3131

3232
- script: ${{ parameters.buildScript }}
3333
-restore
34+
-warnAsError ${{ parameters.warnAsError }}
3435
/bl:${{ parameters.repoLogPath }}/restore.binlog
3536
displayName: Restore
3637

@@ -40,6 +41,7 @@ steps:
4041
4142
- script: ${{ parameters.buildScript }}
4243
-restore
44+
-warnAsError ${{ parameters.warnAsError }}
4345
/bl:${{ parameters.repoLogPath }}/restore2.binlog
4446
displayName: Restore solution
4547

@@ -61,7 +63,7 @@ steps:
6163
- script: ${{ parameters.buildScript }}
6264
-pack
6365
-configuration ${{ parameters.buildConfig }}
64-
-warnAsError 1
66+
-warnAsError ${{ parameters.warnAsError }}
6567
/bl:${{ parameters.repoLogPath }}/pack.binlog
6668
/p:Restore=false /p:Build=false
6769
$(_OfficialBuildIdArgs)
@@ -71,7 +73,7 @@ steps:
7173
- script: ${{ parameters.buildScript }}
7274
-integrationTest
7375
-configuration ${{ parameters.buildConfig }}
74-
-warnAsError 1
76+
-warnAsError ${{ parameters.warnAsError }}
7577
/bl:${{ parameters.repoLogPath }}/integration_tests.binlog
7678
$(_OfficialBuildIdArgs)
7779
displayName: Run integration tests
@@ -158,6 +160,7 @@ steps:
158160
# Publishing will happen in a subsequent step
159161
- script: ${{ parameters.buildScript }}
160162
-projects $(Build.SourcesDirectory)/src/Packages/Microsoft.Internal.Extensions.DotNetApiDocs.Transport/Microsoft.Internal.Extensions.DotNetApiDocs.Transport.proj
163+
-warnAsError ${{ parameters.warnAsError }}
161164
-pack
162165
-configuration ${{ parameters.buildConfig }}
163166
/bl:${{ parameters.repoLogPath }}/transport.binlog
@@ -173,7 +176,7 @@ steps:
173176
-sign $(_SignArgs)
174177
-publish $(_PublishArgs)
175178
-configuration ${{ parameters.buildConfig }}
176-
-warnAsError 1
179+
-warnAsError ${{ parameters.warnAsError }}
177180
/bl:${{ parameters.repoLogPath }}/publish.binlog
178181
/p:Build=false
179182
$(_OfficialBuildIdArgs)

test/Libraries/Microsoft.Extensions.DataIngestion.Tests/Microsoft.Extensions.DataIngestion.Tests.csproj

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,11 @@
1919
<PackageReference Include="Microsoft.SemanticKernel.Connectors.SqliteVec" />
2020
</ItemGroup>
2121

22+
<ItemGroup Condition="'$(TargetFrameworkIdentifier)' == '.NETFramework'">
23+
<!-- Workaround https://github.com/microsoft/semantic-kernel/issues/13316 -->
24+
<PackageReference Include="Microsoft.Bcl.AsyncInterfaces" VersionOverride="$(MicrosoftBclAsyncInterfacesVersion)" />
25+
</ItemGroup>
26+
2227
<ItemGroup>
2328
<Compile Include="..\Microsoft.Extensions.AI.Abstractions.Tests\TestChatClient.cs" />
2429
<!-- We don't run Sqlite tests on Full Framework due to some native dependency issues -->

0 commit comments

Comments
 (0)