Skip to content

Commit b0e2d6f

Browse files
authored
Pass the correct INSTALL_DIR location to docker run (#11)
Do not choose INSTALL_DIR automatically based on the availability of the TOOLCHAIN_BUILD_IN_DOCKER environment variable. While setting that marker variable in Dockerfile works transparently for most of the scripts, it does not work for build.sh launcher. This commit fixes `docker run` being invoked with --tmpfs "$HOST_BUILD_INSTALL_DIR:rw,exec,size=2G" argument instead of the intended one: --tmpfs "$DOCKER_BUILD_INSTALL_DIR:rw,exec,size=2G"
1 parent fca8316 commit b0e2d6f

4 files changed

Lines changed: 3 additions & 10 deletions

File tree

Dockerfile.builder

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,6 @@ RUN apt-get update \
2222

2323
ARG REPO_ROOT
2424

25-
ENV TOOLCHAIN_BUILD_IN_DOCKER=1
26-
2725
COPY cmake /${REPO_ROOT}/cmake
2826
COPY scripts /${REPO_ROOT}/scripts
2927
COPY config /${REPO_ROOT}

build.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ build_in_docker() {
9292
--volume "$ROOT/output:$OUTPUT_DIR:rw" \
9393
--volume "$ROOT/ccache:$CCACHE_DIR:rw" \
9494
--volume "$ROOT/src:$SRC_DIR:ro" \
95-
--tmpfs "$INSTALL_DIR:rw,exec,size=2G" \
95+
--tmpfs "$DOCKER_BUILD_INSTALL_DIR:rw,exec,size=2G" \
9696
--tmpfs "$BUILD_TMP:rw,exec,size=5G" \
9797
"$DOCKER_IMAGE_NAME" "$REPO_ROOT/scripts/build-in-docker.sh"
9898
}
@@ -101,6 +101,7 @@ build_on_host() {
101101
REPO_ROOT="$ROOT"
102102
. ./config
103103
. ./scripts/global-vars
104+
export INSTALL_DIR="$HOST_BUILD_INSTALL_DIR"
104105

105106
check_repo_sha "$ROOT/src/llvm" "$LLVM_SHA"
106107
check_repo_sha "$ROOT/src/musl" "$MUSL_SHA"

scripts/build-in-docker.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ cd "$(dirname "$0")"
1010
export REPO_ROOT="$(pwd)/.."
1111
. ../config
1212
. ./global-vars
13+
export INSTALL_DIR="$DOCKER_BUILD_INSTALL_DIR"
1314

1415
if ! ./build-all.sh; then
1516
echo "Containerized build failed - $BUILD_TMP is discarded automatically."

scripts/global-vars

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -28,13 +28,6 @@ if [ "x$REPO_ROOT" != "x" ]; then
2828
CMAKE_DIR="$REPO_ROOT/cmake"
2929
fi
3030

31-
# TOOLCHAIN_BUILD_IN_DOCKER is defined in Dockerfile.builder
32-
if [ -n "$TOOLCHAIN_BUILD_IN_DOCKER" ]; then
33-
INSTALL_DIR="$DOCKER_BUILD_INSTALL_DIR"
34-
else
35-
INSTALL_DIR="$HOST_BUILD_INSTALL_DIR"
36-
fi
37-
3831
# Linux kernel version to be used to provide user-space headers to libc.
3932
# Any recent version should work, so this variable is defined here instead
4033
# of $REPO_ROOT/config.

0 commit comments

Comments
 (0)