Cerbero build fails in Docker. hangs on fetching cargo-c bootstrap

I was wondering if anyone has experience attempting to use cebero build for multi arch in Docker ? Just on bootstrap it completely fails and hangs at cargo-c bootstrap. No error log or log past that. It could sit there for an hour doing nothing.

A simple command run to build rust.

./cerbero-uninstalled -t -c $HOME/.cerbero/localconf.cbc -c config/cross-lin-arm64.cbc -v rust fetch-bootstrap

verbose: deleted temp file: /build/src/cerbero-build/rust/rustup/tmp/_o4pnou_fk1zblip_file verbose: toolchain 'stable-x86_64-unknown-linux-gnu' installed info: default toolchain set to 'stable-x86_64-unknown-linux-gnu' 0:00:22.536866 Rust toolchain v1.77.2 installed at /build/src/cerbero-build/rust 0:00:22.615274 Fetching the following recipes using 2 async job(s): m4 autoconf gettext-m4 automake libtool meson ninja pkg-config orc zlib cargo-c 0:00:38.285449 [(10/11 @ 100%) FETCH: cargo-c]

Every single method I tried failed. I spent over 20 hours trying to get a building solution working and resorting to building my own Docker image. I think Cerbero for arm64 building is what I need and will work assuming this rust issue is figured out. I need the rust plugins built just to get to the whepsrc plugin.

I think adding Rust has over complicated things. It would have been simpler if whepsrc was in the other prebuilt plugins ? I need to build a python streamer solution for PI. And to get to that stage I need to build gstreamer from scratch to get the plugin.

Here is the docker file how I build the image. I have to pre install the apt packages for cerbero myself as it requires a flag to not install dbus which fails in Docker.

`

syntax = docker/dockerfile:1.2

FROM debian:bookworm-slim
ENV LANG=C.UTF-8
ENV LC_ALL=C.UTF-8
ENV CARGO_HTTP_DEBUG=true
ENV CARGO_LOG=cargo::ops::registry=debug
#ENV NSS_UNKNOWN_HOME=/home/user
ARG DEBIAN_FRONTEND=noninteractive
WORKDIR /build
COPY nsswitch.conf /etc/nsswitch.conf

RUN --mount=type=cache,target=/var/cache/apt
dpkg --add-architecture arm64 &&
apt update &&
apt install -y
–no-install-recommends
build-essential
libnss-unknown
libncurses5-dev
rsync
cpio
python3
unzip
bc
wget
git
nano
binutils-aarch64-linux-gnu
bison
flex
g+±aarch64-linux-gnu
gcc-aarch64-linux-gnu
libglib2.0-dev-bin
liborc-0.4-dev-bin
pkg-config
python3-setuptools
ninja-build
python3-pip
python3-venv
libssl-dev:arm64
openssl:arm64 &&
apt-get clean &&
rm -rf /var/lib/apt/lists/* &&
pip3 install
–break-system-packages
meson==1.2.3
distro

pre install extra packages from cerbero

#requires no-install-recommends to avoid a dbus package error
RUN --mount=type=cache,target=/var/cache/apt
apt update &&
dpkg --configure -a &&
apt-get -y install --no-install-recommends autotools-dev automake autoconf libtool g++ autopoint make cmake ninja-build bison flex nasm pkg-config libxv-dev libx11-dev libx11-xcb-dev libpulse-dev python3-dev gettext build-essential pkg-config libxext-dev libxi-dev x11proto-record-dev libxrender-dev libgl1-mesa-dev libxfixes-dev libxdamage-dev libxcomposite-dev libasound2-dev build-essential gperf wget libxtst-dev libxrandr-dev libglu1-mesa-dev libegl1-mesa-dev git xutils-dev ccache python3-setuptools libssl-dev gcc-aarch64-linux-gnu g+±aarch64-linux-gnu

RUN mkdir $HOME/.cerbero &&
echo “allow_parallel_build=True” > $HOME/.cerbero/cerbero.cbc &&
echo “use_ccache=True” >> $HOME/.cerbero/cerbero.cbc &&
echo “local_sources="/build/src/cerbero-sources"” > $HOME/.cerbero/localconf.cbc &&
echo “home_dir="/build/src/cerbero-build"” >> $HOME/.cerbero/localconf.cbc &&
echo “prefix="/usr/local"” >> $HOME/.cerbero/localconf.cbc
`

Here is how the image is built
docker build --tag danrossi/gstreamer/gst-build-cross:latest --file Dockerfile .
Here is how it’s launched

docker run -dit --net=host -v ${PWD}:/build:z --workdir /build danrossi/gstreamer/gst-build-cross:latest /bin/bash entrypoint.sh

Here is the entry script

`
#!/bin/sh

CERBERO_PATH=/build/src/cerbero

if [ ! -d “$CERBERO_PATH” ] ; then
echo “Cerbero does not exist at $CERBERO_PATH; cloning…”
git clone GStreamer / cerbero · GitLab $CERBERO_PATH
fi

cd src/cerbero

./cerbero-uninstalled -t -c $HOME/.cerbero/localconf.cbc -c config/cross-lin-arm64.cbc -v alsa,pulse,python,gi,optimization,rust,v412,rpi fetch-bootstrap
./cerbero-uninstalled -t -c $HOME/.cerbero/localconf.cbc -c config/cross-lin-arm64.cbc -v alsa,pulse,python,gi,optimization,rust,v412,rpi,nox11,nocdparanoia bootstrap -y
`

I found where log files are it just ends here. I think it’s an issue with cargo in Docker.

Running cargo vendor to vendor sources
Running command ['/build/src/cerbero-build/rust/cargo/bin/cargo', 'vendor', '/build/src/cerbero-sources/cargo-c-0.9.31/cargo-vendor'] in /build/src/cerbero-build/sources/build-tools/cargo-c-0.9.31

Running the command manually

/build/src/cerbero-build/rust/cargo/bin/cargo vendor /build/src/cerbero-sources/cargo-c-0.9.31/cargo-vendor

I get this

error: rustup could not choose a version of cargo to run, because one wasn't specified explicitly, and no default is configured.
help: run 'rustup default stable' to download the latest stable release of Rust and set it as your default toolchain.

See this if anyone experiences the issue. It was custom path configs causing it to fail for some reason.

All our Linux + Windows CI is docker-based, so it would be surprising if docker had anything to do with it.

These two configs can’t be configured to seperate directories on the mount or cargo-c literally hangs with no error message. Even though cebero checkout is on a mount. I’m having issues with a “.cache” going to the user directory. So relaunching tries to rebuild everything.

echo "local_sources=\"/build/src/cerbero-sources\"" > $HOME/.cerbero/localconf.cbc && \
    #    echo "home_dir=\"/build/src/cerbero-build\"" >> $HOME/.cerbero/localconf.cbc 

Here is my updated Docker file. Is there sample docker files to try ? I found I had to manually install packages before cebero with “no-install-recommends” to avoid it trying to install dbus which fails with Docker.

# syntax = docker/dockerfile:1.2
FROM debian:bookworm-slim
ENV LANG=C.UTF-8
ENV LC_ALL=C.UTF-8
ENV CARGO_HTTP_DEBUG=true
ENV CARGO_LOG=cargo::ops::registry=debug
#ENV NSS_UNKNOWN_HOME=/home/user
ARG DEBIAN_FRONTEND=noninteractive
WORKDIR /build
# GStreamer needs meson version >= 1.1.
#$RUN groupadd -r builduser && useradd -r -g builduser builduser
COPY nsswitch.conf /etc/nsswitch.conf

RUN --mount=type=cache,target=/var/cache/apt \
    dpkg --add-architecture arm64 && \
    apt update && \
    apt install -y \
      --no-install-recommends \
      build-essential \
      libnss-unknown \
      libncurses5-dev \
      rsync \
      cpio \
      python3 \
      unzip \
      bc \
      wget \
      git \
      nano \
      binutils-aarch64-linux-gnu \
      bison \
      flex \
      g++-aarch64-linux-gnu \
      gcc-aarch64-linux-gnu \
      libglib2.0-dev-bin \
      liborc-0.4-dev-bin \
      pkg-config \
      python3-setuptools \
      ninja-build \
      python3-pip \
      python3-venv \
      libssl-dev:arm64 \
      libogg-dev \
      openssl:arm64 && \
      apt-get clean && \
      rm -rf /var/lib/apt/lists/* && \
      pip3 install \
      --break-system-packages \
      meson==1.2.3 \
      distro

    #  usermod -l messagebus uid_399 && sudo groupmod -n messagebus gid_399
# pre install extra packages from cerbero
#requires no-install-recommends to avoid a dbus package error
RUN --mount=type=cache,target=/var/cache/apt \
    apt update && \
    dpkg --configure -a && \
    apt-get -y install --no-install-recommends autotools-dev automake autoconf libtool g++ autopoint make cmake ninja-build bison flex nasm pkg-config libxv-dev libx11-dev libx11-xcb-dev libpulse-dev python3-dev gettext build-essential pkg-config libxext-dev libxi-dev x11proto-record-dev libxrender-dev libgl1-mesa-dev libxfixes-dev libxdamage-dev libxcomposite-dev libasound2-dev build-essential gperf wget libxtst-dev libxrandr-dev libglu1-mesa-dev libegl1-mesa-dev git xutils-dev ccache python3-setuptools libssl-dev gcc-aarch64-linux-gnu g++-aarch64-linux-gnu

RUN mkdir $HOME/.cerbero && \
    echo "allow_parallel_build=True" > $HOME/.cerbero/cerbero.cbc && \
    echo "use_ccache=True" >> $HOME/.cerbero/cerbero.cbc && \
    echo "prefix=\"/usr/local/gstreamer\"" >> $HOME/.cerbero/cerbero.cbc
    #echo "local_sources=\"/build/src/cerbero-sources\"" > $HOME/.cerbero/localconf.cbc && \
    #    echo "home_dir=\"/build/src/cerbero-build\"" >> $HOME/.cerbero/localconf.cbc && \
    #    echo "prefix=\"/usr/local\"" >> $HOME/.cerbero/localconf.cbc

after 100 attempts to compile and things breaking 2 hours into it. I figured out an undocumented issue with Windows Docker and mounts. WSL2 is affected and Docker has WSL2 integration. The path to the mount needs to be turned case sensitive.

It worked around a failure with a rust library with poor naming conventions making gst-plugin-rs fail to build “color-name”. It also fixed the cargo-c issue with the original configs in place, the build will continue.

gst-plugin-rs is failing to post install with no error logged because of a prefix config now however and linking fails. so trying to fine tune my Docker image and build script that actually works and make a rep for it.

I’ve never experienced this before with non namedspaced files named the same in the same directory. so I can only guess Rust is poorly programmed and problematic.

It has made building gobject and whepsrc plugin just to get a project working very hard, 3 weeks so far. gvsbuild on windows did not fail somehow and I was able to build and test my python streamer service project with windows. Its just Linux now as there is no binaries available for the whepsrc plugin.

fsutil.exe file setCaseSensitiveInfo  D:\www\players\pi\gst-build-arm64\src