Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Ubuntu] Fix .NET SDK extraction #11007

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 11 additions & 5 deletions images/ubuntu/scripts/build/install-dotnetcore-sdk.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,21 @@ source $HELPER_SCRIPTS/os.sh

extract_dotnet_sdk() {
local archive_name=$1
source $HELPER_SCRIPTS/os.sh

set -e
destination="./tmp-$(basename -s .tar.gz $archive_name)"
destination="$(dirname $archive_name)/tmp-$(basename -s .tar.gz $archive_name)"
if is_ubuntu24; then
dotnet_path="/usr/lib/dotnet"
else
dotnet_path="/usr/share/dotnet"
fi

echo "Extracting $archive_name to $destination"
mkdir "$destination" && tar -C "$destination" -xzf "$archive_name"
rsync -qav --remove-source-files "$destination/shared/" /usr/share/dotnet/shared/
rsync -qav --remove-source-files "$destination/host/" /usr/share/dotnet/host/
rsync -qav --remove-source-files "$destination/sdk/" /usr/share/dotnet/sdk/
rsync -qav --remove-source-files "$destination/shared/" "$dotnet_path/shared/"
rsync -qav --remove-source-files "$destination/host/" "$dotnet_path/host/"
rsync -qav --remove-source-files "$destination/sdk/" "$dotnet_path/sdk/"
rm -rf "$destination" "$archive_name"
}

Expand Down Expand Up @@ -82,7 +88,7 @@ parallel --jobs 0 --halt soon,fail=1 \
'url="https://dotnetcli.blob.core.windows.net/dotnet/Sdk/{}/dotnet-sdk-{}-linux-x64.tar.gz"; \
download_with_retry $url' ::: "${sorted_sdks[@]}"

find . -name "*.tar.gz" | parallel --halt soon,fail=1 'extract_dotnet_sdk {}'
find /tmp -regex ".+dotnet-sdk-.+-linux-x64\.tar\.gz" | parallel --halt soon,fail=1 'extract_dotnet_sdk {}'

# NuGetFallbackFolder at /usr/share/dotnet/sdk/NuGetFallbackFolder is warmed up by smoke test
# Additional FTE will just copy to ~/.dotnet/NuGet which provides no benefit on a fungible machine
Expand Down
2 changes: 1 addition & 1 deletion images/ubuntu/scripts/docs-gen/Generate-SoftwareReport.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ $browsersTools.AddHeader("Environment variables").AddTable($(Build-BrowserWebdri

# .NET Tools
$netCoreTools = $installedSoftware.AddHeader(".NET Tools")
$netCoreTools.AddToolVersionsListInline(".NET Core SDK", $(Get-DotNetCoreSdkVersions), "^\d+\.\d+\.\d")
$netCoreTools.AddToolVersionsListInline(".NET Core SDK", $(Get-DotNetCoreSdkVersions), "^\d+\.\d+\.\d+")
$netCoreTools.AddNodes($(Get-DotnetTools))

# Databases
Expand Down
Loading