tensorrt-cross-builder-libs
maintainer dbermond
· 21 votes
· base
tensorrt
· scanned 2026-08-03 00:08:14.047287
LOW
View on AUR ↗
Why flagged
The package downloads a source tarball from NVIDIA's official developer domain, which is a legitimate and expected source for TensorRT, despite the static analyzer flagging it as non-standard; the rest of the sources are from well-known repositories like GitHub, and the build process compiles the code locally without executing untrusted remote payloads.
Triggered rules
LOW
AI review downgraded a static finding
llm_review
The static rules flagged this MEDIUM, but an AI model (qwen/qwen3-235b-a22b-07-25) reviewed the full PKGBUILD and judged it LOW (confidence 95%): The package downloads a source tarball from NVIDIA's official developer domain, which is a legitimate and expected source for TensorRT, despite the static analyzer flagging it as non-standard; the rest of the sources are from well-known repositories like GitHub, and the build process compiles the code locally without executing untrusted remote payloads.
1 higher static finding superseded - not the current verdict (shown for transparency)
MEDIUM
source=() URL on a non-standard host
source_untrusted_domain
One or more source=() URLs point to a host outside the trusted allowlist (github.com, gitlab.com, codeberg.org, pypi.org, …).
-
PKGBUILD:34
source=("https://developer.nvidia.com/downloads/compute/machine-learning/tensorrt/${pkgver%.*}/tars/TensorRT-Enterprise-${pkgver}-Linux-${CARCH}-cuda-${_cudaver}-Release-external.tar.zst"
PKGBUILD
1 offending line(s) highlighted
1
# Maintainer: Daniel Bermond <dbermond@archlinux.org>
2
3
pkgbase=tensorrt
4
pkgname=(
5
'tensorrt'
6
'tensorrt-cross-builder-libs'
7
'python-tensorrt')
8
pkgver=11.0.0.114
9
_cudaver=13.2
10
_protobuf_ver=3.20.3 # https://github.com/NVIDIA/TensorRT/blob/v11.0/CMakeLists.txt#L243
11
_pybind11_ver=2.9.2
12
_onnx_graphsurgeon_ver=0.6.1
13
_polygraphy_ver=0.49.27
14
_tensorflow_quantization_ver=0.2.0
15
pkgrel=1
16
pkgdesc='A platform for high-performance deep learning inference on NVIDIA hardware'
17
arch=('x86_64')
18
url='https://developer.nvidia.com/tensorrt/'
19
license=('Apache-2.0 AND LicenseRef-TensorRT-LICENSE-AGREEMENT')
20
makedepends=(
21
'cmake'
22
'cuda'
23
'cudnn'
24
'git'
25
'nvidia-utils' # for satisfying namcap
26
'python'
27
'python-build'
28
'python-installer'
29
'python-ml-dtypes'
30
'python-onnx'
31
'python-setuptools'
32
'python-typing_extensions'
33
'python-wheel')
34
source=("https://developer.nvidia.com/downloads/compute/machine-learning/tensorrt/${pkgver%.*}/tars/TensorRT-Enterprise-${pkgver}-Linux-${CARCH}-cuda-${_cudaver}-Release-external.tar.zst"
35
"git+https://github.com/NVIDIA/TensorRT.git#tag=v$(grep -oE '[0-9]+\.[0-9]+' <<< "$pkgver" | head -n1)"
36
'git+https://github.com/protocolbuffers/protobuf.git'
37
'cub-nvlabs'::'git+https://github.com/NVlabs/cub.git'
38
'git+https://github.com/onnx/onnx-tensorrt.git'
39
'git+https://github.com/onnx/onnx.git'
40
"git+https://github.com/pybind/pybind11.git#tag=v${_pybind11_ver}"
41
"https://github.com/google/protobuf/releases/download/v${_protobuf_ver}/protobuf-cpp-${_protobuf_ver}.tar.gz"
42
'010-tensorrt-use-local-protobuf-sources.patch'
43
'020-tensorrt-fix-python.patch'
44
'TensorRT-LICENSE-AGREEMENT.txt')
45
noextract=("protobuf-cpp-${_protobuf_ver}.tar.gz")
46
sha256sums=('ba9ce9c39da5b202bf1a3653002d66fa94e9dbfe5678a1f9fb4d931e6ba5c657'
47
'569143044b73e725d263feac60f2190831b16d7fae3edf5c87a6a6e9314b87b1'
48
'SKIP'
49
'SKIP'
50
'SKIP'
51
'SKIP'
52
'afa2fc2c854d49d63e70a4a15a7939ecbd3b6042b25d0b195a673a0c2823d781'
53
'e51cc8fc496f893e2a48beb417730ab6cbcb251142ad8b2cd1951faa5c76fe3d'
54
'ba94c0685216fe9566f7989df98b372e72a8da04b66d64380024107f2f7f4a8f'
55
'1726e80937c5b4a62c8ca92c34db8d188d6ad29b58f5fd006a81bf08b9e46578'
56
'64907f271b91655a28f3c9f3555a3c645b23d878f41063192a9d2a67f752205a')
57
58
prepare() {
59
# tensorrt git submodules
60
git -C TensorRT submodule init
61
git -C TensorRT config --local submodule.parsers/onnx.url "${srcdir}/onnx-tensorrt"
62
git -C TensorRT config --local submodule.third_party/protobuf.url "${srcdir}/protobuf"
63
git -C TensorRT config --local submodule.third_party/cub.url "${srcdir}/cub-nvlabs"
64
git -C TensorRT -c protocol.file.allow='always' submodule update
65
66
# onnx-tensorrt git submodule
67
git -C TensorRT/parsers/onnx submodule init
68
git -C TensorRT/parsers/onnx config --local submodule.third_party/onnx.url "${srcdir}/onnx"
69
git -C TensorRT/parsers/onnx -c protocol.file.allow='always' submodule update
70
71
git -C TensorRT restore --source='v10.15' python/packaging/bindings_wheel/setup.{cfg,py}
72
73
# protobuf
74
mkdir -p build/third_party.protobuf/src
75
cp -af "protobuf-cpp-${_protobuf_ver}.tar.gz" build/third_party.protobuf/src
76
77
patch -d TensorRT -Np1 -i "${srcdir}/010-tensorrt-use-local-protobuf-sources.patch"
78
patch -d TensorRT -Np1 -i "${srcdir}/020-tensorrt-fix-python.patch"
79
}
80
81
build() {
82
local _cudnnver
83
_cudnnver="$(LC_ALL='C' pacman -Qi 'cudnn' | awk '/^Version/ { print $3 }' | grep -oE '^[0-9]+\.[0-9]+')"
84
85
export CXXFLAGS+=' -ffat-lto-objects'
86
cmake -B build -S TensorRT \
87
-G 'Unix Makefiles' \
88
-DBUILD_SAMPLES:BOOL='OFF' \
89
-DCMAKE_BUILD_TYPE:STRING='None' \
90
-DCMAKE_CUDA_ARCHITECTURES:STRING='75;80;86;87;89;90;100;103;110;120;121' \
91
-DCMAKE_INSTALL_PREFIX:PATH='/usr' \
92
-DCUDA_INCLUDE_DIR:STRING='/opt/cuda/include' \
93
-DCUDNN_VERSION:STRING="$_cudnnver" \
94
-DONNX_BUILD_PYTHON:BOOL='ON' \
95
-DPROTOBUF_VERSION:STRING="$_protobuf_ver" \
96
-DTRT_LIB_DIR:STRING="${srcdir}/TensorRT-${pkgver}/lib" \
97
-Wno-dev
98
cmake --build build
99
100
# python bindings
101
local _pyver
102
_pyver="$(python -c 'import sys; print("%s.%s" %sys.version_info[:2])')"
103
local -x TENSORRT_MODULE='tensorrt'
104
local -x PYTHON_MAJOR_VERSION="${_pyver%%.*}"
105
local -x PYTHON_MINOR_VERSION="${_pyver#*.}"
106
local -x TARGET_ARCHITECTURE="$CARCH"
107
local -x TRT_OSSPATH="${srcdir}/TensorRT"
108
local -x CUDA_ROOT='/opt/cuda'
109
local -x ROOT_PATH="${srcdir}/TensorRT"
110
local -x EXT_PATH="$srcdir"
111
local -x TRT_LIBPATH="${srcdir}/TensorRT-${pkgver}/lib"
112
cd TensorRT/python
113
../scripts/build_python_wheel.sh
114
mv build build_tensorrt
115
TENSORRT_MODULE='tensorrt_dispatch'
116
../scripts/build_python_wheel.sh
117
mv build build_tensorrt_dispatch
118
TENSORRT_MODULE='tensorrt_lean'
119
../scripts/build_python_wheel.sh
120
mv build build_tensorrt_lean
121
122
# python tools
123
local _dir
124
for _dir in Polygraphy tensorflow-quantization onnx-graphsurgeon
125
do
126
cd "${srcdir}/TensorRT/tools/${_dir}"
127
python -m build --wheel --no-isolation
128
done
129
}
130
131
_package_license() {
132
install -D -m644 TensorRT/NOTICE -t "${1}/usr/share/licenses/${2}"
133
install -D -m644 TensorRT-LICENSE-AGREEMENT.txt "${1}/usr/share/licenses/${2}/TensorRT-LICENSE-AGREEMENT"
134
install -D -m644 "TensorRT-${pkgver}/doc/Acknowledgements.txt" "${1}/usr/share/licenses/${2}/ACKNOWLEDGEMENTS"
135
}
136
137
package_tensorrt() {
138
depends=(
139
'cuda'
140
'cudnn'
141
'glibc'
142
'libgcc'
143
'libstdc++'
144
'nvidia-utils')
145
optdepends=(
146
'tensorrt-cross-builder-libs: for cross building engine files')
147
148
DESTDIR="$pkgdir" cmake --install build
149
install -D -m755 "TensorRT-${pkgver}/bin"/* -t "${pkgdir}/usr/bin"
150
install -D -m644 build/libnvinfer_plugin_static.a -t "${pkgdir}/usr/lib"
151
cp -dr --no-preserve='ownership' "TensorRT-${pkgver}/include" "${pkgdir}/usr"
152
cp -dr --no-preserve='ownership' "TensorRT-${pkgver}/lib"/lib{nvinfer{,_dispatch,_lean},tensorrt_shim}.so* "${pkgdir}/usr/lib"
153
154
local _arch
155
for _arch in ptx sm{75,80,86,89,90,100,120}
156
do
157
install -D -m644 "TensorRT-${pkgver}/lib/libnvinfer_builder_resource_${_arch}.so.${pkgver%.*}" -t "${pkgdir}/usr/lib"
158
ln -s "libnvinfer_builder_resource_${_arch}.so.${pkgver%.*}" "${pkgdir}/usr/lib/libnvinfer_builder_resource_${_arch}.so.${pkgver%%.*}"
159
ln -s "libnvinfer_builder_resource_${_arch}.so.${pkgver%%.*}" "${pkgdir}/usr/lib/libnvinfer_builder_resource_${_arch}.so"
160
done
161
162
_package_license "$pkgdir" "$pkgname"
163
}
164
165
package_tensorrt-cross-builder-libs() {
166
pkgdesc='Additional TensorRT libraries for cross building engine files'
167
license=('LicenseRef-TensorRT-LICENSE-AGREEMENT')
168
depends=(
169
'glibc'
170
'libgcc'
171
'libstdc++')
172
options=('!strip')
173
174
local _arch
175
for _arch in ptx sm{75,80,86,89,90,100,120}
176
do
177
install -D -m644 "TensorRT-${pkgver}/lib/libnvinfer_builder_resource_win_${_arch}.so.${pkgver%.*}" -t "${pkgdir}/usr/lib"
178
ln -s "libnvinfer_builder_resource_win_${_arch}.so.${pkgver%.*}" "${pkgdir}/usr/lib/libnvinfer_builder_resource_win_${_arch}.so.${pkgver%%.*}"
179
ln -s "libnvinfer_builder_resource_win_${_arch}.so.${pkgver%%.*}" "${pkgdir}/usr/lib/libnvinfer_builder_resource_win_${_arch}.so"
180
done
181
182
_package_license "$pkgdir" "$pkgname"
183
}
184
185
package_python-tensorrt() {
186
pkgdesc+=' (python bindings and tools)'
187
license=("${license[0]} AND LicenseRef-Python-TensorRT-LICENSE-AGREEMENT")
188
depends=(
189
'glibc'
190
'libgcc'
191
'libstdc++'
192
'python'
193
'python-numpy'
194
'tensorrt')
195
optdepends=(
196
'python-colored: for onnx_graphsurgeon and polygraphy python modules'
197
'python-ml-dtypes: for onnx_graphsurgeon python module'
198
'python-onnx: for onnx_graphsurgeon python module'
199
'python-onnxruntime: for onnx_graphsurgeon python module'
200
'python-protobuf: for polygraphy python module'
201
'python-pytorch: for polygraphy python module'
202
'python-tensorflow-cuda: for polygraphy and tensorflow-quantization python modules'
203
'python-tf2onnx: for tensorflow-quantization python module')
204
provides=(
205
"python-onnx-graphsurgeon=${_onnx_graphsurgeon_ver}"
206
"python-polygraphy=${_polygraphy_ver}"
207
"python-tensorflow-quantization=${_tensorflow_quantization_ver}")
208
209
local _dir
210
for _dir in tensorrt{,_dispatch,_lean}
211
do
212
python -m installer --destdir="$pkgdir" "TensorRT/python/build_${_dir}/bindings_wheel/dist"/*.whl
213
done
214
215
for _dir in Polygraphy tensorflow-quantization onnx-graphsurgeon
216
do
217
python -m installer --destdir="$pkgdir" "TensorRT/tools/${_dir}/dist"/*.whl
218
done
219
220
_package_license "$pkgdir" "$pkgname"
221
222
local _sitepkgs
223
_sitepkgs="$(python -c 'import site; print(site.getsitepackages()[0])')"
224
ln -sr "${pkgdir}${_sitepkgs}/tensorrt-${pkgver%.*}.dist-info/licenses/LICENSE.txt" \
225
"${pkgdir}/usr/share/licenses/${pkgname}/Python-TensorRT-LICENSE-AGREEMENT"
226
}
227
Scan history
| Scanned at (UTC) | Severity | Rules |
|---|---|---|
| 2026-08-03 00:08:14 | LOW | 2 |
| 2026-08-02 00:16:08 | LOW | 2 |
| 2026-08-01 00:11:18 | LOW | 2 |
| 2026-07-31 00:14:10 | LOW | 2 |
| 2026-07-30 00:17:23 | LOW | 2 |
| 2026-07-29 00:25:53 | LOW | 2 |
| 2026-07-28 00:07:28 | LOW | 2 |
| 2026-07-27 00:24:32 | LOW | 2 |
| 2026-07-26 00:07:32 | LOW | 2 |
| 2026-07-25 00:13:44 | LOW | 2 |
| 2026-07-24 00:02:28 | LOW | 2 |
| 2026-07-23 00:14:47 | LOW | 2 |
| 2026-07-22 00:29:32 | LOW | 2 |
| 2026-07-21 00:24:15 | LOW | 2 |
| 2026-07-20 00:19:49 | LOW | 2 |
| 2026-07-19 00:17:08 | LOW | 2 |
| 2026-07-18 00:14:48 | LOW | 2 |
| 2026-07-17 00:06:16 | LOW | 2 |
| 2026-07-16 00:05:41 | LOW | 2 |
| 2026-07-15 00:09:25 | LOW | 2 |