Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

regularized build script #2686

Merged
merged 6 commits into from
Jun 23, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .drone.star
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ def main(ctx):
],
# Standards
'>=11',
docs=False, ubsan=False
docs=False, ubsan=False, asan=False
)

alljobs.extend(generatedjobs)
Expand Down
12 changes: 3 additions & 9 deletions .drone/drone.bat
Original file line number Diff line number Diff line change
Expand Up @@ -26,21 +26,15 @@ cd libs/beast
IF DEFINED DEFINE SET B2_DEFINE="define=%DEFINE%"

echo "Running tests"
cd test
b2 --debug-configuration variant=%VARIANT% cxxstd=%CXXSTD% %B2_DEFINE% address-model=%ADDRESS_MODEL% toolset=%TOOLSET% --verbose-test -j3
cd ..
..\..\b2 --debug-configuration variant=%VARIANT% cxxstd=%CXXSTD% %B2_DEFINE% address-model=%ADDRESS_MODEL% toolset=%TOOLSET% --verbose-test -j3 test
if !errorlevel! neq 0 exit /b !errorlevel!

echo "Running libs/beast/example"
cd example
b2 --debug-configuration variant=%VARIANT% cxxstd=%CXXSTD% %B2_DEFINE% address-model=%ADDRESS_MODEL% toolset=%TOOLSET% -j3
cd ..
..\..\b2 --debug-configuration variant=%VARIANT% cxxstd=%CXXSTD% %B2_DEFINE% address-model=%ADDRESS_MODEL% toolset=%TOOLSET% -j3 example
if !errorlevel! neq 0 exit /b !errorlevel!

echo "Running run-fat-tests"
cd test
b2 --debug-configuration variant=%VARIANT% cxxstd=%CXXSTD% %B2_DEFINE% address-model=%ADDRESS_MODEL% toolset=%TOOLSET% --verbose-test run-fat-tests -j3
cd ..
..\..\b2 --debug-configuration variant=%VARIANT% cxxstd=%CXXSTD% %B2_DEFINE% address-model=%ADDRESS_MODEL% toolset=%TOOLSET% --verbose-test test//run-fat-tests -j3
if !errorlevel! neq 0 exit /b !errorlevel!

echo "============> COMPLETED"
Expand Down
20 changes: 14 additions & 6 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -284,14 +284,15 @@ jobs:
standards=$(sed 's/,/ /g' <<<"${{matrix.cxxstd}}")
variants="debug release"
err=0
cd libs/$LIBRARY
for toolset in ${toolsets} ; do
for standard in ${standards} ; do
for variant in ${variants} ; do
if [[ err -ne 0 ]] ; then
echo "skipping: ${toolset} ${standard} ${variant}"
else
echo "running: ${toolset} ${standard} ${variant}"
./b2 -j3 libs/$LIBRARY/test toolset=${toolset} cxxstd=${standard} variant=${variant}
../../b2 -j3 test toolset=${toolset} cxxstd=${standard} variant=${variant}
err=$?
fi
done
Expand Down Expand Up @@ -400,19 +401,23 @@ jobs:

steps:
- uses: actions/checkout@v3

- name: Setup OpenSSL
env:
OPENSSL_ROOT: "C:\\OpenSSL"
shell: cmd
run: |
echo Install choco
powershell -Command iex ((new-object net.webclient).DownloadString('https://chocolatey.org/install.ps1'))
if "${{matrix.addrmd}}" == "64" (
choco install --no-progress -y openssl --x64
mklink /D "C:\\OpenSSL" "C:\\Program Files\\OpenSSL-Win64"
mklink /D %OPENSSL_ROOT% "C:\\Program Files\\OpenSSL"
refreshenv
) else (
choco install --no-progress -y openssl --x86
mklink /D "C:\\OpenSSL" "C:\\Program Files (x86)\\OpenSSL-Win32"
mklink /D %OPENSSL_ROOT% "C:\\Program Files (x86)\\OpenSSL-Win32"
refreshenv
)
set

- name: Setup Boost
shell: cmd
Expand Down Expand Up @@ -440,10 +445,12 @@ jobs:

- name: Run tests
shell: bash
env:
OPENSSL_ROOT: "C:/OpenSSL"
run: |
echo "current directory: $(pwd)"
cd ../boost-root
export OPENSSL_ROOT="C:\\OpenSSL"
export OPENSSL_ROOT="C:/OpenSSL"
if [[ "${{matrix.supported}}" != "true" ]] ; then
echo "This configuration is not supported because ${{matrix.supported}}"
exit 0
Expand All @@ -452,12 +459,13 @@ jobs:
standards=$(sed 's/,/ /g' <<<"${{matrix.cxxstd}}")
address_models=$(sed 's/,/ /g' <<<"${{matrix.addrmd}}")
variants="debug release"
cd libs/$LIBRARY
for toolset in ${toolsets} ; do
for standard in ${standards} ; do
for address_model in ${address_models} ; do
for variant in ${variants} ; do
echo "running: ${toolset} ${standard} ${address_model} ${variant}"
./b2 -j3 ${{matrix.cxxflags}} libs/$LIBRARY/test toolset=${toolset} cxxstd=${standard} address-model=${address_model} variant=${variant} || exit $?
../../b2 -j3 ${{matrix.cxxflags}} test toolset=${toolset} cxxstd=${standard} address-model=${address_model} variant=${variant} || exit $?
done
done
done
Expand Down
62 changes: 12 additions & 50 deletions Jamfile
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import modules ;
import testing ;
import ../config/checks/config : requires ;

using openssl ;
boost.use-project ;

lib socket ; # SOLARIS, QNXNTO
Expand All @@ -25,54 +26,6 @@ lib mswsock ; # NT
lib ipv6 ; # HPUX
lib network ; # HAIKU

lib ssl ;
lib crypto ;
lib crypt32 ;

# Microsoft Windows section. Refer to FAQ "Windows and OpenSSL"
if [ os.name ] = NT
{
local OPENSSL_ROOT_DEFAULT = "C:/OpenSSL" ;
local OPENSSL_ROOT_ENV = [ os.environ OPENSSL_ROOT ] ;
local OPENSSL_ROOT = "" ;
if $(OPENSSL_ROOT_ENV)
{
OPENSSL_ROOT = $(OPENSSL_ROOT_ENV) ;
}
else
{
OPENSSL_ROOT = $(OPENSSL_ROOT_DEFAULT) ;
}
project
: requirements
<include>$(OPENSSL_ROOT)/include
<variant>debug:<library-path>$(OPENSSL_ROOT)/lib
<target-os>windows<variant>debug:<library-path>$(OPENSSL_ROOT)/debug/lib
<variant>release:<library-path>$(OPENSSL_ROOT)/lib
;

if [ path.exists $(OPENSSL_ROOT)/lib/libssl.lib ]
{
echo "OpenSSL > 1.1.0. Including libssl" ;
lib ssl : : <target-os>windows <name>libssl ;
}
if [ path.exists $(OPENSSL_ROOT)/lib/libcrypto.lib ]
{
echo "OpenSSL > 1.1.0. Including libcrypto" ;
lib crypto : : <target-os>windows <name>libcrypto ;
}
if [ path.exists $(OPENSSL_ROOT)/lib/ssleay32.lib ]
{
echo "OpenSSL < 1.1.0. Including ssleay32" ;
lib ssl : : <target-os>windows <name>ssleay32 ;
}
if [ path.exists $(OPENSSL_ROOT)/lib/libeay32.lib ]
{
echo "OpenSSL < 1.1.0. Including libeay32" ;
lib crypto : : <target-os>windows <name>libeay32 ;
}
}

feature.feature boost.beast.allow-deprecated : on off : propagated composite ;
feature.compose <boost.beast.allow-deprecated>on : <define>BOOST_BEAST_ALLOW_DEPRECATED ;

Expand Down Expand Up @@ -152,17 +105,26 @@ lib lib-asio
$(defines)
;

if [ os.name ] = LINUX
{
lib dl ;
}

lib lib-asio-ssl
: test/lib_asio_ssl.cpp
: requirements
<link>static
$(defines)
[ ac.check-library /boost/beast//ssl : <library>/boost/beast//ssl/<link>shared : <build>no ]
[ ac.check-library /boost/beast//crypto : <library>/boost/beast//crypto/<link>shared : <build>no ]
[ ac.check-library /openssl//ssl : <library>/openssl//ssl/<link>shared : <build>no ]
[ ac.check-library /openssl//crypto : <library>/openssl//crypto/<link>shared : <build>no ]
: usage-requirements
$(defines)
<library>/openssl//ssl/<link>shared
<library>/openssl//crypto/<link>shared
<target-os>linux:<library>dl
;


lib lib-beast
: test/lib_beast.cpp
: requirements
Expand Down
4 changes: 2 additions & 2 deletions test/Jamfile
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@ project /boost/beast/test
<boost.beast.separate-compilation>on:<library>/boost/beast//lib-beast/<link>static
<library>/boost/filesystem//boost_filesystem
<library>/boost/context//boost_context
<target-os>darwin,<address-sanitizer>norecover:<context-impl>ucontext
<target-os>darwin,<address-sanitizer>norecover:<define>BOOST_USE_ASAN=1
<address-sanitizer>norecover:<context-impl>ucontext
<address-sanitizer>norecover:<define>BOOST_USE_ASAN=1
;

path-constant ZLIB_SOURCES :
Expand Down
2 changes: 2 additions & 0 deletions test/beast/websocket/cancel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,8 @@ class cancel_test : public websocket_test_suite
cancel_counter++;

BEAST_EXPECTS(ec == net::error::operation_aborted
// freebsd does this in tests.
|| ec == net::error::connection_reset
|| ec == net::error::broken_pipe
// winapi WSAECONNRESET, as system_category
|| ec == error_code(10054, boost::system::system_category())
Expand Down