Skip to content

Commit

Permalink
Merge branch 'KDAB:2.1' into feelpp
Browse files Browse the repository at this point in the history
  • Loading branch information
vincentchabannes authored Apr 13, 2024
2 parents 8a458f3 + ce788ad commit b90e5da
Show file tree
Hide file tree
Showing 373 changed files with 19,772 additions and 6,780 deletions.
1 change: 1 addition & 0 deletions .clang-tidy
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ Checks: '*, -google-*, -objc-*, -llvmlibc-*, -zircon-*,
-misc-non-private-member-variables-in-classes,
-misc-no-recursion,
-misc-use-anonymous-namespace,
-misc-include-cleaner,
-cppcoreguidelines-pro-type-const-cast,
-cppcoreguidelines-macro-usage,
-cppcoreguidelines-owning-memory,
Expand Down
19 changes: 5 additions & 14 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -14,34 +14,25 @@

# Instructions:
# docker build -t kddw-tests .
# docker run -it -v /data/sources/kddockwidgets/:/kddockwidgets/ -v ~/Qt/5.15.2/gcc_64/:/Qt5/ -v ~/Qt/6.6.0/gcc_64/:/Qt6/ --ulimit nofile=1024:4096 -u 1000:1000 kddw-tests
# docker run -it -v /data/sources/kddockwidgets/:/kddockwidgets/ -v ~/Qt/5.15.2/gcc_64/:/Qt5/ -v ~/Qt/6.6.0/gcc_64/:/Qt6/ --cap-add=SYS_PTRACE --security-opt seccomp=unconfined --ulimit nofile=1024:4096 -u 1000:1000 kddw-tests
# cd /kddockwidgets/
# cmake --preset=dev
# cd build-dev && ninja
# QT_QUICK_BACKEND=software ctest -j12

FROM ubuntu:22.04
FROM ubuntu:24.04
MAINTAINER Sergio Martins ([email protected])

ENV TZ=Europe/Berlin
ENV LC_CTYPE=C.UTF-8
ENV PATH=$PATH:/Qt5/bin/:/Qt6/bin/
ENV LD_LIBRARY_PATH=/Qt5/lib/:/Qt6/lib/
ENV QT_QUICK_BACKEND=software
ENV LSAN_OPTIONS=detect_leaks=0

RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone

RUN apt update
RUN apt install build-essential software-properties-common lld git cmake ninja-build \
RUN apt update -qq && apt install build-essential software-properties-common lld git cmake ninja-build \
mesa-common-dev libglu1-mesa-dev libglib2.0-dev libfontconfig \
libxkbcommon-dev mesa-utils libgl1-mesa-dev libglu1-mesa-dev \
vim clang-tidy-14 valgrind pip libxslt-dev llvm -y

RUN pip install shiboken6-generator==6.6.0 shiboken6==6.6.0 pyside6==6.6.0

RUN pip install --index-url=https://download.qt.io/official_releases/QtForPython \
--trusted-host download.qt.io shiboken2-generator==5.15.2.1 shiboken2==5.15.2.1 pyside2==5.15.2.1

RUN mkdir /home/user && \
groupadd -g 1000 defaultgroup && \
useradd -u 1000 -g defaultgroup user -m && chown -R user /home/user
vim clang-tidy-14 valgrind pip libxslt-dev llvm libspdlog-dev clazy clang -y
42 changes: 42 additions & 0 deletions .devcontainer/Dockerfile_python
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
#
# This file is part of KDDockWidgets.
#
# SPDX-FileCopyrightText: 2023 Klarälvdalens Datakonsult AB, a KDAB Group company <[email protected]>
# Author: Sérgio Martins <[email protected]>
#
# SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only
#
# Contact KDAB at <[email protected]> for commercial licensing options.

# A minimal Dockerfile that's able to build KDDW Python support

# Instructions:
# docker build -t kddw-python .
# docker run -it -v /data/sources/kddockwidgets/:/kddockwidgets/ -v ~/Qt/5.15.2/gcc_64/:/Qt5/ -v ~/Qt/6.6.0/gcc_64/:/Qt6/ --cap-add=SYS_PTRACE --security-opt seccomp=unconfined --ulimit nofile=1024:4096 -u 1000:1000 kddw-python
# cd /kddockwidgets/

FROM ubuntu:22.04
MAINTAINER Sergio Martins ([email protected])

ENV TZ=Europe/Berlin
ENV LC_CTYPE=C.UTF-8
ENV PATH=$PATH:/Qt5/bin/:/Qt6/bin/
ENV LD_LIBRARY_PATH=/Qt5/lib/:/Qt6/lib/
ENV QT_QUICK_BACKEND=software
ENV LSAN_OPTIONS=detect_leaks=0

RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone

RUN apt update -qq && apt install build-essential software-properties-common lld git cmake ninja-build \
mesa-common-dev libglu1-mesa-dev libglib2.0-dev libfontconfig \
libxkbcommon-dev mesa-utils libgl1-mesa-dev libglu1-mesa-dev \
vim clang-tidy-14 valgrind pip libxslt-dev llvm libspdlog-dev clazy clang -y

RUN pip install shiboken6-generator==6.6.0 shiboken6==6.6.0 pyside6==6.6.0

RUN pip install --index-url=https://download.qt.io/official_releases/QtForPython \
--trusted-host download.qt.io shiboken2-generator==5.15.2.1 shiboken2==5.15.2.1 pyside2==5.15.2.1

RUN mkdir /home/user && \
groupadd -g 1000 defaultgroup && \
useradd -u 1000 -g defaultgroup user -m && chown -R user /home/user
2 changes: 1 addition & 1 deletion .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
},
"mounts": [
"source=${localEnv:HOME}/Qt/5.15.2/gcc_64/,target=/Qt5/,type=bind",
"source=${localEnv:HOME}/Qt/6.3.2/gcc_64/,target=/Qt6/,type=bind"
"source=${localEnv:HOME}/Qt/6.6.0/gcc_64/,target=/Qt6/,type=bind"
],
"remoteUser": "user"
}
3 changes: 3 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[*.sh]
indent_style = space
indent_size = 2
22 changes: 22 additions & 0 deletions .github/actions/qt6-asan/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#
# This file is part of KDDockWidgets.
#
# SPDX-FileCopyrightText: 2024 Klarälvdalens Datakonsult AB, a KDAB Group company <[email protected]>
# Author: Sérgio Martins <[email protected]>
#
# SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only
#
# Contact KDAB at <[email protected]> for commercial licensing options.

# Dockerfile for qt6-asan GitHub Action

FROM iamsergio/kddw-qt6-asan
MAINTAINER Sergio Martins ([email protected])

ENV PATH=$PATH:/Qt6/bin/
ENV LD_LIBRARY_PATH=/Qt6/lib/
ENV QT_QUICK_BACKEND=software
ENV LSAN_OPTIONS=detect_leaks=0

COPY entrypoint.sh /entrypoint.sh
ENTRYPOINT ["/entrypoint.sh"]
73 changes: 73 additions & 0 deletions .github/actions/qt6-asan/Dockerfile_qtasan
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
#
# This file is part of KDDockWidgets.
#
# SPDX-FileCopyrightText: 2024 Klarälvdalens Datakonsult AB, a KDAB Group company <[email protected]>
# Author: Sérgio Martins <[email protected]>
#
# SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only
#
# Contact KDAB at <[email protected]> for commercial licensing options.

# Dockerfile for qt6-asan GitHub Action

# Instructions for manual inspection:
# docker build -t kddw-qt6-asan .
# docker run -it -v /data/sources/kddockwidgets/:/kddockwidgets/ kddw-qt6-asan
# cd /kddockwidgets/
# cmake --preset=dev-asan6
# cd build-dev-asan6 && ninja
# ctest -j12

# To prepare an image for GitHub actions we import and export to remove layers
# so the image occupies less space:
# docker build -t kddw-qt6-asan .
# docker run -it kddw-qt6-asan # and exit
# docker ps # to check sha
# docker export -o mycontainer.tar <container_sha>
# docker import mycontainer.tar
# docker images # to check sha
# docker tag <image_sha> iamsergio/kddw-qt6-asan
# docker push iamsergio/kddw-qt6-asan

FROM ubuntu:24.04
MAINTAINER Sergio Martins ([email protected])

ENV TZ=Europe/Berlin
ENV LC_CTYPE=C.UTF-8
ENV PATH=$PATH:/Qt6/bin/
ENV LD_LIBRARY_PATH=/Qt6/lib/
ENV QT_QUICK_BACKEND=software
ENV LSAN_OPTIONS=detect_leaks=0

RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone

RUN apt update
RUN apt install build-essential software-properties-common lld git cmake ninja-build \
mesa-common-dev libglu1-mesa-dev libglib2.0-dev libfontconfig \
libxkbcommon-dev mesa-utils libgl1-mesa-dev libglu1-mesa-dev \
libxslt-dev libspdlog-dev -y

RUN mkdir /sources/

RUN git clone https://code.qt.io/qt/qt5.git /sources/qt6
RUN cd /sources/qt6 && git switch 6.6 && perl init-repository --module-subset=qtbase,qtshadertools,qtdeclarative

# Build qtbase first, so we can delete its build dir to save space, as GitHub has storage limits
RUN mkdir /build/ && cd /build/ && /sources/qt6/qtbase/configure -prefix /Qt6/ -debug -sanitize address -- -DQT_BUILD_EXAMPLES=OFF
RUN cmake --build /build/ --parallel
RUN cmake --install /build/
RUN rm -rf /build/

# qtshadertools
RUN mkdir /build/ && cd /build/ && qt-cmake -G Ninja /sources/qt6/qtshadertools/
RUN cmake --build /build/ --parallel
RUN cmake --install /build/
RUN rm -rf /build/

# qtdeclarative
RUN mkdir /build/ && cd /build/ && qt-cmake -G Ninja /sources/qt6/qtdeclarative/
RUN cmake --build /build/ --parallel
RUN cmake --install /build/
RUN rm -rf /build/

RUN rm -rf /sources/
4 changes: 4 additions & 0 deletions .github/actions/qt6-asan/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# qt6-asan

An action that builds and runs KDDW's tests against an ASAN build of Qt itself.
The Dockerfile clones and builds Qt6 with ASAN.
9 changes: 9 additions & 0 deletions .github/actions/qt6-asan/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# SPDX-FileCopyrightText: 2024 Klarälvdalens Datakonsult AB, a KDAB Group company <[email protected]>
#
# SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only

name: 'build-against-qt6-asan'
description: 'Builds and runs KDDW tests against a Qt6 built with ASAN/UBSAN'
runs:
using: 'docker'
image: 'Dockerfile'
8 changes: 8 additions & 0 deletions .github/actions/qt6-asan/entrypoint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/bin/sh -l

# SPDX-FileCopyrightText: 2024 Klarälvdalens Datakonsult AB, a KDAB Group company <[email protected]>
#
# SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only
cd /github/workspace/ || exit 1
env
cmake --preset=ci-dev-asan-qt6 -DCMAKE_PREFIX_PATH=/Qt6 && cd build-ci-dev-asan-qt6/ && ninja && ctest -j4 --output-on-failure
22 changes: 22 additions & 0 deletions .github/actions/qt6-lsan/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#
# This file is part of KDDockWidgets.
#
# SPDX-FileCopyrightText: 2024 Klarälvdalens Datakonsult AB, a KDAB Group company <[email protected]>
# Author: Sérgio Martins <[email protected]>
#
# SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only
#
# Contact KDAB at <[email protected]> for commercial licensing options.

# Dockerfile for qt6-asan GitHub Action

FROM iamsergio/kddw-qt6-asan
MAINTAINER Sergio Martins ([email protected])

ENV PATH=$PATH:/Qt6/bin/
ENV LD_LIBRARY_PATH=/Qt6/lib/
ENV QT_QUICK_BACKEND=software
ENV LSAN_OPTIONS=detect_leaks=1

COPY entrypoint.sh /entrypoint.sh
ENTRYPOINT ["/entrypoint.sh"]
4 changes: 4 additions & 0 deletions .github/actions/qt6-lsan/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# qt6-asan

An action that builds and runs KDDW's tests against an LSAN build
The Dockerfile clones and builds Qt6 with ASAN.
9 changes: 9 additions & 0 deletions .github/actions/qt6-lsan/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# SPDX-FileCopyrightText: 2024 Klarälvdalens Datakonsult AB, a KDAB Group company <[email protected]>
#
# SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only

name: 'build-against-qt6-lsan'
description: 'Builds and runs KDDW tests against a Qt6 built with LSAN'
runs:
using: 'docker'
image: 'Dockerfile'
9 changes: 9 additions & 0 deletions .github/actions/qt6-lsan/entrypoint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/bin/sh -l

# SPDX-FileCopyrightText: 2024 Klarälvdalens Datakonsult AB, a KDAB Group company <[email protected]>
#
# SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only
cd /github/workspace/ || exit 1
env
cmake --preset=ci-dev-asan-qtwidgets-qt6 -DCMAKE_PREFIX_PATH=/Qt6 && cd build-ci-dev-asan-qtwidgets-qt6/ && ninja && ctest -j4 --output-on-failure && cd .. &&
cmake --preset=ci-dev-asan-qtquick-qt6 -DCMAKE_PREFIX_PATH=/Qt6 && cd build-ci-dev-asan-qtquick-qt6/ && ninja && ctest -j4 --output-on-failure
59 changes: 59 additions & 0 deletions .github/workflows/asan5.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
# SPDX-FileCopyrightText: 2023 Klarälvdalens Datakonsult AB, a KDAB Group company <[email protected]>
#
# SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only

name: Nightly ASAN Qt5

on:
schedule:
- cron: '0 3 * * *'
workflow_dispatch:

jobs:
build:
runs-on: ubuntu-22.04
strategy:
fail-fast: true
matrix:
preset:
- name: ci-dev-asan-qt5
qt_version: "5.15"

steps:
- name: Install Qt ${{ matrix.preset.qt_version }}
uses: jurplel/install-qt-action@v3
with:
version: ${{ matrix.preset.qt_version }}
cache: true

- name: Install dependencies on Ubuntu
run: |
sudo apt update -qq
sudo apt install lld libspdlog-dev ninja-build -y
- name: Checkout sources
uses: actions/checkout@v4

- name: Configure project
run: cmake -S . -B ./build-${{ matrix.preset.name }} --preset ${{ matrix.preset.name }}

- name: Build Project ${{ matrix.preset.build_preset_arg }}
run: cmake --build ./build-${{ matrix.preset.name }} ${{ matrix.preset.build_preset_arg }}

- name: Fix ASAN on ubuntu 22.04
run: |
sudo sysctl vm.mmap_rnd_bits=28
sudo sysctl vm.mmap_rnd_compat_bits=8
- name: Run tests on Linux (offscreen)
run: ctest --test-dir ./build-${{ matrix.preset.name }} --output-on-failure
env:
QT_QPA_PLATFORM: offscreen
QT_QUICK_BACKEND: software
LSAN_OPTIONS: detect_leaks=0

- name: Read tests log when it fails
uses: andstor/file-reader-action@v1
if: ${{ failure() && startsWith(matrix.preset.name, 'ci-dev-') }}
with:
path: "./build-${{ matrix.preset.name }}/Testing/Temporary/LastTest.log"
Loading

0 comments on commit b90e5da

Please sign in to comment.