danrossi / gst-build-cross

0 stars 1 forks source link

Buildrust fails #1

Open pannal opened 1 day ago

pannal commented 1 day ago

Hey,

Trying to set up an ndi-enabled gstreamer image. When running your instructions, this failes pretty immediately:

./docker.sh buildrust
WARN[0000] No output specified for docker-container driver. Build result will only remain in the build cache. To push result image into registry use --push or to load image into docker use --load
[+] Building 589.6s (23/30)
 => [internal] load build definition from Dockerfile.rust                                                                                                                                                                                                                                                                                                0.0s
 => => transferring dockerfile: 3.88kB                                                                                                                                                                                                                                                                                                                   0.0s
 => resolve image config for docker-image://docker.io/docker/dockerfile:1.2                                                                                                                                                                                                                                                                              1.5s
 => [auth] docker/dockerfile:pull token for registry-1.docker.io                                                                                                                                                                                                                                                                                         0.0s
 => docker-image://docker.io/docker/dockerfile:1.2@sha256:e2a8561e419ab1ba6b2fe6cbdf49fd92b95912df1cf7d313c3e2230a333fdbcc                                                                                                                                                                                                                               0.2s
 => => resolve docker.io/docker/dockerfile:1.2@sha256:e2a8561e419ab1ba6b2fe6cbdf49fd92b95912df1cf7d313c3e2230a333fdbcc                                                                                                                                                                                                                                   0.0s
 => => sha256:3cc8e449ce9f6e0752ede8f50a7334bf0c7b2d24d76da2ffae7aa6a729dd1da4 9.64MB / 9.64MB                                                                                                                                                                                                                                                           0.4s
 => => extracting sha256:3cc8e449ce9f6e0752ede8f50a7334bf0c7b2d24d76da2ffae7aa6a729dd1da4                                                                                                                                                                                                                                                                0.2s
 => [internal] load .dockerignore                                                                                                                                                                                                                                                                                                                        0.0s
 => => transferring context: 2B                                                                                                                                                                                                                                                                                                                          0.0s
 => [internal] load build definition from Dockerfile.rust                                                                                                                                                                                                                                                                                                0.0s
 => [linux/amd64 internal] load metadata for docker.io/library/debian:bookworm-slim                                                                                                                                                                                                                                                                      1.1s
 => [linux/arm64 internal] load metadata for docker.io/library/debian:bookworm-slim                                                                                                                                                                                                                                                                      1.1s
 => [auth] library/debian:pull token for registry-1.docker.io                                                                                                                                                                                                                                                                                            0.0s
 => [internal] load build context                                                                                                                                                                                                                                                                                                                        0.1s
 => => transferring context: 35.97kB                                                                                                                                                                                                                                                                                                                     0.0s
 => [linux/amd64 stage-0  1/10] FROM docker.io/library/debian:bookworm-slim@sha256:ca3372ce30b03a591ec573ea975ad8b0ecaf0eb17a354416741f8001bbcae33d                                                                                                                                                                                                      1.2s
 => => resolve docker.io/library/debian:bookworm-slim@sha256:ca3372ce30b03a591ec573ea975ad8b0ecaf0eb17a354416741f8001bbcae33d                                                                                                                                                                                                                            0.0s
 => => sha256:2d429b9e73a6cf90a5bb85105c8118b30a1b2deedeae3ea9587055ffcb80eb45 29.13MB / 29.13MB                                                                                                                                                                                                                                                         0.7s
 => => extracting sha256:2d429b9e73a6cf90a5bb85105c8118b30a1b2deedeae3ea9587055ffcb80eb45                                                                                                                                                                                                                                                                1.2s
 => [linux/arm64 stage-0  1/10] FROM docker.io/library/debian:bookworm-slim@sha256:ca3372ce30b03a591ec573ea975ad8b0ecaf0eb17a354416741f8001bbcae33d                                                                                                                                                                                                      1.7s
 => => resolve docker.io/library/debian:bookworm-slim@sha256:ca3372ce30b03a591ec573ea975ad8b0ecaf0eb17a354416741f8001bbcae33d                                                                                                                                                                                                                            0.0s
 => => sha256:6d29a096dd42e5e003949f934fa6b1a3ec8e076dd8cfc2a85a4e750a3639bf7a 29.16MB / 29.16MB                                                                                                                                                                                                                                                         0.9s
 => => extracting sha256:6d29a096dd42e5e003949f934fa6b1a3ec8e076dd8cfc2a85a4e750a3639bf7a                                                                                                                                                                                                                                                                1.7s
 => [linux/amd64 stage-0  2/10] COPY scripts/configure-initial-gst.sh /tmp/gstreamer/                                                                                                                                                                                                                                                                    0.2s
 => [linux/amd64 stage-0  3/10] COPY scripts/deb/debian/bookworm/debian/ /tmp/debian/                                                                                                                                                                                                                                                                    0.0s
 => [linux/amd64 stage-0  4/10] RUN rm -f /etc/apt/apt.conf.d/docker-clean; echo 'Binary::apt::APT::Keep-Downloaded-Packages "true";' > /etc/apt/apt.conf.d/keep-cache                                                                                                                                                                                   0.1s
 => [linux/amd64 stage-0  5/10] RUN --mount=type=cache,id=apt-amd64,sharing=locked,target=/var/cache/apt     echo "[+] Installing APT base system dependencies for linux/amd64..." &&     apt update -qq &&     apt install -qq -y       --no-install-recommends       ccache       libssl-dev       libogg-dev       libpng-dev       libtiff-dev      59.7s
 => [linux/arm64 stage-0  2/10] COPY scripts/configure-initial-gst.sh /tmp/gstreamer/                                                                                                                                                                                                                                                                    0.1s
 => [linux/arm64 stage-0  3/10] COPY scripts/deb/debian/bookworm/debian/ /tmp/debian/                                                                                                                                                                                                                                                                    0.1s
 => [linux/arm64 stage-0  4/10] RUN rm -f /etc/apt/apt.conf.d/docker-clean; echo 'Binary::apt::APT::Keep-Downloaded-Packages "true";' > /etc/apt/apt.conf.d/keep-cache                                                                                                                                                                                   0.2s
 => [linux/arm64 stage-0  5/10] RUN --mount=type=cache,id=apt-arm64,sharing=locked,target=/var/cache/apt     echo "[+] Installing APT base system dependencies for linux/arm64..." &&     apt update -qq &&     apt install -qq -y       --no-install-recommends       ccache       libssl-dev       libogg-dev       libpng-dev       libtiff-dev     505.2s
 => [linux/amd64 stage-0  6/10] RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --profile minimal &&     rustup toolchain install nightly &&     rustup default nightly &&     printf "[net]\ngit-fetch-with-cli = true" >> "/root/.cargo/config.toml" &&     printf "\n[build]\njobs = 6" >> "/root/.cargo/config.toml"   483.0s
 => CANCELED [linux/arm64 stage-0  6/10] RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --profile minimal &&     rustup toolchain install nightly &&     rustup default nightly &&     printf "[net]\ngit-fetch-with-cli = true" >> "/root/.cargo/config.toml" &&     printf "\n[build]\njobs = 6" >> "/root/.cargo/confi  77.8s
 => ERROR [linux/amd64 stage-0  7/10] RUN mkdir $HOME/build &&     cd $HOME/build &&       git clone https://gitlab.freedesktop.org/gstreamer/gstreamer.git gstreamer &&       cd gstreamer &&       meson wrap install openssl &&       /tmp/gstreamer/configure-initial-gst.sh $HOME/build/gstreamer &&       rm -rf /tmp/gstreamer                   40.9s
------
 > [linux/amd64 stage-0  7/10] RUN mkdir $HOME/build &&     cd $HOME/build &&       git clone https://gitlab.freedesktop.org/gstreamer/gstreamer.git gstreamer &&       cd gstreamer &&       meson wrap install openssl &&       /tmp/gstreamer/configure-initial-gst.sh $HOME/build/gstreamer &&       rm -rf /tmp/gstreamer:
#12 0.232 Cloning into 'gstreamer'...
Updating files: 100% (11381/11381), done.1)
#12 40.49 Installed openssl version 3.0.8 revision 3
#12 40.54 /bin/sh: 1: /tmp/gstreamer/configure-initial-gst.sh: Permission denied
------
Dockerfile.rust:92
--------------------
  91 |
  92 | >>> RUN mkdir $HOME/build && \
  93 | >>>     cd $HOME/build && \
  94 | >>>       git clone https://gitlab.freedesktop.org/gstreamer/gstreamer.git gstreamer && \
  95 | >>>       cd gstreamer && \
  96 | >>>       meson wrap install openssl && \
  97 | >>>       /tmp/gstreamer/configure-initial-gst.sh $HOME/build/gstreamer && \
  98 | >>>       rm -rf /tmp/gstreamer
  99 |
--------------------
error: failed to solve: process "/bin/sh -c mkdir $HOME/build &&     cd $HOME/build &&       git clone https://gitlab.freedesktop.org/gstreamer/gstreamer.git gstreamer &&       cd gstreamer &&       meson wrap install openssl &&       /tmp/gstreamer/configure-initial-gst.sh $HOME/build/gstreamer &&       rm -rf /tmp/gstreamer" did not complete successfully: exit code: 126
pannal commented 1 day ago

Fixed by: https://github.com/pannal/gst-build-cross/commit/03e80b53ebd1032593f72e87a53f0c781d6c7187

danrossi commented 1 day ago

Its a multi arch image. follow instructions here for enabling containerd unfortunately it hides your current images and containers. they will appear again after disabling containerd.

If you dont need arm images. the commented line can be commented out and comment the build arch build. so

docker buildx build --platform=linux/arm64,linux/amd64 --tag ${REPO}/${IMAGE_RUST}:${DEBIAN_VARIANT}  --file Dockerfile.rust .
docker build --tag ${REPO}/${IMAGE_RUST}:${DEBIAN_VARIANT}  --file Dockerfile.rust .

https://github.com/danrossi/gst-build-cross/blob/master/README.rust.md

danrossi commented 1 day ago

The amd64 is slow enough building the rust image but QEMU makes it even slower sadly. so the first image build multi arch will take a while until rust is done building.