From e9b220d65d8e93beda0155d5da710ff13b0f441c Mon Sep 17 00:00:00 2001 From: Christoph Scholtes Date: Fri, 8 Jul 2022 17:50:39 -0600 Subject: [PATCH] Move Rack SDK outside of Docker image to allow updating Rack SDK without rebuilding Docker image. --- .gitignore | 2 +- Dockerfile | 5 ----- Makefile | 17 ++++++++++++----- README.md | 13 +++++++++++++ 4 files changed, 26 insertions(+), 11 deletions(-) diff --git a/.gitignore b/.gitignore index 0d7b20b..b6b0091 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,5 @@ MacOSX*.sdk.tar.* local/ plugin-build/ -Rack-SDK/ +Rack-SDK-*/ osxcross/ diff --git a/Dockerfile b/Dockerfile index f829ec9..b0a9e8a 100644 --- a/Dockerfile +++ b/Dockerfile @@ -32,9 +32,4 @@ RUN JOBS=$JOBS make toolchain-mac RUN JOBS=$JOBS make toolchain-win RUN JOBS=$JOBS make toolchain-lin -# Install Rack SDK -RUN make -j $JOBS rack-sdk-mac -RUN make -j $JOBS rack-sdk-win -RUN make -j $JOBS rack-sdk-lin - RUN rm MacOSX11.1.sdk.tar.* diff --git a/Makefile b/Makefile index d7f36ff..3986bb1 100644 --- a/Makefile +++ b/Makefile @@ -17,10 +17,10 @@ export JOBS_CT_NG := endif RACK_SDK_VERSION := 2.1.2 +DOCKER_IMAGE_VERSION := 3 all: toolchain-all - # Toolchain build @@ -114,8 +114,12 @@ $(rack-sdk-lin): rm Rack-SDK-$(RACK_SDK_VERSION)-lin.zip RACK_DIR_LIN := $(PWD)/$(rack-sdk-lin) +rack-sdk-clean: + rm -rf $(PWD)/Rack-SDK-mac $(PWD)/Rack-SDK-win $(PWD)/Rack-SDK-lin + +rack-sdk-all: rack-sdk-mac rack-sdk-win rack-sdk-lin -toolchain-all: toolchain-lin toolchain-win toolchain-mac rack-sdk-mac rack-sdk-win rack-sdk-lin +toolchain-all: toolchain-lin toolchain-win toolchain-mac rack-sdk-all toolchain-clean: @@ -223,15 +227,18 @@ dep-arch-linux: help2man -docker-build: - docker build --build-arg JOBS=$(JOBS) --tag rack-plugin-toolchain:2 . +docker-build: rack-sdk-all + docker build --build-arg JOBS=$(JOBS) --tag rack-plugin-toolchain:$(DOCKER_IMAGE_VERSION) . DOCKER_RUN := docker run --rm --interactive --tty \ --volume=$(PLUGIN_DIR):/home/build/plugin-src \ --volume=$(PWD)/$(PLUGIN_BUILD_DIR):/home/build/rack-plugin-toolchain/$(PLUGIN_BUILD_DIR) \ + --volume=$(PWD)/Rack-SDK-mac:/home/build/rack-plugin-toolchain/Rack-SDK-mac \ + --volume=$(PWD)/Rack-SDK-win:/home/build/rack-plugin-toolchain/Rack-SDK-win \ + --volume=$(PWD)/Rack-SDK-lin:/home/build/rack-plugin-toolchain/Rack-SDK-lin \ --env PLUGIN_DIR=/home/build/plugin-src \ - rack-plugin-toolchain:2 \ + rack-plugin-toolchain:$(DOCKER_IMAGE_VERSION) \ /bin/bash docker-run: diff --git a/README.md b/README.md index b7c3b22..313701e 100644 --- a/README.md +++ b/README.md @@ -68,6 +68,19 @@ You may replace 8 with your desired number of parallel jobs, such as your number Built plugin packages are placed in the `plugin-build/` directory. +### Rack SDK management + +The latest Rack SDKs for all supported platforms are downloaded during the toolchain build. + +The SDKs can be updated to the latest version (defined in the `Makefile`) as follows: + +``` +make rack-sdk-clean +make rack-sdk-all +``` + +This is especially convenient for the Docker-based toolchain, because it does not require to rebuild the entire toolchain to update to the latest SDK. + ## Acknowledgments Thanks to @cschol for help with crosstool-ng, Ubuntu, Docker, and testing.