Skip to content

Commit 918dfdc

Browse files
authored
Merge pull request #25280 from dotnet/wtgodbe/MergePreview8
Merge preview8 branch to public
2 parents ad5e173 + cd0ec1f commit 918dfdc

File tree

7 files changed

+121
-90
lines changed

7 files changed

+121
-90
lines changed

.azure/pipelines/ci.yml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -622,17 +622,18 @@ stages:
622622
timeoutInMinutes: 240
623623
steps:
624624
# Build the shared framework
625-
- script: ./build.cmd -ci -nobl -all -pack -arch x64 /p:ASPNETCORE_TEST_LOG_DIR=artifacts/log
625+
- script: ./build.cmd -ci -nobl -all -pack -arch x64 /p:ASPNETCORE_TEST_LOG_DIR=artifacts/log $(_InternalRuntimeDownloadArgs)
626626
displayName: Build shared fx
627-
- script: ./build.cmd -ci -nobl -noBuildRepoTasks -restore -noBuild -noBuildNative -projects src/Grpc/**/*.csproj
627+
- script: ./build.cmd -ci -nobl -noBuildRepoTasks -restore -noBuild -noBuildNative -projects src/Grpc/**/*.csproj $(_InternalRuntimeDownloadArgs)
628628
displayName: Restore interop projects
629629
- script: ./build.cmd -ci -nobl -noBuildRepoTasks -noRestore -test -all -noBuildNative -projects eng\helix\helix.proj
630-
/p:IsRequiredCheck=true /p:IsHelixJob=true /p:BuildInteropProjects=true /p:RunTemplateTests=true
630+
/p:IsRequiredCheck=true /p:IsHelixJob=true /p:BuildInteropProjects=true /p:RunTemplateTests=true $(_InternalRuntimeDownloadArgs)
631631
/p:ASPNETCORE_TEST_LOG_DIR=artifacts/log
632632
displayName: Run build.cmd helix target
633633
env:
634634
HelixApiAccessToken: $(HelixApiAccessToken) # Needed for internal queues
635635
SYSTEM_ACCESSTOKEN: $(System.AccessToken) # We need to set this env var to publish helix results to Azure Dev Ops
636+
636637
artifacts:
637638
- name: Helix_logs
638639
path: artifacts/log/
@@ -666,7 +667,7 @@ stages:
666667
arguments: $(Build.SourcesDirectory)/NuGet.config $Token
667668
env:
668669
Token: $(dn-bot-dnceng-artifact-feeds-rw)
669-
- script: ./eng/scripts/ci-source-build.sh --ci --nobl --configuration Release /p:BuildManaged=true /p:BuildNodeJs=false
670+
- script: ./eng/scripts/ci-source-build.sh --ci --nobl --configuration Release /p:BuildManaged=true /p:BuildNodeJs=false $(_InternalRuntimeDownloadArgs)
670671
displayName: Run ci-source-build.sh
671672
- task: PublishBuildArtifacts@1
672673
displayName: Upload logs

eng/common/tools.ps1

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -240,8 +240,8 @@ function GetDotNetInstallScript([string] $dotnetRoot) {
240240
return $installScript
241241
}
242242

243-
function InstallDotNetSdk([string] $dotnetRoot, [string] $version, [string] $architecture = '') {
244-
InstallDotNet $dotnetRoot $version $architecture '' $false $runtimeSourceFeed $runtimeSourceFeedKey
243+
function InstallDotNetSdk([string] $dotnetRoot, [string] $version, [string] $architecture = '', [switch] $noPath) {
244+
InstallDotNet $dotnetRoot $version $architecture '' $false $runtimeSourceFeed $runtimeSourceFeedKey -noPath:$noPath
245245
}
246246

247247
function InstallDotNet([string] $dotnetRoot,
@@ -250,7 +250,8 @@ function InstallDotNet([string] $dotnetRoot,
250250
[string] $runtime = '',
251251
[bool] $skipNonVersionedFiles = $false,
252252
[string] $runtimeSourceFeed = '',
253-
[string] $runtimeSourceFeedKey = '') {
253+
[string] $runtimeSourceFeedKey = '',
254+
[switch] $noPath) {
254255

255256
$installScript = GetDotNetInstallScript $dotnetRoot
256257
$installParameters = @{
@@ -261,6 +262,7 @@ function InstallDotNet([string] $dotnetRoot,
261262
if ($architecture) { $installParameters.Architecture = $architecture }
262263
if ($runtime) { $installParameters.Runtime = $runtime }
263264
if ($skipNonVersionedFiles) { $installParameters.SkipNonVersionedFiles = $skipNonVersionedFiles }
265+
if ($noPath) { $installParameters.NoPath = $True }
264266

265267
try {
266268
& $installScript @installParameters

eng/helix/content/InstallDotNet.ps1

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

eng/helix/content/runtests.cmd

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@ shift
1717
set $aspnetref=%9
1818
shift
1919
set $helixTimeout=%9
20+
shift
21+
set $feedCred=%9
2022

2123
set DOTNET_HOME=%HELIX_CORRELATION_PAYLOAD%\sdk
2224
set DOTNET_ROOT=%DOTNET_HOME%\%$arch%
@@ -26,10 +28,16 @@ set DOTNET_CLI_HOME=%HELIX_CORRELATION_PAYLOAD%\home
2628

2729
set PATH=%DOTNET_ROOT%;!PATH!;%HELIX_CORRELATION_PAYLOAD%\node\bin
2830
echo Set path to: %PATH%
29-
echo "Invoking InstallDotNet.ps1 %$arch% %$sdkVersion% %$runtimeVersion% %DOTNET_ROOT%"
30-
powershell.exe -NoProfile -ExecutionPolicy unrestricted -file InstallDotNet.ps1 %$arch% %$sdkVersion% %$runtimeVersion% %DOTNET_ROOT%
31+
32+
powershell.exe -noLogo -NoProfile -ExecutionPolicy unrestricted -command ". eng\common\tools.ps1; InstallDotNet %DOTNET_ROOT% %$sdkVersion% %$arch% '' $true '' '' $true"
33+
IF [%$feedCred%] == [] (
34+
powershell.exe -noLogo -NoProfile -ExecutionPolicy unrestricted -command ". eng\common\tools.ps1; InstallDotNet %DOTNET_ROOT% %$runtimeVersion% %$arch% dotnet $true '' '' $true"
35+
) else (
36+
powershell.exe -noLogo -NoProfile -ExecutionPolicy unrestricted -command ". eng\common\tools.ps1; InstallDotNet %DOTNET_ROOT% %$runtimeVersion% %$arch% dotnet $true https://dotnetclimsrc.blob.core.windows.net/dotnet %$feedCred% $true"
37+
)
3138

3239
set exit_code=0
40+
3341
echo "Restore: dotnet restore RunTests\RunTests.csproj --source https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet5/nuget/v3/index.json --source https://api.nuget.org/v3/index.json --ignore-failed-sources..."
3442
dotnet restore RunTests\RunTests.csproj --source https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet5/nuget/v3/index.json --source https://api.nuget.org/v3/index.json --ignore-failed-sources
3543

eng/helix/content/runtests.sh

Lines changed: 19 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -30,49 +30,24 @@ RED="\033[0;31m"
3030
YELLOW="\033[0;33m"
3131
MAGENTA="\033[0;95m"
3232

33-
curl -o dotnet-install.sh -sSL https://dot.net/v1/dotnet-install.sh
34-
if [ $? -ne 0 ]; then
35-
download_retries=3
36-
while [ $download_retries -gt 0 ]; do
37-
curl -o dotnet-install.sh -sSL https://dot.net/v1/dotnet-install.sh
38-
if [ $? -ne 0 ]; then
39-
let download_retries=download_retries-1
40-
echo -e "${YELLOW}Failed to download dotnet-install.sh. Retries left: $download_retries.${RESET}"
41-
else
42-
download_retries=0
43-
fi
44-
done
45-
fi
46-
47-
# Call "sync" between "chmod" and execution to prevent "text file busy" error in Docker (aufs)
48-
chmod +x "dotnet-install.sh"; sync
49-
50-
./dotnet-install.sh --version $dotnet_sdk_version --install-dir "$DOTNET_ROOT"
51-
if [ $? -ne 0 ]; then
52-
sdk_retries=3
53-
while [ $sdk_retries -gt 0 ]; do
54-
./dotnet-install.sh --version $dotnet_sdk_version --install-dir "$DOTNET_ROOT"
55-
if [ $? -ne 0 ]; then
56-
let sdk_retries=sdk_retries-1
57-
echo -e "${YELLOW}Failed to install .NET Core SDK $version. Retries left: $sdk_retries.${RESET}"
58-
else
59-
sdk_retries=0
60-
fi
61-
done
62-
fi
63-
64-
./dotnet-install.sh --runtime dotnet --version $dotnet_runtime_version --install-dir "$DOTNET_ROOT"
65-
if [ $? -ne 0 ]; then
66-
runtime_retries=3
67-
while [ $runtime_retries -gt 0 ]; do
68-
./dotnet-install.sh --runtime dotnet --version $dotnet_runtime_version --install-dir "$DOTNET_ROOT"
69-
if [ $? -ne 0 ]; then
70-
let runtime_retries=runtime_retries-1
71-
echo -e "${YELLOW}Failed to install .NET Core runtime $version. Retries left: $runtime_retries.${RESET}"
72-
else
73-
runtime_retries=0
74-
fi
75-
done
33+
. eng/common/tools.sh
34+
InstallDotNet $DOTNET_ROOT $dotnet_sdk_version "" "" true || {
35+
exit_code=$?
36+
Write-PipelineTelemetryError -Category 'InitializeToolset' -Message "dotnet-install.sh failed (exit code '$exit_code')." >&2
37+
ExitWithExitCode $exit_code
38+
}
39+
if [[ -z "${11:-}" ]]; then
40+
InstallDotNet $DOTNET_ROOT $dotnet_runtime_version "" dotnet true || {
41+
exit_code=$?
42+
Write-PipelineTelemetryError -Category 'InitializeToolset' -Message "dotnet-install.sh failed (exit code '$exit_code')." >&2
43+
ExitWithExitCode $exit_code
44+
}
45+
else
46+
InstallDotNet $DOTNET_ROOT $dotnet_runtime_version "" dotnet true https://dotnetclimsrc.blob.core.windows.net/dotnet ${11} || {
47+
exit_code=$?
48+
Write-PipelineTelemetryError -Category 'InitializeToolset' -Message "dotnet-install.sh failed (exit code '$exit_code')." >&2
49+
ExitWithExitCode $exit_code
50+
}
7651
fi
7752

7853
if [ -e /proc/self/coredump_filter ]; then
@@ -82,7 +57,7 @@ if [ -e /proc/self/coredump_filter ]; then
8257
echo -n 0x3F > /proc/self/coredump_filter
8358
fi
8459

85-
# dontet-install.sh seems to affect the Linux filesystem and causes test flakiness unless we sync the filesystem before running tests
60+
# dotnet-install.sh seems to affect the Linux filesystem and causes test flakiness unless we sync the filesystem before running tests
8661
sync
8762

8863
exit_code=0

eng/scripts/ci-source-build.sh

Lines changed: 68 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,76 @@ reporoot="$(dirname "$(dirname "$scriptroot")")"
3333
# mv "$reporoot/global.bak.json" "$reporoot/global.json"
3434
#}" EXIT
3535

36+
dotnet_runtime_source_feed=''
37+
dotnet_runtime_source_feed_key=''
38+
other_args=()
39+
40+
#
41+
# Functions
42+
#
43+
__usage() {
44+
echo "Usage: $(basename "${BASH_SOURCE[0]}") [options] [[--] <Arguments>...]
45+
46+
Arguments:
47+
<Arguments>... Arguments passed to the command. Variable number of arguments allowed.
48+
49+
--dotnet-runtime-source-feed Additional feed that can be used when downloading .NET runtimes
50+
--dotnet-runtime-source-feed-key Key for feed that can be used when downloading .NET runtimes
51+
52+
Description:
53+
This script is meant for testing source build by imitating some of the input parameters and conditions.
54+
"
55+
56+
if [[ "${1:-}" != '--no-exit' ]]; then
57+
exit 2
58+
fi
59+
}
60+
61+
__error() {
62+
echo -e "${RED}error: $*${RESET}" 1>&2
63+
}
64+
65+
#
66+
# main
67+
#
68+
69+
while [[ $# -gt 0 ]]; do
70+
opt="$(echo "${1/#--/-}" | awk '{print tolower($0)}')"
71+
case "$opt" in
72+
-\?|-h|-help)
73+
__usage --no-exit
74+
exit 0
75+
;;
76+
-dotnet-runtime-source-feed|-dotnetruntimesourcefeed)
77+
shift
78+
[ -z "${1:-}" ] && __error "Missing value for parameter --dotnet-runtime-source-feed" && __usage
79+
dotnet_runtime_source_feed="${1:-}"
80+
;;
81+
-dotnet-runtime-source-feed-key|-dotnetruntimesourcefeedkey)
82+
shift
83+
[ -z "${1:-}" ] && __error "Missing value for parameter --dotnet-runtime-source-feed-key" && __usage
84+
dotnet_runtime_source_feed_key="${1:-}"
85+
;;
86+
*)
87+
other_args[${#other_args[*]}]="$1"
88+
;;
89+
esac
90+
shift
91+
done
92+
93+
# Set up additional runtime args
94+
runtime_feed_args=()
95+
if [ ! -z "$dotnet_runtime_source_feed$dotnet_runtime_source_feed_key" ]; then
96+
runtimeFeedArg="/p:DotNetRuntimeSourceFeed=$dotnet_runtime_source_feed"
97+
runtimeFeedKeyArg="/p:DotNetRuntimeSourceFeedKey=$dotnet_runtime_source_feed_key"
98+
runtime_feed_args[${#runtime_feed_args[*]}]=$runtimeFeedArg
99+
runtime_feed_args[${#runtime_feed_args[*]}]=$runtimeFeedKeyArg
100+
fi
101+
36102
# Build repo tasks
37-
"$reporoot/eng/common/build.sh" --restore --build --ci --configuration Release /p:ProjectToBuild=$reporoot/eng/tools/RepoTasks/RepoTasks.csproj
103+
"$reporoot/eng/common/build.sh" --restore --build --ci --configuration Release /p:ProjectToBuild=$reporoot/eng/tools/RepoTasks/RepoTasks.csproj ${runtime_feed_args[@]+"${runtime_feed_args[@]}"}
38104

39105
export DotNetBuildFromSource='true'
40106

41107
# Build projects
42-
"$reporoot/eng/common/build.sh" --restore --build --pack "$@"
108+
"$reporoot/eng/common/build.sh" --restore --build --pack ${other_args[@]+"${other_args[@]}"} ${runtime_feed_args[@]+"${runtime_feed_args[@]}"}

eng/targets/Helix.targets

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,20 @@
2424
<ItemGroup Condition="$(BuildHelixPayload)">
2525
<Content Include="@(HelixContent)" />
2626
<Content Include="$(RepoRoot)eng\scripts\Download.ps1" />
27+
<Content Include="$(RepoRoot)NuGet.config" />
28+
<Content Include="$(RepoRoot)global.json" />
29+
<ContentWithTargetPath Include="
30+
$(RepoRoot)eng\common\pipeline-logging-functions.*;
31+
$(RepoRoot)eng\common\tools.*">
32+
<TargetPath>eng\common\%(Filename)%(Extension)</TargetPath>
33+
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
34+
<CopyToPublishDirectory>PreserveNewest</CopyToPublishDirectory>
35+
</ContentWithTargetPath>
36+
<ContentWithTargetPath Include="$(RepoRoot)eng\common\dotnet-install-scripts\*">
37+
<TargetPath>eng\common\dotnet-install-scripts\%(Filename)%(Extension)</TargetPath>
38+
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
39+
<CopyToPublishDirectory>PreserveNewest</CopyToPublishDirectory>
40+
</ContentWithTargetPath>
2741
</ItemGroup>
2842

2943
<!--

0 commit comments

Comments
 (0)