dotnet-system-io-ports-native-debug

CLEAN
maintainer ChrisTX 0 votes base dotnet-system-io-ports-native scanned 2026-11-02 00:26:00.633185
View on AUR

Triggered rules

Clean AI review downgraded a static finding llm_review

The static rules flagged this LOW, but an AI model (qwen/qwen3-235b-a22b-2507) reviewed the full PKGBUILD and judged it CLEAN (confidence 95%): The package builds a native .NET library from official dotnet/runtime source code, uses standard build tooling, and produces a NuGet package and debug symbols; no remote code execution, obfuscation, or untrusted dependencies are present.

1 higher static finding superseded - not the current verdict (shown for transparency)
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
5pkgbase=dotnet-system-io-ports-native
6pkgname=(dotnet-system-io-ports-native dotnet-system-io-ports-native-debug)
7pkgver=10.0.14
8pkgrel=3
9pkgdesc="Native library of System.IO.Ports for .NET on Linux, runtime.linux-*.runtime.native.System.IO.Ports (NuGet package)"
10arch=('x86_64' 'aarch64')
11url='https://github.com/dotnet/runtime'
12license=('MIT')
13_dotnetsdkver="10.0"
14makedepends=(
15 dotnet-sdk-"$_dotnetsdkver"
16 clang
17 cmake
18 lld
19)
20checkdepends=(python)
21# The library only ends up in $pkgdir inside the NuGet package, where makepkg can't strip it or split off its
22# debug information, so its debug package would be empty. The runtime's build does both itself, and
23# dotnet-system-io-ports-native-debug ships the debug information (see package_*-debug()).
24options=('!debug')
25# The runtime commit of the .NET release, from src/source-manifest.json of the dotnet/dotnet commit the
26# 10.0.14 packages were published from (0427b9abbead3fa64c6655eb4290c537397131fa); the same commit as
27# 10.0.13, 10.0.14 brought no runtime changes. The library isn't part of the source-built .NET of Arch
28# Linux, so it's built for its version here.
29_commit="6aa72daa24f66c01c3d7b6a32519e9d21396deec"
30# Where ./aur commits reads it from on upgrade, the native pack carries no repository commit on NuGet
31_commit_lookup() {
32 curl -fsSL "https://raw.githubusercontent.com/dotnet/dotnet/v$pkgver/src/source-manifest.json" |
33 jq -r '.repositories[] | select(.path == "runtime") | .commitSha'
34}
35# The tarball of the commit, only the native sources are used
36source=("runtime-$_commit.tar.gz::$url/archive/$_commit.tar.gz"
37 "check-serial.py")
38sha512sums=('58c92aaa08d3f8ff4af9eb2c75b0d1559d62c23b6043d534e8bcb5cfb371446e5ceb0dd49dc9d11bfb3a8adfc4e66d78bd79c7af84661cffa2d51909fdda5e82'
39 '52fccbac017ec1eb19d7b970aa3f28606986182eef0fdb84436d139399a4e7cc2ce77d74e03f738db1ab2c7bc7334e0a15811a938a7dd4860889bad4bc9b94e9')
40b2sums=('993176a52c72dd0ba44d76c08ee72ff926e688c8bb9b9121c4fbbbbfe92286ae51516ec6d4ac37ebc4f09670fb7d027719012c6b513251c1166434c260cee914'
41 '91c610080cc18e001e4559b7bda582d7fd9b31186d932a183a4f3805490b88ffab0345967c18b6d181e235b9603da6769c0d0773dde77b2693a471d179c0522b')
42
43# The runtime's name of the architecture, and the portable RID the NuGet package is for
44_arch() {
45 case "$CARCH" in
46 x86_64) echo x64 ;;
47 aarch64) echo arm64 ;;
48 esac
49}
50
51# The configuration of the runtime's native build, and the build folder of the library in it (relative to
52# $srcdir)
53_outconfig() {
54 echo "net$_dotnetsdkver-linux-Release-$(_arch)"
55}
56_objdir() {
57 echo "runtime-$_commit/artifacts/obj/native/$(_outconfig)/System.IO.Ports.Native"
58}
59
60# Where the debug package has the sources, as in makepkg's debug packages
61_dbgsrcdir() {
62 echo "${DBGSRCDIR:-/usr/src/debug}/$pkgbase"
63}
64
65prepare() {
66 local _nugetid
67 _nugetid="runtime.linux-$(_arch).runtime.native.System.IO.Ports"
68 mkdir -p nupkg-src
69 cat >nupkg-src/pack.csproj <<EOF
70<Project Sdk="Microsoft.NET.Sdk">
71 <PropertyGroup>
72 <TargetFramework>net$_dotnetsdkver</TargetFramework>
73 <IncludeBuildOutput>false</IncludeBuildOutput>
74 <NuspecFile>$_nugetid.nuspec</NuspecFile>
75 </PropertyGroup>
76</Project>
77EOF
78 # Like upstream's package, minus the empty placeholders for the other platforms
79 cat >"nupkg-src/$_nugetid.nuspec" <<EOF
80<?xml version="1.0" encoding="utf-8"?>
81<package xmlns="http://schemas.microsoft.com/packaging/2013/05/nuspec.xsd">
82 <metadata>
83 <id>$_nugetid</id>
84 <version>$pkgver</version>
85 <authors>Microsoft</authors>
86 <license type="expression">MIT</license>
87 <projectUrl>https://dot.net/</projectUrl>
88 <description>Internal implementation package not meant for direct consumption. Please do not reference directly.</description>
89 <repository type="git" url="$url" commit="$_commit" />
90 </metadata>
91 <files>
92 <file src="libSystem.IO.Ports.Native.so" target="runtimes/linux-$(_arch)/native" />
93 </files>
94</package>
95EOF
96}
97
98build() {
99 cd "runtime-$_commit" || exit
100 # Configure the runtime's native libraries like upstream, but only build this one. After linking, the
101 # build splits the debug information off into libSystem.IO.Ports.Native.so.dbg and strips the library
102 # (with llvm-objcopy, from llvm, a dependency of clang).
103 local _crossargs=()
104 # A cross build ($CARCH differs from the build host) compiles with clang against the C library and GCC of
105 # a root file system for $CARCH with base-devel, e.g. the Arch Linux ARM one of the native aarch64 build,
106 # which the runtime's cross toolchain (eng/common/cross/toolchain.cmake) takes from ROOTFS_DIR. Its
107 # default GNU triple is Debian's (aarch64-linux-gnu), TOOLCHAIN overrides it. The build takes CFLAGS, so
108 # makepkg needs a configuration for $CARCH (e.g. makepkg --config), as for setting $CARCH.
109 if [[ "$(uname -m)" != "$CARCH" ]]; then
110 if [[ ! -d "${ROOTFS_DIR:-}" ]]; then
111 echo "dotnet-system-io-ports-native: a cross build needs ROOTFS_DIR set to a $CARCH root file system" >&2
112 exit 1
113 fi
114 if [[ -z "${TOOLCHAIN:-}" && -d "$ROOTFS_DIR/usr/lib/gcc/$CARCH-unknown-linux-gnu" ]]; then
115 export TOOLCHAIN="$CARCH-unknown-linux-gnu"
116 fi
117 _crossargs=(-cross)
118 fi
119 # The debug information refers to the sources where the debug package has them, like makepkg does with
120 # its debug option, which also keeps the build directory out of the library (and its build ID)
121 CFLAGS+=" -ffile-prefix-map=$srcdir=$(_dbgsrcdir)"
122 ./src/native/libs/build-native.sh -release -arch "$(_arch)" -outconfig "$(_outconfig)" -configureonly "${_crossargs[@]}"
123 cmake --build "artifacts/obj/native/$(_outconfig)" --target System.IO.Ports.Native
124 install -Dm755 "$srcdir/$(_objdir)/libSystem.IO.Ports.Native.so" -t "$srcdir/nupkg-src/"
125
126 cd "$srcdir/nupkg-src" || exit
127 DOTNET_CLI_HOME="$srcdir/dotnet-home" DOTNET_CLI_TELEMETRY_OPTOUT=1 DOTNET_NOLOGO=1 NUGET_PACKAGES="$srcdir/nuget" \
128 dotnet pack pack.csproj --output "$srcdir/nupkg"
129}
130
131check() {
132 # The test loads the library, which on a cross build is for another architecture and can't run here.
133 # Run it natively on the target instead.
134 if [[ "$(uname -m)" != "$CARCH" ]]; then
135 echo 'dotnet-system-io-ports-native: skipping the test on a cross build; run it natively on the target' >&2
136 return 0
137 fi
138 # The tests of System.IO.Ports need serial ports, drive a pseudo-terminal with the library instead
139 python -I check-serial.py "$srcdir/nupkg-src/libSystem.IO.Ports.Native.so"
140}
141
142package_dotnet-system-io-ports-native() {
143 # With the packages of the .NET build it belongs to, apart from libraries built from other sources
144 install -Dm644 "$srcdir/nupkg/runtime.linux-$(_arch).runtime.native.System.IO.Ports.$pkgver.nupkg" \
145 -t "$pkgdir/usr/share/nuget/dotnet-$_dotnetsdkver/packages/"
146 install -Dm644 "runtime-$_commit/LICENSE.TXT" -t "$pkgdir/usr/share/licenses/$pkgbase/"
147}
148
149# The debug information of the library, under its build ID, where debuggers find it for every copy of the
150# library: the one in the NuGet package, and the ones applications ship, e.g. in $PSHOME of powershell
151package_dotnet-system-io-ports-native-debug() {
152 pkgdesc="Detached debugging symbols for dotnet-system-io-ports-native"
153 # makepkg would strip the debug information itself
154 options=('!strip')
155 local _dbg _buildid _file
156 _dbg="$(_objdir)/libSystem.IO.Ports.Native.so.dbg"
157 _buildid=$(LANG=C readelf -n "$_dbg" | sed -n '/Build ID/ { s/.*: //p; q; }')
158 install -Dm644 "$_dbg" "$pkgdir/usr/lib/debug/.build-id/${_buildid:0:2}/${_buildid:2}.debug"
159 # The sources it refers to, which build() mapped to $(_dbgsrcdir); the list is relative to that
160 while IFS= read -r -d '' _file; do
161 if [[ -f "$srcdir/$_file" ]]; then
162 install -Dm644 "$srcdir/$_file" "$pkgdir$(_dbgsrcdir)/$_file"
163 fi
164 done < <(LANG=C debugedit --no-recompute-build-id --base-dir "$(_dbgsrcdir)" --list-file /dev/stdout "$_dbg" | sort -zu)
165 install -Dm644 "runtime-$_commit/LICENSE.TXT" -t "$pkgdir/usr/share/licenses/$pkgbase-debug/"
166}
167

Scan history

Scanned at (UTC)SeverityRules
2026-11-02 00:26:00 Clean 2
2026-11-02 00:02:06 Low 1
2026-11-01 22:01:45 Low 1

Report a package

Reports go to the AURWatch maintainer (one person) and are read by hand. No login required.

0 / 4000
Your suggestion