Skip to content

Commit

Permalink
build: Use tmpfs for cargo cache
Browse files Browse the repository at this point in the history
That seems to workaround rust-lang/cargo#8719.
  • Loading branch information
nijel committed Nov 23, 2021
1 parent b52b843 commit 3cfea22
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 6 deletions.
7 changes: 7 additions & 0 deletions .github/workflows/bleeding.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,13 @@ jobs:
env:
MATRIX_ARCHITECTURE: ${{ matrix.architecture }}
steps:
- run: |
# Workaround for https://github.com/rust-lang/cargo/issues/8719
find /var/lib/docker
sudo mv /var/lib/docker /var/lib/docker-tmp
sudo mkdir -p /var/lib/docker
sudo mount -t tmpfs none /var/lib/docker
sudo mv /var/lib/docker-tmp/* /var/lib/docker/
- uses: actions/[email protected]
- name: Set up QEMU
uses: docker/[email protected]
Expand Down
6 changes: 6 additions & 0 deletions .github/workflows/dockerimage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,12 @@ jobs:
env:
MATRIX_ARCHITECTURE: ${{ matrix.architecture }}
steps:
- run: |
# Workaround for https://github.com/rust-lang/cargo/issues/8719
sudo mkdir -p /var/lib/docker
sudo mount -t tmpfs none /var/lib/docker
sudo systemctl status
sudo systemctl restart docker
- uses: actions/[email protected]
- name: Set up QEMU
uses: docker/[email protected]
Expand Down
7 changes: 1 addition & 6 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -110,11 +110,6 @@ RUN \
fi \
&& curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y \
&& source $HOME/.cargo/env \
# Handle an extremely specific issue when building the cryptography package for \
# 32-bit architectures within QEMU running on a 64-bit host (issue #30). \
&& if [ "${BUILDX_QEMU_ENV}" = "true" -a "$(getconf LONG_BIT)" = "32" ] ; then \
sed -i s/^cryptography==/cryptography==3.3.2/ /usr/src/weblate/requirements.txt ; \
fi \
&& python3 -m pip install --no-cache-dir --upgrade $(grep -E '^(pip|wheel|setuptools)==' /usr/src/weblate/requirements.txt) \
&& python3 -m pip install --no-cache-dir --no-binary :all: $(grep ^cffi== /usr/src/weblate/requirements.txt) \
&& case "$VERSION" in \
Expand Down Expand Up @@ -159,7 +154,7 @@ RUN \
&& apt-get -y autoremove \
&& apt-get clean \
&& rustup self uninstall -y \
&& rm -rf /root/.cache /tmp/* /var/lib/apt/lists/*
&& rm -rf /root/.cache /root/.cargo /tmp/* /var/lib/apt/lists/*

# Apply hotfixes on Weblate
RUN find /usr/src/weblate -name '*.patch' -print0 | sort -z | \
Expand Down

0 comments on commit 3cfea22

Please sign in to comment.