From fbe93b0afca4c266533923923046db05ffe3c6f2 Mon Sep 17 00:00:00 2001 From: John Preston Date: Sat, 2 Dec 2023 21:12:36 +0400 Subject: [PATCH 1/6] Fix webpage layouts with thumbnails. --- .../SourceFiles/history/view/media/history_view_web_page.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/Telegram/SourceFiles/history/view/media/history_view_web_page.cpp b/Telegram/SourceFiles/history/view/media/history_view_web_page.cpp index b42fca336b7939..ecd2884dff9226 100644 --- a/Telegram/SourceFiles/history/view/media/history_view_web_page.cpp +++ b/Telegram/SourceFiles/history/view/media/history_view_web_page.cpp @@ -421,9 +421,7 @@ QSize WebPage::countCurrentSize(int newWidth) { _pixh = (asSponsored ? kSponsoredUserpicLines : linesMax) * lineHeight; do { _pixw = asSponsored ? _pixh : articleThumbWidth(_data->photo, _pixh); - auto wleft = asSponsored - ? innerWidth - st::webPagePhotoDelta - qMax(_pixw, lineHeight) - : innerWidth; + auto wleft = innerWidth - st::webPagePhotoDelta - qMax(_pixw, lineHeight); newHeight = siteNameHeight; From 6c42095108b2c2e4de7b517c7fc899a2ff75cc81 Mon Sep 17 00:00:00 2001 From: Ilya Fedin Date: Fri, 15 Dec 2023 05:20:16 +0400 Subject: [PATCH 2/6] Move the GHCR authentication to the first set up step --- .github/workflows/docker.yml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index 947fc9178805ec..7a65b483fb3f26 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -28,6 +28,7 @@ jobs: run: | sudo apt update curl -sSL https://install.python-poetry.org | python3 - + echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u $ --password-stdin - name: Free up some disk space. uses: jlumbroso/free-disk-space@f68fdb76e2ea636224182cfb7377ff9a1708f9b8 @@ -40,6 +41,4 @@ jobs: - name: Push the Docker image. if: ${{ github.ref_name == github.event.repository.default_branch }} - run: | - echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u $ --password-stdin - docker push $IMAGE_TAG + run: docker push $IMAGE_TAG From 73294bfabf9e72e05b8d9c764c96d8db0a7bd070 Mon Sep 17 00:00:00 2001 From: Ilya Fedin Date: Fri, 15 Dec 2023 05:15:41 +0400 Subject: [PATCH 3/6] Make Linux action to use the pre-set entrypoint --- .github/workflows/linux.yml | 24 +++++++++--------------- 1 file changed, 9 insertions(+), 15 deletions(-) diff --git a/.github/workflows/linux.yml b/.github/workflows/linux.yml index 4961c68f3e9919..5ded5a0400b18b 100644 --- a/.github/workflows/linux.yml +++ b/.github/workflows/linux.yml @@ -43,15 +43,6 @@ jobs: linux: name: Rocky Linux 8 runs-on: ubuntu-latest - container: - image: ghcr.io/${{ github.repository }}/centos_env - credentials: - username: ${{ github.actor }} - password: ${{ secrets.GITHUB_TOKEN }} - - defaults: - run: - shell: scl enable gcc-toolset-12 -- bash --noprofile --norc -eo pipefail {0} strategy: matrix: @@ -75,12 +66,13 @@ jobs: - name: First set up. run: | - gcc --version - ln -s /usr/src/Libraries + echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u $ --password-stdin + docker pull ghcr.io/$GITHUB_REPOSITORY/centos_env + docker tag ghcr.io/$GITHUB_REPOSITORY/centos_env tdesktop:centos_env - name: Telegram Desktop build. run: | - cd $REPO_NAME/Telegram + cd $REPO_NAME DEFINE="" if [ -n "${{ matrix.defines }}" ]; then @@ -91,7 +83,11 @@ jobs: echo "ARTIFACT_NAME=Telegram" >> $GITHUB_ENV fi - ./configure.sh \ + docker run --rm \ + -v $PWD:/usr/src/tdesktop \ + -e DEBUG=1 \ + tdesktop:centos_env \ + /usr/src/tdesktop/Telegram/build/docker/centos_env/build.sh \ -D CMAKE_C_FLAGS_DEBUG="" \ -D CMAKE_CXX_FLAGS_DEBUG="" \ -D CMAKE_C_FLAGS="-Werror" \ @@ -101,8 +97,6 @@ jobs: -D DESKTOP_APP_DISABLE_CRASH_REPORTS=OFF \ $DEFINE - cmake --build ../out --config Debug --parallel - - name: Check. run: | filePath="$REPO_NAME/out/Debug/Telegram" From 4c82620677978472b3e1bf53ca34ead3d7a00e77 Mon Sep 17 00:00:00 2001 From: Ilya Fedin Date: Sat, 16 Dec 2023 03:22:16 +0400 Subject: [PATCH 4/6] Disable building libstdc++ tests --- Telegram/build/docker/centos_env/Dockerfile | 1 + snap/snapcraft.yaml | 1 + 2 files changed, 2 insertions(+) diff --git a/Telegram/build/docker/centos_env/Dockerfile b/Telegram/build/docker/centos_env/Dockerfile index a87d857df2f412..c7c5f8868a0581 100644 --- a/Telegram/build/docker/centos_env/Dockerfile +++ b/Telegram/build/docker/centos_env/Dockerfile @@ -729,6 +729,7 @@ RUN git clone -b 2.78.0 --depth=1 {{ GIT }}/GNOME/glibmm.git \ -Dbuild-examples=false \ -Dsigc++-3.0:build-documentation=false \ -Dsigc++-3.0:build-examples=false \ + -Dsigc++-3.0:build-tests=false \ -Dsigc++-3.0:validation=false \ -Dmm-common:use-network=true \ && meson compile -C build \ diff --git a/snap/snapcraft.yaml b/snap/snapcraft.yaml index 81b19266901ebf..16e8914b638a2d 100644 --- a/snap/snapcraft.yaml +++ b/snap/snapcraft.yaml @@ -296,6 +296,7 @@ parts: - -Dbuild-examples=false - -Dsigc++-3.0:build-documentation=false - -Dsigc++-3.0:build-examples=false + - -Dsigc++-3.0:build-tests=false - -Dsigc++-3.0:validation=false prime: - -./usr/include From 0ee0ffa7f1fbc813dff8c88df505ac66fd40439d Mon Sep 17 00:00:00 2001 From: Ilya Fedin Date: Sat, 16 Dec 2023 03:22:42 +0400 Subject: [PATCH 5/6] Update breakpad in Docker --- Telegram/build/docker/centos_env/Dockerfile | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) diff --git a/Telegram/build/docker/centos_env/Dockerfile b/Telegram/build/docker/centos_env/Dockerfile index c7c5f8868a0581..fce4df5f81b548 100644 --- a/Telegram/build/docker/centos_env/Dockerfile +++ b/Telegram/build/docker/centos_env/Dockerfile @@ -797,19 +797,10 @@ RUN git clone -b {{ QT_TAG }} --depth=1 {{ GIT }}/qt/qt5.git qt_{{ QT }} \ && cd .. \ && rm -rf qt_{{ QT }} -FROM patches AS breakpad -RUN git init breakpad \ +FROM builder AS breakpad +RUN git clone -b v2023.01.27 --depth=1 https://chromium.googlesource.com/breakpad/breakpad.git \ && cd breakpad \ - && git remote add origin https://chromium.googlesource.com/breakpad/breakpad.git \ - && git fetch --depth=1 origin dfcb7b6799b7c1e2c8d65e857d8afede185471d8 \ - && git reset --hard FETCH_HEAD \ - && git apply ../patches/breakpad.diff \ - && git init src/third_party/lss \ - && cd src/third_party/lss \ - && git remote add origin https://chromium.googlesource.com/linux-syscall-support.git \ - && git fetch --depth=1 origin e1e7b0ad8ee99a875b272c8e33e308472e897660 \ - && git reset --hard FETCH_HEAD \ - && cd ../../.. \ + && git clone -b v2022.10.12 --depth=1 https://chromium.googlesource.com/linux-syscall-support.git src/third_party/lss \ && env -u CFLAGS -u CXXFLAGS ./configure \ && make -j$(nproc) \ && make DESTDIR="{{ LibrariesPath }}/breakpad-cache" install \ From 3adbfb1fb50695702c041cb3384582b64091e803 Mon Sep 17 00:00:00 2001 From: Ilya Fedin Date: Fri, 15 Dec 2023 04:57:34 +0400 Subject: [PATCH 6/6] Update GCC to 13 in Docker --- Telegram/build/docker/centos_env/Dockerfile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Telegram/build/docker/centos_env/Dockerfile b/Telegram/build/docker/centos_env/Dockerfile index fce4df5f81b548..fbe9e0d162ef3d 100644 --- a/Telegram/build/docker/centos_env/Dockerfile +++ b/Telegram/build/docker/centos_env/Dockerfile @@ -24,14 +24,14 @@ RUN dnf -y install epel-release \ && dnf -y install autoconf automake libtool pkgconfig make patch git \ python3.11-pip python3.11-devel gperf flex bison clang lld yasm \ file which perl-open perl-XML-Parser xorg-x11-util-macros \ - gcc-toolset-12-gcc gcc-toolset-12-gcc-c++ gcc-toolset-12-binutils \ + gcc-toolset-13-gcc gcc-toolset-13-gcc-c++ gcc-toolset-13-binutils \ libffi-devel fontconfig-devel freetype-devel libX11-devel \ alsa-lib-devel pulseaudio-libs-devel mesa-libGL-devel mesa-libEGL-devel \ mesa-libgbm-devel libdrm-devel vulkan-devel libva-devel libvdpau-devel \ glib2-devel at-spi2-core-devel gtk3-devel boost1.78-devel fmt-devel \ && dnf clean all -SHELL [ "bash", "-c", ". /opt/rh/gcc-toolset-12/enable; exec bash -c \"$@\"", "-s"] +SHELL [ "bash", "-c", ". /opt/rh/gcc-toolset-13/enable; exec bash -c \"$@\"", "-s"] WORKDIR {{ LibrariesPath }} @@ -906,5 +906,5 @@ ENV BOOST_INCLUDEDIR /usr/include/boost1.78 ENV BOOST_LIBRARYDIR /usr/lib64/boost1.78 VOLUME [ "/usr/src/tdesktop" ] -ENTRYPOINT [ "scl", "enable", "gcc-toolset-12", "--" ] +ENTRYPOINT [ "scl", "enable", "gcc-toolset-13", "--" ] CMD [ "/usr/src/tdesktop/Telegram/build/docker/centos_env/build.sh" ]