Skip to content

Commit 645574e

Browse files
authored
Add support for modular build structure. (#239)
* Make the library modular usable. * Switch to library requirements instead of source. As source puts extra source in install targets. * Add missing NO_LIB usage requirements. * Add requires-b2 check to top-level build file. * Bump B2 require to 5.2 * Update copyright dates. * Move inter-lib dependencies to a project variable and into the build targets. * Adjust doc build to avoid boost-root references. * Update build deps. * Rework GHA to use containers for the ubuntu that are god or going away. * Remove obsolete package installs. * Need another package? * Some deepndencies are now C++11 only. Hence date_time is now also C++11 only. * Switch macOS test to use the latest version. * Remove not-needed software-properties-common package. * Remove setup gcc toolchain step. * Install some missing compilers. * Maybe the gcc builds for the specific ubuntu versions rea broken. Switch to something newer.
1 parent 3971490 commit 645574e

9 files changed

Lines changed: 144 additions & 117 deletions

File tree

.github/workflows/ci.yml

Lines changed: 47 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -44,76 +44,85 @@ jobs:
4444
matrix:
4545
include:
4646
# Linux, gcc
47-
- { compiler: gcc-4.8, cxxstd: '03,11', os: ubuntu-18.04 }
48-
- { compiler: gcc-5, cxxstd: '03,11', os: ubuntu-18.04 }
49-
- { compiler: gcc-6, cxxstd: '03,11,14,17', os: ubuntu-18.04 }
50-
- { compiler: gcc-7, cxxstd: '03,11,14,17', os: ubuntu-18.04 }
51-
- { compiler: gcc-8, cxxstd: '03,11,14,17,2a', os: ubuntu-18.04 }
52-
- { compiler: gcc-9, cxxstd: '03,11,14,17,2a', os: ubuntu-18.04 }
53-
- { compiler: gcc-10, cxxstd: '03,11,14,17,20', os: ubuntu-20.04 }
54-
- { compiler: gcc-11, cxxstd: '03,11,14,17,20', os: ubuntu-20.04, self-contained-header-tests: 1 }
47+
- { compiler: gcc-4.8, cxxstd: '11', container: 'ubuntu:18.04', os: ubuntu-latest }
48+
- { compiler: gcc-5, cxxstd: '11', container: 'ubuntu:18.04', os: ubuntu-latest }
49+
- { compiler: gcc-6, cxxstd: '11,14,17', container: 'ubuntu:18.04', os: ubuntu-latest }
50+
- { compiler: gcc-7, cxxstd: '11,14,17', container: 'ubuntu:18.04', os: ubuntu-latest }
51+
- { compiler: gcc-8, cxxstd: '11,14,17,2a', container: 'ubuntu:18.04', os: ubuntu-latest }
52+
- { compiler: gcc-9, cxxstd: '11,14,17,2a', container: 'ubuntu:20.04', os: ubuntu-latest }
53+
- { compiler: gcc-10, cxxstd: '11,14,17,20', container: 'ubuntu:20.04', os: ubuntu-latest }
54+
- { compiler: gcc-11, cxxstd: '11,14,17,20', container: 'ubuntu:22.04', os: ubuntu-latest, self-contained-header-tests: 1 }
5555
# disabled: there are too many issues in serialization and not enough time to add suppressions
5656
# - { name: GCC w/ sanitizers, sanitize: yes,
57-
# compiler: gcc-11, cxxstd: '03,11,14,17,20', os: ubuntu-20.04 }
57+
# compiler: gcc-11, cxxstd: '11,14,17,20', container: 'ubuntu:20.04', os: ubuntu-latest }
5858
- { name: Collect coverage, coverage: yes,
59-
compiler: gcc-10, cxxstd: '03,11', os: ubuntu-20.04, install: 'g++-10-multilib', address-model: '32,64' }
59+
compiler: gcc-10, cxxstd: '11', container: 'ubuntu:20.04', os: ubuntu-latest, install: 'g++-10-multilib', address-model: '32,64' }
6060

6161
# Linux, clang
62-
- { compiler: clang-3.9, cxxstd: '03,11,14', os: ubuntu-18.04 }
63-
- { compiler: clang-4.0, cxxstd: '03,11,14', os: ubuntu-18.04 }
64-
- { compiler: clang-5.0, cxxstd: '03,11,14,1z', os: ubuntu-18.04 }
65-
- { compiler: clang-6.0, cxxstd: '03,11,14,17', os: ubuntu-18.04 }
66-
- { compiler: clang-7, cxxstd: '03,11,14,17', os: ubuntu-18.04 }
62+
- { compiler: clang-3.9, cxxstd: '11,14', container: 'ubuntu:18.04', os: ubuntu-latest }
63+
- { compiler: clang-4.0, cxxstd: '11,14', container: 'ubuntu:18.04', os: ubuntu-latest }
64+
- { compiler: clang-5.0, cxxstd: '11,14,1z', container: 'ubuntu:18.04', os: ubuntu-latest }
65+
- { compiler: clang-6.0, cxxstd: '11,14,17', container: 'ubuntu:18.04', os: ubuntu-latest }
66+
- { compiler: clang-7, cxxstd: '11,14,17', container: 'ubuntu:18.04', os: ubuntu-latest }
6767
# Note: clang-8 does not fully support C++20, so it is not compatible with some libstdc++ versions in this mode
68-
- { compiler: clang-8, cxxstd: '03,11,14,17,2a', os: ubuntu-18.04, install: 'clang-8 g++-7', gcc_toolchain: 7 }
69-
- { compiler: clang-9, cxxstd: '03,11,14,17,2a', os: ubuntu-20.04 }
70-
- { compiler: clang-10, cxxstd: '03,11,14,17,20', os: ubuntu-20.04 }
71-
- { compiler: clang-11, cxxstd: '03,11,14,17,20', os: ubuntu-20.04 }
72-
- { compiler: clang-12, cxxstd: '03,11,14,17,20', os: ubuntu-20.04, self-contained-header-tests: 1 }
68+
- { compiler: clang-8, cxxstd: '11,14,17,2a', container: 'ubuntu:18.04', os: ubuntu-latest, install: 'clang-8 g++-7' }
69+
- { compiler: clang-9, cxxstd: '11,14,17,2a', container: 'ubuntu:20.04', os: ubuntu-latest }
70+
- { compiler: clang-10, cxxstd: '11,14,17,20', container: 'ubuntu:20.04', os: ubuntu-latest }
71+
- { compiler: clang-11, cxxstd: '11,14,17,20', container: 'ubuntu:20.04', os: ubuntu-latest }
72+
- { compiler: clang-12, cxxstd: '11,14,17,20', container: 'ubuntu:20.04', os: ubuntu-latest, self-contained-header-tests: 1 }
7373

7474
# libc++
75-
- { compiler: clang-6.0, cxxstd: '03,11,14', os: ubuntu-18.04, stdlib: libc++, install: 'clang-6.0 libc++-dev libc++abi-dev' }
76-
- { compiler: clang-12, cxxstd: '03,11,14,17,20', os: ubuntu-20.04, stdlib: libc++, install: 'clang-12 libc++-12-dev libc++abi-12-dev', self-contained-header-tests: 1 }
75+
- { compiler: clang-6.0, cxxstd: '11,14', container: 'ubuntu:18.04', os: ubuntu-latest, stdlib: libc++, install: 'clang-6.0 libc++-dev libc++abi-dev' }
76+
- { compiler: clang-12, cxxstd: '11,14,17,20', container: 'ubuntu:20.04', os: ubuntu-latest, stdlib: libc++, install: 'clang-12 libc++-12-dev libc++abi-12-dev', self-contained-header-tests: 1 }
7777
# disabled: there are too many issues in serialization and not enough time to add suppressions
7878
# - { name: Clang w/ sanitizers, sanitize: yes,
79-
# compiler: clang-12, cxxstd: '03,11,14,17,20', os: ubuntu-20.04, stdlib: libc++, install: 'clang-12 libc++-12-dev libc++abi-12-dev' }
79+
# compiler: clang-12, cxxstd: '11,14,17,20', container: 'ubuntu:20.04', os: ubuntu-latest, stdlib: libc++, install: 'clang-12 libc++-12-dev libc++abi-12-dev' }
8080

8181
# OSX, clang
8282
# sanitize disabled: there are too many issues in serialization and not enough time to add suppressions
83-
- { compiler: clang, cxxstd: '03,11,14,17,2a', os: macos-11 }
83+
- { compiler: clang, cxxstd: '11,14,17,20', os: macos-latest }
8484

8585
# Coverity Scan
8686
# requires two github secrets in repo to activate; see ci/github/coverity.sh
8787
# does not run on pull requests, only on pushes into develop and master
8888
- { name: Coverity, coverity: yes,
89-
compiler: clang-10, cxxstd: '17', os: ubuntu-20.04, ccache: no }
89+
compiler: clang-10, cxxstd: '17', container: 'ubuntu:20.04', os: ubuntu-latest, ccache: no }
9090

9191
# multiarch (bigendian testing) - does not support coverage yet
9292
# date_time has no endian compile-time branches
9393
# - { name: Big-endian, multiarch: yes,
94-
# compiler: clang, cxxstd: '17', os: ubuntu-20.04, ccache: no, distro: fedora, edition: 34, arch: s390x }
94+
# compiler: clang, cxxstd: '17', container: 'ubuntu:20.04', os: ubuntu-latest, ccache: no, distro: fedora, edition: 34, arch: s390x }
9595

9696

9797
timeout-minutes: 120
9898
runs-on: ${{matrix.os}}
99-
container: ${{matrix.container}}
99+
container:
100+
image: ${{matrix.container}}
101+
volumes:
102+
- /node20217:/node20217:rw,rshared
103+
- ${{ startsWith(matrix.container, 'ubuntu:1') && '/node20217:/__e/node20:ro,rshared' || ' ' }}
100104
env: {B2_USE_CCACHE: 1}
101105

102106
steps:
107+
- name: Setup container environment
108+
if: matrix.container
109+
run: |
110+
apt-get update
111+
apt-get -y install sudo python3 git g++ curl xz-utils
112+
113+
- name: Install nodejs20glibc2.17
114+
if: ${{ startsWith( matrix.container, 'ubuntu:1' ) }}
115+
run: |
116+
curl -LO https://archives.boost.io/misc/node/node-v20.9.0-linux-x64-glibc-217.tar.xz
117+
tar -xf node-v20.9.0-linux-x64-glibc-217.tar.xz --strip-components 1 -C /node20217
118+
ldd /__e/node20/bin/node
119+
103120
- name: Setup environment
104121
run: |
105122
if [ -f "/etc/debian_version" ]; then
106123
echo "DEBIAN_FRONTEND=noninteractive" >> $GITHUB_ENV
107124
export DEBIAN_FRONTEND=noninteractive
108125
fi
109-
if [ -n "${{matrix.container}}" ] && [ -f "/etc/debian_version" ]; then
110-
apt-get -o Acquire::Retries=$NET_RETRY_COUNT update
111-
apt-get -o Acquire::Retries=$NET_RETRY_COUNT install -y sudo software-properties-common
112-
# Need (newer) git
113-
for i in {1..${NET_RETRY_COUNT:-3}}; do sudo -E add-apt-repository -y ppa:git-core/ppa && break || sleep 10; done
114-
apt-get -o Acquire::Retries=$NET_RETRY_COUNT update
115-
apt-get -o Acquire::Retries=$NET_RETRY_COUNT install -y g++ python libpython-dev git
116-
fi
117126
# multiple job types are not compatible with ccache, they use "ccache: no" in the matrix
118127
if [[ "${{ matrix.ccache }}" == "no" ]]; then
119128
echo "B2_USE_CCACHE=0" >> $GITHUB_ENV
@@ -174,18 +183,6 @@ jobs:
174183
fi
175184
sudo apt-get -o Acquire::Retries=$NET_RETRY_COUNT install -y $pkgs
176185
177-
- name: Setup GCC Toolchain
178-
if: matrix.gcc_toolchain
179-
run: |
180-
GCC_TOOLCHAIN_ROOT="$HOME/gcc-toolchain"
181-
echo "GCC_TOOLCHAIN_ROOT=$GCC_TOOLCHAIN_ROOT" >> $GITHUB_ENV
182-
MULTIARCH_TRIPLET="$(dpkg-architecture -qDEB_HOST_MULTIARCH)"
183-
mkdir -p "$GCC_TOOLCHAIN_ROOT"
184-
ln -s /usr/include "$GCC_TOOLCHAIN_ROOT/include"
185-
ln -s /usr/bin "$GCC_TOOLCHAIN_ROOT/bin"
186-
mkdir -p "$GCC_TOOLCHAIN_ROOT/lib/gcc/$MULTIARCH_TRIPLET"
187-
ln -s "/usr/lib/gcc/$MULTIARCH_TRIPLET/${{matrix.gcc_toolchain}}" "$GCC_TOOLCHAIN_ROOT/lib/gcc/$MULTIARCH_TRIPLET/${{matrix.gcc_toolchain}}"
188-
189186
- name: Setup multiarch
190187
if: matrix.multiarch
191188
run: |
@@ -240,7 +237,7 @@ jobs:
240237
- { toolset: msvc-14.2, cxxstd: '14,17,20', addrmd: '32,64', os: windows-2019, self-contained-header-tests: 1 }
241238
- { name: Collect coverage, coverage: yes,
242239
toolset: msvc-14.3, cxxstd: '14,17,20', addrmd: '32,64', os: windows-2022 }
243-
- { toolset: gcc, cxxstd: '03,11,14,17,2a', addrmd: '64', os: windows-2019 }
240+
- { toolset: gcc, cxxstd: '11,14,17,2a', addrmd: '64', os: windows-2019 }
244241

245242
runs-on: ${{matrix.os}}
246243

@@ -296,8 +293,8 @@ jobs:
296293
fail-fast: false
297294
matrix:
298295
include:
299-
- { os: ubuntu-20.04, build_shared: ON, build_type: Release, generator: 'Unix Makefiles' }
300-
- { os: ubuntu-20.04, build_shared: OFF, build_type: Debug, generator: 'Unix Makefiles' }
296+
- { os: ubuntu-latest, build_shared: ON, build_type: Release, generator: 'Unix Makefiles' }
297+
- { os: ubuntu-latest, build_shared: OFF, build_type: Debug, generator: 'Unix Makefiles' }
301298
- { os: windows-2019, build_shared: ON, build_type: Release, generator: 'Visual Studio 16 2019' }
302299
- { os: windows-2019, build_shared: OFF, build_type: Debug, generator: 'Visual Studio 16 2019' }
303300

Jamfile

Lines changed: 0 additions & 11 deletions
This file was deleted.

build.jam

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
# Copyright René Ferdinand Rivera Morell 2023-2024
2+
# Distributed under the Boost Software License, Version 1.0.
3+
# (See accompanying file LICENSE_1_0.txt or copy at
4+
# http://www.boost.org/LICENSE_1_0.txt)
5+
6+
require-b2 5.2 ;
7+
8+
constant boost_dependencies :
9+
/boost/algorithm//boost_algorithm
10+
/boost/assert//boost_assert
11+
/boost/config//boost_config
12+
/boost/core//boost_core
13+
/boost/io//boost_io
14+
/boost/lexical_cast//boost_lexical_cast
15+
/boost/numeric_conversion//boost_numeric_conversion
16+
/boost/range//boost_range
17+
/boost/smart_ptr//boost_smart_ptr
18+
/boost/static_assert//boost_static_assert
19+
/boost/throw_exception//boost_throw_exception
20+
/boost/tokenizer//boost_tokenizer
21+
/boost/type_traits//boost_type_traits
22+
/boost/utility//boost_utility
23+
/boost/winapi//boost_winapi ;
24+
25+
project /boost/date_time
26+
: common-requirements
27+
<include>include
28+
;
29+
30+
explicit
31+
[ alias boost_date_time : build//boost_date_time ]
32+
[ alias all : boost_date_time example test ]
33+
;
34+
35+
call-if : boost-library date_time
36+
: install boost_date_time
37+
;
38+

build/Jamfile.v2

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,24 @@
11
# Copyright (c) 2002-2005 CrystalClear Software, Inc.
2-
# Use, modification and distribution is subject to the
2+
# Use, modification and distribution is subject to the
33
# Boost Software License, Version 1.0. (See accompanying
44
# file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt)
55
#
66
# date_time is now header only -- this file provides a stub for backward compatibility
77
#
88

99

10-
project boost/date_time
10+
project
11+
: common-requirements <library>$(boost_dependencies)
1112
: requirements
1213
<define>DATE_TIME_INLINE
13-
<link>shared:<define>BOOST_ALL_DYN_LINK=1
14+
<link>shared:<define>BOOST_ALL_DYN_LINK=1
1415
: usage-requirements
1516
<define>DATE_TIME_INLINE
1617
<link>shared:<define>BOOST_DATE_TIME_DYN_LINK=1
18+
<define>BOOST_DATE_TIME_NO_LINK=1
1719
: source-location ../src
1820
;
1921

2022
# greg_month.cpp is now just a stub so that there is
2123
# still a boost_date_time library to link for backward compatibility
2224
lib boost_date_time : gregorian/greg_month.cpp ;
23-
24-
boost-install boost_date_time ;

doc/build.jam

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44
# (See accompanying file LICENSE_1_0.txt or copy at
55
# http://www.boost.org/LICENSE_1_0.txt)
66

7+
require-b2 5.2 ;
8+
79
###############################################################################
810
alias boostdoc
911
: ../xmldoc/date_time.xml

example/Jamfile

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
project libs/date_time/example ;
1+
project : requirements <library>/boost/date_time//boost_date_time ;
22

33
exe dates_as_strings : gregorian/dates_as_strings.cpp ;
44
exe days_alive : gregorian/days_alive.cpp ;
@@ -18,19 +18,19 @@ exe days_since_year_start : gregorian/days_since_year_start.cpp ;
1818

1919

2020
exe local_utc_conversion : posix_time/local_utc_conversion.cpp
21-
: <define>BOOST_DATE_TIME_POSIX_TIME_STD_CONFIG
21+
: <define>BOOST_DATE_TIME_POSIX_TIME_STD_CONFIG
2222
;
2323

2424
exe print_hours : posix_time/print_hours.cpp
25-
: <define>BOOST_DATE_TIME_POSIX_TIME_STD_CONFIG
25+
: <define>BOOST_DATE_TIME_POSIX_TIME_STD_CONFIG
2626
;
2727

2828
exe time_math : posix_time/time_math.cpp
29-
: <define>BOOST_DATE_TIME_POSIX_TIME_STD_CONFIG
29+
: <define>BOOST_DATE_TIME_POSIX_TIME_STD_CONFIG
3030
;
3131

3232
exe time_periods : posix_time/time_periods.cpp
33-
: <define>BOOST_DATE_TIME_POSIX_TIME_STD_CONFIG
33+
: <define>BOOST_DATE_TIME_POSIX_TIME_STD_CONFIG
3434
;
3535

3636
exe simple_time_zone : local_time/simple_time_zone.cpp ;
@@ -41,7 +41,7 @@ exe io_tutorial : tutorial/io_tutorial.cpp ;
4141

4242
# Copyright (c) 2002-2005
4343
# CrystalClear Software, Inc.
44-
# Subject to the Boost Software License, Version 1.0.
45-
# (See accompanying file LICENSE_1_0.txt or
44+
# Subject to the Boost Software License, Version 1.0.
45+
# (See accompanying file LICENSE_1_0.txt or
4646
# http://www.boost.org/LICENSE_1_0.txt)
4747

meta/libraries.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,5 +13,5 @@
1313
"Jeff Garland <jeff -at- crystalclearsoftware.com>",
1414
"James E. King III <jking -at- apache.org>"
1515
],
16-
"cxxstd": "03"
16+
"cxxstd": "11"
1717
}

0 commit comments

Comments
 (0)