You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

328 lines
12 KiB

Index: SConstruct
--- SConstruct.orig 2018-05-11 23:52:10.000000000 +0200
+++ SConstruct 2018-05-22 20:16:13.101090000 +0200
@@ -544,7 +544,6 @@
def variable_tools_converter(val):
tool_list = shlex.split(val)
return tool_list + [
- "distsrc",
"gziptool",
'idl_tool',
"jsheader",
@@ -930,9 +929,9 @@
print(env_vars.GenerateHelpText(env))
Exit(0)
-unknown_vars = env_vars.UnknownVariables()
-if unknown_vars:
- env.FatalError("Unknown variables specified: {0}", ", ".join(unknown_vars.keys()))
+# unknown_vars = env_vars.UnknownVariables()
+# if unknown_vars:
+# env.FatalError("Unknown variables specified: {0}", ", ".join(unknown_vars.keys()))
def set_config_header_define(env, varname, varval = 1):
env['CONFIG_HEADER_DEFINES'][varname] = varval
@@ -1620,21 +1619,19 @@
# If runtime hardening is requested, then build anything
# destined for an executable with the necessary flags for PIE.
env.AppendUnique(
- PROGCCFLAGS=['-fPIE'],
+ PROGCCFLAGS=['-fpic'],
PROGLINKFLAGS=['-pie'],
)
# -Winvalid-pch Warn if a precompiled header (see Precompiled Headers) is found in the search path but can't be used.
env.Append( CCFLAGS=["-fno-omit-frame-pointer",
"-fno-strict-aliasing",
- "-ggdb",
"-pthread",
- "-Wall",
"-Wsign-compare",
"-Wno-unknown-pragmas",
"-Winvalid-pch"] )
# env.Append( " -Wconversion" ) TODO: this doesn't really work yet
- if env.TargetOSIs('linux', 'darwin', 'solaris'):
+ if env.TargetOSIs('linux', 'darwin', 'solaris', 'freebsd'):
if not has_option("disable-warnings-as-errors"):
env.Append( CCFLAGS=["-Werror"] )
@@ -1670,19 +1667,10 @@
env.Append( LINKFLAGS=["-fprofile-arcs", "-ftest-coverage"] )
if optBuild:
- env.Append( CCFLAGS=["-O2"] )
+ env.Append( CCFLAGS=["-O1"] )
else:
env.Append( CCFLAGS=["-O0"] )
- # Promote linker warnings into errors. We can't yet do this on OS X because its linker considers
- # noall_load obsolete and warns about it.
- if not has_option("disable-warnings-as-errors"):
- env.Append(
- LINKFLAGS=[
- '-Wl,-fatal_warnings' if env.TargetOSIs('darwin') else "-Wl,--fatal-warnings",
- ]
- )
-
mmapv1 = False
if get_option('mmapv1') == 'auto':
# The mmapv1 storage engine is only supported on x86
@@ -2567,7 +2555,7 @@
}}
"""
context.Message('Checking for storage class thread_local ')
- ret = context.TryLink(textwrap.dedent(test_body), ".cpp")
+ ret = context.TryCompile(textwrap.dedent(test_body), ".cpp")
context.Result(ret)
return ret
@@ -3174,8 +3162,6 @@
)
)
-env.AddDistSrcCallback(add_version_to_distsrc)
-
env['SERVER_DIST_BASENAME'] = env.subst('mongodb-%s-$MONGO_DISTNAME' % (getSystemInstallName()))
module_sconscripts = moduleconfig.get_module_sconscripts(mongo_modules)
@@ -3217,17 +3203,9 @@
vcxprojFile = env.Command(
"mongodb.vcxproj",
compileCommands,
- r"$PYTHON buildscripts\make_vcxproj.py mongodb")
+ r"$PYTHON buildscripts/make_vcxproj.py mongodb")
vcxproj = env.Alias("vcxproj", vcxprojFile)
-env.Alias("distsrc-tar", env.DistSrc("mongodb-src-${MONGO_VERSION}.tar"))
-env.Alias("distsrc-tgz", env.GZip(
- target="mongodb-src-${MONGO_VERSION}.tgz",
- source=["mongodb-src-${MONGO_VERSION}.tar"])
-)
-env.Alias("distsrc-zip", env.DistSrc("mongodb-src-${MONGO_VERSION}.zip"))
-env.Alias("distsrc", "distsrc-tgz")
-
env.SConscript(
dirs=[
'src',
@@ -3239,7 +3217,7 @@
variant_dir='$BUILD_DIR',
)
-all = env.Alias('all', ['core', 'tools', 'dbtest', 'unittests', 'integration_tests', 'benchmarks'])
+all = env.Alias('all', ['core', 'tools'])
# run the Dagger tool if it's installed
if should_dagger:
Index: site_scons/site_tools/mongo_integrationtest.py
--- site_scons/site_tools/mongo_integrationtest.py.orig 2018-05-11 23:52:10.000000000 +0200
+++ site_scons/site_tools/mongo_integrationtest.py 2018-05-22 20:11:45.897048000 +0200
@@ -7,9 +7,7 @@
_integration_tests = []
def register_integration_test(env, test):
- installed_test = env.Install("#/build/integration_tests/", test)
- _integration_tests.append(installed_test[0].path)
- env.Alias('$INTEGRATION_TEST_ALIAS', installed_test)
+ return True
def integration_test_list_builder_action(env, target, source):
ofile = open(str(target[0]), 'wb')
@@ -21,14 +19,7 @@
ofile.close()
def build_cpp_integration_test(env, target, source, **kwargs):
- libdeps = kwargs.get('LIBDEPS', [])
- libdeps.append( '$BUILD_DIR/mongo/unittest/integration_test_main' )
-
- kwargs['LIBDEPS'] = libdeps
-
- result = env.Program(target, source, **kwargs)
- env.RegisterIntegrationTest(result[0])
- return result
+ return True
def generate(env):
env.Command('$INTEGRATION_TEST_LIST', env.Value(_integration_tests),
Index: site_scons/site_tools/mongo_unittest.py
--- site_scons/site_tools/mongo_unittest.py.orig 2018-05-11 23:52:10.000000000 +0200
+++ site_scons/site_tools/mongo_unittest.py 2018-05-22 20:11:45.897225000 +0200
@@ -7,8 +7,7 @@
_unittests = []
def register_unit_test(env, test):
- _unittests.append(test.path)
- env.Alias('$UNITTEST_ALIAS', test)
+ return True
def unit_test_list_builder_action(env, target, source):
ofile = open(str(target[0]), 'wb')
@@ -20,15 +19,7 @@
ofile.close()
def build_cpp_unit_test(env, target, source, **kwargs):
- libdeps = kwargs.get('LIBDEPS', [])
- libdeps.append( '$BUILD_DIR/mongo/unittest/unittest_main' )
-
- kwargs['LIBDEPS'] = libdeps
-
- result = env.Program(target, source, **kwargs)
- env.RegisterUnitTest(result[0])
- env.Install("#/build/unittests/", result[0])
- return result
+ return True
def generate(env):
env.Command('$UNITTEST_LIST', env.Value(_unittests),
Index: src/mongo/SConscript
--- src/mongo/SConscript.orig 2018-05-11 23:52:10.000000000 +0200
+++ src/mongo/SConscript 2018-05-22 20:11:45.897515000 +0200
@@ -28,7 +28,6 @@
'dbtests',
'executor',
'idl',
- 'installer',
'logger',
'platform',
'rpc',
Index: src/mongo/crypto/SConscript
--- src/mongo/crypto/SConscript.orig 2018-05-11 23:52:10.000000000 +0200
+++ src/mongo/crypto/SConscript 2018-05-22 20:11:45.897714000 +0200
@@ -2,6 +2,10 @@
Import("env")
+def has_option(name):
+ optval = GetOption(name)
+ return True if optval == () else bool(optval)
+
env = env.Clone()
env.Library('sha1_block',
@@ -46,15 +50,16 @@
]
)
-env.Library('sha_block_openssl',
- source=[
- 'sha_block_openssl.cpp'
- ],
- LIBDEPS=[
- '$BUILD_DIR/mongo/base',
- 'sha1_block',
- 'sha256_block',
- ])
+if has_option("ssl"):
+ env.Library('sha_block_openssl',
+ source=[
+ 'sha_block_openssl.cpp'
+ ],
+ LIBDEPS=[
+ '$BUILD_DIR/mongo/base',
+ 'sha1_block',
+ 'sha256_block',
+ ])
env.Library('scramauth',
['mechanism_scram.cpp'],
Index: src/mongo/db/pipeline/document_source_bucket_auto.cpp
--- src/mongo/db/pipeline/document_source_bucket_auto.cpp.orig 2018-05-11 23:52:10.000000000 +0200
+++ src/mongo/db/pipeline/document_source_bucket_auto.cpp 2018-05-22 20:11:45.898039000 +0200
@@ -167,7 +167,7 @@
// Calculate the approximate bucket size. We attempt to fill each bucket with this many
// documents.
- long long approxBucketSize = std::round(double(_nDocuments) / double(_nBuckets));
+ long long approxBucketSize = round(double(_nDocuments) / double(_nBuckets));
if (approxBucketSize < 1) {
// If the number of buckets is larger than the number of documents, then we try to make as
Index: src/mongo/db/pipeline/expression.cpp
--- src/mongo/db/pipeline/expression.cpp.orig 2018-05-11 23:52:10.000000000 +0200
+++ src/mongo/db/pipeline/expression.cpp 2018-05-22 20:11:45.899049000 +0200
@@ -35,6 +35,7 @@
#include <boost/algorithm/string.hpp>
#include <cstdio>
#include <vector>
+#include <cmath>
#include "mongo/db/jsobj.h"
#include "mongo/db/pipeline/document.h"
@@ -4232,7 +4233,7 @@
return Value(numericArg.getDecimal().quantize(Decimal128::kNormalizedZero,
Decimal128::kRoundTowardZero));
case NumberDouble:
- return Value(std::trunc(numericArg.getDouble()));
+ return Value(trunc(numericArg.getDouble()));
default:
return numericArg;
}
Index: src/mongo/db/pipeline/granularity_rounder_powers_of_two.cpp
--- src/mongo/db/pipeline/granularity_rounder_powers_of_two.cpp.orig 2018-05-11 23:52:10.000000000 +0200
+++ src/mongo/db/pipeline/granularity_rounder_powers_of_two.cpp 2018-05-22 20:11:45.899274000 +0200
@@ -67,7 +67,7 @@
Value exp;
if (value.getType() == BSONType::NumberDouble) {
- exp = Value(static_cast<int>(std::floor(std::log2(value.getDouble())) + 1.0));
+ exp = Value(static_cast<int>(std::floor(log2(value.getDouble())) + 1.0));
} else if (value.getType() == BSONType::NumberDecimal) {
Decimal128 input = value.getDecimal();
exp = Value(Decimal128(
@@ -92,7 +92,7 @@
Value exp;
if (value.getType() == BSONType::NumberDouble) {
- exp = Value(static_cast<int>(std::ceil(std::log2(value.getDouble())) - 1.0));
+ exp = Value(static_cast<int>(std::ceil(log2(value.getDouble())) - 1.0));
} else if (value.getType() == BSONType::NumberDecimal) {
Decimal128 input = value.getDecimal();
exp = Value(Decimal128(
Index: src/mongo/util/represent_as.h
--- src/mongo/util/represent_as.h.orig 2018-05-11 23:52:10.000000000 +0200
+++ src/mongo/util/represent_as.h 2018-05-22 20:11:45.899577000 +0200
@@ -202,7 +202,7 @@
// If Output is integral and number is a non-integral floating point value,
// return a disengaged optional.
if (std::is_floating_point<Input>::value && std::is_integral<Output>::value) {
- if (!(std::trunc(number) == number)) {
+ if (!(trunc(number) == number)) {
return {};
}
}
Index: src/mongo/util/summation.h
--- src/mongo/util/summation.h.orig 2018-05-11 23:52:10.000000000 +0200
+++ src/mongo/util/summation.h 2018-05-22 20:11:45.899762000 +0200
@@ -104,7 +104,7 @@
* Returns whether the accumulated sum has a fractional part.
*/
bool isInteger() const {
- return std::trunc(_sum) == _sum && std::trunc(_addend) == _addend;
+ return trunc(_sum) == _sum && trunc(_addend) == _addend;
}
/**
Index: src/mongo/util/time_support.cpp
--- src/mongo/util/time_support.cpp.orig 2018-05-11 23:52:10.000000000 +0200
+++ src/mongo/util/time_support.cpp 2018-05-22 20:11:45.900064000 +0200
@@ -933,7 +933,7 @@
// Find minimum timer resolution of OS
Nanoseconds getMinimumTimerResolution() {
Nanoseconds minTimerResolution;
-#if defined(__linux__)
+#if defined(__linux__) || defined(__FreeBSD__)
struct timespec tp;
clock_getres(CLOCK_REALTIME, &tp);
minTimerResolution = Nanoseconds{tp.tv_nsec};
Index: src/third_party/SConscript
--- src/third_party/SConscript.orig 2018-05-11 23:52:10.000000000 +0200
+++ src/third_party/SConscript 2018-05-22 20:11:45.900302000 +0200
@@ -127,8 +127,8 @@
if use_system_version_of_library("pcre"):
pcreEnv = env.Clone(
SYSLIBDEPS=[
- env['LIBDEPS_PCRE_SYSLIBDEP'],
env['LIBDEPS_PCRECPP_SYSLIBDEP'],
+ env['LIBDEPS_PCRE_SYSLIBDEP'],
])
else:
pcreEnv = env.Clone()