dotnet-azure-core
LOW
maintainer ChrisTX
0 votes
scanned 2026-10-31 05:57:59.662655
Why flagged
Uploaded within the last 14 days with 2 or fewer community votes — little peer review so far.
Triggered rules
Low
Few votes, recently uploaded
zero_votes_recent
Uploaded within the last 14 days with 2 or fewer community votes — little peer review so far.
PKGBUILD
1
# Maintainer: Christian Pfeiffer <cpfeiffer at rev-crew dot info>
2
# shellcheck disable=SC2034,SC2154
3
# shellcheck shell=bash
4
5
pkgname=dotnet-azure-core
6
_nugetid=Azure.Core
7
pkgver=1.64.0
8
pkgrel=1
9
pkgdesc="Shared primitives, abstractions and helpers for .NET Azure SDK client libraries, Azure.Core (NuGet package)"
10
arch=('any')
11
url='https://github.com/Azure/azure-sdk-for-net'
12
license=('MIT')
13
_dotnetsdkver="10.0"
14
makedepends=(
15
dotnet-microsoft-identity-client
16
dotnet-sdk-"$_dotnetsdkver"
17
dotnet-system-clientmodel
18
git
19
jq
20
)
21
# The commit the package was published from (tag Azure.Core_1.64.0), and the official build of it,
22
# see the file version 1.6400.26.52605 of its assemblies (encoding the date and build number)
23
_commit="254a1b693af968afee40958e77d0762b44a1b13c"
24
_officialbuildid="20261026.5"
25
# The recordings the tests play back, which upstream keeps in a separate repository, see
26
# sdk/core/Azure.Core/assets.json
27
_assetscommit="3adf93d405a7f3fcb2f99fe9dd519fa4d86eb480"
28
source=("azure-sdk-for-net-$_commit.tar.gz::$url/archive/$_commit.tar.gz"
29
"azure-sdk-assets-$_assetscommit.tar.gz::https://github.com/Azure/azure-sdk-assets/archive/$_assetscommit.tar.gz"
30
"azure-core-tests-no-broker.patch")
31
sha512sums=('8392aaf82ef21544a9eae17501eaff12085fbd5f3d70bb3d4854b01a30cbaf66340e64eb83819b19cce5256638459075f7b650cc33e07887d3561d123edc4abe'
32
'05c66fd5fd5ec24b7dee5642c9ec7aaaf871d7ff92c6790ad997bac591c1526b173623fe125a0188c221c53ee947e6881036d3bae63fc551f0ad2f8e0cd21485'
33
'9821a7e046bbf11c4bc1e2e065d26a23c45fa946902efa0b3b046f861e05b1aa0463f8b0ea721d39ce15bb90627bd6d00e858bff4a26b414a77d86646a4648d3')
34
b2sums=('1045e4f6a071a58fd858cb44212bd25c308fcdc391667f25e9b68f51b62b3ceec13411fb6957c3f9c37127f2b7d60cc23d6dae0d7f547eabe2896dea8e3cbeba'
35
'ed564f1dc84dfbdd2b47b51b428d9a23115fd052cd64eb42a0211543da022b568dae2359cf6b755f9d35987a4d58a3a63570b1a7231a68996c92302c66618eae'
36
'b4c5b6b0e9ea0b8c58b876875a8a54c78a0bb628bcc756580b3eaf583870c4c0030e13d686e453ceefb09e17c11448a4db97e2c71352e995ad94b23a65539099')
37
38
_dotnet_env() {
39
export NUGET_PACKAGES="$srcdir/nuget"
40
export DOTNET_CLI_HOME="$srcdir/dotnet-home"
41
export DOTNET_CLI_TELEMETRY_OPTOUT=1
42
export DOTNET_NOLOGO=1
43
44
# The checks of the API listing, the analyzers and API compatibility with the previous release
45
# (from nuget.org) don't change the build. Source Link needs git, so the repository information is
46
# passed in. The packages from the source-built artifacts and the system feed are newer than the
47
# versions referenced (NU1603).
48
_build_arguments=(
49
--configuration Release
50
-p:GenerateAPIListing=false
51
-p:EnableClientSdkAnalyzers=false
52
-p:EnableMicrosoftCodeAnalysisNetAnalyzers=false
53
-p:EnableBannedApiAnalyzers=false
54
-p:EnableStyleCopAnalyzers=false
55
-p:RunApiCompat=false
56
-p:ValidateRunApiCompat=false
57
-p:ApiCompatVersion=
58
-p:EnableSourceLink=false
59
-p:SourceRevisionId="$_commit"
60
-p:RepositoryCommit="$_commit"
61
-p:RepositoryUrl="$url"
62
-p:SkipDevBuildNumber=true
63
-p:WarningsNotAsErrors=NU1603
64
)
65
}
66
67
# .NET runtime packages Azure.Core is built against
68
_runtimepackages=(
69
Microsoft.Bcl.AsyncInterfaces
70
Microsoft.Extensions.Configuration.Abstractions
71
Microsoft.Extensions.DependencyInjection.Abstractions
72
Microsoft.Extensions.Diagnostics.Abstractions
73
Microsoft.Extensions.FileProviders.Abstractions
74
Microsoft.Extensions.Hosting.Abstractions
75
Microsoft.Extensions.Logging.Abstractions
76
Microsoft.Extensions.Options
77
Microsoft.Extensions.Primitives
78
Microsoft.IdentityModel.Abstractions
79
System.Diagnostics.DiagnosticSource
80
System.IO.Pipelines
81
System.Memory.Data
82
System.Net.ServerSentEvents
83
System.Text.Encodings.Web
84
System.Text.Json
85
)
86
87
# Packages built from source by other packages (makedepends), in the system feed
88
_systempackages=(
89
Microsoft.Identity.Client
90
Microsoft.Identity.Client.Extensions.Msal
91
System.ClientModel
92
)
93
94
# Writes NuGet.config with the feed $1 (as key=url) for everything but the packages of the system
95
# feed and the runtime packages, which are taken from the source-built artifacts if prepare() found
96
# them there
97
_nuget_config() {
98
local _package
99
{
100
cat <<EOF
101
<?xml version="1.0" encoding="utf-8"?>
102
<configuration>
103
<packageSources>
104
<clear />
105
<add key="dotnet-system" value="/usr/share/dotnet/nuget-packages" />
106
<add key="dotnet-source-built" value="$srcdir/nuget-local" />
107
<add key="${1%%=*}" value="${1#*=}" />
108
</packageSources>
109
<packageSourceMapping>
110
<clear />
111
<packageSource key="dotnet-system">
112
EOF
113
for _package in "${_systempackages[@]}"; do
114
echo " <package pattern=\"$_package\" />"
115
done
116
echo ' </packageSource>'
117
if [[ -f "$srcdir/runtime-packages" ]]; then
118
echo ' <packageSource key="dotnet-source-built">'
119
for _package in "${_runtimepackages[@]}"; do
120
echo " <package pattern=\"$_package\" />"
121
done
122
echo ' </packageSource>'
123
fi
124
cat <<EOF
125
<packageSource key="${1%%=*}">
126
<package pattern="*" />
127
</packageSource>
128
</packageSourceMapping>
129
</configuration>
130
EOF
131
} >NuGet.Config
132
}
133
134
prepare() {
135
# The runtime packages are part of the source-built .NET of Arch Linux
136
# (dotnet-source-built-artifacts), which Arch Linux ARM doesn't have. It can't be a makedepends of
137
# an arch=any package, so it's used when it's installed, and they come from nuget.org otherwise.
138
mkdir -p nuget-local
139
local _artifacts
140
for _artifacts in /usr/share/dotnet/source-built-artifacts/Private.SourceBuilt.Artifacts.*.tar.gz; do
141
[[ -f "$_artifacts" ]] || continue
142
bsdtar -xf "$_artifacts" -C nuget-local "${_runtimepackages[@]/%/.*.nupkg}"
143
touch runtime-packages
144
done
145
146
# Upstream builds with a newer feature band of the .NET SDK, which isn't needed. dotnet only works
147
# outside the repository until its global.json is updated.
148
local _sdkver
149
_sdkver=$(dotnet --version)
150
151
cd "azure-sdk-for-net-$_commit" || exit
152
# Upstream's NuGet.Config, which has the feed the tests need
153
mv NuGet.Config NuGet.Config.upstream
154
jq --arg sdk "$_sdkver" '.sdk.version = $sdk | .sdk.rollForward = "latestPatch"' global.json >global.json.new
155
mv global.json.new global.json
156
# Release builds have to check the API listing, which is turned off above
157
sed -i '/<Target Name="_CheckGenerateAPIListingValue"/,/<\/Target>/d' eng/ApiListing.targets
158
159
# The test framework references Azure.Identity.Broker since upstream's PR #57407, so tests that
160
# expect no broker sign in through the browser and wait for it, see
161
# https://github.com/Azure/azure-sdk-for-net/issues/58160. It references Azure.Core like before.
162
patch -Np1 -i "$srcdir/azure-core-tests-no-broker.patch"
163
# The test proxy would get the recordings with git, from the git repository it finds above the
164
# sources, so it gets them from the sources instead, in their own repository
165
cp -r "$srcdir/azure-sdk-assets-$_assetscommit/net/sdk/core/$_nugetid/tests/SessionRecords" "sdk/core/$_nugetid/tests/"
166
rm "sdk/core/$_nugetid/assets.json"
167
git init --quiet .
168
}
169
170
build() {
171
_dotnet_env
172
cd "azure-sdk-for-net-$_commit" || exit
173
# Version and frameworks as in the official build, the .NET Framework ones against the reference
174
# assemblies from nuget.org. The assemblies are public signed with Microsoft's key, giving them the
175
# same strong names as upstream's.
176
_nuget_config "nuget.org=https://api.nuget.org/v3/index.json"
177
dotnet pack "sdk/core/$_nugetid/src/$_nugetid.csproj" "${_build_arguments[@]}" \
178
-p:OfficialBuildId="$_officialbuildid" --output "$srcdir/nupkg"
179
}
180
181
check() {
182
_dotnet_env
183
cd "azure-sdk-for-net-$_commit" || exit
184
# The tests need packages from the feed upstream uses, which mirrors nuget.org
185
local _feed
186
_feed=$(sed -n -E 's|.*<add key="([^"]+)" value="(https[^"]+)".*|\1=\2|p' NuGet.Config.upstream)
187
_nuget_config "$_feed"
188
# Like upstream's CI (eng/pipelines/templates/jobs/ci.tests.yml), without the tests that need user
189
# interaction or Azure. Only on the .NET runtime that's installed, the tests target older ones, too.
190
# Without a display and browser, so a test that would sign in interactively can't open sign-in
191
# pages, and failing instead of waiting for the sign-in.
192
local _result=0
193
env -u DISPLAY -u WAYLAND_DISPLAY BROWSER=false \
194
dotnet test "sdk/core/$_nugetid/tests/$_nugetid.Tests.csproj" "${_build_arguments[@]}" --framework net10.0 \
195
--filter 'TestCategory!=Manually&TestCategory!=Live' --blame-hang-timeout 10m --blame-hang-dump-type none ||
196
_result=$?
197
# The test framework only stops the test proxy it starts on Windows
198
pkill -f "^/usr/bin/dotnet $srcdir/nuget/azure.sdk.tools.testproxy/" || true
199
return "$_result"
200
}
201
202
# Fails if a binary in $pkgdir, also inside the .nupkg files there, is identical to one of the packages
203
# restored from a remote feed like nuget.org into $1, so no prebuilt binary slips in instead of one built
204
# from source
205
_check_prebuilt() {
206
local _extracted="$srcdir/check-prebuilt" _metadata _file _hash _found=0
207
local _binaries=(-type f '(' -name '*.dll' -o -name '*.exe' -o -name '*.so' -o -name '*.so.*' -o -name '*.dylib' ')')
208
local -A _prebuilt=()
209
while IFS= read -r -d '' _metadata; do
210
grep -qE '"source": *"https?://' "$_metadata" || continue
211
while IFS= read -r -d '' _file; do
212
_prebuilt[$(sha256sum <"$_file")]="${_file#"$1"/}"
213
done < <(find "${_metadata%/*}" "${_binaries[@]}" -print0)
214
done < <(find "$1" -name .nupkg.metadata -print0)
215
216
rm -rf "$_extracted"
217
mkdir -p "$_extracted"
218
while IFS= read -r -d '' _file; do
219
mkdir -p "$_extracted/${_file#"$pkgdir"/}"
220
bsdtar -xf "$_file" -C "$_extracted/${_file#"$pkgdir"/}"
221
done < <(find "$pkgdir" -type f -name '*.nupkg' -print0)
222
while IFS= read -r -d '' _file; do
223
_hash=$(sha256sum <"$_file")
224
if [[ -v "_prebuilt[$_hash]" ]]; then
225
echo "Prebuilt binary: ${_file#"$_extracted"/} is ${_prebuilt[$_hash]}" >&2
226
_found=1
227
fi
228
done < <(find "$pkgdir" "$_extracted" "${_binaries[@]}" -print0)
229
rm -rf "$_extracted"
230
return "$_found"
231
}
232
233
package() {
234
install -Dm644 "$srcdir/nupkg/$_nugetid.$pkgver.nupkg" -t "$pkgdir/usr/share/dotnet/nuget-packages/"
235
install -Dm644 "azure-sdk-for-net-$_commit/LICENSE.txt" -t "$pkgdir/usr/share/licenses/$pkgname/"
236
237
_check_prebuilt "$srcdir/nuget"
238
}
239
Scan history
| Scanned at (UTC) | Severity | Rules |
|---|---|---|
| 2026-10-31 05:57:59 | Low | 1 |