From 5d63c28d855fc99aa748c8f401aa5591a598f95e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Storsj=C3=B6?= Date: Wed, 2 Feb 2022 23:36:26 +0200 Subject: [PATCH] docker: Upgrade to Ubuntu 20.04 Ubuntu 20.04 comes with CMake 3.16, so there's no need to install a custom version of CMake for now (for LLVM 16.x; LLVM 17 will have the requirement raised to CMake 3.20 though). Also drop the workaround for git issues in the old version in Ubuntu 18.04. The latest releases that are built on GitHub Actions without docker are based on Ubuntu 20.04 anyway, so there's less demand for building this with an older version for the sake of compatibility of the built binaries. For users using the built docker image as such, having it based on a newer base distribution is beneficial. --- Dockerfile | 31 +++---------------------------- Dockerfile.dev | 31 +++---------------------------- release.sh | 2 +- 3 files changed, 7 insertions(+), 57 deletions(-) diff --git a/Dockerfile b/Dockerfile index c726351..8dd1ca5 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,38 +1,13 @@ -FROM ubuntu:18.04 +FROM ubuntu:20.04 -RUN apt-get update -qq && apt-get install -qqy --no-install-recommends \ +RUN apt-get update -qq && \ + DEBIAN_FRONTEND="noninteractive" apt-get install -qqy --no-install-recommends \ git wget bzip2 file unzip libtool pkg-config cmake build-essential \ automake yasm gettext autopoint vim-tiny python3 python3-distutils \ ninja-build ca-certificates curl less zip && \ apt-get clean -y && \ rm -rf /var/lib/apt/lists/* -# Manually install a newer version of CMake; this is needed since building -# LLVM requires CMake 3.13.4, while Ubuntu 18.04 ships with 3.10.2. If -# updating to a newer distribution, this can be dropped. -RUN cd /opt && \ - curl -LO https://github.com/Kitware/CMake/releases/download/v3.20.1/cmake-3.20.1-Linux-$(uname -m).tar.gz && \ - tar -zxf cmake-*.tar.gz && \ - rm cmake-*.tar.gz && \ - mv cmake-* cmake -ENV PATH=/opt/cmake/bin:$PATH - -# Install a newer version of Git; the version of Git in Ubuntu 18.04 is -# said to have issues with submodules, see e.g. -# https://github.com/mstorsjo/llvm-mingw/pull/210#issuecomment-870104971 and -# https://github.com/mstorsjo/llvm-mingw/pull/210#issuecomment-873486503. -# This isn't needed for building LLVM itself, but makes the built Docker -# image more useful for use as image for building other projects. If updating -# to a newer distribution, this can be dropped. -RUN apt-get update -qq && \ - apt-get install -qqy --no-install-recommends software-properties-common && \ - add-apt-repository ppa:git-core/ppa && \ - apt-get update -qq && \ - apt-get upgrade -qqy git && \ - apt-get clean -y && \ - rm -rf /var/lib/apt/lists/* - - RUN git config --global user.name "LLVM MinGW" && \ git config --global user.email root@localhost diff --git a/Dockerfile.dev b/Dockerfile.dev index 2046a73..4db9eb3 100644 --- a/Dockerfile.dev +++ b/Dockerfile.dev @@ -1,38 +1,13 @@ -FROM ubuntu:18.04 +FROM ubuntu:20.04 -RUN apt-get update -qq && apt-get install -qqy --no-install-recommends \ +RUN apt-get update -qq && \ + DEBIAN_FRONTEND="noninteractive" apt-get install -qqy --no-install-recommends \ git wget bzip2 file unzip libtool pkg-config cmake build-essential \ automake yasm gettext autopoint vim-tiny python3 python3-distutils \ ninja-build ca-certificates curl less zip && \ apt-get clean -y && \ rm -rf /var/lib/apt/lists/* -# Manually install a newer version of CMake; this is needed since building -# LLVM requires CMake 3.13.4, while Ubuntu 18.04 ships with 3.10.2. If -# updating to a newer distribution, this can be dropped. -RUN cd /opt && \ - curl -LO https://github.com/Kitware/CMake/releases/download/v3.20.1/cmake-3.20.1-Linux-$(uname -m).tar.gz && \ - tar -zxf cmake-*.tar.gz && \ - rm cmake-*.tar.gz && \ - mv cmake-* cmake -ENV PATH=/opt/cmake/bin:$PATH - -# Install a newer version of Git; the version of Git in Ubuntu 18.04 is -# said to have issues with submodules, see e.g. -# https://github.com/mstorsjo/llvm-mingw/pull/210#issuecomment-870104971 and -# https://github.com/mstorsjo/llvm-mingw/pull/210#issuecomment-873486503. -# This isn't needed for building LLVM itself, but makes the built Docker -# image more useful for use as image for building other projects. If updating -# to a newer distribution, this can be dropped. -RUN apt-get update -qq && \ - apt-get install -qqy --no-install-recommends software-properties-common && \ - add-apt-repository ppa:git-core/ppa && \ - apt-get update -qq && \ - apt-get upgrade -qqy git && \ - apt-get clean -y && \ - rm -rf /var/lib/apt/lists/* - - RUN git config --global user.name "LLVM MinGW" && \ git config --global user.email root@localhost diff --git a/release.sh b/release.sh index b4fd1ff..40bdc72 100755 --- a/release.sh +++ b/release.sh @@ -29,7 +29,7 @@ fi time docker build -f Dockerfile . -t mstorsjo/llvm-mingw:latest -t mstorsjo/llvm-mingw:$TAG -DISTRO=ubuntu-18.04-$(uname -m) +DISTRO=ubuntu-20.04-$(uname -m) docker run --rm mstorsjo/llvm-mingw:latest sh -c "cd /opt && mv llvm-mingw llvm-mingw-$TAG-ucrt-$DISTRO && tar -Jcvf - llvm-mingw-$TAG-ucrt-$DISTRO" > llvm-mingw-$TAG-ucrt-$DISTRO.tar.xz if [ -n "$NATIVEONLY" ]; then