Skip to content

Commit 235c344

Browse files
committed
PSMDB-1860 Remove unnecessary build options
The patch removes the following build options: - `--audit`, - `--enable-fcbis`, - `--enable-fipsmode`, - `--enable-oidc`, - `--full-featured`, - `--hotbackup`, - `--inmemory`. Their respective features are included in the build unconditionally. Also, the patch moves the list of the Percona-specific features from Python to C++ source code.
1 parent c3989bb commit 235c344

35 files changed

+161
-438
lines changed

CONTRIBUTING.rst

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -243,19 +243,9 @@ Build Percona Server for MongoDB
243243
244244
2. Build Percona Server for MongoDB from ``buildscripts/scons.py``
245245

246-
* Basic build
247-
248-
.. code:: bash
249-
250-
$ buildscripts/scons.py --disable-warnings-as-errors --release --ssl --opt=on -j$(nproc --all) --use-sasl-client --wiredtiger --audit --inmemory --hotbackup CPPPATH="${AWS_LIBS}/include" LIBPATH="${AWS_LIBS}/lib ${AWS_LIBS}/lib64" install-mongod install-mongos
251-
252-
253-
* Pro build
254-
255-
.. code:: bash
246+
.. code:: bash
256247
257-
$ buildscripts/scons.py --disable-warnings-as-errors --release --ssl --opt=on -j$(nproc --all) --use-sasl-client --wiredtiger --audit --inmemory --hotbackup --full-featured CPPPATH="${AWS_LIBS}/include" LIBPATH="${AWS_LIBS}/lib ${AWS_LIBS}/lib64" install-mongod install-mongos
258-
248+
$ buildscripts/scons.py --disable-warnings-as-errors --release --ssl --opt=on -j$(nproc --all) --use-sasl-client --wiredtiger CPPPATH="${AWS_LIBS}/include" LIBPATH="${AWS_LIBS}/lib ${AWS_LIBS}/lib64" install-mongod install-mongos
259249
260250
This command builds core components of the database. Other available
261251
targets for the ``scons`` command are:

SConstruct

Lines changed: 2 additions & 95 deletions
Original file line numberDiff line numberDiff line change
@@ -87,21 +87,11 @@ def get_option(name):
8787

8888

8989
def has_option(name):
90-
# For now, we just enable all the optional Percona-specific features.
91-
# Since none of the features are going to be disabled, we can later
92-
# remove the respective build flags completely
93-
if name == 'full-featured':
94-
return True
95-
9690
optval = GetOption(name)
9791
# Options with nargs=0 are true when their value is the empty tuple. Otherwise,
9892
# if the value is falsish (empty string, None, etc.), coerce to False.
9993
return True if optval == () else bool(optval)
10094

101-
# Returns true if a given option is set or if the 'full-featured' option is set.
102-
def has_feature_option(name):
103-
return has_option(name) or has_option('full-featured')
104-
10595
def use_system_version_of_library(name):
10696
return has_option('use-system-all') or has_option('use-system-' + name)
10797

@@ -276,52 +266,6 @@ add_option(
276266
type='choice',
277267
)
278268

279-
add_option(
280-
'inmemory',
281-
choices=['on', 'off'],
282-
const='on',
283-
default='off',
284-
help='Enable InMemory',
285-
nargs='?',
286-
type='choice',
287-
)
288-
289-
add_option(
290-
'audit',
291-
help='Enable auditing',
292-
nargs=0,
293-
)
294-
295-
add_option(
296-
'hotbackup',
297-
help='Enable Hot Backup',
298-
nargs=0,
299-
)
300-
301-
add_option(
302-
'enable-fipsmode',
303-
help='Enable tls.FIPSMode configuration option',
304-
nargs=0,
305-
)
306-
307-
add_option(
308-
'enable-fcbis',
309-
help='Enable file copy-based initial sync',
310-
nargs=0,
311-
)
312-
313-
add_option(
314-
'enable-oidc',
315-
help='Enable OpenID Connect authentication support',
316-
nargs=0,
317-
)
318-
319-
add_option(
320-
'full-featured',
321-
help='Enable all optional features',
322-
nargs=0,
323-
)
324-
325269
add_option(
326270
'ocsp-stapling',
327271
choices=['on', 'off'],
@@ -2714,38 +2658,6 @@ def link_guard_libdeps_tag_expand(source, target, env, for_signature):
27142658
env['LIBDEPS_TAG_EXPANSIONS'].append(link_guard_libdeps_tag_expand)
27152659

27162660

2717-
# Since none of the features are going to be disabled, we can later
2718-
# remove the build flags completely and move the feature list to a more
2719-
# appropriate place.
2720-
assert has_option('audit'), "audit must be enabled"
2721-
assert has_feature_option('enable-fipsmode'), "FIPS must be enabled"
2722-
assert has_feature_option('enable-fcbis'), "FCBIS must be enabled"
2723-
assert has_feature_option('enable-oidc'), "OIDC must be enabled"
2724-
2725-
env['PERCONA_FEATURES'] = [
2726-
'MemoryEngine',
2727-
'HotBackup',
2728-
'BackupCursorAggregationStage',
2729-
'BackupCursorExtendAggregationStage',
2730-
'AWSIAM',
2731-
'Kerberos',
2732-
'LDAP',
2733-
'OIDC',
2734-
'TDE',
2735-
'FIPSMode',
2736-
'FCBIS',
2737-
'Auditing',
2738-
'ProfilingRateLimit',
2739-
'LogRedaction',
2740-
'ngram'
2741-
]
2742-
2743-
env.Append( CPPDEFINES=[ 'PERCONA_AUDIT_ENABLED' ] )
2744-
2745-
env.SetConfigHeaderDefine("PERCONA_FIPSMODE_ENABLED")
2746-
env.SetConfigHeaderDefine("PERCONA_FCBIS_ENABLED")
2747-
env.SetConfigHeaderDefine("PERCONA_OIDC_ENABLED")
2748-
27492661
env.Tool('forceincludes')
27502662

27512663
# ---- other build setup -----
@@ -3269,11 +3181,8 @@ if get_option('wiredtiger') == 'on':
32693181
wiredtiger = True
32703182
env.SetConfigHeaderDefine("MONGO_CONFIG_WIREDTIGER_ENABLED")
32713183

3272-
inmemory = False
3273-
if get_option('inmemory') == 'on':
3274-
inmemory = True
3275-
if not wiredtiger:
3276-
env.FatalError("InMemory engine requires WiredTiger to build")
3184+
if not wiredtiger:
3185+
env.FatalError("InMemory engine requires WiredTiger to build")
32773186

32783187
if get_option('ocsp-stapling') == 'on':
32793188
# OCSP Stapling needs to be disabled on ubuntu 18.04 machines because when TLS 1.3 is
@@ -6386,9 +6295,7 @@ Export([
63866295
'endian',
63876296
'get_option',
63886297
'has_option',
6389-
'has_feature_option',
63906298
'http_client',
6391-
'inmemory',
63926299
'jsEngine',
63936300
'module_sconscripts',
63946301
'optBuild',

docs/audit/README.md

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,11 @@
11

22
# Auditing
33

4-
This document describes how to build, enable, configure and test auditing in Percona Server for MongoDB.
4+
This document describes how to enable, configure and test auditing in Percona Server for MongoDB.
55

66
Auditing allows administrators to track and log user activity on a server. With auditing enabled, the server
77
will generate an audit log file. This file contains information about different user events including authentication, authorization failures, and more.
88

9-
## Building
10-
11-
By default, when building Percona Server for MongoDB from source, audit functionality is
12-
neither compiled with, nor linked into, the final binary executable. To enable auditing, execute
13-
SCons with the `--audit` argument:
14-
15-
scons <other options> --audit <targets>
16-
179
## Activation and Configuration
1810

1911
The following server parameters control auditing. They are entered at the command line when starting a server instance.

docs/inmemory/README.md

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,11 @@
11

22
# InMemory engine
33

4-
This document describes how to build, enable, configure and test InMemory engine in Percona Server for MongoDB.
4+
This document describes how to enable, configure and test InMemory engine in Percona Server for MongoDB.
55

66
InMemory engine is a special configuration of WiredTiger that doesn’t store user data on disk.
77
With this engine, data fully resides in the virtual memory of the system.
88

9-
## Building
10-
11-
To enable building InMemory engine, execute SCons with the `--inmemory` argument.
12-
WiredTiger engine is also required for building (use the `--wiredtiger` argument).
13-
14-
```
15-
scons <other options> --inmemory --wiredtiger <targets>
16-
```
17-
189
## Activation and Configuration
1910

2011
To use InMemory engine, run mongod with `--storageEngine=inMemory` option.

percona-packaging/debian/rules

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -25,17 +25,15 @@ override_dh_auto_clean:
2525
dh_auto_clean
2626
rm -fr $(PSMSRC)/bin
2727
#rm -fr $(INSTALLDIR)
28-
buildscripts/scons.py CC=$(CC) CXX=$(CXX) -C $(PSMSRC) -c --disable-warnings-as-errors --audit --release --ssl --opt -j$(NJOBS) --use-sasl-client CPPPATH=$(INSTALLDIR)/include \
29-
--full-featured \
30-
LIBPATH=$(INSTALLDIR)/lib LINKFLAGS=$(OPT_LINKFLAGS) --wiredtiger --inmemory --hotbackup $(PSM_TARGETS) || exit $?
28+
buildscripts/scons.py CC=$(CC) CXX=$(CXX) -C $(PSMSRC) -c --disable-warnings-as-errors --release --ssl --opt -j$(NJOBS) --use-sasl-client CPPPATH=$(INSTALLDIR)/include \
29+
LIBPATH=$(INSTALLDIR)/lib LINKFLAGS=$(OPT_LINKFLAGS) --wiredtiger $(PSM_TARGETS) || exit $?
3130
rm -fr build resmoke.ini
3231
find $(PSMSRC) -name '*.pyc' -delete
3332

3433
# Finally PSMDB
3534
percona-server-mongodb:
36-
buildscripts/scons.py CC=${CC} CXX=${CXX} --disable-warnings-as-errors --audit --release --ssl --opt=on -j$(NJOBS) \
37-
--full-featured \
38-
--use-sasl-client --wiredtiger --inmemory --hotbackup \
35+
buildscripts/scons.py CC=${CC} CXX=${CXX} --disable-warnings-as-errors --release --ssl --opt=on -j$(NJOBS) \
36+
--use-sasl-client --wiredtiger \
3937
CPPPATH=${INSTALLDIR}/include LIBPATH=${INSTALLDIR}/lib LINKFLAGS=${OPT_LINKFLAGS} ${PSM_TARGETS} || exit $?
4038

4139
compile-mongo-tools:

percona-packaging/redhat/percona-server-mongodb.spec.template

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -178,10 +178,9 @@ mv ${INSTALLDIR_AWS}/lib*/* ${INSTALLDIR}/lib/
178178

179179
# Build PSfMDB with SCons
180180
pushd $RPM_BUILD_DIR/%{src_dir}
181-
buildscripts/scons.py CC=${CC} CXX=${CXX} --disable-warnings-as-errors --audit --release --ssl --opt=on \
181+
buildscripts/scons.py CC=${CC} CXX=${CXX} --disable-warnings-as-errors --release --ssl --opt=on \
182182
%{?_smp_mflags} --use-sasl-client CPPPATH=${INSTALLDIR}/include LIBPATH="${INSTALLDIR}/lib ${AWS_LIBS}/lib ${AWS_LIBS}/lib64" \
183-
--full-featured \
184-
--wiredtiger --inmemory --hotbackup LINKFLAGS="${OPT_LINKFLAGS}" ${PSM_TARGETS} || exit $?
183+
--wiredtiger LINKFLAGS="${OPT_LINKFLAGS}" ${PSM_TARGETS} || exit $?
185184
rm -fr resmoke.ini
186185
popd
187186

percona-packaging/scripts/psmdb_builder.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1021,10 +1021,10 @@ build_tarball(){
10211021
export OPT_LINKFLAGS="${OPT_LINKFLAGS} ${CURL_LINKFLAGS}"
10221022
fi
10231023
if [ ${DEBUG} = 0 ]; then
1024-
buildscripts/scons.py CC=${CC} CXX=${CXX} --disable-warnings-as-errors --release --ssl --opt=on -j${NCPU} --use-sasl-client --full-featured --wiredtiger --audit --inmemory --hotbackup CPPPATH="${INSTALLDIR}/include ${AWS_LIBS}/include" LIBPATH="${INSTALLDIR}/lib ${AWS_LIBS}/lib ${AWS_LIBS}/lib64" LINKFLAGS="${OPT_LINKFLAGS}" ${PSM_REAL_TARGETS[@]} || exit $?
1024+
buildscripts/scons.py CC=${CC} CXX=${CXX} --disable-warnings-as-errors --release --ssl --opt=on -j${NCPU} --use-sasl-client --wiredtiger CPPPATH="${INSTALLDIR}/include ${AWS_LIBS}/include" LIBPATH="${INSTALLDIR}/lib ${AWS_LIBS}/lib ${AWS_LIBS}/lib64" LINKFLAGS="${OPT_LINKFLAGS}" ${PSM_REAL_TARGETS[@]} || exit $?
10251025
else
1026-
buildscripts/scons.py CC=${CC} CXX=${CXX} --disable-warnings-as-errors --audit --ssl --dbg=on -j${NCPU} --use-sasl-client \
1027-
CPPPATH="${INSTALLDIR}/include ${AWS_LIBS}/include" LIBPATH="${INSTALLDIR}/lib ${AWS_LIBS}/lib ${AWS_LIBS}/lib64" LINKFLAGS="${OPT_LINKFLAGS}" --full-featured --wiredtiger --inmemory --hotbackup ${PSM_REAL_TARGETS[@]} || exit $?
1026+
buildscripts/scons.py CC=${CC} CXX=${CXX} --disable-warnings-as-errors --ssl --dbg=on -j${NCPU} --use-sasl-client \
1027+
CPPPATH="${INSTALLDIR}/include ${AWS_LIBS}/include" LIBPATH="${INSTALLDIR}/lib ${AWS_LIBS}/lib ${AWS_LIBS}/lib64" LINKFLAGS="${OPT_LINKFLAGS}" --wiredtiger ${PSM_REAL_TARGETS[@]} || exit $?
10281028
fi
10291029
#
10301030
# scons install doesn't work - it installs the binaries not linked with fractal tree

src/mongo/SConscript

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -77,9 +77,6 @@ config_header_substs = (
7777
('@mongo_config_wiredtiger_enabled@', 'MONGO_CONFIG_WIREDTIGER_ENABLED'),
7878
('@mongo_config_grpc@', 'MONGO_CONFIG_GRPC'),
7979
('@mongo_config_have_basic_stringbuf_str_rvalue@', 'MONGO_CONFIG_HAVE_BASIC_STRINGBUF_STR_RVALUE'),
80-
('@percona_fipsmode_enabled@', 'PERCONA_FIPSMODE_ENABLED'),
81-
('@percona_fcbis_enabled@', 'PERCONA_FCBIS_ENABLED'),
82-
('@percona_oidc_enabled@', 'PERCONA_OIDC_ENABLED'),
8380
)
8481

8582

src/mongo/config.h.in

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -107,17 +107,5 @@
107107
// Defined if grpc support is enabled
108108
@mongo_config_grpc@
109109

110-
111-
// Percona specific section
112-
113-
// FIPSMode enabled
114-
@percona_fipsmode_enabled@
115-
116-
// FCBIS enabled
117-
@percona_fcbis_enabled@
118-
119-
// OIDC enabled
120-
@percona_oidc_enabled@
121-
122110
// Defined if basic_stringbuf::str()&& overload exists
123111
@mongo_config_have_basic_stringbuf_str_rvalue@

0 commit comments

Comments
 (0)