From 04f30658cdf83f47d822177993d99af2ddc17831 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Fri, 7 Oct 2022 02:34:11 +0200 Subject: [PATCH 1/9] Remove CI builds not using C++11 Also add MSVS 2019 and 2022 builds to AppVeyor. --- .github/workflows/ci.yml | 2 +- .github/workflows/ci_cmake.yml | 1 - appveyor.yml | 14 +++++--------- 3 files changed, 6 insertions(+), 11 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index dde8d63dd3..dabb4ae87e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -71,7 +71,7 @@ jobs: use_xvfb: true - name: Ubuntu 18.04 wxGTK 3 STL runner: ubuntu-18.04 - configure_flags: --enable-cxx11 --enable-stl --disable-compat30 + configure_flags: --enable-stl --disable-compat30 use_xvfb: true - name: Ubuntu 18.04 wxGTK 3 with clang runner: ubuntu-18.04 diff --git a/.github/workflows/ci_cmake.yml b/.github/workflows/ci_cmake.yml index 336403c5ab..6e5ba03c71 100644 --- a/.github/workflows/ci_cmake.yml +++ b/.github/workflows/ci_cmake.yml @@ -63,7 +63,6 @@ jobs: - name: macOS 11 wxOSX runner: macos-11 cmake_generator: Xcode - cmake_defines: -DCMAKE_CXX_STANDARD=11 - name: macOS 11 wxIOS runner: macos-11 cmake_generator: Xcode diff --git a/appveyor.yml b/appveyor.yml index 2b16f4f34f..b8f430877d 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -3,7 +3,6 @@ version: '{build}' branches: only: - master - - WX_3_0_BRANCH skip_commits: files: @@ -38,27 +37,24 @@ environment: CONFIGURATION: DLL Release ARCH: x64 wxUSE_STL: 1 - - TOOLSET: nmake - VS: '9.0' - BUILD: release - ARCH: x86 + APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2022 - TOOLSET: nmake VS: '14.0' BUILD: debug ARCH: amd64 wxUSE_STL: 1 wxUSE_WEBVIEW_EDGE: 1 - - TOOLSET: mingw - - TOOLSET: msys2 - MSYSTEM: MINGW32 + APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015 - TOOLSET: cmake - GENERATOR: 'Visual Studio 12' + GENERATOR: 'Visual Studio 15 2017' SHARED: ON CONFIGURATION: Release + APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017 - TOOLSET: cmake_qt GENERATOR: 'Visual Studio 14 2015 Win64' SHARED: ON CONFIGURATION: Release + APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015 clone_depth: 50 From 2c206e7b6e2ac77778f105cdcd7ed78892fc55bd Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Fri, 7 Oct 2022 02:34:45 +0200 Subject: [PATCH 2/9] Always require C++11 for CMake builds --- CMakeLists.txt | 3 +++ build/tools/appveyor.bat | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 9c9f78b9dd..ee8fd239c1 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -97,6 +97,9 @@ endif() project(wxWidgets VERSION ${wxVERSION} LANGUAGES ${wxLANGUAGES}) +set(CMAKE_CXX_STANDARD 11) +set(CMAKE_CXX_STANDARD_REQUIRED ON) + include(build/cmake/main.cmake) # Set the default startup project for Visual Studio diff --git a/build/tools/appveyor.bat b/build/tools/appveyor.bat index ed8c6800e4..999d555708 100644 --- a/build/tools/appveyor.bat +++ b/build/tools/appveyor.bat @@ -65,7 +65,7 @@ goto :eof :cmake_qt set SKIPINSTALL=1 set QT5DIR="C:\Qt\5.11\msvc2015_64" -set CMAKE_CONFIGURE_FLAGS=-DCMAKE_PREFIX_PATH=%QT5DIR% -DwxBUILD_TOOLKIT="qt" -DCMAKE_CXX_STANDARD=11 +set CMAKE_CONFIGURE_FLAGS=-DCMAKE_PREFIX_PATH=%QT5DIR% -DwxBUILD_TOOLKIT="qt" goto cmake :cmake From c93b1066c12d0aa1239e0db82af7cb99f7b78808 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Fri, 7 Oct 2022 17:16:18 +0200 Subject: [PATCH 3/9] Run Ubuntu 18.04 builds in a container Ubuntu 18.04 runner is being discontinued by GitHub, so switch the builds using it to using a container. We probably ought to actually run all of the builds in containers to make them independent of changes to GitHub environment. --- .github/workflows/ci.yml | 62 +++++++++++++++++++++++++++++++++------- 1 file changed, 51 insertions(+), 11 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index dabb4ae87e..a43eca6155 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -52,29 +52,34 @@ jobs: build: runs-on: ${{ matrix.runner }} name: ${{ matrix.name }} + container: ${{ matrix.container }} strategy: fail-fast: false matrix: include: - name: Ubuntu 18.04 wxGTK 2 - runner: ubuntu-18.04 + runner: ubuntu-latest + container: ubuntu:18.04 gtk_version: 2 use_xvfb: true - - name: Ubuntu 18.04 wxGTK 2 UTF-8 - runner: ubuntu-18.04 - gtk_version: 2 + - name: Ubuntu 18.04 wxGTK UTF-8 + runner: ubuntu-latest + container: ubuntu:18.04 configure_flags: --enable-utf8 --enable-utf8only --enable-monolithic use_xvfb: true - name: Ubuntu 18.04 wxGTK3 static - runner: ubuntu-18.04 + runner: ubuntu-latest + container: ubuntu:18.04 configure_flags: --disable-shared use_xvfb: true - name: Ubuntu 18.04 wxGTK 3 STL - runner: ubuntu-18.04 + runner: ubuntu-latest + container: ubuntu:18.04 configure_flags: --enable-stl --disable-compat30 use_xvfb: true - name: Ubuntu 18.04 wxGTK 3 with clang - runner: ubuntu-18.04 + runner: ubuntu-latest + container: ubuntu:18.04 compiler: clang configure_flags: --disable-sys-libs use_xvfb: true @@ -93,20 +98,24 @@ jobs: configure_flags: --with-cxx=20 skip_samples: true - name: Ubuntu 18.04 wxX11 - runner: ubuntu-18.04 + runner: ubuntu-latest + container: ubuntu:18.04 configure_flags: --with-x11 --enable-pch --disable-stc skip_samples: true - name: Ubuntu 18.04 wxDFB - runner: ubuntu-18.04 + runner: ubuntu-latest + container: ubuntu:18.04 configure_flags: --with-directfb --enable-pch --disable-stc skip_samples: true allow_warnings: true - name: Ubuntu 18.04 wxMotif - runner: ubuntu-18.04 + runner: ubuntu-latest + container: ubuntu:18.04 configure_flags: --with-motif --enable-pch --disable-stc skip_samples: true - name: Ubuntu 18.04 wxQt - runner: ubuntu-18.04 + runner: ubuntu-latest + container: ubuntu:18.04 configure_flags: --with-qt --enable-pch --without-opengl skip_samples: true @@ -117,6 +126,37 @@ jobs: wxUSE_XVFB: ${{ matrix.use_xvfb && 1 || 0 }} steps: + - name: Set up build system + run: | + case '${{ matrix.container }}' in + ubuntu:*) + export DEBIAN_FRONTEND=noninteractive + + if [ '${{ matrix.container }}' = 'ubuntu:18.04' ]; then + # First get the package containing /usr/bin/apt-add-repository. + apt-get update -qq + apt-get install -qq software-properties-common + + # Git 2.17 in the official repository is too old to checkout + # submodules using it, so get a newer version. + apt-add-repository ppa:git-core/ppa + fi + + # Explanation for installing some less obvious packages: + # - coreutils contains nproc used in proc_count.sh called below. + # - locales contains locale-gen also used below. + apt-get update -qq + apt-get install -qq coreutils g++ git locales make pkg-config sudo + ;; + + '') + ;; + + *) + echo '::error ::Unknown container kind.' + exit 1 + esac + - name: Checkout uses: actions/checkout@v2 with: From d088c61b3982cf235dc0fd2e92409d8bbf6faa34 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sun, 9 Oct 2022 01:25:32 +0200 Subject: [PATCH 4/9] Don't install latest Python when running inside container This doesn't work because the action installs an ABI-incompatible version of Python 3.10, resulting in errors like the following python3: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.28' not found (required by /__t/Python/3.10.7/x64/lib/libpython3.10.so.1.0) so try using the system version (3.6) to avoid this. --- .github/workflows/ci.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a43eca6155..5aa008285e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -145,8 +145,11 @@ jobs: # Explanation for installing some less obvious packages: # - coreutils contains nproc used in proc_count.sh called below. # - locales contains locale-gen also used below. + # - Python can't be installed using the action as usual because + # it installs an ABI-incompatible version, see (wrongly, IMO) + # closed https://github.com/actions/setup-python/issues/370 apt-get update -qq - apt-get install -qq coreutils g++ git locales make pkg-config sudo + apt-get install -qq coreutils g++ git locales make pkg-config python3 python3-pip sudo ;; '') @@ -263,6 +266,7 @@ jobs: make -k $wxBUILD_ARGS "CXXFLAGS=$wxMAKEFILE_CXXFLAGS" "LDFLAGS=$wxMAKEFILE_LDFLAGS" - name: Setup Python + if: matrix.container == '' uses: actions/setup-python@v4 with: python-version: '3.10' From 256d7296b209acc1ce8c7235231ceeb753871aa3 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sun, 9 Oct 2022 01:40:31 +0200 Subject: [PATCH 5/9] Install xvfb when using a container Unlike the full GitHub environment, this package is not pre-installed in a "plain" Ubuntu container. --- .github/workflows/ci.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 5aa008285e..200f47497a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -148,8 +148,9 @@ jobs: # - Python can't be installed using the action as usual because # it installs an ABI-incompatible version, see (wrongly, IMO) # closed https://github.com/actions/setup-python/issues/370 + # - xvfb is used for running the GUI tests. apt-get update -qq - apt-get install -qq coreutils g++ git locales make pkg-config python3 python3-pip sudo + apt-get install -qq coreutils g++ git locales make pkg-config python3 python3-pip sudo xvfb ;; '') From be97082425bd817f70aefec6d0d5d369da899650 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sun, 9 Oct 2022 14:15:01 +0200 Subject: [PATCH 6/9] Install the specified compiler package in container Don't always install g++ as an existing build uses clang. Also modify another build to use g++-4.8 as this is the oldest still supported compiler and so it's nice to have a build using it. --- .github/workflows/ci.yml | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 200f47497a..d6aefed664 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -67,8 +67,9 @@ jobs: container: ubuntu:18.04 configure_flags: --enable-utf8 --enable-utf8only --enable-monolithic use_xvfb: true - - name: Ubuntu 18.04 wxGTK3 static + - name: Ubuntu 18.04 wxGTK 3 static with gcc 4.8 runner: ubuntu-latest + compiler: g++-4.8 container: ubuntu:18.04 configure_flags: --disable-shared use_xvfb: true @@ -79,7 +80,6 @@ jobs: use_xvfb: true - name: Ubuntu 18.04 wxGTK 3 with clang runner: ubuntu-latest - container: ubuntu:18.04 compiler: clang configure_flags: --disable-sys-libs use_xvfb: true @@ -142,6 +142,8 @@ jobs: apt-add-repository ppa:git-core/ppa fi + compiler=${{ matrix.compiler }} + # Explanation for installing some less obvious packages: # - coreutils contains nproc used in proc_count.sh called below. # - locales contains locale-gen also used below. @@ -150,7 +152,7 @@ jobs: # closed https://github.com/actions/setup-python/issues/370 # - xvfb is used for running the GUI tests. apt-get update -qq - apt-get install -qq coreutils g++ git locales make pkg-config python3 python3-pip sudo xvfb + apt-get install -qq coreutils ${compiler-g++} git locales make pkg-config python3 python3-pip sudo xvfb ;; '') @@ -184,7 +186,8 @@ jobs: # messages from WebKit tests that we're not interested in. echo NO_AT_BRIDGE=1 >> $GITHUB_ENV - case "${{ matrix.compiler }}" in + compiler=${{ matrix.compiler }} + case "$compiler" in clang) echo CC=clang >> $GITHUB_ENV echo CXX='clang++ -stdlib=libc++' >> $GITHUB_ENV @@ -193,6 +196,13 @@ jobs: allow_warn_opt="-Wno-error=#warnings" ;; + g++*) + echo CC=`echo $compiler | sed s/++/cc/` >> $GITHUB_ENV + echo CXX=$compiler >> $GITHUB_ENV + echo LD=$compiler >> $GITHUB_ENV + allow_warn_opt="-Wno-error=cpp" + ;; + '') # Assume gcc. allow_warn_opt="-Wno-error=cpp" From 549be66c7da696d3605cf4ed784458fb1d477a4a Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sun, 9 Oct 2022 16:15:57 +0200 Subject: [PATCH 7/9] Avoid warnings about deprecated functions inside glib.h This happens when using gcc 4.8 under Ubuntu 18.04 and has to be suppressed in the source file including the header as just doing it in the header itself, with the usual wxGCC_WARNING_SUPPRESS/RESTORE macros, has no effect, i.e. the warning is still given even if we bracket glib.h inclusion with them. --- src/gtk/webview_webkit2.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/gtk/webview_webkit2.cpp b/src/gtk/webview_webkit2.cpp index 5826177a81..efe4e75800 100644 --- a/src/gtk/webview_webkit2.cpp +++ b/src/gtk/webview_webkit2.cpp @@ -11,6 +11,13 @@ #if wxUSE_WEBVIEW && wxUSE_WEBVIEW_WEBKIT2 +// In Ubuntu 18.04 compiling glib.h with gcc 4.8 results in the warnings inside +// it, and disabling them temporarily using wxGCC_WARNING_SUPPRESS/RESTORE +// doesn't work (i.e. they're still given), so disable them globally here. +#if wxCHECK_GCC_VERSION(4, 8) && !wxCHECK_GCC_VERSION(4, 9) + #pragma GCC diagnostic ignored "-Wdeprecated-declarations" +#endif + #include "wx/dir.h" #include "wx/dynlib.h" #include "wx/filename.h" From ab1c5105a0bc54c9cf4c8cf8832aca0c754b4fc5 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sun, 9 Oct 2022 16:18:50 +0200 Subject: [PATCH 8/9] Switch clang CI build to use Ubuntu 20.04 Running it in 18.04 container would require installing libc++-dev and other packages, it's simpler to just write it on the GitHub-provided runner where they're already installed. Note that we need to explicitly choose to use clang-10, as the GitHub runner has clang-11 and clang-12 installed as well and the default clang version is 11, but only libc++-10-dev is installed, so using the default clang with -stdlib=libc++ fails out of the box. --- .github/workflows/ci.yml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d6aefed664..9d2e574163 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -78,9 +78,9 @@ jobs: container: ubuntu:18.04 configure_flags: --enable-stl --disable-compat30 use_xvfb: true - - name: Ubuntu 18.04 wxGTK 3 with clang - runner: ubuntu-latest - compiler: clang + - name: Ubuntu 20.04 wxGTK 3 with clang + runner: ubuntu-20.04 + compiler: clang++-10 configure_flags: --disable-sys-libs use_xvfb: true - name: Ubuntu 20.04 wxGTK ANSI @@ -188,10 +188,10 @@ jobs: compiler=${{ matrix.compiler }} case "$compiler" in - clang) - echo CC=clang >> $GITHUB_ENV - echo CXX='clang++ -stdlib=libc++' >> $GITHUB_ENV - echo LD=clang++ >> $GITHUB_ENV + clang++*) + echo CC=`echo $compiler | sed s/++//` >> $GITHUB_ENV + echo CXX="$compiler -stdlib=libc++" >> $GITHUB_ENV + echo LD=$compiler >> $GITHUB_ENV allow_warn_opt="-Wno-error=#warnings" ;; From cccf2ba26380e7785f24a2bd4f28134a33ae0c51 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Mon, 10 Oct 2022 23:40:48 +0200 Subject: [PATCH 9/9] Try ignoring the first test failure in clang/Ubuntu 20.04 build For unknown reason this test fails when run for the first time on this system, but succeeds during the subsequent runs. --- .github/workflows/ci.yml | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 9d2e574163..fc7efb94ee 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -329,6 +329,15 @@ jobs: wx_tests_selection='~[.] ~RichTextCtrlTestCase' fi ulimit -c unlimited + + # This is exceedingly weird, but for some reason the first test using + # wxWebView in the build using clang under Ubuntu 20.04 fails (even + # if the timeout in the test is increased), so run it before really + # running the tests -- then they will succeed. + if [ '${{ matrix.compiler }}' = 'clang++-10' ]; then + xvfb-run -a -s '-screen 0 1600x1200x24' ./test_gui -c Title WebView >/dev/null 2>&1 || echo 'First wxWebView test failure ignored.' + fi + /bin/bash -o pipefail -c "xvfb-run -a -s '-screen 0 1600x1200x24' ./test_gui -d 1 $wx_tests_selection 2>&1 | tee -a test_gui.out" || rc=$? if [ -n "$rc" ]; then if fgrep -q '(core dumped)' test_gui.out; then