Skip to content

Commit

Permalink
ci: test
Browse files Browse the repository at this point in the history
  • Loading branch information
David Gomes authored and David Gomes committed Jun 12, 2023
1 parent 14eaccd commit 471ec52
Show file tree
Hide file tree
Showing 6 changed files with 146 additions and 33 deletions.
119 changes: 107 additions & 12 deletions server/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 1 addition & 3 deletions server/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ tracing = "0.1"
tracing-appender = "0.2"
tracing-subscriber = "0.3"

tracing-loki = "0.2"
tracing-loki = { version = "0.2", default-features = false, features = ["rustls", "compat-0-2-1"] }

tokio-metrics = "0.2"
console-subscriber = "0.1"
Expand All @@ -44,5 +44,3 @@ juniper_graphql_ws = "0.3"

# Vulnerability transient dependencies overrides
tempfile = "3.4.0"

openssl = { version = '0.10', features = ["vendored"] }
3 changes: 0 additions & 3 deletions server/Cross.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,2 @@
[target.armv7-unknown-linux-gnueabihf]
dockerfile = "docker/cross-compile/armv7.Dockerfile"

[target.armv7-unknown-linux-gnueabihf.env]
passthrough = ["PKG_CONFIG_LIBDIR=/usr/lib/arm-linux-gnueabihf/pkgconfig"]
31 changes: 16 additions & 15 deletions server/docker/cross-compile/armv7.Dockerfile
Original file line number Diff line number Diff line change
@@ -1,23 +1,24 @@
FROM ghcr.io/cross-rs/armv7-unknown-linux-gnueabihf:latest AS base

WORKDIR /home/src
RUN apt-get update && apt-get upgrade && apt-get install multistrap --assume-yes

RUN dpkg --add-architecture armhf
COPY docker/cross-compile/multistrap.conf /
RUN multistrap -a armhf -f multistrap.conf /sysroot-armhf

RUN apt-get update && \
apt-get upgrade -y && \
apt-get install -y pkg-config:armhf libssl-dev:armhf libudev-dev:armhf libsystemd-dev:armhf libusb-1.0-0-dev:armhf
ENV SYS_ROOT=/sysroot-armhf

RUN curl https://sh.rustup.rs -sSf | \
sh -s -- -t armv7-unknown-linux-gnueabihf stable -y
COPY docker/cross-compile/relink.sh /
RUN cd /sysroot-armhf && chmod +x /relink.sh && /relink.sh

ENV CARGO_TARGET_ARMV7_UNKNOWN_LINUX_GNUEABIHF_RUSTFLAGS="-L /usr/lib/arm-linux-gnueabihf -C link-args=-Wl,-rpath-link,/usr/lib/arm-linux-gnueabihf $CARGO_TARGET_ARMV7_UNKNOWN_LINUX_GNUEABIHF_RUSTFLAGS"
ENV PKG_CONFIG_DIR=""
ENV PKG_CONFIG_PATH=""
ENV PKG_CONFIG_LIBDIR="${SYS_ROOT}/usr/lib/arm-linux-gnueabihf/pkgconfig"
ENV PKG_CONFIG_INCLUDE_DIR="${SYS_ROOT}/usr/include/arm-linux-gnueabihf"
ENV PKG_CONFIG_SYSROOT_DIR=${SYS_ROOT}
ENV PKG_CONFIG_ALLOW_CROSS=1

RUN which pkg-config; echo
RUN echo $PATH
ENV PATH="/usr/bin:${PATH}"
RUN pkg-config --libs --cflags libudev
#RUN apt-get update && apt-get install -y --no-install-recommends apt-utils
#RUN dpkg --add-architecture armhf
#RUN apt-get update && apt-get -y install libudev-dev:armhf

RUN exit 1

RUN . "$HOME/.cargo/env"
ENV RUSTFLAGS="-C link-arg=--sysroot=/sysroot-armhf -L /sysroot-armhf/usr/lib/arm-linux-gnueabihf -C link-args=-Wl,-rpath-link,/sysroot-armhf/usr/lib/arm-linux-gnueabihf -lpthread"
13 changes: 13 additions & 0 deletions server/docker/cross-compile/multistrap.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
[General]
arch=armhf
directory=/sysroot-armhf/
noauth=true
unpack=true
cleanup=true
bootstrap=Raspbian
aptsources=Raspbian

[Raspbian]
packages=pkg-config libudev-dev libsystemd-dev libusb-1.0-0-dev build-essential
source=http://raspbian.raspberrypi.org/raspbian/
suite=buster
9 changes: 9 additions & 0 deletions server/docker/cross-compile/relink.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Find all absolute symlinks recursively in the current directory
# (find command) and process them line by line (`while read`)
find . -lname '/*' | while read -r link; do
# Get the (broken) path from the symlink.
abs_target=$(readlink "$link")
# Prepend that with the current working directory and overwrite
# the old link with the prepended version.
ln -fs "$(pwd)$abs_target" "$link"
done

0 comments on commit 471ec52

Please sign in to comment.