diff options
Diffstat (limited to 'databases/mongodb80/files')
13 files changed, 323 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/extrapatch-src_third__party_mozjs_SConscript b/databases/mongodb80/files/extrapatch-src_third__party_mozjs_SConscript new file mode 100644 index 000000000000..4370f13323a4 --- /dev/null +++ b/databases/mongodb80/files/extrapatch-src_third__party_mozjs_SConscript @@ -0,0 +1,11 @@ +--- src/third_party/mozjs/SConscript.orig 2024-08-14 20:38:09 UTC ++++ src/third_party/mozjs/SConscript +@@ -144,7 +145,7 @@ sources = [ + "extract/js/src/wasm/WasmCode-platform.cpp", + ] + +-if env['TARGET_ARCH'] == 'x86_64' and not env.TargetOSIs('windows'): ++if False and env['TARGET_ARCH'] == 'x86_64' and not env.TargetOSIs('windows'): + env.Append(CCFLAGS=['-mavx2']) + sources.extend(["extract/mozglue/misc/SIMD_avx2.cpp", "extract/mozglue/misc/SSE.cpp"]) + diff --git a/databases/mongodb80/files/extrapatch-src_third__party_mozjs_extract_mozglue_misc_SIMD.cpp b/databases/mongodb80/files/extrapatch-src_third__party_mozjs_extract_mozglue_misc_SIMD.cpp new file mode 100644 index 000000000000..f68cc2552390 --- /dev/null +++ b/databases/mongodb80/files/extrapatch-src_third__party_mozjs_extract_mozglue_misc_SIMD.cpp @@ -0,0 +1,11 @@ +--- src/third_party/mozjs/extract/mozglue/misc/SIMD.cpp.orig 2024-11-07 09:56:02 UTC ++++ src/third_party/mozjs/extract/mozglue/misc/SIMD.cpp +@@ -448,7 +448,7 @@ const char* SIMD::memchr8SSE2(const char* ptr, char va + // assertion failure. Accordingly, we just don't allow that to happen. We + // are not particularly concerned about ensuring that newer 32 bit processors + // get access to the AVX2 functions exposed here. +-# if defined(MOZILLA_MAY_SUPPORT_AVX2) && defined(__x86_64__) ++# if 0 && defined(MOZILLA_MAY_SUPPORT_AVX2) && defined(__x86_64__) + + bool SupportsAVX2() { return supports_avx2(); } + 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..e2c815567836 --- /dev/null +++ b/databases/mongodb80/files/patch-src_mongo_platform_waitable__atomic.cpp @@ -0,0 +1,58 @@ +--- src/mongo/platform/waitable_atomic.cpp.orig 2024-11-20 23:53:48 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 +@@ -233,6 +236,45 @@ bool waitUntil(const void* uaddr, + // 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_PRIVATE, 1, NULL, NULL); ++} ++ ++void notifyMany(const void* uaddr, int nToWake) { ++ _umtx_op(const_cast<void*>(uaddr), UMTX_OP_WAKE_PRIVATE, nToWake, NULL, NULL); ++} ++ ++void notifyAll(const void* uaddr) { ++ _umtx_op(const_cast<void*>(uaddr), UMTX_OP_WAKE_PRIVATE, INT_MAX, NULL, NULL); ++} ++ ++bool waitUntil(const void* uaddr, ++ uint32_t old, ++ boost::optional<system_clock::time_point> deadline) { ++ struct _umtx_time umtx_deadline; ++ void* uaddr2 = nullptr; ++ ++ if (deadline) { ++ umtx_deadline._timeout.tv_sec = durationCount<Seconds>(deadline->time_since_epoch()); ++ umtx_deadline._timeout.tv_nsec = durationCount<Nanoseconds>( ++ deadline->time_since_epoch() - stdx::chrono::seconds(umtx_deadline._timeout.tv_sec)); ++ umtx_deadline._flags = UMTX_ABSTIME; ++ umtx_deadline._clockid = CLOCK_REALTIME_FAST; ++ uaddr2 = &umtx_deadline; ++ } ++ ++ int umtxOpRet; ++ if ((umtxOpRet = _umtx_op(const_cast<void*>(uaddr), UMTX_OP_WAIT_UINT_PRIVATE, old, (void*)sizeof(struct _umtx_time), uaddr2)) != 0) { ++ if (errno == ETIMEDOUT) { ++ return false; ++ } ++ invariant(umtxOpRet == 0, errorMessage(lastSystemError())); ++ } ++ return true; + } + + #else 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_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_boost_boost_thread_future.hpp b/databases/mongodb80/files/patch-src_third__party_boost_boost_thread_future.hpp new file mode 100644 index 000000000000..cf4ad80ef93d --- /dev/null +++ b/databases/mongodb80/files/patch-src_third__party_boost_boost_thread_future.hpp @@ -0,0 +1,18 @@ +https://github.com/boostorg/thread/issues/402 + +In file included from src/third_party/boost/libs/thread/src/pthread/thread.cpp:19: +src/third_party/boost/boost/thread/future.hpp:4672:19: error: no member named 'that' in 'run_it<FutureExecutorContinuationSharedState>'; did you mean 'that_'? + 4672 | that_=x.that; + | ^~~~ + +--- src/third_party/boost/boost/thread/future.hpp.orig 2024-12-12 08:36:29 UTC ++++ src/third_party/boost/boost/thread/future.hpp +@@ -4669,7 +4669,7 @@ namespace detail + } + run_it& operator=(BOOST_THREAD_RV_REF(run_it) x) BOOST_NOEXCEPT { + if (this != &x) { +- that_=x.that; ++ that_=x.that_; + x.that_.reset(); + } + return *this; 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..2e515c03f964 --- /dev/null +++ b/databases/mongodb80/files/patch-src_third__party_mozjs_gen-config.sh @@ -0,0 +1,36 @@ +--- src/third_party/mozjs/gen-config.sh.orig 2025-05-13 17:12:47 UTC ++++ src/third_party/mozjs/gen-config.sh +@@ -1,4 +1,4 @@ +-#!/bin/bash ++#!/bin/sh + + set -e + set -v +@@ -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" + ;; +@@ -111,7 +114,7 @@ CFLAGS="$CFLAGS -D__STDC_FORMAT_MACROS" \ + --disable-wasm-moz-intgemm \ + "$_CONFIG_OPTS" + +-make recurse_export ++gmake recurse_export + + cd ../../../.. + +@@ -166,7 +169,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" |