Updated Boost version to 1.75.0

commit 5d0dafa324453ce731ddd2a427fa68490843b6c6
Author: Ruben Perez <rubenperez038@gmail.com>
Date:   Sun Dec 20 18:52:52 2020 +0100

    Added missing test exlussion on Windows

commit 52f1ce1eb6f43478451ee1c9761efa9a1f0c85bf
Author: Ruben Perez <rubenperez038@gmail.com>
Date:   Sun Dec 20 18:05:47 2020 +0100

    Trying to fix PS syntax errors 2

commit d680a874b069b8cc6c7965b226cda02f49438206
Author: Ruben Perez <rubenperez038@gmail.com>
Date:   Sun Dec 20 17:58:30 2020 +0100

    Fixing PS syntax errors

commit 84915ac269714fcfbfc6dc9e6ce10aefa395d33a
Author: Ruben Perez <rubenperez038@gmail.com>
Date:   Sun Dec 20 17:52:14 2020 +0100

    Changed Windows CMake builds to use latest Boost

commit 75aa757ae50f9c9d31cdb8018cf14e1dea5e6530
Author: Ruben Perez <rubenperez038@gmail.com>
Date:   Sun Dec 20 16:07:25 2020 +0100

    Removed conflictive build config under Windows

commit 7cd77f9204b842999233f8c6782caa3fbbf15a89
Author: Ruben Perez <rubenperez038@gmail.com>
Date:   Mon Dec 14 20:09:23 2020 +0100

    Desperate try to fix MSVC internal errors 2

commit f81de256735b1a705d03a7994cfecbce1a7581d4
Author: Ruben Perez <rubenperez038@gmail.com>
Date:   Sun Dec 13 20:44:59 2020 +0100

    Desperate try to fix stuff

commit 3a8f8d1caf8e8d906a7d96ba7edf62f2e3b09651
Author: Ruben Perez <rubenperez038@gmail.com>
Date:   Sun Dec 13 18:48:33 2020 +0100

    Reverted to using env var

commit 420427989274036fd04351531bdae2ebde621f5f
Author: Ruben Perez <rubenperez038@gmail.com>
Date:   Sun Dec 13 16:55:17 2020 +0100

    Changed CMake way of excluding tests to match b2's

commit 1db13f9e3df346135dadb1c2686ecafc0fe6c2df
Author: Ruben Perez <rubenperez038@gmail.com>
Date:   Sun Dec 13 16:33:05 2020 +0100

    Updated B2 CIs to explicitly run certain tests

commit 12700b387beb99f2ac1cf342291bc63f49d26a99
Author: Ruben Perez <rubenperez038@gmail.com>
Date:   Sun Dec 13 16:14:47 2020 +0100

    Updated test selection (sha256/unix) in b2

commit 0f23bddeb64203e5c570280e5e1de4a5ae083f94
Author: Ruben Perez <rubenperez038@gmail.com>
Date:   Sun Dec 13 16:14:34 2020 +0100

    Added internal script to setup b2 env

commit 13cf6b102b0d71f5496bcd433e3269ea297a9f26
Author: Ruben Perez <rubenperez038@gmail.com>
Date:   Sun Dec 13 14:00:30 2020 +0100

    Added option to skip UNIX socket tests (only cmake)

commit a35f668ae0a968ef01eb6517d9de86c45e07dceb
Author: Ruben Perez <rubenperez038@gmail.com>
Date:   Sat Dec 12 21:38:06 2020 +0100

    Attempted to correct test filter problem

commit 29282e5a4fa6e4f5b7c5de56662b9cbea7758e06
Author: anarthal <rubenperez038@gmail.com>
Date:   Sat Dec 12 11:27:53 2020 -0800

    Fixes to build in MSVC

commit bc8599358435de946cba10cc7cbdc264bb793e5b
Author: Ruben Perez <rubenperez038@gmail.com>
Date:   Sat Dec 5 13:57:56 2020 +0100

    Reduced concurrency on Unix cmake builds

commit 3e183277cb2b3c4480ec102f956a4683811d3f44
Author: Ruben Perez <rubenperez038@gmail.com>
Date:   Fri Dec 4 17:50:31 2020 +0100

    Test ssh keys

commit d91a4ebdb65444da1c5952444c571dc68de1cd7b
Author: Ruben Perez <rubenperez038@gmail.com>
Date:   Sun Nov 29 19:59:07 2020 +0100

    Remove TODO.txt in favor of GitHub issues

commit fbe5e58966304b6fd87029af4657e6ed1aa2f2fd
Author: Ruben Perez <rubenperez038@gmail.com>
Date:   Sun Nov 29 19:58:25 2020 +0100

    Updated to build with 1.75
This commit is contained in:
Ruben Perez 2020-12-20 21:20:23 +01:00
parent 94c44f43e6
commit dd2447c6cb
16 changed files with 159 additions and 142 deletions

View File

@ -19,15 +19,6 @@ environment:
B2_VARIANT: release,debug
B2_CXXSTD: 11,14,17
matrix:
# Boost.Build (TODO: recover these when we figure out what happens with Asio 1.74 in Windows)
#- FLAVOR: Visual Studio 2019
# APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2019
# PLATFORM: x86
# B2_TOOLSET: msvc-14.2
#- FLAVOR: Visual Studio 2019
# APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2019
# PLATFORM: x64
# B2_TOOLSET: msvc-14.2
# CMake
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2019
CMAKE_BUILD_TYPE: Debug
@ -41,3 +32,13 @@ environment:
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2019
CMAKE_BUILD_TYPE: Release
PLATFORM: x86
# Boost.Build
- FLAVOR: Visual Studio 2019
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2019
PLATFORM: x86
B2_TOOLSET: msvc-14.2
B2_CXXSTD: 11,14 # Hitting an internal compiler error under C++17 x86, can't reproduce locally
- FLAVOR: Visual Studio 2019
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2019
PLATFORM: x64
B2_TOOLSET: msvc-14.2

View File

@ -87,6 +87,7 @@ matrix:
- CMAKE_BUILD_TYPE=Debug
- USE_VALGRIND=1
- USE_COVERAGE=1
- NUM_JOBS=1
- name: cmake_linux_gcc_release
<<: *__linux_defaults
compiler: gcc

View File

@ -22,10 +22,6 @@ if(CMAKE_PROJECT_NAME STREQUAL PROJECT_NAME)
# Build with coverage
option(BOOST_MYSQL_COVERAGE OFF "Whether to build using coverage")
mark_as_advanced(BOOST_MYSQL_COVERAGE)
# Run SHA256 tests
option(BOOST_MYSQL_SHA256_TESTS OFF "Whether to run SHA256 tests or not")
mark_as_advanced(BOOST_MYSQL_SHA256_TESTS)
endif()
# Includes

View File

@ -60,3 +60,5 @@ Yet to be done (but it is on our list - PRs welcome):
- Further authentication methods: sha256_password
- Multi-resultset: being able to specify several semicolon-separated queries.

View File

@ -1,72 +0,0 @@
CI tests for older compilers
GCCs
Clangs
MSVCs
Multiresultset
Text protocol
Binary protocol (stored procedures)
Handshake
compression
SSL certificate & common name validation
sha256_password
Usability
Simplify rows
Single row type
Make rows copyable
Should make_error_code be public?
Incomplete query reads: how does this affect further queries?
Metadata in rows: being able to index by name
Iterators for sync resultset iteration
Timeouts
Retries
Connection pool
Prepared statements: being able to specify how many rows to fetch from server (use cursors)
Types
Decimal
Bit
Geometry
connection::run_sql that hides the resultset concept
Option for separate compilation
Reconnect cycle
Ensure you can reconnect after a failed handshake/successful close
Shutdown SSL stream
Other possible features
CLIENT_SESSION_TRACK
CLIENT_OPTIONAL_RESULTSET_METADATA
Status flags accessors in resultset (for OK_Packet)
Technical debt
1.74 asio breaking changes
Review strand names in unit tests (rebind_executor)
Review polymorphic executor name in examples
Recover Windows b2 builds
Valgrind suppressions
Review exception throw by value::get
Mock stream and recover channel unit tests
Do we need --with-system --with-date_time
Constexpr issues with value and optional
Increase int serialization test coverage
Increase DB version test coverage
Conan for dependencies
Tests for field_metadata::character_set
Refactor database type cases, and remove unit tests superseeded by them
Random input tests
Change channel read to make less syscalls
Test dashboard
Sanitizers
Integ tests for different default auth plugins
Integ tests for not enough capabilities
Integ tests for ssl_mode::enable and SSL not available
Review convention in test names
Review named_param
Take fetch_many() algorithm out into network_algorithms (e.g. read_many_rows)
Concept checking for StreamType
Review valid() for moved-from resultsets (should it return always true?)
Force the same number of values in each row as in fields()
Rework deserialize_row_fn to allow cursors
Test prepared statement binding to procedure out params
More thorough testing for several NULLs in integration testing
Query and statement tests for DELETEs
prepared_statement::execute(): static_assert(), handle value&, const value&, anything convertible
Test for too many connections
Executor tests?

View File

@ -53,8 +53,8 @@ set(BOOST_MYSQL_EXAMPLES
query_async_futures
metadata
prepared_statements
unix_socket
default_completion_tokens
unix_socket
)
# The examples we do NOT want to ever memcheck

View File

@ -15,10 +15,13 @@ local EXAMPLES =
query_async_futures
prepared_statements
metadata
;
local EXPLICIT_EXAMPLES =
unix_socket
;
for local example in $(EXAMPLES)
for local example in $(EXAMPLES) $(EXPLICIT_EXAMPLES)
{
unit-test "boost_mysql_example_$(example)"
:
@ -29,3 +32,8 @@ for local example in $(EXAMPLES)
<testing.arg>"example_user example_password"
;
}
for local example in $(EXPLICIT_EXAMPLES)
{
explicit "boost_mysql_example_$(example)" ;
}

View File

@ -100,32 +100,25 @@ target_link_libraries(
)
common_target_settings(boost_mysql_integrationtests)
# Regular integration tests
add_test(
NAME boost_mysql_integrationtests
COMMAND
${CMAKE_CURRENT_BINARY_DIR}/boost_mysql_integrationtests
"-t" "!@sha256" # Exclude anything using SHA256
)
if ("$ENV{BOOST_MYSQL_TEST_FILTER}" STREQUAL "")
add_test(
NAME boost_mysql_integrationtests
COMMAND boost_mysql_integrationtests
)
else()
add_test(
NAME boost_mysql_integrationtests
COMMAND boost_mysql_integrationtests "-t" $ENV{BOOST_MYSQL_TEST_FILTER}
)
endif()
# If we are using memcheck, then run a subset of the integration tests
# under valgrind. Coroutine tests don't work well under Valgrind, and
# SSL tests are too slow. We do some other exclusions to reduce runtime
if (BOOST_MYSQL_VALGRIND_TESTS)
set(TEST_FILTER "!@sha256:!@sslrequire:!@async_coroutine_errinfo:!@async_coroutine_noerrinfo:!@unix:!@tcp_default_token")
set(TEST_FILTER "!@sha256:!@sslrequire:!@async_coroutine_errinfo:!@async_coroutine_noerrinfo:!@unix:!@tcp_default_token:!@unix")
add_memcheck_test(
NAME boost_mysql_integrationtests_memcheck
COMMAND ${CMAKE_CURRENT_BINARY_DIR}/boost_mysql_integrationtests "-t" ${TEST_FILTER}
)
endif()
# SHA256 tests
if (BOOST_MYSQL_SHA256_TESTS)
# Actual tests
add_test(
NAME boost_mysql_integrationtests_sha256
COMMAND
${CMAKE_CURRENT_BINARY_DIR}/boost_mysql_integrationtests
"-t" "@sha256" # Run only SHA256 stuff
)
endif()

View File

@ -7,15 +7,14 @@
import os ;
if [ os.environ BOOST_MYSQL_SHA256_TESTS ]
# SHA256 tests and UNIX tests overlap, so we cannot just create
# different testing targets for each
local TEST_FILTER = [ os.environ BOOST_MYSQL_TEST_FILTER ] ;
local TEST_COMMAND = "" ;
if $(TEST_FILTER)
{
TEST_FILTER = "*" ;
TEST_COMMAND = "-t $(TEST_FILTER)" ;
}
else
{
TEST_FILTER = "!@sha256" ;
}
alias boost_mysql_test
:
@ -77,8 +76,5 @@ unit-test boost_mysql_integrationtests
integration/database_types.cpp
integration/entry_point.cpp
:
<testing.arg>"-t '$(TEST_FILTER)'"
<testing.arg>$(TEST_COMMAND)
;
build-project ../example ;

View File

@ -57,8 +57,11 @@ BOOST_MYSQL_NETWORK_TEST(iterator_mismatched_num_params, network_fixture, networ
{
this->connect(sample.ssl);
std::forward_list<value> params { value("item") };
auto stmt = do_prepare(sample.net, this->conn,
"SELECT * FROM empty_table WHERE id IN (?, ?)");
auto stmt = do_prepare<Stream>(
sample.net,
this->conn,
"SELECT * FROM empty_table WHERE id IN (?, ?)"
);
auto result = sample.net->execute_statement(stmt, params.begin(), params.end());
result.validate_error(errc::wrong_num_params,
{"param", "2", "1", "statement", "execute"});

View File

@ -10,6 +10,7 @@
#include <boost/asio/ip/tcp.hpp>
#include <boost/asio/use_future.hpp>
#include <type_traits>
namespace boost {
namespace mysql {
@ -19,9 +20,15 @@ namespace test {
class future_executor : public boost::asio::io_context::executor_type
{
public:
future_executor(const boost::asio::io_context::executor_type& base) :
boost::asio::io_context::executor_type(base) {}
future_executor(const boost::asio::io_context::executor_type& inner) :
boost::asio::io_context::executor_type(inner) {}
using default_completion_token_type = boost::asio::use_future_t<>;
// Required to build in MSVC for some arcane reason
operator boost::asio::any_io_executor() const
{
return boost::asio::any_io_executor(static_cast<const boost::asio::io_context::executor_type>(*this));
}
};
using tcp_future_socket = boost::asio::basic_stream_socket<
boost::asio::ip::tcp,

View File

@ -8,13 +8,12 @@
from sys import argv
from subprocess import check_call
from os import chdir
from os import chdir, path
REPO_BASE = path.abspath(path.join(path.dirname(__file__), '..'))
BASE_CONFIG = {
'CMAKE_PREFIX_PATH': '/opt/boost_latest',
'BOOST_MYSQL_SHA256_TESTS': 'ON',
'CMAKE_PREFIX_PATH': '/opt/boost-latest',
'CMAKE_INSTALL_PREFIX': '/tmp/boost_mysql'
}
@ -24,11 +23,16 @@ CLANG_CONFIG = {
}
ALL_CONFIGS = {
'gcc-7': {
**BASE_CONFIG,
'CMAKE_C_COMPILER': 'gcc-7',
'CMAKE_CXX_COMPILER': 'g++-7',
'CMAKE_BUILD_TYPE': 'Debug'
},
'clang-debug': {
**BASE_CONFIG,
**CLANG_CONFIG,
'CMAKE_BUILD_TYPE': 'Debug',
'BOOST_MYSQL_VALGRIND_TESTS': 'ON'
'CMAKE_BUILD_TYPE': 'Debug'
},
'clang-release': {
**BASE_CONFIG,

View File

@ -6,6 +6,9 @@
# file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
#
# Config
BOOST_ROOT=/opt/boost-latest
# Get latest cmake
function get_cmake {
if [ "$TRAVIS_OS_NAME" != "osx" ]; then # OSX cmake is good enough
@ -22,7 +25,6 @@ function get_cmake {
# Build latest boost (for CMake builds)
function build_boost {
BOOST_ROOT=/opt/boost_1_73_0
sudo mkdir $BOOST_ROOT
sudo chmod 777 $BOOST_ROOT
git clone https://github.com/anarthal/boost-unix-mirror.git boost-latest
@ -65,8 +67,8 @@ function setup_db {
-d \
anarthal/$DATABASE
fi
if [ "$DATABASE" == "mysql:8" ]; then
export BOOST_MYSQL_SHA256_TESTS=1
if [ "$DATABASE" != "mysql:8" ]; then
export BOOST_MYSQL_TEST_FILTER='!@sha256'
fi
}
@ -115,25 +117,24 @@ function cmake_build {
cd build
cmake \
-DCMAKE_INSTALL_PREFIX=/tmp/boost_mysql \
-DCMAKE_PREFIX_PATH=/opt/boost_1_73_0 \
-DCMAKE_PREFIX_PATH=$BOOST_ROOT \
-DCMAKE_BUILD_TYPE=$CMAKE_BUILD_TYPE \
-DCMAKE_CXX_STANDARD=$CMAKE_CXX_STANDARD \
$(if [ $USE_VALGRIND ]; then echo -DBOOST_MYSQL_VALGRIND_TESTS=ON; fi) \
$(if [ $USE_COVERAGE ]; then echo -DBOOST_MYSQL_COVERAGE=ON; fi) \
$(if [ $BOOST_MYSQL_SHA256_TESTS ]; then echo -DBOOST_MYSQL_SHA256_TESTS=ON; fi) \
$openssl_arg \
-DCMAKE_CXX_FLAGS="$CMAKE_CXX_FLAGS" \
$CMAKE_OPTIONS \
..
make -j6 CTEST_OUTPUT_ON_FAILURE=1 all install
make "-j$(if [ $NUM_JOBS ]; then echo $NUM_JOBS; else echo 4; fi)" all install
wait_for_db
ctest --output-on-failure
ctest --verbose
cd ..
# Test that a user project could use our export
python3 \
tools/user_project_find_package/build.py \
"-DCMAKE_PREFIX_PATH=/tmp/boost_mysql;/opt/boost_1_73_0" \
"-DCMAKE_PREFIX_PATH=/tmp/boost_mysql;$BOOST_ROOT" \
$openssl_arg
}
@ -156,7 +157,10 @@ if [ "$B2_TOOLSET" != "" ]; then # Boost.Build
source ci/travis/install.sh
# Boost.CI build. Note: takes time enough for DB container to load
$BOOST_ROOT/libs/$SELF/ci/travis/build.sh
$BOOST_ROOT/libs/$SELF/ci/build.sh \
libs/mysql/example \
libs/mysql/example//boost_mysql_example_unix_socket
else # CMake
get_cmake
build_boost

View File

@ -22,8 +22,7 @@ $Env:Path += ";C:\Program Files\MySQL\MySQL Server 5.7\bin"
$Env:Path += ";C:\Libraries\boost_1_73_0\lib64-msvc-14.2"
$Env:Path += ";C:\Libraries\boost_1_73_0\lib32-msvc-14.2"
$Env:Path = "C:\Python37-x64;" + $Env:Path # Override Python 2 setting
$Env:BOOST_MYSQL_SHA256_TESTS = "1"
$Env:BOOST_MYSQL_TEST_FILTER = "!@unix"
# DB setup
Check-Call { docker run --name mysql -p 3306:3306 -d anarthal/mysql:8 }
@ -56,17 +55,38 @@ if ($Env:B2_TOOLSET) # Use Boost.Build
Copy-Item -Path "C:\boost-ci-cloned\ci" -Destination ".\ci" -Recurse
Remove-Item -Recurse -Force "C:\boost-ci-cloned"
Check-Call { python ".\tools\wait_for_db_container.py" }
Check-Call { cmd /c ".\tools\build_windows_b2.bat" }
Check-Call { .\tools\build_windows_b2.bat `
libs/mysql/example
}
}
else # Use CMake
{
$InstallPrefix = "C:\boost_mysql"
$BoostLocation = "C:\boost_latest"
# Download and build Boost
Check-Call { git clone https://github.com/anarthal/boost-windows-mirror.git }
Set-Location -Path "boost-windows-mirror"
Check-Call { .\bootstrap.bat }
Check-Call { .\b2 `
--prefix=${BoostLocation} `
--with-system `
--with-context `
--with-coroutine `
--with-date_time `
--with-test `
-d0 `
install
}
Set-Location -Path ".."
# CMake build
New-Item -Path "." -Name "build" -ItemType "directory" | Out-Null
Set-Location -Path "build"
Check-Call { cmake `
"-G" "Ninja" `
"-DCMAKE_INSTALL_PREFIX=$InstallPrefix" `
"-DBOOST_ROOT=C:\Libraries\boost_1_73_0" `
"-DCMAKE_PREFIX_PATH=$BoostLocation" `
"-DCMAKE_BUILD_TYPE=$Env:CMAKE_BUILD_TYPE" `
"-DCMAKE_CXX_STANDARD=17" `
"-DCMAKE_C_COMPILER=cl" `
@ -75,9 +95,9 @@ else # Use CMake
}
Check-Call { cmake --build . -j --target install }
Check-Call { python ../tools/wait_for_db_container.py }
Check-Call { ctest --output-on-failure }
Check-Call { ctest --verbose -E boost_mysql_example_unix_socket }
Check-Call { python `
..\tools\user_project_find_package\build.py `
"-DCMAKE_PREFIX_PATH=$InstallPrefix;C:\Libraries\boost_1_73_0"
"-DCMAKE_PREFIX_PATH=$InstallPrefix;$BoostLocation"
}
}

View File

@ -6,4 +6,34 @@ REM file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
REM
call ci\appveyor\install.bat || exit /b 1
call ci\build.bat || exit /b 1
REM Copied from boost-ci to enable argument forwarding
setlocal enabledelayedexpansion
IF NOT DEFINED B2_CI_VERSION (
echo You need to set B2_CI_VERSION in your CI script
exit /B 1
)
PATH=%ADDPATH%%PATH%
SET B2_TOOLCXX=toolset=%B2_TOOLSET%
IF DEFINED B2_CXXSTD (SET B2_CXXSTD=cxxstd=%B2_CXXSTD%)
IF DEFINED B2_CXXFLAGS (SET B2_CXXFLAGS=cxxflags=%B2_CXXFLAGS%)
IF DEFINED B2_DEFINES (SET B2_DEFINES=define=%B2_DEFINES%)
IF DEFINED B2_ADDRESS_MODEL (SET B2_ADDRESS_MODEL=address-model=%B2_ADDRESS_MODEL%)
IF DEFINED B2_LINK (SET B2_LINK=link=%B2_LINK%)
IF DEFINED B2_VARIANT (SET B2_VARIANT=variant=%B2_VARIANT%)
cd %BOOST_ROOT%
IF DEFINED SCRIPT (
call libs\%SELF%\%SCRIPT%
) ELSE (
set SELF_S=%SELF:\=/%
REM Echo the complete build command to the build log
ECHO b2 --abbreviate-paths libs/!SELF_S!/test %B2_TOOLCXX% %B2_CXXSTD% %B2_CXXFLAGS% %B2_DEFINES% %B2_THREADING% %B2_ADDRESS_MODEL% %B2_LINK% %B2_VARIANT% -j3 %*
REM Now go build...
b2 --abbreviate-paths libs/!SELF_S!/test %B2_TOOLCXX% %B2_CXXSTD% %B2_CXXFLAGS% %B2_DEFINES% %B2_THREADING% %B2_ADDRESS_MODEL% %B2_LINK% %B2_VARIANT% -j3 %*
)

24
tools/setup_b2_env.sh Executable file
View File

@ -0,0 +1,24 @@
#!/bin/bash
#
# Copyright (c) 2019-2020 Ruben Perez Hidalgo (rubenperez038 at gmail dot com)
#
# Distributed under the Boost Software License, Version 1.0. (See accompanying
# file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
#
# Helper to set up a local dev environment to work with b2. For internal use only!
set -e
SELF_PATH=$HOME/workspace/mysql
git clone --depth 1 https://github.com/boostorg/boost.git boost-root
cd boost-root
git submodule update -q --init tools/boostdep
ln -s $SELF_PATH $(pwd)/libs/mysql
ln -s $SELF_PATH/tools/user-config.jam $HOME/
export BOOST_ROOT="$(pwd)"
export PATH="$(pwd):$PATH"
python tools/boostdep/depinst/depinst.py --include benchmark --include example --include examples --include tools mysql
./bootstrap.sh
./b2 headers