---
name: ubuntu dependencies
description: installs dependencies required to compile quantus-cli on ubuntu
runs:
using: composite
steps:
- name: rust compilation prerequisites (ubuntu)
run: |
sudo rm -f /etc/apt/sources.list.d/microsoft-prod.list
sudo rm -f /etc/apt/sources.list.d/azure-cli.list
sudo apt-get update -yqq
sudo apt-get install -yqq --no-install-recommends \
libclang-dev \
clang \
protobuf-compiler
# Unconditionally install the toolchain pinned in rust-toolchain.toml
# (rustup >=1.28 no longer auto-installs the active toolchain, and
# `rustup update` only refreshes already-installed toolchains).
# This installs the channel + every component/target listed in the file.
rustup toolchain install
rustup target add wasm32-unknown-unknown
rustup component add rustfmt --toolchain nightly
rustup component add clippy rust-src
shell: bash
- name: Set LIBCLANG_PATH for clang-sys (bindgen/rocksdb etc.)
run: |
# Runner may set wrong LIBCLANG_PATH; use known dirs then find then llvm-config.
DIR=
for ver in 18 17 16 15 14; do
D="/usr/lib/llvm-$ver/lib"
if [ -d "$D" ] && ls "$D"/libclang*.so* 1>/dev/null 2>&1; then
DIR=$D
break
fi
done
if [ -z "$DIR" ]; then
LIB=$(find /usr -name 'libclang.so*' \( -type f -o -type l \) 2>/dev/null | head -1)
[ -n "$LIB" ] && DIR=$(dirname "$LIB")
fi
if [ -z "$DIR" ] && command -v llvm-config >/dev/null 2>&1; then
D=$(llvm-config --libdir 2>/dev/null)
if [ -n "$D" ] && [ -d "$D" ] && ls "$D"/libclang*.so* 1>/dev/null 2>&1; then
DIR=$D
fi
fi
if [ -n "$DIR" ] && [ "$DIR" != "." ]; then
echo "LIBCLANG_PATH=$DIR" >> $GITHUB_ENV
fi
echo "LIBCLANG_PATH=${LIBCLANG_PATH:-not set}"
shell: bash