Browse Source

Revert Docker host image back to Ubuntu 22.04 LTS to resolve performance issues on Apple Silicon platform.

ubuntu-based-toolchain
Christoph Scholtes 1 year ago
parent
commit
25be88dade
2 changed files with 15 additions and 13 deletions
  1. +4
    -5
      Dockerfile
  2. +11
    -8
      Makefile

+ 4
- 5
Dockerfile View File

@@ -1,4 +1,4 @@
FROM archlinux:base-20230709.0.163418
FROM ubuntu:22.04
ENV LANG C.UTF-8

ARG JOBS
@@ -9,7 +9,7 @@ RUN useradd --create-home --uid 1000 --gid 1000 --shell /bin/bash build

# Install make to run make
ENV DEBIAN_FRONTEND=noninteractive
RUN pacman -Suyy --noconfirm && pacman -S make --noconfirm
RUN apt-get update && apt-get install -y --no-install-recommends make

# Create toolchain directory
USER build
@@ -20,10 +20,9 @@ COPY Makefile /home/build/rack-plugin-toolchain/

# Install dependencies for building toolchains and plugins
USER root
RUN make dep-arch-linux

RUN make dep-ubuntu
# Clean up files to free up space
RUN pacman -Sc --noconfirm
RUN rm -rf /var/lib/apt/lists/*

USER build
COPY MacOSX11.1.sdk.tar.* /home/build/rack-plugin-toolchain/


+ 11
- 8
Makefile View File

@@ -17,7 +17,7 @@ export JOBS_CT_NG :=
endif

RACK_SDK_VERSION := 2.4.0
DOCKER_IMAGE_VERSION := 10
DOCKER_IMAGE_VERSION := 11


all: toolchain-all rack-sdk-all
@@ -89,6 +89,15 @@ $(toolchain-mac):
cd osxcross && BINUTILS_VERSION=$(OSXCROSS_BINUTILS_VERSION) TARGET_DIR="$(LOCAL_DIR)/osxcross" JOBS=$(JOBS) ./build_binutils.sh
cd osxcross/build/build_stage && cmake . -DLLVM_BINUTILS_INCDIR=$(PWD)/osxcross/build/binutils-$(OSXCROSS_BINUTILS_VERSION)/include && make install -j $(JOBS)

# Fix library paths (for Arch Linux and Ubuntu arm64).
export PLATFORM_ID=$$($(LOCAL_DIR)/bin/clang -dumpmachine) ; \
echo "Platform ID: $$PLATFORM_ID" ; \
if [ ! -z "$$PLATFORM_ID" ] && [ -e "$(LOCAL_DIR)/lib/$$PLATFORM_ID/" ]; then \
echo "Copying lib files..." ; \
cp -Pv $(LOCAL_DIR)/lib/$$PLATFORM_ID/* $(LOCAL_DIR)/lib/ ; \
echo "done" ; \
fi

## Download rcodesign binary to ad-hoc sign arm64 plugin builds in a cross-compilation environment.
wget --continue "https://github.com/indygreg/apple-platform-rs/releases/download/apple-codesign%2F0.22.0/apple-codesign-0.22.0-x86_64-unknown-linux-musl.tar.gz"
tar -xvf apple-codesign-0.22.0-x86_64-unknown-linux-musl.tar.gz
@@ -96,12 +105,6 @@ $(toolchain-mac):
cp ./apple-codesign-0.22.0-x86_64-unknown-linux-musl/rcodesign $(LOCAL_DIR)/osxcross/bin/
rm -r apple-codesign-0.22.0-x86_64-unknown-linux-musl

# TODO Fix library paths.
# Background: clang build adds `x86_64-unknown-linux-gnu` on Arch,
# but cross-compilation environment for macOS platform does not expect it.
# As a result libcxx-abi.so.1 cannot be found.
cp $(LOCAL_DIR)/lib/x86_64-unknown-linux-gnu/* $(LOCAL_DIR)/lib/

rm -rf osxcross


@@ -291,7 +294,7 @@ dep-arch-linux:


docker-build: rack-sdk-all
docker build --build-arg JOBS=$(JOBS) --tag rack-plugin-toolchain:$(DOCKER_IMAGE_VERSION) .
docker build --build-arg JOBS=$(JOBS) --no-cache --tag rack-plugin-toolchain:$(DOCKER_IMAGE_VERSION) . --progress=plain 2>&1 | tee docker-build.log


DOCKER_RUN := docker run --rm --interactive --tty \


Loading…
Cancel
Save