Skip to content

Commit dcfd5c6

Browse files
nathantfrankMongoDB Bot
authored andcommitted
SERVER-102596: upgrade libbson to 1.28.1 (#34206)
GitOrigin-RevId: 86e52f8
1 parent 491a4a8 commit dcfd5c6

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

63 files changed

+253
-119
lines changed

README.third_party.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ a notice will be included in
5050
| [LibTomCrypt] | WTFPL, Public Domain | 1.18.2 |||
5151
| [libunwind/libunwind] | MIT | v1.8.1 | ||
5252
| [linenoise] | BSD-2-Clause | Unknown | ||
53-
| [MongoDB C Driver] | Apache-2.0 | 1.27.6 |||
53+
| [MongoDB C Driver] | Apache-2.0 | 1.28.1 |||
5454
| [Mozilla Firefox] | MPL-2.0 | 128.8.0esr | unknown ||
5555
| [nlohmann-json] | MIT | 3.11.3 || |
5656
| [nlohmann.json.decomposed] | MIT | 3.10.5 | unknown | |

bazel/mongo_src_rules.bzl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1574,7 +1574,7 @@ def force_includes_hdr(package_name, name):
15741574

15751575
return []
15761576

1577-
# TODO(SERVER-102596): Stop including this flag when ASP is able to upgrade mongoc and mongocxx
1577+
# TODO(SERVER-103006): Stop including this flag when ASP is able to upgrade mongoc and mongocxx
15781578
STREAMS_THIRD_PARTY_DIR = "src/mongo/db/modules/enterprise/src/streams/third_party"
15791579

15801580
def package_specific_copt(package_name):

sbom.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1191,15 +1191,15 @@
11911191
"name": "Organization: github"
11921192
},
11931193
"name": "MongoDB C Driver",
1194-
"version": "1.27.6",
1194+
"version": "1.28.1",
11951195
"licenses": [
11961196
{
11971197
"license": {
11981198
"id": "Apache-2.0"
11991199
}
12001200
}
12011201
],
1202-
"purl": "pkg:github/mongodb/mongo-c-driver@1.27.6",
1202+
"purl": "pkg:github/mongodb/mongo-c-driver@1.28.1",
12031203
"properties": [
12041204
{
12051205
"name": "internal:team_responsible",

src/third_party/libbson/dist/src/common/common-b64-private.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2018-present MongoDB Inc.
2+
* Copyright 2009-present MongoDB, Inc.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.

src/third_party/libbson/dist/src/common/common-macros-private.h

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,18 @@
1+
/*
2+
* Copyright 2009-present MongoDB, Inc.
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
116

217
#include "common-prelude.h"
318

@@ -12,4 +27,32 @@
1227
#define MONGOC_DEBUG_ASSERT(statement) ((void) 0)
1328
#endif
1429

30+
// `MC_ENABLE_CONVERSION_WARNING_BEGIN` enables -Wconversion to check for potentially unsafe integer conversions.
31+
// The `bson_in_range_*` functions can help address these warnings by ensuring a cast is within bounds.
32+
#if (__GNUC__ > 4) || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6) // gcc 4.6 added support for "diagnostic push".
33+
#define MC_ENABLE_CONVERSION_WARNING_BEGIN \
34+
_Pragma ("GCC diagnostic push") _Pragma ("GCC diagnostic warning \"-Wconversion\"")
35+
#define MC_ENABLE_CONVERSION_WARNING_END _Pragma ("GCC diagnostic pop")
36+
#elif defined(__clang__)
37+
#define MC_ENABLE_CONVERSION_WARNING_BEGIN \
38+
_Pragma ("clang diagnostic push") _Pragma ("clang diagnostic warning \"-Wconversion\"")
39+
#define MC_ENABLE_CONVERSION_WARNING_END _Pragma ("clang diagnostic pop")
40+
#else
41+
#define MC_ENABLE_CONVERSION_WARNING_BEGIN
42+
#define MC_ENABLE_CONVERSION_WARNING_END
1543
#endif
44+
45+
// Disable the -Wcast-function-type-strict warning.
46+
#define MC_DISABLE_CAST_FUNCTION_TYPE_STRICT_WARNING_BEGIN
47+
#define MC_DISABLE_CAST_FUNCTION_TYPE_STRICT_WARNING_END
48+
#if defined(__clang__)
49+
#if __has_warning("-Wcast-function-type-strict")
50+
#undef MC_DISABLE_CAST_FUNCTION_TYPE_STRICT_WARNING_BEGIN
51+
#undef MC_DISABLE_CAST_FUNCTION_TYPE_STRICT_WARNING_END
52+
#define MC_DISABLE_CAST_FUNCTION_TYPE_STRICT_WARNING_BEGIN \
53+
_Pragma ("clang diagnostic push") _Pragma ("clang diagnostic ignored \"-Wcast-function-type-strict\"")
54+
#define MC_DISABLE_CAST_FUNCTION_TYPE_STRICT_WARNING_END _Pragma ("clang diagnostic pop")
55+
#endif // __has_warning("-Wcast-function-type-strict")
56+
#endif // defined(__clang__)
57+
58+
#endif /* COMMON_MACROS_PRIVATE_H */

src/third_party/libbson/dist/src/common/common-md5-private.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2018-present MongoDB, Inc.
2+
* Copyright 2009-present MongoDB, Inc.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.

src/third_party/libbson/dist/src/common/common-prelude.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2018-present MongoDB, Inc.
2+
* Copyright 2009-present MongoDB, Inc.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.

src/third_party/libbson/dist/src/common/common-thread-private.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2013-present MongoDB, Inc.
2+
* Copyright 2009-present MongoDB, Inc.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.

src/third_party/libbson/dist/src/common/common-thread.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2020-present MongoDB, Inc.
2+
* Copyright 2009-present MongoDB, Inc.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -24,7 +24,7 @@ mcommon_thread_create (bson_thread_t *thread, BSON_THREAD_FUN_TYPE (func), void
2424
{
2525
BSON_ASSERT_PARAM (thread);
2626
BSON_ASSERT_PARAM (func);
27-
BSON_ASSERT (arg || true); // optional.
27+
BSON_OPTIONAL_PARAM (arg); // optional.
2828
return pthread_create (thread, NULL, func, arg);
2929
}
3030
int
@@ -47,7 +47,7 @@ mcommon_thread_create (bson_thread_t *thread, BSON_THREAD_FUN_TYPE (func), void
4747
{
4848
BSON_ASSERT_PARAM (thread);
4949
BSON_ASSERT_PARAM (func);
50-
BSON_ASSERT (arg || true); // optional.
50+
BSON_OPTIONAL_PARAM (arg); // optional.
5151

5252
*thread = (HANDLE) _beginthreadex (NULL, 0, func, arg, 0, NULL);
5353
if (0 == *thread) {

src/third_party/libbson/dist/src/libbson/NEWS

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,33 @@
1+
libbson 1.28.1
2+
==============
3+
4+
Fixes:
5+
6+
* Fix large string handling in `bson_string_truncate`.
7+
* Fix possible crash in `bson_value_copy`.
8+
9+
10+
Thanks to everyone who contributed to the development of this release.
11+
12+
* Joshua Siegel
13+
* Kevin Albertson
14+
15+
16+
17+
libbson 1.28.0
18+
==============
19+
20+
New features:
21+
22+
* Add `bson_validate_with_error_and_offset`.
23+
24+
Build Configuration:
25+
26+
* Remove automatic ccache detection and usage (CCache.cmake).
27+
* Set [`CMAKE_<LANG>_COMPILER_LAUNCHER`](https://cmake.org/cmake/help/latest/envvar/CMAKE_LANG_COMPILER_LAUNCHER.html) to build with ccache.
28+
* Remove `MONGO_USE_CCACHE` (no longer applicable; see above).
29+
30+
131
libbson 1.27.6
232
==============
333

0 commit comments

Comments
 (0)