From 5df4dd36a7d60b4ab67cd6e179e1e729c3a4fd26 Mon Sep 17 00:00:00 2001 From: Ilya Fedin Date: Wed, 23 Nov 2022 21:10:44 +0400 Subject: [PATCH] Update Python to 3.8 in Docker --- .github/workflows/linux.yml | 2 +- Telegram/build/docker/build.sh | 8 ++------ Telegram/build/docker/centos_env/Dockerfile | 9 +++++---- Telegram/build/docker/centos_env/build.sh | 2 +- Telegram/build/docker/centos_env/run.sh | 2 +- 5 files changed, 10 insertions(+), 13 deletions(-) diff --git a/.github/workflows/linux.yml b/.github/workflows/linux.yml index b7febd2b7..44ab3bd0f 100644 --- a/.github/workflows/linux.yml +++ b/.github/workflows/linux.yml @@ -51,7 +51,7 @@ jobs: defaults: run: - shell: scl enable llvm-toolset-7.0 -- scl enable devtoolset-10 -- bash --noprofile --norc -eo pipefail {0} + shell: scl enable rh-python38 -- scl enable llvm-toolset-7.0 -- scl enable devtoolset-10 -- bash --noprofile --norc -eo pipefail {0} strategy: matrix: diff --git a/Telegram/build/docker/build.sh b/Telegram/build/docker/build.sh index a85e4894f..0c484bb6d 100755 --- a/Telegram/build/docker/build.sh +++ b/Telegram/build/docker/build.sh @@ -15,10 +15,6 @@ if [ ! -d "$FullScriptPath/../../../../DesktopPrivate" ]; then exit fi -Run () { - scl enable llvm-toolset-7.0 -- scl enable devtoolset-10 -- "$@" -} - HomePath="$FullScriptPath/../.." cd $HomePath @@ -30,10 +26,10 @@ if [ ! -f "/usr/bin/cmake" ]; then ln -s cmake3 /usr/bin/cmake fi -Run ./configure.sh +./configure.sh cd $ProjectPath -Run cmake --build . --config Release --target Telegram +cmake --build . --config Release --target Telegram cd $ReleasePath echo "$BinaryName build complete!" diff --git a/Telegram/build/docker/centos_env/Dockerfile b/Telegram/build/docker/centos_env/Dockerfile index 670cf911a..9d8569ecc 100644 --- a/Telegram/build/docker/centos_env/Dockerfile +++ b/Telegram/build/docker/centos_env/Dockerfile @@ -21,7 +21,7 @@ ENV PKG_CONFIG_PATH /usr/local/lib64/pkgconfig:/usr/local/lib/pkgconfig:/usr/loc RUN yum -y install https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm \ && yum -y install https://packages.endpointdev.com/rhel/7/os/x86_64/endpoint-repo.x86_64.rpm \ && yum -y install centos-release-scl \ - && yum -y install git python3-pip autoconf automake libtool patch \ + && yum -y install git rh-python38-python-pip autoconf automake libtool patch \ fontconfig-devel freetype-devel libX11-devel at-spi2-core-devel alsa-lib-devel \ pulseaudio-libs-devel mesa-libGL-devel mesa-libEGL-devel mesa-libgbm-devel \ libdrm-devel vulkan-devel gtk3-devel \ @@ -31,15 +31,15 @@ RUN yum -y install https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.n llvm-toolset-7.0-llvm-devel \ && yum clean all -RUN python3 -m pip install meson ninja - # Fix a bug with argument naming in CentOS 7 glibc RUN sed -i 's/char \*__block/char */' /usr/include/unistd.h -SHELL [ "bash", "-c", ". /opt/rh/devtoolset-10/enable; exec bash -c \"$@\"", "-s"] +SHELL [ "bash", "-c", ". /opt/rh/rh-python38/enable; . /opt/rh/devtoolset-10/enable; exec bash -c \"$@\"", "-s"] WORKDIR {{ LibrariesPath }} +RUN python3 -m pip install meson ninja + RUN mkdir /opt/cmake \ && curl -sSLo {{ CMAKE_FILE }} {{ GIT }}/Kitware/CMake/releases/download/v{{ CMAKE_VER }}/{{ CMAKE_FILE }} \ && sh {{ CMAKE_FILE }} --prefix=/opt/cmake --skip-license \ @@ -825,4 +825,5 @@ COPY --link --from=webrtc_debug {{ LibrariesPath }}/tg_owt/out/Debug tg_owt/out/ WORKDIR ../tdesktop VOLUME [ "/usr/src/tdesktop" ] +ENTRYPOINT [ "scl", "enable", "rh-python38", "--", "scl", "enable", "llvm-toolset-7.0", "--", "scl", "enable", "devtoolset-10", "--" ] CMD [ "/usr/src/tdesktop/Telegram/build/docker/centos_env/build.sh" ] diff --git a/Telegram/build/docker/centos_env/build.sh b/Telegram/build/docker/centos_env/build.sh index 8fa1e6ae0..b86f9911e 100755 --- a/Telegram/build/docker/centos_env/build.sh +++ b/Telegram/build/docker/centos_env/build.sh @@ -1,4 +1,4 @@ -#!/usr/bin/scl enable llvm-toolset-7.0 -- scl enable devtoolset-10 -- bash +#!/bin/bash cd Telegram ./configure.sh "$@" diff --git a/Telegram/build/docker/centos_env/run.sh b/Telegram/build/docker/centos_env/run.sh index 3df128ded..4be3f8f03 100755 --- a/Telegram/build/docker/centos_env/run.sh +++ b/Telegram/build/docker/centos_env/run.sh @@ -15,7 +15,7 @@ fi Command="$1" if [ "$Command" == "" ]; then - Command="scl enable llvm-toolset-7.0 -- scl enable devtoolset-10 -- bash" + Command="bash" fi docker run -it --rm --cpus=8 --memory=22g -v $HOME/Telegram/DesktopPrivate:/usr/src/DesktopPrivate -v $HOME/Telegram/tdesktop:/usr/src/tdesktop tdesktop:centos_env $Command