tensorflow-computecpp

maintainer orphaned · 0 votes · scanned 2026-08-03 00:08:14.047287
MEDIUM
View on AUR ↗
Why flagged The PKGBUILD downloads a prebuilt Bazel binary package (bazel-0.17.2-1-x86_64.pkg.tar.xz) from archive.org rather than from the official Arch Linux mirrors or the official Bazel release page. This binary is then extracted and placed on PATH (export PATH="${srcdir}/usr/bin:$PATH") and executed to build TensorFlow. archive.org is a content-addressable archive but it is not an official distribution channel for Arch Linux packages — the content at that URL could have been uploaded by anyone and could be replaced or tampered with. The sha256sum is provided (758e10...) which mitigates but does not eliminate the risk, since the hash itself was written by the maintainer and could have been set to match a malicious binary. This is a classic supply-chain concern: an executed binary from a non-official, non-vendor host. The pip install of a wheel built from that binary chain is also executed at package time. The 'broken' flag is not warranted as the PKGBUILD appears structurally functional. This is a genuine medium-severity supply-chain risk, consistent with the cheaper model's assessment.

Triggered rules

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:18 "https://archive.org/download/archlinux_pkg_bazel/bazel-0.17.2-1-x86_64.pkg.tar.xz"
MEDIUM AI review llm_review

An AI model (anthropic/claude-4.6-sonnet-20260217) reviewed this and agrees it is MEDIUM (confidence 75%): The PKGBUILD downloads a prebuilt Bazel binary package (bazel-0.17.2-1-x86_64.pkg.tar.xz) from archive.org rather than from the official Arch Linux mirrors or the official Bazel release page. This binary is then extracted and placed on PATH (export PATH="${srcdir}/usr/bin:$PATH") and executed to build TensorFlow. archive.org is a content-addressable archive but it is not an official distribution channel for Arch Linux packages — the content at that URL could have been uploaded by anyone and could be replaced or tampered with. The sha256sum is provided (758e10...) which mitigates but does not eliminate the risk, since the hash itself was written by the maintainer and could have been set to match a malicious binary. This is a classic supply-chain concern: an executed binary from a non-official, non-vendor host. The pip install of a wheel built from that binary chain is also executed at package time. The 'broken' flag is not warranted as the PKGBUILD appears structurally functional. This is a genuine medium-severity supply-chain risk, consistent with the cheaper model's assessment.

  • PKGBUILD:131 pip install --ignore-installed --upgrade --root "$pkgdir" $WHEEL_PACKAGE --no-dependencies --no-warn-script-location

PKGBUILD

2 offending line(s) highlighted
1# Maintainer: enihcam <nanericwang at the google email domain which is .com>
2
3pkgbase=tensorflow-computecpp
4pkgname=(tensorflow-computecpp python-tensorflow-computecpp)
5pkgver=1.9
6pkgrel=8
7pkgdesc="Library for computation using data flow graphs for scalable machine learning (backend with ComputeCpp)"
8url="https://github.com/codeplaysoftware/tensorflow"
9epoch=1
10license=('APACHE')
11arch=('x86_64')
12depends=(opencl-icd-loader computecpp)
13makedepends=(git opencl-icd-loader computecpp cmake opencl-headers
14 python-numpy python-pip python-wheel python-setuptools java-environment=8)
15options=(!ccache)
16source=("git+${url}"
17 #"https://github.com/bazelbuild/bazel/releases/download/0.17.2/bazel-0.17.2-dist.zip"
18 "https://archive.org/download/archlinux_pkg_bazel/bazel-0.17.2-1-x86_64.pkg.tar.xz"
19 python37.patch
20 py37.diff
21 gcc1.diff
22 gcc2.diff
23 gcc3.diff
24 python38.patch
25 gcc10.patch
26 numpy.diff
27 python310.diff
28 python310or.patch)
29sha256sums=('SKIP'
30 '758e10caff4c1cb496d1cf49d6f4da2969b610b174276fb734b8502686d07ddd'
31 'ef54b3783a05b5604cd8f448136567686806ad3a5759978f48549256807a8394'
32 'b3997091bc7a32f9e8c062a88e9148273090ebf66aeebb5dc055baa41b7aae7e'
33 '7d9f32a46cac83ec1a7308ac380226cdf40f98830c869bcdf5feb7bf110abf9a'
34 '10de738141852cfebae9847b746ae9b58f3b3985561cccede929d8fbdba93551'
35 '742abe5d8bfd3f7ce33778a08cbb233337db56238d11ac2ad07171b0d6097bfb'
36 'b69895cfd098efacc95b1d1fffd471afa05c449f8d42964ee10b1a6fd9a75689'
37 '15c20b31394537051f8756707819e13f3c12da24d8aa63d3ba47e6fce4d19d95'
38 'fe4c34a66000ba3a24d7c35914dc22e95adb5efa60a58d1f0b3d3cad77fd722d'
39 '16bbc9d5cfd7e3888a7bda73ac4ebaab5c9c2588632eac342917f7cec745db9a'
40 '7fe63476cb7b2dfe359f8ae3d894869f2329c399c6611a52449cd5dcd6f67098')
41
42prepare() {
43 # These environment variables influence the behavior of the configure call below.
44 export PYTHON_BIN_PATH=/usr/bin/python
45 export USE_DEFAULT_PYTHON_LIB_PATH=1
46 export TF_DOWNLOAD_CLANG=0
47 export TF_CUDA_CLANG=0
48 export TF_NEED_CUDA=0
49 export TF_NEED_JEMALLOC=0
50 export TF_NEED_GCP=0
51 export TF_NEED_HDFS=0
52 export TF_ENABLE_XLA=0
53 export TF_NEED_GDR=0
54 export TF_NEED_VERBS=0
55 export TF_NEED_MPI=0
56 export TF_NEED_S3=0
57 export TF_NEED_KAFKA=0
58 export TF_NEED_TENSORRT=0
59 export TF_SET_ANDROID_WORKSPACE=0
60 export TF_NEED_OPENCL=1
61 export TF_NEED_OPENCL_SYCL=1
62 export TF_NEED_COMPUTECPP=1
63 export COMPUTECPP_TOOLKIT_PATH=/opt/ComputeCpp-CE
64 export COMPUTE=:0
65# Device-sensitive magic, these should work on as much hardware as possible
66 export TF_USE_HALF_SYCL=0
67 export TF_USE_DOUBLE_SYCL=0
68 export TF_SYCL_BITCODE_TARGET=spir64
69 export CC_OPT_FLAGS="-march=native -mfpmath=sse -O2 -pipe" # -sycl-compress-name for some amd cards
70
71 # make sure the proxy variables are in all caps, otherwise bazel ignores them
72 export HTTP_PROXY=`echo $http_proxy | sed -e 's/\/$//'`
73 export HTTPS_PROXY=`echo $https_proxy | sed -e 's/\/$//'`
74
75 cd "${srcdir}"/tensorflow
76 git apply --index ../python37.patch
77 git apply --index --whitespace=nowarn ../py37.diff
78 git apply --index --whitespace=nowarn ../gcc1.diff
79 git apply --index --whitespace=fix ../gcc2.diff
80 git apply --index --whitespace=nowarn ../gcc3.diff
81 git apply --index ../python38.patch
82 git apply --index ../gcc10.patch
83 git apply --index ../numpy.diff
84 git apply --index ../python310.diff
85 git apply --index ../python310or.patch
86}
87
88build() {
89 # Build bazel
90 echo "Please note: currently, bazel version <0.18 is required to build this package."
91 echo "Fixing that for you" # "Building it temporarily..."
92 echo "Make sure there are no spaces in PATH"
93 cd "$srcdir"
94 # ./compile.sh
95 export PATH="${srcdir}/usr/bin:$PATH"
96
97 cd "${srcdir}"/tensorflow
98 if [ ! -f .bazelrc ]; then # configure should be in prepare, but bazel has to be built first atm
99 ./configure
100 fi
101
102# Please take notice this requires at least 8GB of swap/disk space and 0.7+(3.2*threads)GB of RAM to build
103 bazel build -c opt --config=sycl //tensorflow:libtensorflow.so \
104 //tensorflow/tools/pip_package:build_pip_package # --jobs 1 --verbose_failures
105 bazel-bin/tensorflow/tools/pip_package/build_pip_package "${srcdir}"/tmp
106}
107
108package_tensorflow-computecpp() {
109 conflicts=(tensorflow)
110 provides=(tensorflow)
111
112 cd "${srcdir}"/tensorflow
113
114 tensorflow/c/generate-pc.sh --prefix=/usr --version=${pkgver}
115 install -Dm644 tensorflow.pc "${pkgdir}"/usr/lib/pkgconfig/tensorflow.pc
116 install -Dm755 bazel-bin/tensorflow/libtensorflow.so "${pkgdir}"/usr/lib/libtensorflow.so
117 install -Dm755 bazel-bin/tensorflow/libtensorflow_framework.so "${pkgdir}"/usr/lib/libtensorflow_framework.so
118 install -Dm644 tensorflow/c/c_api.h "${pkgdir}"/usr/include/tensorflow/c/c_api.h
119 install -Dm644 LICENSE "${pkgdir}"/usr/share/licenses/${pkgname}/LICENSE
120}
121
122package_python-tensorflow-computecpp() {
123 conflicts=(python-tensorflow)
124 provides=(python-tensorflow)
125 depends=(python-numpy python-protobuf absl-py)
126 optdepends=('python-werkzeug: for using tensorboard')
127
128 cd "${srcdir}"/tensorflow
129
130 WHEEL_PACKAGE=$(find "${srcdir}"/tmp -name "tensor*.whl")
131 pip install --ignore-installed --upgrade --root "$pkgdir" $WHEEL_PACKAGE --no-dependencies --no-warn-script-location
132
133 # tensorboard has been separated from upstream but they still install it with
134 # tensorflow. I don't know what kind of sense that makes but we have to clean
135 # it out from this pacakge.
136 rm -rf "${pkgdir}"/usr/bin/tensorboard
137
138 install -Dm644 LICENSE "${pkgdir}"/usr/share/licenses/${pkgname}/LICENSE
139}
140

Scan history

Scanned at (UTC)SeverityRules
2026-08-03 00:08:14 MEDIUM 2
2026-08-02 00:16:08 MEDIUM 2
2026-08-01 00:11:18 MEDIUM 2
2026-07-31 00:14:10 MEDIUM 2
2026-07-30 00:17:23 MEDIUM 2
2026-07-29 00:25:53 MEDIUM 2
2026-07-28 00:07:28 MEDIUM 2
2026-07-27 00:24:32 MEDIUM 2
2026-07-26 00:07:32 MEDIUM 2
2026-07-25 00:13:44 MEDIUM 2
2026-07-24 00:02:28 MEDIUM 2
2026-07-23 00:14:47 MEDIUM 2
2026-07-22 00:29:32 MEDIUM 2
2026-07-21 00:24:15 MEDIUM 2
2026-07-20 00:19:49 MEDIUM 2
2026-07-19 00:17:08 MEDIUM 2
2026-07-18 00:14:48 MEDIUM 2
2026-07-17 00:06:16 MEDIUM 2
2026-07-16 00:05:41 MEDIUM 2
2026-07-15 00:09:25 MEDIUM 2

Report a package

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

0 / 4000
Your suggestion