Skip to content

Commit 45f5554

Browse files
[main] Update dependencies from dotnet/arcade (#763)
[main] Update dependencies from dotnet/arcade - Merge branch 'main' into darc-main-4516b51a-2f25-49a7-9f67-8e8cc83b16c5
1 parent 41f1a15 commit 45f5554

File tree

7 files changed

+236
-13
lines changed

7 files changed

+236
-13
lines changed

eng/Version.Details.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@
1111
<Sha>529fbc2aad419d0c1551d6685cc68be33e62a996</Sha>
1212
<SourceBuild RepoName="source-build-reference-packages" ManagedOnly="true" />
1313
</Dependency>
14-
<Dependency Name="Microsoft.DotNet.Arcade.Sdk" Version="8.0.0-beta.23371.1">
14+
<Dependency Name="Microsoft.DotNet.Arcade.Sdk" Version="8.0.0-beta.23411.1">
1515
<Uri>https://github.com/dotnet/arcade</Uri>
16-
<Sha>602351e3681015ea789b2aeaa7b2a9156a8baf38</Sha>
16+
<Sha>9b2af35a6702526dc8a7c5fcadcc44efd0dca170</Sha>
1717
<SourceBuild RepoName="arcade" ManagedOnly="true" />
1818
</Dependency>
1919
<Dependency Name="Microsoft.DotNet.GenAPI.Task" Version="8.0.100-rc.1.23408.3">
32 Bytes
Binary file not shown.
Lines changed: 132 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,132 @@
1+
#!/usr/bin/env bash
2+
3+
# getNonPortableDistroRid
4+
#
5+
# Input:
6+
# targetOs: (str)
7+
# targetArch: (str)
8+
# rootfsDir: (str)
9+
#
10+
# Return:
11+
# non-portable rid
12+
getNonPortableDistroRid()
13+
{
14+
local targetOs="$1"
15+
local targetArch="$2"
16+
local rootfsDir="$3"
17+
local nonPortableRid=""
18+
19+
if [ "$targetOs" = "linux" ]; then
20+
if [ -e "${rootfsDir}/etc/os-release" ]; then
21+
source "${rootfsDir}/etc/os-release"
22+
23+
if [[ "${ID}" == "rhel" || "${ID}" == "rocky" || "${ID}" == "alpine" ]]; then
24+
# remove the last version digit
25+
VERSION_ID="${VERSION_ID%.*}"
26+
fi
27+
28+
if [[ "${VERSION_ID:-}" =~ ^([[:digit:]]|\.)+$ ]]; then
29+
nonPortableRid="${ID}.${VERSION_ID}-${targetArch}"
30+
else
31+
# Rolling release distros either do not set VERSION_ID, set it as blank or
32+
# set it to non-version looking string (such as TEMPLATE_VERSION_ID on ArchLinux);
33+
# so omit it here to be consistent with everything else.
34+
nonPortableRid="${ID}-${targetArch}"
35+
fi
36+
37+
elif [ -e "${rootfsDir}/android_platform" ]; then
38+
source "$rootfsDir"/android_platform
39+
nonPortableRid="$RID"
40+
fi
41+
fi
42+
43+
if [ "$targetOs" = "freebsd" ]; then
44+
# $rootfsDir can be empty. freebsd-version is shell script and it should always work.
45+
__freebsd_major_version=$($rootfsDir/bin/freebsd-version | { read v; echo "${v%%.*}"; })
46+
nonPortableRid="freebsd.$__freebsd_major_version-${targetArch}"
47+
elif command -v getprop && getprop ro.product.system.model 2>&1 | grep -qi android; then
48+
__android_sdk_version=$(getprop ro.build.version.sdk)
49+
nonPortableRid="android.$__android_sdk_version-${targetArch}"
50+
elif [ "$targetOs" = "illumos" ]; then
51+
__uname_version=$(uname -v)
52+
case "$__uname_version" in
53+
omnios-*)
54+
__omnios_major_version=$(echo "${__uname_version:8:2}")
55+
nonPortableRid=omnios."$__omnios_major_version"-"$targetArch"
56+
;;
57+
joyent_*)
58+
__smartos_major_version=$(echo "${__uname_version:7:4}")
59+
nonPortableRid=smartos."$__smartos_major_version"-"$targetArch"
60+
;;
61+
illumos_*)
62+
nonPortableRid=openindiana-"$targetArch"
63+
;;
64+
esac
65+
elif [ "$targetOs" = "solaris" ]; then
66+
__uname_version=$(uname -v)
67+
__solaris_major_version=$(echo "${__uname_version%.*}")
68+
nonPortableRid=solaris."$__solaris_major_version"-"$targetArch"
69+
elif [ "$targetOs" = "haiku" ]; then
70+
__uname_release=$(uname -r)
71+
nonPortableRid=haiku.r"$__uname_release"-"$targetArch"
72+
fi
73+
74+
echo "$(echo $nonPortableRid | tr '[:upper:]' '[:lower:]')"
75+
}
76+
77+
# initDistroRidGlobal
78+
#
79+
# Input:
80+
# os: (str)
81+
# arch: (str)
82+
# isPortable: (int)
83+
# rootfsDir?: (nullable:string)
84+
#
85+
# Return:
86+
# None
87+
#
88+
# Notes:
89+
#
90+
# It is important to note that the function does not return anything, but it
91+
# exports the following variables on success:
92+
#
93+
# __DistroRid : Non-portable rid of the target platform.
94+
# __PortableTargetOS : OS-part of the portable rid that corresponds to the target platform.
95+
#
96+
initDistroRidGlobal()
97+
{
98+
local targetOs="$1"
99+
local targetArch="$2"
100+
local isPortable="$3"
101+
local rootfsDir=""
102+
if [ "$#" -ge 4 ]; then
103+
rootfsDir="$4"
104+
fi
105+
106+
if [ -n "${rootfsDir}" ]; then
107+
# We may have a cross build. Check for the existence of the rootfsDir
108+
if [ ! -e "${rootfsDir}" ]; then
109+
echo "Error rootfsDir has been passed, but the location is not valid."
110+
exit 1
111+
fi
112+
fi
113+
114+
__DistroRid=$(getNonPortableDistroRid "${targetOs}" "${targetArch}" "${rootfsDir}")
115+
116+
if [ -z "${__PortableTargetOS:-}" ]; then
117+
__PortableTargetOS="$targetOs"
118+
119+
STRINGS="$(command -v strings || true)"
120+
if [ -z "$STRINGS" ]; then
121+
STRINGS="$(command -v llvm-strings || true)"
122+
fi
123+
124+
# Check for musl-based distros (e.g Alpine Linux, Void Linux).
125+
if "${rootfsDir}/usr/bin/ldd" --version 2>&1 | grep -q musl ||
126+
( [ -n "$STRINGS" ] && "$STRINGS" "${rootfsDir}/usr/bin/ldd" 2>&1 | grep -q musl ); then
127+
__PortableTargetOS="linux-musl"
128+
fi
129+
fi
130+
131+
export __DistroRid __PortableTargetOS
132+
}
Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
#!/usr/bin/env bash
2+
3+
# Use uname to determine what the OS is.
4+
OSName=$(uname -s | tr '[:upper:]' '[:lower:]')
5+
6+
if command -v getprop && getprop ro.product.system.model 2>&1 | grep -qi android; then
7+
OSName="android"
8+
fi
9+
10+
case "$OSName" in
11+
freebsd|linux|netbsd|openbsd|sunos|android|haiku)
12+
os="$OSName" ;;
13+
darwin)
14+
os=osx ;;
15+
*)
16+
echo "Unsupported OS $OSName detected!"
17+
exit 1 ;;
18+
esac
19+
20+
# On Solaris, `uname -m` is discouraged, see https://docs.oracle.com/cd/E36784_01/html/E36870/uname-1.html
21+
# and `uname -p` returns processor type (e.g. i386 on amd64).
22+
# The appropriate tool to determine CPU is isainfo(1) https://docs.oracle.com/cd/E36784_01/html/E36870/isainfo-1.html.
23+
if [ "$os" = "sunos" ]; then
24+
if uname -o 2>&1 | grep -q illumos; then
25+
os="illumos"
26+
else
27+
os="solaris"
28+
fi
29+
CPUName=$(isainfo -n)
30+
else
31+
# For the rest of the operating systems, use uname(1) to determine what the CPU is.
32+
CPUName=$(uname -m)
33+
fi
34+
35+
case "$CPUName" in
36+
arm64|aarch64)
37+
arch=arm64
38+
;;
39+
40+
loongarch64)
41+
arch=loongarch64
42+
;;
43+
44+
riscv64)
45+
arch=riscv64
46+
;;
47+
48+
amd64|x86_64)
49+
arch=x64
50+
;;
51+
52+
armv7l|armv8l)
53+
if (NAME=""; . /etc/os-release; test "$NAME" = "Tizen"); then
54+
arch=armel
55+
else
56+
arch=arm
57+
fi
58+
;;
59+
60+
armv6l)
61+
arch=armv6
62+
;;
63+
64+
i[3-6]86)
65+
echo "Unsupported CPU $CPUName detected, build might not succeed!"
66+
arch=x86
67+
;;
68+
69+
s390x)
70+
arch=s390x
71+
;;
72+
73+
ppc64le)
74+
arch=ppc64le
75+
;;
76+
*)
77+
echo "Unknown CPU $CPUName detected!"
78+
exit 1
79+
;;
80+
esac

eng/common/sdl/extract-artifact-packages.ps1

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -35,31 +35,33 @@ try {
3535
param(
3636
[string] $PackagePath # Full path to a NuGet package
3737
)
38-
38+
3939
if (!(Test-Path $PackagePath)) {
4040
Write-PipelineTelemetryError -Category 'Build' -Message "Input file does not exist: $PackagePath"
4141
ExitWithExitCode 1
4242
}
43-
43+
4444
$RelevantExtensions = @('.dll', '.exe', '.pdb')
4545
Write-Host -NoNewLine 'Extracting ' ([System.IO.Path]::GetFileName($PackagePath)) '...'
46-
46+
4747
$PackageId = [System.IO.Path]::GetFileNameWithoutExtension($PackagePath)
4848
$ExtractPath = Join-Path -Path $using:ExtractPath -ChildPath $PackageId
49-
49+
5050
Add-Type -AssemblyName System.IO.Compression.FileSystem
51-
51+
5252
[System.IO.Directory]::CreateDirectory($ExtractPath);
53-
53+
5454
try {
5555
$zip = [System.IO.Compression.ZipFile]::OpenRead($PackagePath)
5656

5757
$zip.Entries |
5858
Where-Object {$RelevantExtensions -contains [System.IO.Path]::GetExtension($_.Name)} |
5959
ForEach-Object {
60-
$TargetFile = Join-Path -Path $ExtractPath -ChildPath $_.Name
61-
62-
[System.IO.Compression.ZipFileExtensions]::ExtractToFile($_, $TargetFile, $true)
60+
$TargetPath = Join-Path -Path $ExtractPath -ChildPath (Split-Path -Path $_.FullName)
61+
[System.IO.Directory]::CreateDirectory($TargetPath);
62+
63+
$TargetFile = Join-Path -Path $ExtractPath -ChildPath $_.FullName
64+
[System.IO.Compression.ZipFileExtensions]::ExtractToFile($_, $TargetFile)
6365
}
6466
}
6567
catch {

eng/common/templates/steps/source-build.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,3 +118,12 @@ steps:
118118
artifactName: BuildLogs_SourceBuild_${{ parameters.platform.name }}_Attempt$(System.JobAttempt)
119119
continueOnError: true
120120
condition: succeededOrFailed()
121+
122+
# Manually inject component detection so that we can ignore the source build upstream cache, which contains
123+
# a nupkg cache of input packages (a local feed).
124+
# This path must match the upstream cache path in property 'CurrentRepoSourceBuiltNupkgCacheDir'
125+
# in src\Microsoft.DotNet.Arcade.Sdk\tools\SourceBuild\SourceBuildArcade.targets
126+
- task: ComponentGovernanceComponentDetection@0
127+
displayName: Component Detection (Exclude upstream cache)
128+
inputs:
129+
ignoreDirectories: '$(Build.SourcesDirectory)/artifacts/source-build/self/src/artifacts/obj/source-built-upstream-cache'

global.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
{
22
"tools": {
3-
"dotnet": "8.0.100-preview.6.23330.14"
3+
"dotnet": "8.0.100-preview.7.23376.3"
44
},
55
"msbuild-sdks": {
6-
"Microsoft.DotNet.Arcade.Sdk": "8.0.0-beta.23371.1",
6+
"Microsoft.DotNet.Arcade.Sdk": "8.0.0-beta.23411.1",
77
"Microsoft.Build.NoTargets": "3.7.0"
88
}
99
}

0 commit comments

Comments
 (0)