Skip to content

Commit 47a41ad

Browse files
authored
Merge pull request #1663 from dagood/3.1.6
2 parents 1d0b7a8 + 3ac6dc0 commit 47a41ad

27 files changed

+405
-652
lines changed

.vsts.pipelines/jobs/ci-linux.yml

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,12 @@ jobs:
4141
# Default type, can be overridden by matrix legs.
4242
type: Production
4343

44+
${{ if not(and(ne(variables['System.TeamProject'], 'public'), notin(variables['Build.Reason'], 'PullRequest'))) }}:
45+
SetInternalPackageFeedPatDockerArg: ''
46+
${{ if and(ne(variables['System.TeamProject'], 'public'), notin(variables['Build.Reason'], 'PullRequest')) }}:
47+
SetInternalPackageFeedPatDockerArg: >-
48+
-e internalPackageFeedPat=$(dn-bot-dnceng-artifact-feeds-rw)
49+
4450
steps:
4551
- template: ../steps/cleanup-unneeded-files.yml
4652
- template: ../steps/docker-cleanup-linux.yml
@@ -64,7 +70,7 @@ jobs:
6470
if [ "$(sb.tarball)" != "true" ]; then
6571
failOnBaselineError=true
6672
fi
67-
$(docker.run) $(docker.src.map) $(docker.src.work) $(imageName) ./build.sh \
73+
$(docker.run) $(docker.src.map) $(docker.src.work) $(SetInternalPackageFeedPatDockerArg) $(imageName) ./build.sh \
6874
/p:Configuration=$(sb.configuration) \
6975
/p:PortableBuild=$(sb.portable) \
7076
/p:UseSystemLibunwind=$(systemLibunwind) \
@@ -90,7 +96,7 @@ jobs:
9096
- script: |
9197
set -ex
9298
df -h
93-
$(docker.run) $(docker.src.map) $(docker.src.work) $(imageName) ./build.sh \
99+
$(docker.run) $(docker.src.map) $(docker.src.work) $(SetInternalPackageFeedPatDockerArg) $(imageName) ./build.sh \
94100
--run-smoke-test \
95101
/p:Configuration=$(sb.configuration) \
96102
/p:ProdConBlobFeedUrlPrefix=$(prodConBlobFeedUrlPrefix)
@@ -119,7 +125,7 @@ jobs:
119125
if [ "$(reportPrebuiltLeaks)" = "true" ]; then
120126
args="$args --enable-leak-detection"
121127
fi
122-
$(docker.run) $(docker.tb.map) $(docker.src.map) $(docker.src.work) $(imageName) ./build-source-tarball.sh \
128+
$(docker.run) $(docker.tb.map) $(docker.src.map) $(docker.src.work) $(SetInternalPackageFeedPatDockerArg) $(imageName) ./build-source-tarball.sh \
123129
"/tb/$(tarballName)" \
124130
$args
125131
du -h $(rootDirectory) | sort -h | tail -n 50

.vsts.pipelines/jobs/ci-local.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,11 @@ jobs:
3535
# Default type, can be overridden by matrix legs.
3636
type: Production
3737

38+
${{ if not(and(ne(variables['System.TeamProject'], 'public'), notin(variables['Build.Reason'], 'PullRequest'))) }}:
39+
InternalPackageFeedPatEnv: ''
40+
${{ if and(ne(variables['System.TeamProject'], 'public'), notin(variables['Build.Reason'], 'PullRequest')) }}:
41+
InternalPackageFeedPatEnv: $(dn-bot-dnceng-artifact-feeds-rw)
42+
3843
steps:
3944
- checkout: self
4045
clean: true
@@ -64,6 +69,8 @@ jobs:
6469

6570
# Build source-build.
6671
- script: ${{ format('{0}build{1} $(args.build)', parameters.scriptPrefix, parameters.scriptSuffix) }}
72+
env:
73+
internalPackageFeedPat: $(InternalPackageFeedPatEnv)
6774
displayName: Build source-build
6875
timeoutInMinutes: 150
6976

@@ -72,6 +79,8 @@ jobs:
7279
# Run smoke tests.
7380
- ${{ if ne(parameters.skipSmokeTest, true) }}:
7481
- bash: ${{ format('{0}build{1} $(args.smokeTest)', parameters.scriptPrefix, parameters.scriptSuffix) }}
82+
env:
83+
internalPackageFeedPat: $(InternalPackageFeedPatEnv)
7584
displayName: Run smoke-test
7685

7786
# Gather artifacts. Uses git bash on Windows.

Directory.Build.targets

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@
2525
<IgnoredRepos>$(IgnoredRepos);https://dev.azure.com/devdiv/DevDiv/_git/DotNet-Trusted</IgnoredRepos>
2626
<IgnoredRepos>$(IgnoredRepos);https://devdiv.visualstudio.com/DevDiv/_git/DotNet-Trusted</IgnoredRepos>
2727
<IgnoredRepos>$(IgnoredRepos);https://dnceng@dev.azure.com/dnceng/internal/_git/dotnet-optimization</IgnoredRepos>
28-
<IgnoredRepos>$(IgnoredRepos);https://dev.azure.com/dnceng/internal/_git/dotnet-core-setup</IgnoredRepos>
2928
<IgnoredRepos>$(IgnoredRepos);https://github.com/dotnet/source-build-reference-packages</IgnoredRepos>
3029

3130
<DarcCloneReposFolder Condition="'$(DarcCloneReposFolder)' == ''">$(ClonedSubmoduleDirectory)</DarcCloneReposFolder>

NuGet.config

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,6 @@
33
<packageSources>
44
<clear />
55
<!--Begin: Package sources managed by Dependency Flow automation. Do not edit the sources below.-->
6-
<add key="darc-pub-dotnet-templating-4609143" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/darc-pub-dotnet-templating-46091435/nuget/v3/index.json" />
7-
<add key="darc-pub-dotnet-extensions-7d9baaf" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/darc-pub-dotnet-extensions-7d9baaf6/nuget/v3/index.json" />
8-
<add key="darc-pub-dotnet-aspnetcore-tooling-5ecfad7" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/darc-pub-dotnet-aspnetcore-tooling-5ecfad7e/nuget/v3/index.json" />
9-
<add key="darc-pub-dotnet-aspnetcore-e81033e" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/darc-pub-dotnet-aspnetcore-e81033e0/nuget/v3/index.json" />
106
<!--End: Package sources managed by Dependency Flow automation. Do not edit the sources above.-->
117
<add key="api.nuget.org" value="https://api.nuget.org/v3/index.json" />
128
<add key="nuget-build" value="https://dotnet.myget.org/F/nuget-build/api/v3/index.json" />

build.proj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@
163163
AfterTargets="Build"
164164
Condition="'$(OfflineBuild)' != 'true' and '$(OS)' != 'Windows_NT' and '$(SkipDownloadingPreviouslySourceBuiltPackages)' != 'true'">
165165
<PropertyGroup Condition="'$(DownloadSourceBuiltArtifactsTimeoutSeconds)' == ''">
166-
<DownloadSourceBuiltArtifactsTimeoutSeconds>600</DownloadSourceBuiltArtifactsTimeoutSeconds>
166+
<DownloadSourceBuiltArtifactsTimeoutSeconds>1500</DownloadSourceBuiltArtifactsTimeoutSeconds>
167167
</PropertyGroup>
168168

169169
<DownloadFileSB

build.sh

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,21 @@ export DOTNET_SKIP_FIRST_TIME_EXPERIENCE=1
102102
export DOTNET_MULTILEVEL_LOOKUP=0
103103
export NUGET_PACKAGES="$scriptroot/packages/restored/"
104104

105+
if [ "${internalPackageFeedPat:-}" ]; then
106+
echo "Setting up NuGet credential provider using PAT from env var 'internalPackageFeedPat'..."
107+
. "$scriptroot/eng/install-nuget-credprovider.sh"
108+
# TODO: Read these from nuget.config
109+
# The internal transport isn't added by Darc, though, so it will still need special-casing.
110+
export VSS_NUGET_EXTERNAL_FEED_ENDPOINTS='{"endpointCredentials": [
111+
{"endpoint":"https://pkgs.dev.azure.com/dnceng/_packaging/darc-int-dotnet-templating-3a2d6426/nuget/v3/index.json", "username":"optional", "password":"'$internalPackageFeedPat'"},
112+
{"endpoint":"https://pkgs.dev.azure.com/dnceng/_packaging/darc-int-dotnet-extensions-be18161f/nuget/v3/index.json", "username":"optional", "password":"'$internalPackageFeedPat'"},
113+
{"endpoint":"https://pkgs.dev.azure.com/dnceng/_packaging/darc-int-dotnet-core-setup-3acd9b0c/nuget/v3/index.json", "username":"optional", "password":"'$internalPackageFeedPat'"},
114+
{"endpoint":"https://pkgs.dev.azure.com/dnceng/_packaging/darc-int-dotnet-aspnetcore-tooling-d63ec4a1/nuget/v3/index.json", "username":"optional", "password":"'$internalPackageFeedPat'"},
115+
{"endpoint":"https://pkgs.dev.azure.com/dnceng/_packaging/darc-int-dotnet-aspnetcore-62c098bc/nuget/v3/index.json", "username":"optional", "password":"'$internalPackageFeedPat'"},
116+
{"endpoint":"https://pkgs.dev.azure.com/dnceng/_packaging/dotnet3.1-internal-transport/nuget/v3/index.json", "username":"optional", "password":"'$internalPackageFeedPat'"}
117+
]}'
118+
fi
119+
105120
set -x
106121
scriptroot="$( cd -P "$( dirname "$source" )" && pwd )"
107122

eng/SourceBuild.Tarball.KnownExtraPrebuilts.targets

Lines changed: 18 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,13 @@
99
DependsOnTargets="GetTarballDirProps">
1010
<ItemGroup>
1111
<KnownExtraPrebuiltFile Include="
12-
$(TarballPrebuiltPackageDir)dotnet-dev-certs.3.0.0-rc2.19465.2.nupkg;
13-
$(TarballPrebuiltPackageDir)dotnet-user-secrets.3.0.0-rc2.19465.2.nupkg;
14-
$(TarballPrebuiltPackageDir)dotnet-watch.3.0.0-rc2.19465.2.nupkg;
15-
$(TarballPrebuiltPackageDir)microsoft.aspnetcore.analyzers.3.0.0-rc2.19465.2.nupkg;
16-
$(TarballPrebuiltPackageDir)microsoft.aspnetcore.developercertificates.xplat.3.0.0-rc2.19465.2.nupkg;
17-
$(TarballPrebuiltPackageDir)microsoft.aspnetcore.mvc.analyzers.3.0.0-rc2.19465.2.nupkg;
18-
$(TarballPrebuiltPackageDir)microsoft.aspnetcore.mvc.api.analyzers.3.0.0-rc2.19465.2.nupkg;
12+
$(TarballPrebuiltPackageDir)dotnet-dev-certs.3.1.6-servicing.20326.1.nupkg;
13+
$(TarballPrebuiltPackageDir)dotnet-user-secrets.3.1.6-servicing.20326.1.nupkg;
14+
$(TarballPrebuiltPackageDir)dotnet-watch.3.1.6-servicing.20326.1.nupkg;
15+
$(TarballPrebuiltPackageDir)microsoft.aspnetcore.analyzers.3.1.6-servicing.20326.1.nupkg;
16+
$(TarballPrebuiltPackageDir)microsoft.aspnetcore.developercertificates.xplat.3.1.6-servicing.20326.1.nupkg;
17+
$(TarballPrebuiltPackageDir)microsoft.aspnetcore.mvc.analyzers.3.1.6-servicing.20326.1.nupkg;
18+
$(TarballPrebuiltPackageDir)microsoft.aspnetcore.mvc.api.analyzers.3.1.6-servicing.20326.1.nupkg;
1919
$(TarballPrebuiltPackageDir)microsoft.codeanalysis.analyzers.2.6.1.nupkg;
2020
$(TarballPrebuiltPackageDir)microsoft.codeanalysis.common.2.9.0.nupkg;
2121
$(TarballPrebuiltPackageDir)microsoft.codeanalysis.csharp.2.9.0.nupkg;
@@ -55,6 +55,17 @@
5555
$(TarballPrebuiltPackageDir)system.xml.xpath.xdocument.4.3.0.nupkg;
5656
$(TarballPrebuiltPackageDir)vswhere.2.6.7.nupkg;
5757
" />
58+
<!--
59+
Remove packages that have had a new release during servicing, and we want to use the
60+
source-built version while building the tarball.
61+
62+
For example, a dependency on A/1.0.0 is checked into the repos, but now we build A/1.0.1 and
63+
we have A/1.0.1 as previously-source-built. During the tarball build, we can use A/1.0.1
64+
fine, but need to remove A/1.0.0 manually from the production build.
65+
-->
66+
<KnownExtraPrebuiltFile Include="
67+
$(TarballPrebuiltPackageDir)microsoft.bcl.asyncinterfaces.1.1.0.nupkg;
68+
" />
5869
<!--
5970
Remove source-link packages to throw away tooling that Arcade imports unconditionally in the
6071
production build.

eng/SourceBuild.Tarball.targets

Lines changed: 29 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,18 @@
151151
Include="$(ProjectDir)support/tarball/build.sh"
152152
RelativeDestination="build.sh" />
153153

154+
<!--
155+
When building an internal build, the main smoke-test nuget config has authenticated sources
156+
in it to generate a full set of smoke-test-prereqs. This isn't necessary in the tarball
157+
because we have those smoke-test-prereqs, but we hit authentication errors nonetheless. Copy
158+
a trimmed down nuget.config in this case.
159+
TODO: Automatically trim down the main nuget.config.
160+
-->
161+
<TarballCopyFile
162+
Condition="Exists('$(ProjectDir)support\tarball\smoke-testNuGet.Config')"
163+
Include="$(ProjectDir)support\tarball\smoke-testNuGet.Config"
164+
RelativeDestination="smoke-testNuGet.Config" />
165+
154166
<!-- Setup package version props to include both source-built and running PackageVersions.props -->
155167
<TarballCopyFile
156168
Include="$(ProjectDir)support\tarball\PackageVersions.props"
@@ -161,7 +173,7 @@
161173
<Target Name="AddTarballPackages">
162174
<!-- Find reference-packages to exclude from tarball prebuilts...-->
163175
<ItemGroup Condition="'$(CustomRefPackagesDir)' != ''">
164-
<SourceBuildReferencePackageFile Include="$(CustomRefPackagesDir)**\*.nupkg" />
176+
<SourceBuildReferencePackageFile Include="$([MSBuild]::NormalizeDirectory('$(CustomRefPackagesDir)'))**\*.nupkg" />
165177
</ItemGroup>
166178

167179
<Exec
@@ -178,7 +190,7 @@
178190

179191
<!-- Find previously source-built packages to exclude from tarball prebuilts... -->
180192
<ItemGroup Condition="'$(CustomPreviouslySourceBuiltPackagesDir)' != ''">
181-
<PreviouslySourceBuiltPackageFile Include="$(CustomPreviouslySourceBuiltPackagesDir)**\*.nupkg" />
193+
<PreviouslySourceBuiltPackageFile Include="$([MSBuild]::NormalizeDirectory('$(CustomPreviouslySourceBuiltPackagesDir)'))**\*.nupkg" />
182194
</ItemGroup>
183195

184196
<Exec
@@ -212,18 +224,26 @@
212224
RelativeDestination="packages\prebuilt\%(Filename)%(Extension)" />
213225

214226
<SmokeTestPackageFile
215-
Include="$(ProjectDir)testing-smoke\smoke-test-packages\**"
227+
Include="$(ProjectDir)testing-smoke\smoke-test-packages\**\*.nupkg"
216228
RelativeRoot="packages\smoke-test-packages\" />
217229

218-
<!-- Set identity to the filename to allow for Remove, but keep old identity to swap back. -->
230+
<!--
231+
Set up filename-based items, in order to filter out some packages that aren't necessary as
232+
prebuilts, or are generated/acquired another way.
233+
-->
234+
<IncludedPrebuiltPackageCandidate Include="@(PrebuiltPackageFile)" />
235+
236+
<!--
237+
For internal builds, all smoke-test packages should be kept. For external builds, they can
238+
be restored during smoke-test execution from public sources, so can be pruned.
239+
-->
240+
<IncludedPrebuiltPackageFile Include="@(SmokeTestPackageFile)" Condition="'$(VSS_NUGET_EXTERNAL_FEED_ENDPOINTS)' != ''" />
241+
<IncludedPrebuiltPackageCandidate Include="@(SmokeTestPackageFile)" Condition="'$(VSS_NUGET_EXTERNAL_FEED_ENDPOINTS)' == ''" />
242+
219243
<IncludedPrebuiltPackageFilename
220-
Include="
221-
@(PrebuiltPackageFile -> '%(Filename)');
222-
@(SmokeTestPackageFile -> '%(Filename)');
223-
"
244+
Include="@(IncludedPrebuiltPackageCandidate -> '%(Filename)')"
224245
OriginalIdentity="%(Identity)" />
225246

226-
<!-- Exclude prebuilt nupkgs supplied a different way or not actually needed as prebuilts. -->
227247
<IncludedPrebuiltPackageFilename Remove="
228248
@(SourceBuiltPackageFilename);
229249
@(SourceBuildReferencePackageFilename);

0 commit comments

Comments
 (0)