Skip to content

Commit

Permalink
Boost 1.86 new CI builds
Browse files Browse the repository at this point in the history
Added gcc-14 build
Updated mysql8 to MySQL 8.4.1
Updated mariadb to MariaDB 11.4.2
Updated some CMake builds to the latest compiler versions
Updated GHA workflows to use Node 20 actions
Updated deprecated ENV commands in Dockerfiles
Removed debugging statements in OSX CI build
DB entrypoints are now inline scripts in Dockerfiles
TSAN is now run in ARM CIs and recent gcc's
TSAN is now disabled for TS executors

close #302
  • Loading branch information
anarthal authored Jul 8, 2024
1 parent 6c48d6c commit 3a49afe
Show file tree
Hide file tree
Showing 18 changed files with 84 additions and 80 deletions.
18 changes: 10 additions & 8 deletions .drone.star
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
#

_triggers = { "branch": [ "master", "develop" ] }
_container_tag = '252732b3d7af7f78618e877479b85d4d611a61f4'
_win_container_tag = 'ca0db5925a497b70e7d6b303c81d56b70c06f9ef'
_container_tag = 'c3f5316cc19bf3c0f7a83e31dec58139581f5764'
_win_container_tag = 'e7bd656c3515263f9b3c69a2d73d045f6a0fed72'


def _image(name):
Expand Down Expand Up @@ -100,6 +100,7 @@ def _pipeline(
"name": "Build and run",
"image": image,
"pull": "if-not-exists",
"privileged": arch == "arm64",
"volumes":[{
"name": "mysql-socket",
"path": "/var/run/mysqld"
Expand Down Expand Up @@ -279,11 +280,11 @@ def docs(name):
def main(ctx):
return [
# CMake Linux
linux_cmake('Linux CMake MySQL 5.x', _image('build-clang14'), db='mysql5', build_shared_libs=0),
linux_cmake('Linux CMake MariaDB', _image('build-clang14'), db='mariadb', build_shared_libs=1),
linux_cmake('Linux CMake MySQL 5.x', _image('build-gcc14'), db='mysql5', build_shared_libs=0),
linux_cmake('Linux CMake MariaDB', _image('build-gcc14'), db='mariadb', build_shared_libs=1),
linux_cmake('Linux CMake cmake 3.8', _image('build-cmake3_8'), cxxstd='11', install_test=0),
linux_cmake('Linux CMake gcc Release', _image('build-gcc11'), cmake_build_type='Release'),
linux_cmake('Linux CMake gcc MinSizeRel', _image('build-gcc13'), cmake_build_type='MinSizeRel'),
linux_cmake('Linux CMake gcc Release', _image('build-gcc14'), cmake_build_type='Release'),
linux_cmake('Linux CMake gcc MinSizeRel', _image('build-gcc14'), cmake_build_type='MinSizeRel'),
linux_cmake_noopenssl('Linux CMake no OpenSSL'),
linux_cmake_nointeg('Linux CMake without integration tests'),

Expand Down Expand Up @@ -314,8 +315,9 @@ def main(ctx):
linux_b2('Linux B2 gcc-11-arm64', _image('build-gcc11'), toolset='gcc-11', cxxstd='11,20', arch='arm64', variant='release'),
linux_b2('Linux B2 gcc-11-arm64-sanit', _image('build-gcc11'), toolset='gcc-11', cxxstd='20', arch='arm64', variant='debug'),
linux_b2('Linux B2 gcc-13', _image('build-gcc13'), toolset='gcc-13', cxxstd='20', variant='release'),
linux_b2('Linux B2 gcc-13-sanit', _image('build-gcc13'), toolset='gcc-13', cxxstd='20', variant='debug', address_sanitizer=1, undefined_sanitizer=1),
linux_b2('Linux B2 gcc-13-valgrind', _image('build-gcc13'), toolset='gcc-13', cxxstd='20', variant='debug', valgrind=1),
linux_b2('Linux B2 gcc-14', _image('build-gcc14'), toolset='gcc-14', cxxstd='23', variant='release'),
linux_b2('Linux B2 gcc-14-sanit', _image('build-gcc14'), toolset='gcc-14', cxxstd='23', variant='debug', address_sanitizer=1, undefined_sanitizer=1),
linux_b2('Linux B2 gcc-14-valgrind', _image('build-gcc14'), toolset='gcc-14', cxxstd='23', variant='debug', valgrind=1),
linux_b2('Linux B2 noopenssl', _image('build-noopenssl'), toolset='gcc', cxxstd='11', fail_if_no_openssl=0),

# B2 Windows
Expand Down
3 changes: 0 additions & 3 deletions .github/workflows/build-code.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,6 @@ jobs:
steps:
- uses: actions/checkout@v4
- run: |
brew --prefix openssl
realpath $(brew --prefix openssl)
find $(realpath $(brew --prefix openssl))
unlink /usr/local/bin/python || echo "/usr/local/bin/python not found"
ln -s /usr/local/bin/python3 /usr/local/bin/python
cp tools/user-config-osx-gha.jam ~/user-config.jam
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,12 @@ jobs:
coverage:
runs-on: ubuntu-latest
container:
image: ghcr.io/anarthal-containers/build-gcc13:252732b3d7af7f78618e877479b85d4d611a61f4
image: ghcr.io/anarthal-containers/build-gcc14:c3f5316cc19bf3c0f7a83e31dec58139581f5764
volumes:
- /var/run/mysqld:/var/run/mysqld
services:
mysql:
image: ghcr.io/anarthal-containers/mysql8:252732b3d7af7f78618e877479b85d4d611a61f4
image: ghcr.io/anarthal-containers/mysql8:c3f5316cc19bf3c0f7a83e31dec58139581f5764
ports:
- 3306:3306
volumes:
Expand All @@ -51,7 +51,7 @@ jobs:
run: |
SOURCE_DIR=$(pwd)
cd ~/boost-root
gcov-13 -r -p $(find bin.v2/ -name '*.gcda') > /dev/null
gcov-14 -r -p $(find bin.v2/ -name '*.gcda') > /dev/null
mkdir $GCOV_REPORT_DIR
cp boost#mysql#*.gcov $GCOV_REPORT_DIR
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/docker-linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,23 +49,23 @@ jobs:

steps:
- name: Checkout repository
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Set up QEMU
uses: docker/setup-qemu-action@v2
uses: docker/setup-qemu-action@v3

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
uses: docker/setup-buildx-action@v3

- name: Log in to the Container registry
uses: docker/login-action@v2
uses: docker/login-action@v3
with:
registry: ghcr.io
username: anarthal-containers
password: ${{ secrets.ANARTHAL_CONTAINERS_TOKEN }}

- name: Build and push
uses: docker/build-push-action@v4
uses: docker/build-push-action@v6
with:
context: .
push: true
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/docker-windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,10 @@ jobs:

steps:
- name: Checkout repository
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Log in to the Container registry
uses: docker/login-action@v2
uses: docker/login-action@v3
with:
registry: ghcr.io
username: anarthal-containers
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/fuzz.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,12 @@ jobs:
fuzz:
runs-on: ubuntu-latest
container:
image: ghcr.io/anarthal-containers/build-clang18:252732b3d7af7f78618e877479b85d4d611a61f4
image: ghcr.io/anarthal-containers/build-clang18:c3f5316cc19bf3c0f7a83e31dec58139581f5764
volumes:
- /var/run/mysqld:/var/run/mysqld
services:
mysql:
image: ghcr.io/anarthal-containers/mysql8:252732b3d7af7f78618e877479b85d4d611a61f4
image: ghcr.io/anarthal-containers/mysql8:c3f5316cc19bf3c0f7a83e31dec58139581f5764
ports:
- 3306:3306
volumes:
Expand Down
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,15 +55,15 @@ target_link_libraries(main PRIVATE Boost::charconv Threads::Threads OpenSSL::Cry

Boost.MySQL has been tested with the following compilers:

- gcc 5 to 13.
- clang 3.6 to 16.
- gcc 5 to 14.
- clang 3.6 to 18.
- msvc 14.1, 14.2 and 14.3.

And with the following databases:

- MySQL v5.7.41.
- MySQL v8.0.33.
- MariaDB v11.0.
- MySQL v8.4.1.
- MariaDB v11.4.2.

## Features

Expand Down
9 changes: 6 additions & 3 deletions doc/qbk/01_intro.qbk
Original file line number Diff line number Diff line change
Expand Up @@ -79,21 +79,24 @@ Boost.MySQL is tested under the following compilers:
* gcc 10.3 (Linux)
* gcc 11.2 (Linux)
* gcc 13.0 (Linux)
* gcc 14.0 (Linux)
* clang 3.6 (Linux)
* clang 7.0 (Linux)
* clang 11.0 (Linux)
* clang 14.0 (Linux)
* clang 16.0 (Linux)
* clang 14.0 (OSX)
* clang 17.0 (Linux)
* clang 18.0 (Linux)
* Apple clang 14.0 (OSX)
* MSVC 14.1 - Visual Studio 2017 (Windows)
* MSVC 14.2 - Visual Studio 2019 (Windows)
* MSVC 14.3 - Visual Studio 2022 (Windows)

And with the following RDBMS systems:

* MySQL v5.7.41.
* MySQL v8.0.33.
* MariaDB v11.0.
* MySQL v8.4.1.
* MariaDB v11.4.2.

[heading Acknowledgements]

Expand Down
18 changes: 14 additions & 4 deletions test/Jamfile
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,12 @@ local requirements =
<toolset>msvc:<define>_SILENCE_CXX17_ALLOCATOR_VOID_DEPRECATION_WARNING
<toolset>msvc:<define>_SILENCE_CXX17_ADAPTOR_TYPEDEFS_DEPRECATION_WARNING
<toolset>msvc:<define>_SILENCE_CXX17_ITERATOR_BASE_CLASS_DEPRECATION_WARNING
# GCC13 doesn't understand view types and issues array bound warnings that don't make sense.
<toolset>gcc-13:<cxxflags>"-Wno-dangling-reference -Wno-array-bounds"
<toolset>gcc:<cxxflags>-Wno-implicit-fallthrough # Required by Asio SSL components
# gcc-13+ doesn't understand view types and issues array bound warnings that don't make sense.
# -Wno-implicit-fallthrough is required by Asio SSL components
<toolset>gcc:<cxxflags>"-Wno-dangling-reference -Wno-array-bounds -Wno-implicit-fallthrough"
# gcc-13+ complains about TSAN not supporting std::atomic_thread_fence,
# used by Asio old net-ts type-erased executors.
<toolset>gcc,<thread-sanitizer>norecover:<cxxflags>-Wno-tsan
<target-os>linux:<define>_XOPEN_SOURCE=600
<target-os>linux:<define>_GNU_SOURCE=1
<target-os>windows:<define>_WIN32_WINNT=0x0601
Expand Down Expand Up @@ -118,7 +121,14 @@ alias common_test_sources

# Boost.Context causes failures with warnings-as-errors
# under libc++, because it builds objects that raise a -stdlib=libc++ unused warning
alias boost_context_lib : /boost/context//boost_context/<warnings-as-errors>off ;
alias boost_context_lib
:
/boost/context//boost_context/<warnings-as-errors>off
: usage-requirements
# gcc-14+ seem to enable CET by default, which causes warnings with Boost.Context.
# Disable CET until https://github.com/boostorg/context/issues/263 gets fixed
<toolset>gcc-14:<cxxflags>-fcf-protection=none
;

alias boost_mysql_test
:
Expand Down
20 changes: 5 additions & 15 deletions test/thread_safety/Jamfile
Original file line number Diff line number Diff line change
Expand Up @@ -14,26 +14,16 @@ if $(hostname) = ""
hostname = "127.0.0.1" ;
}

# TSAN can't be enabled in our ARM CIs, since they fail
# the personality() syscall to disable address space layout randomization.
# In OSX, tsan reports a race condition in Asio's kqueue reactor. Ignore this for now.
# gcc-13 complains about TSAN not supporting std::atomic_thread_fence, which is used by Asio.
# However, this doesn't seem to affect TSAN results
rule tsan_if_not_arm ( properties * )
{
local result ;
if ! <architecture>arm in $(properties) && ! <target-os>darwin in $(properties) && ! <toolset-gcc:version>13 in $(properties)
{
result += <thread-sanitizer>norecover ;
}
return $(result) ;
}

# In OSX, tsan reports a race condition in Asio's kqueue reactor. Ignore this for now.
# Net TS executors use std::atomic_thread_fence, unsupported by TSAN, which yields false positives.
run
/boost/mysql/test//boost_mysql_compiled
connection_pool.cpp
: requirements
<testing.arg>$(hostname)
<conditional>@tsan_if_not_arm
<target-os>darwin:<build>no
<boost.mysql.use-ts-executor>on:<build>no
<thread-sanitizer>norecover
: target-name boost_mysql_thread_safety
;
4 changes: 2 additions & 2 deletions tools/docker/build-docs.dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ FROM openjdk:11

COPY tools/docker/install_build_docs.sh /

ENV DOCBOOK_DTD_DIR /opt/docbook-dtd
ENV DOCBOOK_XSL_DIR /opt/docbook-xsl
ENV DOCBOOK_DTD_DIR=/opt/docbook-dtd
ENV DOCBOOK_XSL_DIR=/opt/docbook-xsl

RUN bash install_build_docs.sh
8 changes: 7 additions & 1 deletion tools/docker/mariadb.dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,15 @@ FROM mariadb:11.4.2
ENV MYSQL_ALLOW_EMPTY_PASSWORD=1

Check warning on line 10 in tools/docker/mariadb.dockerfile

View workflow job for this annotation

GitHub Actions / docker-linux (mariadb, mariadb, linux/amd64, linux/arm64/v8)

Sensitive data should not be used in the ARG or ENV commands

SecretsUsedInArgOrEnv: Do not use ARG or ENV instructions for sensitive data (ENV "MYSQL_ALLOW_EMPTY_PASSWORD") More info: https://docs.docker.com/go/dockerfile/rule/secrets-used-in-arg-or-env/
ENV MYSQL_ROOT_PASSWORD=

Check warning on line 11 in tools/docker/mariadb.dockerfile

View workflow job for this annotation

GitHub Actions / docker-linux (mariadb, mariadb, linux/amd64, linux/arm64/v8)

Sensitive data should not be used in the ARG or ENV commands

SecretsUsedInArgOrEnv: Do not use ARG or ENV instructions for sensitive data (ENV "MYSQL_ROOT_PASSWORD") More info: https://docs.docker.com/go/dockerfile/rule/secrets-used-in-arg-or-env/

COPY tools/docker/mariadb_entrypoint.sh /
COPY tools/docker/unix-socket.cnf /etc/mysql/conf.d/
COPY tools/docker/ssl.cnf /etc/mysql/conf.d/
COPY tools/ssl/*.pem /etc/ssl/certs/mysql/

# Custom entry point to correctly set UNIX socket permissions, even if using volumes
RUN <<EOF cat > /mariadb_entrypoint.sh
chown -R mysql:mysql /var/run/mysqld
/bin/bash /usr/local/bin/docker-entrypoint.sh mariadbd
EOF


ENTRYPOINT ["/bin/bash", "/mariadb_entrypoint.sh"]
10 changes: 0 additions & 10 deletions tools/docker/mariadb_entrypoint.sh

This file was deleted.

7 changes: 6 additions & 1 deletion tools/docker/mysql5.dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,13 @@ FROM mysql:5.7.41
ENV MYSQL_ALLOW_EMPTY_PASSWORD=1

Check warning on line 10 in tools/docker/mysql5.dockerfile

View workflow job for this annotation

GitHub Actions / docker-linux (mysql5, mysql5, linux/amd64)

Sensitive data should not be used in the ARG or ENV commands

SecretsUsedInArgOrEnv: Do not use ARG or ENV instructions for sensitive data (ENV "MYSQL_ALLOW_EMPTY_PASSWORD") More info: https://docs.docker.com/go/dockerfile/rule/secrets-used-in-arg-or-env/
ENV MYSQL_ROOT_PASSWORD=

Check warning on line 11 in tools/docker/mysql5.dockerfile

View workflow job for this annotation

GitHub Actions / docker-linux (mysql5, mysql5, linux/amd64)

Sensitive data should not be used in the ARG or ENV commands

SecretsUsedInArgOrEnv: Do not use ARG or ENV instructions for sensitive data (ENV "MYSQL_ROOT_PASSWORD") More info: https://docs.docker.com/go/dockerfile/rule/secrets-used-in-arg-or-env/

COPY tools/docker/mysql_entrypoint.sh /
COPY tools/docker/ssl.cnf /etc/mysql/conf.d/
COPY tools/ssl/*.pem /etc/ssl/certs/mysql/

# Custom entry point to correctly set UNIX socket permissions, even if using volumes
RUN <<EOF cat > /mysql_entrypoint.sh
chown -R mysql:mysql /var/run/mysqld
/bin/bash /usr/local/bin/docker-entrypoint.sh mysqld
EOF

ENTRYPOINT ["/bin/bash", "/mysql_entrypoint.sh"]
8 changes: 7 additions & 1 deletion tools/docker/mysql8.dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,14 @@ FROM mysql:8.4.1
ENV MYSQL_ALLOW_EMPTY_PASSWORD=1

Check warning on line 10 in tools/docker/mysql8.dockerfile

View workflow job for this annotation

GitHub Actions / docker-linux (mysql8, mysql8, linux/amd64, linux/arm64/v8)

Sensitive data should not be used in the ARG or ENV commands

SecretsUsedInArgOrEnv: Do not use ARG or ENV instructions for sensitive data (ENV "MYSQL_ALLOW_EMPTY_PASSWORD") More info: https://docs.docker.com/go/dockerfile/rule/secrets-used-in-arg-or-env/
ENV MYSQL_ROOT_PASSWORD=

Check warning on line 11 in tools/docker/mysql8.dockerfile

View workflow job for this annotation

GitHub Actions / docker-linux (mysql8, mysql8, linux/amd64, linux/arm64/v8)

Sensitive data should not be used in the ARG or ENV commands

SecretsUsedInArgOrEnv: Do not use ARG or ENV instructions for sensitive data (ENV "MYSQL_ROOT_PASSWORD") More info: https://docs.docker.com/go/dockerfile/rule/secrets-used-in-arg-or-env/

COPY tools/docker/mysql_entrypoint.sh /
COPY tools/docker/ssl.cnf /etc/mysql/conf.d/
COPY tools/ssl/*.pem /etc/ssl/certs/mysql/

# Custom entry point to correctly set UNIX socket permissions, even if using volumes.
# Re-activate the native password plugin, which is now disabled by default
RUN <<EOF cat > /mysql_entrypoint.sh
chown -R mysql:mysql /var/run/mysqld
/bin/bash /usr/local/bin/docker-entrypoint.sh mysqld --mysql-native-password=ON
EOF

ENTRYPOINT ["/bin/bash", "/mysql_entrypoint.sh"]
7 changes: 6 additions & 1 deletion tools/docker/mysql9.dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,13 @@ FROM mysql:9.0.0
ENV MYSQL_ALLOW_EMPTY_PASSWORD=1

Check warning on line 10 in tools/docker/mysql9.dockerfile

View workflow job for this annotation

GitHub Actions / docker-linux (mysql9, mysql9, linux/amd64, linux/arm64/v8)

Sensitive data should not be used in the ARG or ENV commands

SecretsUsedInArgOrEnv: Do not use ARG or ENV instructions for sensitive data (ENV "MYSQL_ALLOW_EMPTY_PASSWORD") More info: https://docs.docker.com/go/dockerfile/rule/secrets-used-in-arg-or-env/
ENV MYSQL_ROOT_PASSWORD=

Check warning on line 11 in tools/docker/mysql9.dockerfile

View workflow job for this annotation

GitHub Actions / docker-linux (mysql9, mysql9, linux/amd64, linux/arm64/v8)

Sensitive data should not be used in the ARG or ENV commands

SecretsUsedInArgOrEnv: Do not use ARG or ENV instructions for sensitive data (ENV "MYSQL_ROOT_PASSWORD") More info: https://docs.docker.com/go/dockerfile/rule/secrets-used-in-arg-or-env/

COPY tools/docker/mysql_entrypoint.sh /
COPY tools/docker/ssl.cnf /etc/mysql/conf.d/
COPY tools/ssl/*.pem /etc/ssl/certs/mysql/

# Custom entry point to correctly set UNIX socket permissions, even if using volumes
RUN <<EOF cat > /mysql_entrypoint.sh
chown -R mysql:mysql /var/run/mysqld
/bin/bash /usr/local/bin/docker-entrypoint.sh mysqld
EOF

ENTRYPOINT ["/bin/bash", "/mysql_entrypoint.sh"]
10 changes: 0 additions & 10 deletions tools/docker/mysql_entrypoint.sh

This file was deleted.

10 changes: 5 additions & 5 deletions tools/scripts/build_unix_local.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ set -e

repo_base=$(realpath $(dirname $(realpath $0))/../..)

BK=docs
IMAGE=build-docs
SHA=252732b3d7af7f78618e877479b85d4d611a61f4
BK=b2
IMAGE=build-gcc14
SHA=c3f5316cc19bf3c0f7a83e31dec58139581f5764
CONTAINER=builder-$IMAGE
FULL_IMAGE=ghcr.io/anarthal-containers/$IMAGE:$SHA
DB=mysql8
Expand All @@ -35,8 +35,8 @@ db_args="--server-host=$DB --db=$DB"
case $BK in
b2) cmd="$db_args
--toolset=gcc
--cxxstd=20
--variant=debug
--cxxstd=23
--variant=release
--stdlib=native
--address-model=64
--separate-compilation=1
Expand Down

0 comments on commit 3a49afe

Please sign in to comment.