Skip to content

Commit 8e1c47a

Browse files
authored
CXX-2814 Remove BSONCXX_POLY_USE_STD_EXPERIMENTAL from polyfill options (#1089)
1 parent 93ba46b commit 8e1c47a

File tree

15 files changed

+3
-95
lines changed

15 files changed

+3
-95
lines changed

.evergreen/compile.sh

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ set -o pipefail
2323
: "${REQUIRED_CXX_STANDARD:-}"
2424
: "${RUN_DISTCHECK:-}"
2525
: "${USE_POLYFILL_BOOST:-}"
26-
: "${USE_POLYFILL_STD_EXPERIMENTAL:-}"
2726
: "${USE_SANITIZER_ASAN:-}"
2827
: "${USE_SANITIZER_UBSAN:-}"
2928
: "${USE_STATIC_LIBS:-}"
@@ -136,13 +135,6 @@ esac
136135
export CMAKE_GENERATOR="${generator:?}"
137136
export CMAKE_GENERATOR_PLATFORM="${platform:-}"
138137

139-
if [[ "${USE_POLYFILL_STD_EXPERIMENTAL:-}" == "ON" ]]; then
140-
cmake_flags+=(
141-
"-DCMAKE_CXX_STANDARD=14"
142-
"-DBSONCXX_POLY_USE_STD_EXPERIMENTAL=ON"
143-
)
144-
fi
145-
146138
if [[ "${USE_POLYFILL_BOOST:-}" == "ON" ]]; then
147139
cmake_flags+=("-DBSONCXX_POLY_USE_BOOST=ON")
148140
fi

.mci.yml

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -469,7 +469,6 @@ functions:
469469
- REQUIRED_CXX_STANDARD
470470
- RUN_DISTCHECK
471471
- USE_POLYFILL_BOOST
472-
- USE_POLYFILL_STD_EXPERIMENTAL
473472
- USE_SANITIZER_ASAN
474473
- USE_SANITIZER_UBSAN
475474
- USE_STATIC_LIBS
@@ -1685,24 +1684,6 @@ buildvariants:
16851684
- name: build_example_with_add_subdirectory
16861685
- name: uninstall_check
16871686

1688-
# TODO CXX-2260 Upgrade std::experimental tasks to use Ubuntu 18.04 and mongodb_latest
1689-
# after bug fixes with newer g++ versions.
1690-
- name: ubuntu1604-debug-std-experimental
1691-
display_name: "Ubuntu 16.04 Debug (std::experimental) (MongoDB 4.4)"
1692-
expansions:
1693-
build_type: "Debug"
1694-
USE_POLYFILL_STD_EXPERIMENTAL: ON
1695-
mongodb_version: "4.4"
1696-
example_projects_cxx_standard: 14
1697-
use_mongocryptd: true # crypt_shared is not available for Ubuntu 16.04
1698-
run_on:
1699-
- ubuntu1604-build
1700-
tasks:
1701-
- name: compile_and_test_with_shared_libs
1702-
- name: compile_and_test_with_shared_libs_extra_alignment
1703-
- name: compile_and_test_with_static_libs
1704-
- name: compile_and_test_with_static_libs_extra_alignment
1705-
17061687
- name: ubuntu2004-debug-valgrind-latest
17071688
display_name: "Valgrind Ubuntu 20.04 Debug (MongoDB Latest)"
17081689
expansions:

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ Changes prior to 3.9.0 are documented as [release notes on GitHub](https://githu
3333
Use `find_package(bsoncxx)` and `find_package(mongocxx)` instead.
3434
- Accordingly, `LIBBSONCXX_*` and `LIBMONGOCXX_*` CMake variables provided by the legacy CMake package config files are no longer supported. Use the `mongo::bsoncxx_*` and `mongo::mongocxx_*` CMake targets instead.
3535
- Note: manually setting compile definitions, include directories, and link libraries is unnecessary with target-based CMake. The former `LIBBSONCXX_*` and `LIBMONGOCXX_*` CMake variables are superseded by the `target_link_libraries()` CMake command, which automatically propagates the necessary compile definitions, include directories, and link libraries to dependent targets via `mongo::bsoncxx_*` and `mongo::mongocxx_*` interface properties.
36+
- Experimental C++ standard library as a polyfill option via `BSONCXX_POLY_USE_STD_EXPERIMENTAL`.
3637

3738
## 3.9.0
3839

CMakeLists.txt

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -460,10 +460,6 @@ if(NOT(TARGET dist OR TARGET distcheck))
460460
list(APPEND polyfill_flags "-DBSONCXX_POLY_USE_MNMLSTC=${BSONCXX_POLY_USE_MNMLSTC}")
461461
endif()
462462

463-
if(NOT "${BSONCXX_POLY_USE_STD_EXPERIMENTAL}" STREQUAL "")
464-
list(APPEND polyfill_flags "-DBSONCXX_POLY_USE_STD_EXPERIMENTAL=${BSONCXX_POLY_USE_STD_EXPERIMENTAL}")
465-
endif()
466-
467463
if(NOT "${BSONCXX_POLY_USE_SYSTEM_MNMLSTC}" STREQUAL "")
468464
list(APPEND polyfill_flags "-DBSONCXX_POLY_USE_SYSTEM_MNMLSTC=${BSONCXX_POLY_USE_SYSTEM_MNMLSTC}")
469465
endif()

cmake/BsoncxxUtil.cmake

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -55,22 +55,19 @@ function(bsoncxx_add_library TARGET OUTPUT_NAME LINK_TYPE)
5555
# Library used for C++17 polyfills:
5656
# - 'm' for mnmlstc/core.
5757
# - 'b' for Boost.
58-
# - 'x' for experimental standard library.
5958
# - 'i' for bsoncxx implementations.
6059
# - 's' for standard library (no polyfill).
6160
if(1)
6261
if(BSONCXX_POLY_USE_MNMLSTC)
6362
set(polyfill "m")
6463
elseif(BSONCXX_POLY_USE_BOOST)
6564
set(polyfill "b")
66-
elseif(BSONCXX_POLY_USE_STD_EXPERIMENTAL)
67-
set(polyfill "x")
6865
elseif(0) # CXX-2796: reserved for bsoncxx implementations as polyfill.
6966
set(polyfill "i")
7067
elseif(BSONCXX_POLY_USE_STD)
7168
set(polyfill "s")
7269
else()
73-
message(FATAL_ERROR "could not determine polyfill library: must be one of [mbxis]")
70+
message(FATAL_ERROR "could not determine polyfill library: must be one of [mbis]")
7471
endif()
7572

7673
set_target_properties(${TARGET} PROPERTIES INTERFACE_BSONCXX_ABI_TAG_POLYFILL_LIBRARY ${polyfill})

cmake/make_dist/MakeDistCheck.cmake

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,6 @@ function (RUN_DIST_CHECK PACKAGE_PREFIX EXT)
3939
if (NOT "${BSONCXX_POLY_USE_MNMLSTC}" STREQUAL "")
4040
list(APPEND polyfill_flags "-DBSONCXX_POLY_USE_MNMLSTC=${BSONCXX_POLY_USE_MNMLSTC}")
4141
endif()
42-
if (NOT "${BSONCXX_POLY_USE_STD_EXPERIMENTAL}" STREQUAL "")
43-
list(APPEND polyfill_flags "-DBSONCXX_POLY_USE_STD_EXPERIMENTAL=${BSONCXX_POLY_USE_STD_EXPERIMENTAL}")
44-
endif()
4542
if (NOT "${BSONCXX_POLY_USE_SYSTEM_MNMLSTC}" STREQUAL "")
4643
list(APPEND polyfill_flags "-DBSONCXX_POLY_USE_SYSTEM_MNMLSTC=${BSONCXX_POLY_USE_SYSTEM_MNMLSTC}")
4744
endif()

docs/content/mongocxx-v3/installation/linux.md

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -26,15 +26,6 @@ must choose one of the following implementations for these features:
2626
only option if you are using a version of MSVC that does not support
2727
C++17.
2828

29-
`std::experimental`
30-
Select with `-DBSONCXX_POLY_USE_STD_EXPERIMENTAL=1`. If your
31-
toolchain's standard library provides `optional` and
32-
`string_view` in the namespace `std::experimental`, you can use
33-
this option. Be aware that your standard library's
34-
`std::experimental` implementation may change over time,
35-
breaking binary compatibility in unexpected ways. Note that this
36-
polyfill is *not* recommended and is unsupported.
37-
3829
Most users should be fine sticking with the default. However, if you
3930
have an existing application which makes heavy use of one of the
4031
available libraries, you may prefer to build the mongocxx driver

docs/content/mongocxx-v3/installation/macos.md

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -26,15 +26,6 @@ must choose one of the following implementations for these features:
2626
only option if you are using a version of MSVC that does not support
2727
C++17.
2828

29-
`std::experimental`
30-
Select with `-DBSONCXX_POLY_USE_STD_EXPERIMENTAL=1`. If your
31-
toolchain's standard library provides `optional` and
32-
`string_view` in the namespace `std::experimental`, you can use
33-
this option. Be aware that your standard library's
34-
`std::experimental` implementation may change over time,
35-
breaking binary compatibility in unexpected ways. Note that this
36-
polyfill is *not* recommended and is unsupported.
37-
3829
Most users should be fine sticking with the default. However, if you
3930
have an existing application which makes heavy use of one of the
4031
available libraries, you may prefer to build the mongocxx driver

docs/content/mongocxx-v3/installation/windows.md

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -26,15 +26,6 @@ must choose one of the following implementations for these features:
2626
only option if you are using a version of MSVC that does not support
2727
C++17.
2828

29-
`std::experimental`
30-
Select with `-DBSONCXX_POLY_USE_STD_EXPERIMENTAL=1`. If your
31-
toolchain's standard library provides `optional` and
32-
`string_view` in the namespace `std::experimental`, you can use
33-
this option. Be aware that your standard library's
34-
`std::experimental` implementation may change over time,
35-
breaking binary compatibility in unexpected ways. Note that this
36-
polyfill is *not* recommended and is unsupported.
37-
3829
Most users should be fine sticking with the default. However, if you
3930
have an existing application which makes heavy use of one of the
4031
available libraries, you may prefer to build the mongocxx driver

src/bsoncxx/CMakeLists.txt

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ set(BSONCXX_VERSION ${BSONCXX_VERSION_NO_EXTRA}${BSONCXX_VERSION_EXTRA})
2121
message(STATUS "bsoncxx version: ${BSONCXX_VERSION}")
2222

2323
option(BSONCXX_POLY_USE_MNMLSTC "Use MNMLSTC/core for stdx polyfills" OFF)
24-
option(BSONCXX_POLY_USE_STD_EXPERIMENTAL "Use std::experimental for stdx polyfills" OFF)
2524
option(BSONCXX_POLY_USE_SYSTEM_MNMLSTC "Obtain mnmlstc/core from system" OFF)
2625
option(BSONCXX_POLY_USE_BOOST "Use boost for stdx polyfills" OFF)
2726
option(BSONCXX_POLY_USE_STD "Use C++17 std library for stdx polyfills" OFF)
@@ -31,7 +30,7 @@ set(BSONCXX_OUTPUT_BASENAME "bsoncxx" CACHE STRING "Output bsoncxx library base
3130
# Count how many polyfill options are true-ish
3231
set(BSONCXX_POLY_OPTIONS_SET 0)
3332

34-
foreach(BSONCXX_POLY_OPTION ${BSONCXX_POLY_USE_MNMLSTC} ${BSONCXX_POLY_USE_STD_EXPERIMENTAL} ${BSONCXX_POLY_USE_BOOST} ${BSONCXX_POLY_USE_STD})
33+
foreach(BSONCXX_POLY_OPTION ${BSONCXX_POLY_USE_MNMLSTC} ${BSONCXX_POLY_USE_BOOST} ${BSONCXX_POLY_USE_STD})
3534
if(${BSONCXX_POLY_OPTION})
3635
MATH(EXPR BSONCXX_POLY_OPTIONS_SET "${BSONCXX_POLY_OPTIONS_SET}+1")
3736
endif()
@@ -63,11 +62,6 @@ if(NOT BSONCXX_POLY_USE_MNMLSTC AND BSONCXX_POLY_USE_SYSTEM_MNMLSTC)
6362
MESSAGE(FATAL_ERROR "Can't specify system mnmlstc when not using mnmlstc")
6463
endif()
6564

66-
# Can only use STD_EXPERIMENTAL in C++14 mode
67-
if(BSONCXX_POLY_USE_STD_EXPERIMENTAL AND CMAKE_CXX_STANDARD LESS 14)
68-
message(FATAL_ERROR "Can only use BSONCXX_POLY_USE_STD_EXPERIMENTAL if CMAKE_CXX_STANDARD is 14 or higher")
69-
endif()
70-
7165
set(BSONCXX_BOOST_PKG_DEP "") # Required by bsoncxx-config.cmake.in.
7266

7367
if(BSONCXX_POLY_USE_BOOST)

src/bsoncxx/include/bsoncxx/v_noabi/bsoncxx/config/postlude.hpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,6 @@ BSONCXX_POP_WARNINGS();
2626
#pragma pop_macro("BSONCXX_INLINE_NAMESPACE_END")
2727
#undef BSONCXX_POLY_USE_MNMLSTC
2828
#pragma pop_macro("BSONCXX_POLY_USE_MNMLSTC")
29-
#undef BSONCXX_POLY_USE_STD_EXPERIMENTAL
30-
#pragma pop_macro("BSONCXX_POLY_USE_STD_EXPERIMENTAL")
3129
#undef BSONCXX_POLY_USE_SYSTEM_MNMLSTC
3230
#pragma pop_macro("BSONCXX_POLY_USE_SYSTEM_MNMLSTC")
3331
#undef BSONCXX_POLY_USE_BOOST

src/bsoncxx/include/bsoncxx/v_noabi/bsoncxx/config/prelude.hpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,8 +67,6 @@
6767
#undef BSONCXX_INLINE_NAMESPACE_END
6868
#pragma push_macro("BSONCXX_POLY_USE_MNMLSTC")
6969
#undef BSONCXX_POLY_USE_MNMLSTC
70-
#pragma push_macro("BSONCXX_POLY_USE_STD_EXPERIMENTAL")
71-
#undef BSONCXX_POLY_USE_STD_EXPERIMENTAL
7270
#pragma push_macro("BSONCXX_POLY_USE_SYSTEM_MNMLSTC")
7371
#undef BSONCXX_POLY_USE_SYSTEM_MNMLSTC
7472
#pragma push_macro("BSONCXX_POLY_USE_BOOST")

src/bsoncxx/include/bsoncxx/v_noabi/bsoncxx/stdx/optional.hpp

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -54,23 +54,6 @@ using ::boost::make_optional;
5454
} // namespace v_noabi
5555
} // namespace bsoncxx
5656

57-
#elif defined(BSONCXX_POLY_USE_STD_EXPERIMENTAL)
58-
59-
#include <experimental/optional>
60-
61-
namespace bsoncxx {
62-
namespace v_noabi {
63-
namespace stdx {
64-
65-
using ::std::experimental::make_optional;
66-
using ::std::experimental::nullopt;
67-
using ::std::experimental::nullopt_t;
68-
using ::std::experimental::optional;
69-
70-
} // namespace stdx
71-
} // namespace v_noabi
72-
} // namespace bsoncxx
73-
7457
#elif defined(BSONCXX_POLY_USE_STD)
7558

7659
#include <optional>

src/bsoncxx/lib/bsoncxx/v_noabi/bsoncxx/config/config.hpp.in

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
// See the License for the specific language governing permissions and
1313
// limitations under the License.
1414

15-
#cmakedefine BSONCXX_POLY_USE_STD_EXPERIMENTAL
1615
#cmakedefine BSONCXX_POLY_USE_MNMLSTC
1716
#cmakedefine BSONCXX_POLY_USE_SYSTEM_MNMLSTC
1817
#cmakedefine BSONCXX_POLY_USE_BOOST

src/bsoncxx/test/CMakeLists.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,6 @@ if(ENABLE_MACRO_GUARD_TESTS)
7878
BSONCXX_INLINE_NAMESPACE_BEGIN # config.hpp (generated by CMake)
7979
BSONCXX_INLINE_NAMESPACE_END
8080
BSONCXX_POLY_USE_MNMLSTC
81-
BSONCXX_POLY_USE_STD_EXPERIMENTAL
8281
BSONCXX_POLY_USE_SYSTEM_MNMLSTC
8382
BSONCXX_POLY_USE_BOOST
8483
BSONCXX_VERSION_EXTRA # version.hpp (generated by CMake)

0 commit comments

Comments
 (0)