2505: Fix building wheels when deps need to compile r=mergify[bot] a=ghostwheel42

## What type of PR?

bug-fix

## What does this PR do?

This installs build requiremnets (compiler, etc.) when tehre are no pre-built wheels an the current architecture.

Co-authored-by: Alexander Graf <ghostwheel42@users.noreply.github.com>
main
bors[bot] 2 years ago committed by GitHub
commit 0015335f4a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -22,7 +22,7 @@ CMD /bin/bash
# build virtual env (intermediate)
FROM system as build
ARG MAILU_ENV=prod
ARG MAILU_DEPS=prod
ENV VIRTUAL_ENV=/app/venv
@ -37,18 +37,25 @@ RUN set -euxo pipefail \
ENV PATH="${VIRTUAL_ENV}/bin:${PATH}"
COPY requirements-${MAILU_ENV}.txt ./
COPY requirements-${MAILU_DEPS}.txt ./
COPY libs/ libs/
RUN set -euxo pipefail \
; machine="$(uname -m)"; deps="" \
; [[ "${machine}" == arm* || "${machine}" == aarch64 ]] && deps="${deps} build-base gcc libffi-dev python3-dev" \
; [[ "${machine}" == armv7* ]] && deps="${deps} cargo git libressl-dev mariadb-connector-c-dev postgresql-dev" \
; [[ "${deps}" ]] && apk add --virtual .build-deps ${deps} \
; [[ "${machine}" == armv7* ]] && mkdir -p /root/.cargo/registry/index && git clone --bare https://github.com/rust-lang/crates.io-index.git /root/.cargo/registry/index/github.com-1285ae84e5963aae \
; pip install -r requirements-${MAILU_ENV}.txt \
; apk -e info -q .build-deps && apk del -r .build-deps \
; rm -rf /root/.cargo /root/.cache /tmp/*.pem
; pip install -r requirements-${MAILU_DEPS}.txt || \
{ \
machine="$(uname -m)" \
; deps="build-base gcc libffi-dev python3-dev" \
; [[ "${machine}" == armv7 ]] && \
deps="${deps} cargo git libressl-dev mariadb-connector-c-dev postgresql-dev" \
; apk add --virtual .build-deps ${deps} \
; [[ "${machine}" == armv7 ]] && \
mkdir -p /root/.cargo/registry/index && \
git clone --bare https://github.com/rust-lang/crates.io-index.git /root/.cargo/registry/index/github.com-1285ae84e5963aae \
; pip install -r requirements-${MAILU_DEPS}.txt \
; apk del -r .build-deps \
; rm -rf /root/.cargo /tmp/*.pem \
; } \
; rm -rf /root/.cache
# base mailu image

Loading…
Cancel
Save