Resolve linker issues on arm. ()

This commit is contained in:
Firstyear 2022-05-26 21:13:07 +10:00 committed by GitHub
parent b6d3a0511f
commit ee4e9b906b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 24 additions and 18 deletions

View file

@ -4,7 +4,9 @@ IMAGE_BASE ?= kanidm
IMAGE_VERSION ?= devel
CONTAINER_TOOL_ARGS ?=
IMAGE_ARCH ?= "linux/amd64,linux/arm64"
CONTAINER_BUILD_ARGS ?=
CONTAINER_BUILD_ARGS ?=
# Example of using redis with sccache
# --build-arg "SCCACHE_REDIS=redis://redis.dev.blackhats.net.au:6379"
CONTAINER_TOOL ?= docker
BOOK_VERSION ?= master

View file

@ -1,9 +1,14 @@
ARG BASE_IMAGE=opensuse/tumbleweed:latest
FROM ${BASE_IMAGE} AS builder
FROM ${BASE_IMAGE} AS repos
# To help mirrors not be as bad
RUN zypper install -y mirrorsorcerer
RUN /usr/sbin/mirrorsorcerer -x; true
RUN zypper refresh --force
RUN zypper dup -y
FROM repos AS builder
LABEL maintainer william@blackhats.net.au
RUN zypper refresh
RUN zypper dup -y
RUN zypper install -y \
cargo \
rust \
@ -21,10 +26,13 @@ ARG SCCACHE_REDIS
ARG KANIDM_FEATURES
ARG KANIDM_BUILD_PROFILE
ENV RUSTC_BOOTSTRAP=1
RUN mkdir /scratch
RUN ln -s -f /usr/bin/clang /usr/bin/cc
RUN ln -s -f /usr/bin/ld.lld /usr/bin/ld
RUN echo $KANIDM_BUILD_PROFILE
RUN echo $KANIDM_FEATURES
ENV RUSTFLAGS="-Clinker=clang -Clink-arg=-fuse-ld=/usr/bin/ld.lld"
ENV CARGO_HOME=/scratch/.cargo
RUN if [ "${SCCACHE_REDIS}" != "" ]; \
then \
export CC="/usr/bin/sccache /usr/bin/clang" && \
@ -32,24 +40,20 @@ RUN if [ "${SCCACHE_REDIS}" != "" ]; \
sccache --start-server; \
else \
export CC="/usr/bin/clang"; \
fi
RUN echo $KANIDM_BUILD_PROFILE
RUN echo $KANIDM_FEATURES
ENV CARGO_HOME=/scratch/.cargo
RUN cargo build \
fi && \
cargo build \
--features=${KANIDM_FEATURES} \
--target-dir=/usr/src/kanidm/target/ \
--release
RUN ls -al /usr/src/kanidm/target/release
RUN if [ "${SCCACHE_REDIS}" != "" ]; \
--release && \
if [ "${SCCACHE_REDIS}" != "" ]; \
then sccache -s; \
fi;
FROM ${BASE_IMAGE}
RUN ls -al /usr/src/kanidm/target/release
FROM repos
LABEL maintainer william@blackhats.net.au
RUN zypper refresh
RUN zypper dup -y
RUN zypper install -y \
timezone \
sqlite3 \