diff options
author | Ronald Klop <ronald@FreeBSD.org> | 2024-07-23 17:44:45 +0200 |
---|---|---|
committer | Ronald Klop <ronald@FreeBSD.org> | 2024-07-23 17:44:45 +0200 |
commit | f2c9ba7c53c9a599c36b722305a189fd912db5d2 (patch) | |
tree | accade01ff4ca28522f8702d4a8864689c862da1 /databases/mongodb80/files | |
parent | sysutils/cfengine*-lts: cfengine* 3.24.0 is LTS (diff) |
databases/mongodb80: new port 8.0.0-rc14
Still release candidate, use with care.
Notes:
https://www.mongodb.com/docs/v8.0/release-notes/8.0/
Diffstat (limited to 'databases/mongodb80/files')
12 files changed, 308 insertions, 0 deletions
diff --git a/databases/mongodb80/files/extrapatch-SConstruct b/databases/mongodb80/files/extrapatch-SConstruct new file mode 100644 index 000000000000..05946bd82cdc --- /dev/null +++ b/databases/mongodb80/files/extrapatch-SConstruct @@ -0,0 +1,16 @@ +--- SConstruct.orig 2023-06-07 17:07:38 UTC ++++ SConstruct +@@ -3217,8 +3205,12 @@ if not env.TargetOSIs('windows', 'macOS') and (env.Too + # setting it for both C and C++ by setting both of CFLAGS and + # CXXFLAGS. + ++ arm_march_flag = "armv8-a" ++ if get_option('use-hardware-crc32') == "on": ++ arm_march_flag += "+crc" ++ + default_targeting_flags_for_architecture = { +- "aarch64": {"-march=": "armv8.2-a", "-mtune=": "generic"}, ++ "aarch64": {"-march=": arm_march_flag, "-mtune=": "generic"}, + "i386": {"-march=": "nocona", "-mtune=": "generic"}, + "ppc64le": {"-mcpu=": "power8", "-mtune=": "power8", "-mcmodel=": "medium"}, + "s390x": {"-march=": "z196", "-mtune=": "zEC12"}, diff --git a/databases/mongodb80/files/make.test.sh b/databases/mongodb80/files/make.test.sh new file mode 100755 index 000000000000..c42bb1973e6b --- /dev/null +++ b/databases/mongodb80/files/make.test.sh @@ -0,0 +1,31 @@ +#! /bin/sh + +set -e + +usage() { + echo "Usage: $0 <path>" + echo "<path> path to the executables" +} + +test "$#" -eq 1 || ( usage && exit 1 ) + +set -x + +PATH="$1:$PATH" + +DBDIR=$( mktemp -d -t tmp.mongodb ) + +trap 'rm -rf "$DBDIR"' EXIT + +# Trivial check if the binaries execute at all. +mongod --version +mongos --version + +# Check if an empty database can be created. +mkdir "$DBDIR/db" +tail -F "$DBDIR/log" | ( grep -qFe "Waiting for connections" && kill $(cat "$DBDIR/pid") ) & +script -eF "$DBDIR/log" \ + timeout -s TERM -k 30s 60s \ + mongod --dbpath "$DBDIR/db" --pidfilepath "$DBDIR/pid" + +echo "Test successful" diff --git a/databases/mongodb80/files/mongod.in b/databases/mongodb80/files/mongod.in new file mode 100644 index 000000000000..20b0f5c0f43d --- /dev/null +++ b/databases/mongodb80/files/mongod.in @@ -0,0 +1,53 @@ +#!/bin/sh + +# PROVIDE: mongod +# REQUIRE: NETWORK ldconfig +# KEYWORD: shutdown +# +# Add the following lines to /etc/rc.conf.local or /etc/rc.conf +# to enable this service: +# +# mongod_enable (bool): Set to "NO" by default. +# Set it to "YES" to enable mongod. +# mongod_dbpath (str): Default to "/var/db/mongodb" +# Base database directory. +# mongod_flags (str): Custom additional arguments to be passed to mongod. +# Default to "--logpath ${mongod_dbpath}/mongod.log --logappend". +# mongod_config (str): Default to "%%PREFIX%%/etc/mongodb.conf" +# Path to config file +# + +. /etc/rc.subr + +name="mongod" +rcvar=mongod_enable + +load_rc_config $name + +: ${mongod_enable="NO"} +: ${mongod_dbpath="/var/db/mongodb"} +: ${mongod_flags="--logpath ${mongod_dbpath}/mongod.log --logappend --setParameter=disabledSecureAllocatorDomains=\*"} +: ${mongod_user="mongodb"} +: ${mongod_group="mongodb"} +: ${mongod_config="%%PREFIX%%/etc/mongodb.conf"} + +pidfile="${mongod_dbpath}/mongod.lock" +command=%%PREFIX%%/bin/${name} +command_args="--config $mongod_config --dbpath $mongod_dbpath --fork >/dev/null 2>/dev/null" +start_precmd="${name}_prestart" + +mongod_create_dbpath() +{ + mkdir ${mongod_dbpath} >/dev/null 2>/dev/null + [ $? -eq 0 ] && chown -R ${mongod_user}:${mongod_group} ${mongod_dbpath} +} + +mongod_prestart() +{ + if [ ! -d ${mongod_dbpath} ]; then + mongod_create_dbpath || return 1 + fi + return 0 +} + +run_rc_command "$1" diff --git a/databases/mongodb80/files/patch-SConstruct b/databases/mongodb80/files/patch-SConstruct new file mode 100644 index 000000000000..375b9238a97a --- /dev/null +++ b/databases/mongodb80/files/patch-SConstruct @@ -0,0 +1,36 @@ +--- SConstruct.orig 2024-07-22 19:17:33 UTC ++++ SConstruct +@@ -25,7 +25,6 @@ import SCons.Script + + import SCons + import SCons.Script +-from mongo_tooling_metrics.lib.top_level_metrics import SConsToolingMetrics + from site_scons.mongo import build_profiles + + # This must be first, even before EnsureSConsVersion, if +@@ -1722,16 +1721,6 @@ env.AddMethod(lambda env, name, **kwargs: add_option(n + del envDict + env.AddMethod(lambda env, name, **kwargs: add_option(name, **kwargs), 'AddOption') + +-# The placement of this is intentional. Here we setup an atexit method to store tooling metrics. +-# We should only register this function after env, env_vars and the parser have been properly initialized. +-SConsToolingMetrics.register_metrics( +- utc_starttime=datetime.utcnow(), +- artifact_dir=env.Dir('$BUILD_DIR').get_abspath(), +- env_vars=env_vars, +- env=env, +- parser=_parser, +-) +- + if get_option('build-metrics'): + env['BUILD_METRICS_ARTIFACTS_DIR'] = '$BUILD_ROOT/$VARIANT_DIR' + env.Tool('build_metrics') +@@ -1835,7 +1824,7 @@ if unknown_vars: + + unknown_vars = env_vars.UnknownVariables() + if unknown_vars: +- env.FatalError("Unknown variables specified: {0}", ", ".join(list(unknown_vars.keys()))) ++ print("Unknown variables specified: {0}", ", ".join(list(unknown_vars.keys()))) + + install_actions.setup(env, get_option('install-action')) + diff --git a/databases/mongodb80/files/patch-buildscripts_scons.py b/databases/mongodb80/files/patch-buildscripts_scons.py new file mode 100644 index 000000000000..5759ae7f71d9 --- /dev/null +++ b/databases/mongodb80/files/patch-buildscripts_scons.py @@ -0,0 +1,18 @@ +--- buildscripts/scons.py.orig 2024-07-23 11:11:41 UTC ++++ buildscripts/scons.py +@@ -18,15 +18,6 @@ sys.path = [SCONS_DIR, SITE_TOOLS_DIR] + sys.path + + sys.path = [SCONS_DIR, SITE_TOOLS_DIR] + sys.path + +-# pylint: disable=C0413 +-from mongo.pip_requirements import verify_requirements, MissingRequirements +- +-try: +- verify_requirements() +-except MissingRequirements as ex: +- print(ex) +- sys.exit(1) +- + try: + import SCons.Script + except ImportError as import_err: diff --git a/databases/mongodb80/files/patch-src_mongo_platform_waitable__atomic.cpp b/databases/mongodb80/files/patch-src_mongo_platform_waitable__atomic.cpp new file mode 100644 index 000000000000..92a361721080 --- /dev/null +++ b/databases/mongodb80/files/patch-src_mongo_platform_waitable__atomic.cpp @@ -0,0 +1,65 @@ +--- src/mongo/platform/waitable_atomic.cpp.orig 2024-07-23 11:53:14 UTC ++++ src/mongo/platform/waitable_atomic.cpp +@@ -34,6 +34,9 @@ + #ifdef __linux__ + #include <linux/futex.h> + #include <sys/syscall.h> ++#elif defined(__FreeBSD__) ++#include <sys/types.h> ++#include <sys/umtx.h> + #elif defined(_WIN32) + #include <synchapi.h> + #endif +@@ -228,6 +231,52 @@ bool waitUntil(const void* uaddr, + } + + if (__ulock_wait(UL_COMPARE_AND_WAIT, const_cast<void*>(uaddr), old, timeoutMicros) != -1) ++ return true; ++ ++ // There isn't a good list of possible errors, so assuming that anything other than a timeout ++ // error is a possible spurious wakeup. ++ return timeoutOverflow || errno != ETIMEDOUT; ++} ++ ++#elif defined(__FreeBSD__) ++ ++void notifyOne(const void* uaddr) { ++ _umtx_op(const_cast<void*>(uaddr), UMTX_OP_WAKE, 1, NULL, NULL); ++} ++ ++void notifyMany(const void* uaddr, int nToWake) { ++ _umtx_op(const_cast<void*>(uaddr), UMTX_OP_WAKE, nToWake, NULL, NULL); ++} ++ ++void notifyAll(const void* uaddr) { ++ _umtx_op(const_cast<void*>(uaddr), UMTX_OP_WAKE, INT_MAX, NULL, NULL); ++} ++ ++bool waitUntil(const void* uaddr, ++ uint32_t old, ++ boost::optional<system_clock::time_point> deadline) { ++ struct timespec timeout; ++ bool timeoutOverflow = false; ++ if (deadline) { ++ int64_t micros = durationCount<Microseconds>(*deadline - system_clock::now()); ++ if (micros <= 0) { ++ return false; // Synthesize a timeout. ++ } ++ ++ if (micros > int64_t(std::numeric_limits<uint32_t>::max())) { ++ // 2**32 micros is a little over an hour. If this happens, we wait as long as we can, ++ // then return as-if a spurious wakeup happened, rather than a timeout. This will cause ++ // the caller to loop and we will compute a smaller time each pass, eventually reaching ++ // a representable timeout. ++ micros = std::numeric_limits<uint32_t>::max(); ++ timeoutOverflow = true; ++ } ++ ++ timeout.tv_sec = micros / 1000; ++ timeout.tv_nsec = (micros % 1000) * 1000; ++ } ++ ++ if (_umtx_op(const_cast<void*>(uaddr), UMTX_OP_WAIT, old, (void*)sizeof(struct timespec), &timeout) != -1) + return true; + + // There isn't a good list of possible errors, so assuming that anything other than a timeout diff --git a/databases/mongodb80/files/patch-src_third__party_abseil-cpp_dist_absl_time_internal_cctz_src_time__zone__format.cc b/databases/mongodb80/files/patch-src_third__party_abseil-cpp_dist_absl_time_internal_cctz_src_time__zone__format.cc new file mode 100644 index 000000000000..d498ecfd3fbd --- /dev/null +++ b/databases/mongodb80/files/patch-src_third__party_abseil-cpp_dist_absl_time_internal_cctz_src_time__zone__format.cc @@ -0,0 +1,13 @@ +# https://github.com/abseil/abseil-cpp/commit/ded2ec077d911de647d47ab48ef3a8e24a1fb64a +# https://github.com/abseil/abseil-cpp/issues/1587 +--- src/third_party/abseil-cpp/dist/absl/time/internal/cctz/src/time_zone_format.cc.orig 2024-07-23 13:17:01 UTC ++++ src/third_party/abseil-cpp/dist/absl/time/internal/cctz/src/time_zone_format.cc +@@ -19,7 +19,7 @@ + #endif + + #if defined(HAS_STRPTIME) && HAS_STRPTIME +-#if !defined(_XOPEN_SOURCE) && !defined(__OpenBSD__) ++#if !defined(_XOPEN_SOURCE) && !defined(__FreeBSD__) && !defined(__OpenBSD__) + #define _XOPEN_SOURCE 500 // Exposes definitions for SUSv2 (UNIX 98). + #endif + #endif diff --git a/databases/mongodb80/files/patch-src_third__party_asio-master_asio_include_asio_detail_config.hpp b/databases/mongodb80/files/patch-src_third__party_asio-master_asio_include_asio_detail_config.hpp new file mode 100644 index 000000000000..09713cbc0028 --- /dev/null +++ b/databases/mongodb80/files/patch-src_third__party_asio-master_asio_include_asio_detail_config.hpp @@ -0,0 +1,10 @@ +--- src/third_party/asio-master/asio/include/asio/detail/config.hpp.orig 2023-04-29 10:17:24 UTC ++++ src/third_party/asio-master/asio/include/asio/detail/config.hpp +@@ -19,6 +19,7 @@ + // individual scons objects. + # define ASIO_STANDALONE // MongoDB + # define ASIO_SEPARATE_COMPILATION // MongoDB ++# define ASIO_HAS_STD_INVOKE_RESULT // FreeBSD + + #if defined(ASIO_STANDALONE) + # define ASIO_DISABLE_BOOST_ARRAY 1 diff --git a/databases/mongodb80/files/patch-src_third__party_boost_boost_mpl_aux___integral__wrapper.hpp b/databases/mongodb80/files/patch-src_third__party_boost_boost_mpl_aux___integral__wrapper.hpp new file mode 100644 index 000000000000..f6e1178b4a65 --- /dev/null +++ b/databases/mongodb80/files/patch-src_third__party_boost_boost_mpl_aux___integral__wrapper.hpp @@ -0,0 +1,11 @@ +--- src/third_party/boost/boost/mpl/aux_/integral_wrapper.hpp.orig 2023-06-15 22:07:57 UTC ++++ src/third_party/boost/boost/mpl/aux_/integral_wrapper.hpp +@@ -56,7 +56,7 @@ struct AUX_WRAPPER_NAME + // have to #ifdef here: some compilers don't like the 'N + 1' form (MSVC), + // while some other don't like 'value + 1' (Borland), and some don't like + // either +-#if BOOST_WORKAROUND(__EDG_VERSION__, <= 243) ++#if 1 //BOOST_WORKAROUND(__EDG_VERSION__, <= 243) + private: + BOOST_STATIC_CONSTANT(AUX_WRAPPER_VALUE_TYPE, next_value = BOOST_MPL_AUX_STATIC_CAST(AUX_WRAPPER_VALUE_TYPE, (N + 1))); + BOOST_STATIC_CONSTANT(AUX_WRAPPER_VALUE_TYPE, prior_value = BOOST_MPL_AUX_STATIC_CAST(AUX_WRAPPER_VALUE_TYPE, (N - 1))); diff --git a/databases/mongodb80/files/patch-src_third__party_libbson_dist_src_libbson_src_bson_bson-error.c b/databases/mongodb80/files/patch-src_third__party_libbson_dist_src_libbson_src_bson_bson-error.c new file mode 100644 index 000000000000..4ee39110eefd --- /dev/null +++ b/databases/mongodb80/files/patch-src_third__party_libbson_dist_src_libbson_src_bson_bson-error.c @@ -0,0 +1,11 @@ +--- src/third_party/libbson/dist/src/libbson/src/bson/bson-error.c.orig 2024-07-04 10:59:36 UTC ++++ src/third_party/libbson/dist/src/libbson/src/bson/bson-error.c +@@ -130,7 +130,7 @@ bson_strerror_r (int err_code, /* I + // required) by the POSIX spec (see: + // https://pubs.opengroup.org/onlinepubs/9699919799/functions/strerror.html#tag_16_574_08). + (void) strerror_r (err_code, buf, buflen); +-#elif defined(_XOPEN_SOURCE) && _XOPEN_SOURCE >= 700 ++#elif defined(__FreeBSD__) || ( defined(_XOPEN_SOURCE) && _XOPEN_SOURCE >= 700 ) + // The behavior (of `strerror_l`) is undefined if the locale argument to + // `strerror_l()` is the special locale object LC_GLOBAL_LOCALE or is not a + // valid locale object handle. diff --git a/databases/mongodb80/files/patch-src_third__party_mozjs_gen-config.sh b/databases/mongodb80/files/patch-src_third__party_mozjs_gen-config.sh new file mode 100644 index 000000000000..e05c48c9f8f7 --- /dev/null +++ b/databases/mongodb80/files/patch-src_third__party_mozjs_gen-config.sh @@ -0,0 +1,30 @@ +--- src/third_party/mozjs/gen-config.sh.orig 2024-07-22 19:17:33 UTC ++++ src/third_party/mozjs/gen-config.sh +@@ -29,6 +29,9 @@ case "$_Path" in + } + + case "$_Path" in ++ "platform/aarch64/freebsd") ++ _CONFIG_OPTS="--host=aarch64-freebsd" ++ ;; + "platform/aarch64/linux") + _CONFIG_OPTS="--host=aarch64-linux" + ;; +@@ -109,7 +112,7 @@ CFLAGS="$CFLAGS -D__STDC_FORMAT_MACROS" \ + --disable-js-shell \ + --disable-tests "$_CONFIG_OPTS" + +-make recurse_export ++gmake recurse_export + + cd ../../../.. + +@@ -164,7 +167,7 @@ find "$_Path/build" -name '*.cpp' | + find "$_Path/build" -name '*.cpp' | + while read unified_file ; do + echo "Processing $unified_file" +- sed $SEDOPTION \ ++ gsed $SEDOPTION \ + -e 's|#include ".*/js/src/|#include "|' \ + -e 's|#error ".*/js/src/|#error "|' \ + "$unified_file" diff --git a/databases/mongodb80/files/patch-src_third__party_mozjs_get-sources.sh b/databases/mongodb80/files/patch-src_third__party_mozjs_get-sources.sh new file mode 100644 index 000000000000..278f09c46e52 --- /dev/null +++ b/databases/mongodb80/files/patch-src_third__party_mozjs_get-sources.sh @@ -0,0 +1,14 @@ +--- src/third_party/mozjs/get-sources.sh.orig 2024-07-22 19:17:33 UTC ++++ src/third_party/mozjs/get-sources.sh +@@ -12,9 +12,9 @@ LIB_GIT_REPO=git@github.com:mongodb-forks/spidermonkey + LIB_GIT_REVISION=bb6edb4fcd43607c87de81df8c58db11a663634a + LIB_GIT_REPO=git@github.com:mongodb-forks/spidermonkey.git + +-DEST_DIR=$(git rev-parse --show-toplevel)/src/third_party/mozjs ++DEST_DIR=$(realpath .) + +-LIB_GIT_DIR=$(mktemp -d /tmp/import-spidermonkey.XXXXXX) ++LIB_GIT_DIR=$(mktemp -d /var/tmp/import-spidermonkey.XXXXXX) + trap "rm -rf $LIB_GIT_DIR" EXIT + + git clone $LIB_GIT_REPO $LIB_GIT_DIR |