Browse Source

mongodb package update

Signed-off-by: nosqlbuilder_pel7ppc64lebuilder0 <nosqlbuilder@powerel.org>
master
nosqlbuilder_pel7ppc64lebuilder0 5 years ago
parent
commit
5c4e630c9a
  1. 40
      SOURCES/32bit-support.patch
  2. 37
      SOURCES/ppc64.patch
  3. 580
      SOURCES/python3-buildscripts-tests.patch
  4. 132
      SPECS/mongodb.spec

40
SOURCES/32bit-support.patch

@ -1,8 +1,8 @@ @@ -1,8 +1,8 @@
diff --git a/src/mongo/bson/bsonobjbuilder.h b/src/mongo/bson/bsonobjbuilder.h
index 6162495c1c..8c0bece154 100644
index 38dae82..ee9b957 100644
--- a/src/mongo/bson/bsonobjbuilder.h
+++ b/src/mongo/bson/bsonobjbuilder.h
@@ -350,7 +350,7 @@ public:
@@ -341,7 +341,7 @@ public:
return append(fieldName, d);
}
@ -11,7 +11,7 @@ index 6162495c1c..8c0bece154 100644 @@ -11,7 +11,7 @@ index 6162495c1c..8c0bece154 100644
static const size_t maxInt = (1 << 30);
if (n < maxInt)
append(fieldName, static_cast<int>(n));
@@ -359,6 +359,18 @@ public:
@@ -350,6 +350,18 @@ public:
return *this;
}
@ -30,30 +30,16 @@ index 6162495c1c..8c0bece154 100644 @@ -30,30 +30,16 @@ index 6162495c1c..8c0bece154 100644
BSONObjBuilder& appendNumber(StringData fieldName, Decimal128 decNumber) {
return append(fieldName, decNumber);
}
diff --git a/src/mongo/db/storage/storage_options.cpp b/src/mongo/db/storage/storage_options.cpp
index dfbb776656..02d9f18520 100644
--- a/src/mongo/db/storage/storage_options.cpp
+++ b/src/mongo/db/storage/storage_options.cpp
@@ -41,7 +41,7 @@ StorageGlobalParams::StorageGlobalParams() {
}
diff --git a/src/mongo/platform/pause.h b/src/mongo/platform/pause.h
index 46df146..5003de5 100644
--- a/src/mongo/platform/pause.h
+++ b/src/mongo/platform/pause.h
@@ -55,7 +55,7 @@
/* ori 0,0,0 is the PPC64 noop instruction */
#define MONGO_YIELD_CORE_FOR_SMT() __asm__ volatile("ori 0,0,0" ::: "memory")
void StorageGlobalParams::reset() {
- engine = "wiredTiger";
+ engine = "mmapv1";
engineSetByUser = false;
dbpath = kDefaultDbPath;
upgrade = false;
diff --git a/src/mongo/platform/overflow_arithmetic.h b/src/mongo/platform/overflow_arithmetic.h
index a213bf479f..0fcce4b138 100644
--- a/src/mongo/platform/overflow_arithmetic.h
+++ b/src/mongo/platform/overflow_arithmetic.h
@@ -143,7 +143,8 @@ inline bool mongoSignedAddOverflow64(long long lhs, long long rhs, long long* su
return __builtin_add_overflow(lhs, rhs, sum);
}
-#elif defined(__aarch64__)
+#elif defined(__aarch64__) || defined(__arm__)
-inline bool mongoUnsignedAddOverflow64(unsigned long lhs, unsigned long rhs, unsigned long* sum) {
+// 32b arch: invalid conversion from 'size_t*' {aka 'unsigned int*'} to 'long unsigned int*'
+inline bool mongoUnsignedAddOverflow64(std::size_t lhs, std::size_t rhs, std::size_t* sum) {
return __builtin_add_overflow(lhs, rhs, sum);
}
#define MONGO_YIELD_CORE_FOR_SMT() __asm__ volatile("yield" ::: "memory")

37
SOURCES/ppc64.patch

@ -1,8 +1,8 @@ @@ -1,8 +1,8 @@
diff --git a/SConstruct b/SConstruct
index 52095d8b70..29ffc3ada4 100644
index fe7975b..88d6650 100644
--- a/SConstruct
+++ b/SConstruct
@@ -1059,6 +1059,7 @@ processor_macros = {
@@ -980,6 +980,7 @@ processor_macros = {
'arm' : { 'endian': 'little', 'defines': ('__arm__',) },
'aarch64' : { 'endian': 'little', 'defines': ('__arm64__', '__aarch64__')},
'i386' : { 'endian': 'little', 'defines': ('__i386', '_M_IX86')},
@ -10,17 +10,8 @@ index 52095d8b70..29ffc3ada4 100644 @@ -10,17 +10,8 @@ index 52095d8b70..29ffc3ada4 100644
'ppc64le' : { 'endian': 'little', 'defines': ('__powerpc64__',)},
's390x' : { 'endian': 'big', 'defines': ('__s390x__',)},
'sparc' : { 'endian': 'big', 'defines': ('__sparc',)},
@@ -3358,7 +3359,7 @@ def doConfigure(myenv):
# ask each module to configure itself and the build environment.
moduleconfig.configure_modules(mongo_modules, conf)
- if env['TARGET_ARCH'] == "ppc64le":
+ if env['TARGET_ARCH'] == "ppc64le" or env['TARGET_ARCH'] == "ppc64":
# This checks for an altivec optimization we use in full text search.
# Different versions of gcc appear to put output bytes in different
# parts of the output vector produced by vec_vbpermq. This configure
diff --git a/src/third_party/IntelRDFPMathLib20U1/LIBRARY/float128/architecture.h b/src/third_party/IntelRDFPMathLib20U1/LIBRARY/float128/architecture.h
index 355d70e813..afefe7b1f0 100755
index 355d70e..afefe7b 100755
--- a/src/third_party/IntelRDFPMathLib20U1/LIBRARY/float128/architecture.h
+++ b/src/third_party/IntelRDFPMathLib20U1/LIBRARY/float128/architecture.h
@@ -570,7 +570,7 @@
@ -33,10 +24,10 @@ index 355d70e813..afefe7b1f0 100755 @@ -33,10 +24,10 @@ index 355d70e813..afefe7b1f0 100755
# undef vax
# undef mips
diff --git a/src/third_party/IntelRDFPMathLib20U1/SConscript b/src/third_party/IntelRDFPMathLib20U1/SConscript
index c8eb827c28..60d7506adc 100644
index 20287a6..a495e9c 100644
--- a/src/third_party/IntelRDFPMathLib20U1/SConscript
+++ b/src/third_party/IntelRDFPMathLib20U1/SConscript
@@ -316,6 +316,9 @@ elif processor == 'x86_64' or processor == 'ppc64le':
@@ -313,6 +313,9 @@ elif processor == 'x86_64' or processor == 'ppc64le':
cpp_defines['efi2'] = '1'
cpp_defines['EFI2'] = '1'
# Using 64 bit big endian
@ -46,10 +37,10 @@ index c8eb827c28..60d7506adc 100644 @@ -46,10 +37,10 @@ index c8eb827c28..60d7506adc 100644
elif processor == 's390x':
cpp_defines['s390x'] = '1'
cpp_defines['BID_BIG_ENDIAN'] = '1'
diff --git a/src/third_party/timelib-2018.01alpha1/parse_tz.c b/src/third_party/timelib-2018.01alpha1/parse_tz.c
index 5986cd6468..18d41254ce 100644
--- a/src/third_party/timelib-2018.01alpha1/parse_tz.c
+++ b/src/third_party/timelib-2018.01alpha1/parse_tz.c
diff --git a/src/third_party/timelib-2017.05/parse_tz.c b/src/third_party/timelib-2017.05/parse_tz.c
index 3b68549..6460475 100644
--- a/src/third_party/timelib-2017.05/parse_tz.c
+++ b/src/third_party/timelib-2017.05/parse_tz.c
@@ -38,7 +38,7 @@
# endif
#endif
@ -60,10 +51,10 @@ index 5986cd6468..18d41254ce 100644 @@ -60,10 +51,10 @@ index 5986cd6468..18d41254ce 100644
# define WORDS_BIGENDIAN
# else
diff --git a/src/third_party/wiredtiger/SConscript b/src/third_party/wiredtiger/SConscript
index 40b80a09b6..fac3466aed 100644
index 1e07852..8a671b6 100644
--- a/src/third_party/wiredtiger/SConscript
+++ b/src/third_party/wiredtiger/SConscript
@@ -152,7 +152,7 @@ condition_map = {
@@ -135,7 +135,7 @@ condition_map = {
'WINDOWS_HOST' : env.TargetOSIs('windows'),
'ARM64_HOST' : env['TARGET_ARCH'] == 'aarch64',
@ -72,9 +63,9 @@ index 40b80a09b6..fac3466aed 100644 @@ -72,9 +63,9 @@ index 40b80a09b6..fac3466aed 100644
'X86_HOST' : env['TARGET_ARCH'] == 'x86_64',
'ZSERIES_HOST' : env['TARGET_ARCH'] == 's390x',
}
@@ -182,6 +182,10 @@ if useSnappy:
if (get_option("use-s390x-crc32") == "off"):
env.Append(CPPDEFINES=["HAVE_NO_CRC32_HARDWARE"])
@@ -167,6 +167,10 @@ if useSnappy:
if not (env['TARGET_ARCH'] == 's390x' and get_option("use-s390x-crc32") == "off"):
env.Append(CPPDEFINES=["HAVE_CRC32_HARDWARE"])
+# It is not possible to pass ASFLAGS through variables to scons now
+if env['TARGET_ARCH'] == 'ppc64':

580
SOURCES/python3-buildscripts-tests.patch

File diff suppressed because it is too large Load Diff

132
SPECS/mongodb.spec

@ -37,8 +37,8 @@ @@ -37,8 +37,8 @@
%global MONGO_DISTNAME mongo-r%{version}

Name: mongodb
Version: 4.0.3
Release: 3%{?dist}
Version: 3.6.6
Release: 2%{?dist}
Summary: High-performance, schema-free document-oriented database
Group: Applications/Databases
License: AGPLv3 and zlib and ASL 2.0
@ -60,26 +60,39 @@ Source9: %{daemonshard}.service @@ -60,26 +60,39 @@ Source9: %{daemonshard}.service
Source10: %{daemonshard}.sysconf
Source11: README.txt

# TabError: inconsistent use of tabs and spaces in indentation
#
Patch0: inconsistent-tabs.patch
# Fix build system to allow building with system version of libraries (mozjs, icu and asio)
# - needed for building additional architectures
# https://jira.mongodb.org/browse/SERVER-21353 -> now patching bundled mozjs45 - see patch23
#Patch0: use-system-mozjs-icu-asio.patch

# Convert build scripts and testsuite to support python3
# https://jira.mongodb.org/browse/SERVER-32295
Patch1: python3-buildscripts-tests.patch

# Fix building with boost 1.66
# https://jira.mongodb.org/browse/SERVER-32516
Patch2: boost-1.66.patch

# Few tests fail because of error in altivec implementation of ByteVector
# https://jira.mongodb.org/browse/SERVER-33395
Patch3: ppc64le-fix-altivec.patch

# Fedora specific - adding support for rest of Fedora architectures
# Upstream doesn't support it and isn't considering merging
#
# https://jira.mongodb.org/browse/SERVER-27833
# Enable ppc64 big endian support
Patch20: ppc64.patch
Patch22: ppc64-altivec.patch
# Add support also for 32bit platforms
# + set default storage engine for non 64-bit arches - RHBZ#1303846
Patch21: 32bit-support.patch
# Generate mozjs code for ppc64, arm and i386 arches
# Generate code for ppc64, arm and i386 arches
Patch23: ppc64-arm-i386-mozjs-code.patch

# PowerEL patches
Patch100: mongodb-gcc485.patch
Patch101: mongodb-c11.patch

BuildRequires: gcc-c++ >= 5.3.0
BuildRequires: boost-devel >= 1.56
# Provides tcmalloc
@ -93,7 +106,6 @@ BuildRequires: snappy-devel @@ -93,7 +106,6 @@ BuildRequires: snappy-devel
BuildRequires: yaml-cpp-devel
BuildRequires: zlib-devel
BuildRequires: valgrind-devel
BuildRequires: libcurl-devel
%if 0%{?fedora} >= 15 || 0%{?rhel} >= 7
BuildRequires: systemd
%endif
@ -159,7 +171,7 @@ Provides: bundled(icu) = 57.1 @@ -159,7 +171,7 @@ Provides: bundled(icu) = 57.1
Provides: bundled(IntelRDFPMathLib) = 20U1
# https://github.com/derickr/timelib
Provides: bundled(timelib) = 2017.05beta10
# MongoDB provides mozjs customization to recover from OOM
# MongoDB does provides mozjs customization to recover from OOM
Provides: bundled(mozjs45) = 45.8.0

%description server
@ -184,11 +196,13 @@ the MongoDB sources. @@ -184,11 +196,13 @@ the MongoDB sources.

%prep
%setup -q -n %{MONGO_DISTNAME}
%patch0 -p1
%patch1 -p1
%patch2 -p1
%patch3 -p1
# Patch only Fedora specific architectures
%ifnarch %{upstream_arches}
%patch20 -p1
%patch22 -p1
%patch21 -p1
%patch23 -p1

@ -196,12 +210,17 @@ the MongoDB sources. @@ -196,12 +210,17 @@ the MongoDB sources.
sed -i -e "/extract\/js\/src\/jit\/ProcessExecutableMemory.cpp/d" src/third_party/mozjs-45/SConscript
%endif

# Workaround for https://jira.mongodb.org/browse/SERVER-37135 to make mongodb buildable with new openssl
sed -i "s|\(#ifdef TLS1_3_VERSION\)|#undef TLS1_3_VERSION\n\1|" src/mongo/util/net/ssl_manager_openssl.cpp
# PowerEL
%patch100 -p1
%patch101 -p1

# CRLF -> LF
sed -i 's/\r//' README

# Disable optimization for s2 library
# https://jira.mongodb.org/browse/SERVER-17511
sed -i -r "s|(env.Append\(CCFLAGS=\['-DDEBUG_MODE=false')(\]\))|\1,'-O0'\2|" src/third_party/s2/SConscript

#TODO - removed unused bundles
# Use system versions of header files (bundled does not differ)
sed -i -r "s|third_party/libstemmer_c/include/libstemmer.h|libstemmer.h|" src/mongo/db/fts/stemmer.h
@ -216,12 +235,17 @@ sed -i -r "s|/data/db|%{_datadir}/%{pkg_name}-test/var|" buildscripts/resmokel @@ -216,12 +235,17 @@ sed -i -r "s|/data/db|%{_datadir}/%{pkg_name}-test/var|" buildscripts/resmokel

sed -i -r "s|env python|env python3|" buildscripts/resmoke.py

# set default storage engine for non 64-bit arches - RHBZ#1303846
%ifnarch %{upstream_arches} ppc64
sed -i 's|engine = "wiredTiger"|engine = "mmapv1"|' src/mongo/db/storage/storage_options.h
%endif


%build
export LANG=C.UTF-8
export LANG="en_US.UTF-8"
# Prepare variables for building
cat > variables.list << EOF
CCFLAGS="$(echo %{?optflags} | sed -e "s/-O. //" -e "s/-g //")"
CCFLAGS="$(echo %{?optflags} | sed -e "s/-O. //" -e "s/-g //") -fvisibility=hidden"
LINKFLAGS="%{?__global_ldflags} -Wl,-z,noexecstack -Wl,--reduce-memory-overheads,--no-keep-memory"
VERBOSE=1
MONGO_VERSION="%{version}"
@ -289,6 +313,7 @@ scons-3 unittests $(cat build-options) @@ -289,6 +313,7 @@ scons-3 unittests $(cat build-options)
install -p -D -m 755 mongod %{buildroot}%{_bindir}/mongod
install -p -D -m 755 mongos %{buildroot}%{_bindir}/mongos
install -p -D -m 755 mongo %{buildroot}%{_bindir}/mongo
install -p -D -m 755 mongoperf %{buildroot}%{_bindir}/mongoperf
install -p -D -m 755 mongobridge %{buildroot}%{_bindir}/mongobridge

mkdir -p %{buildroot}%{_sharedstatedir}/%{pkg_name}
@ -317,6 +342,7 @@ sed -i -r "s|(engine: )mmapv1|\1wiredTiger|" %{buildroot}%{_sysconfdir}/%{daemon @@ -317,6 +342,7 @@ sed -i -r "s|(engine: )mmapv1|\1wiredTiger|" %{buildroot}%{_sysconfdir}/%{daemon
#TODO - create man page for mongobridge
install -d -m 755 %{buildroot}%{_mandir}/man1
install -p -m 644 debian/mongo.1 %{buildroot}%{_mandir}/man1/
install -p -m 644 debian/mongoperf.1 %{buildroot}%{_mandir}/man1/
install -p -m 644 debian/mongod.1 %{buildroot}%{_mandir}/man1/
install -p -m 644 debian/mongos.1 %{buildroot}%{_mandir}/man1/

@ -354,7 +380,7 @@ done < ./build/unittests.txt @@ -354,7 +380,7 @@ done < ./build/unittests.txt


%check
export LANG=C.UTF-8
export LANG="en_US.UTF-8"
%if %runselftest
# More info about testing:
# http://www.mongodb.org/about/contributors/tutorial/test-the-mongodb-server/
@ -374,7 +400,6 @@ sed -i "/mongo_uri_test/d" build/unittests.txt @@ -374,7 +400,6 @@ sed -i "/mongo_uri_test/d" build/unittests.txt
#TODO
%ifarch %{ix86} %{arm}
sed -i "/service_entry_point_mock_test/d" build/unittests.txt
sed -i "/rs_rollback_test/d" build/unittests.txt
# Crashing on armv7hl due to optimizations
sed -i "/chunk_diff_test/d" build/unittests.txt
%endif
@ -404,6 +429,11 @@ done @@ -404,6 +429,11 @@ done
rm -Rf ./var
%endif

%post -p /sbin/ldconfig


%postun -p /sbin/ldconfig


%pre server
getent group %{pkg_name} >/dev/null || groupadd -f -g 184 -r %{pkg_name}
@ -461,14 +491,47 @@ if [ "$1" -ge 1 ] ; then @@ -461,14 +491,47 @@ if [ "$1" -ge 1 ] ; then
fi


# Make rename of config files transparent and effortless
%triggerpostun server -- %{name}-server < 2.6.7-3
if [ -f %{_sysconfdir}/sysconfig/%{daemon}.rpmnew ]; then
if [ -f %{_sysconfdir}/%{pkg_name}.conf.rpmsave ]; then
mv %{_sysconfdir}/%{daemon}.conf %{_sysconfdir}/%{daemon}.conf.rpmnew
mv %{_sysconfdir}/%{pkg_name}.conf.rpmsave %{_sysconfdir}/%{pkg_name}.conf
else
mv %{_sysconfdir}/%{daemon}.conf %{_sysconfdir}/%{pkg_name}.conf
fi
else
if [ -f %{_sysconfdir}/%{pkg_name}.conf.rpmsave ]; then
mv %{_sysconfdir}/%{daemon}.conf %{_sysconfdir}/%{daemon}.conf.rpmnew
mv %{_sysconfdir}/%{pkg_name}.conf.rpmsave %{_sysconfdir}/%{daemon}.conf
fi
fi

if [ -f %{_sysconfdir}/sysconfig/%{daemonshard}.rpmnew ]; then
if [ -f %{_sysconfdir}/%{pkg_name}-shard.conf.rpmsave ]; then
mv %{_sysconfdir}/%{daemonshard}.conf %{_sysconfdir}/%{daemonshard}.conf.rpmnew
mv %{_sysconfdir}/%{pkg_name}-shard.conf.rpmsave %{_sysconfdir}/%{pkg_name}-shard.conf
else
mv %{_sysconfdir}/%{daemonshard}.conf %{_sysconfdir}/%{pkg_name}-shard.conf
fi
else
if [ -f %{_sysconfdir}/%{pkg_name}-shard.conf.rpmsave ]; then
mv %{_sysconfdir}/%{daemonshard}.conf %{_sysconfdir}/%{daemonshard}.conf.rpmnew
mv %{_sysconfdir}/%{pkg_name}-shard.conf.rpmsave %{_sysconfdir}/%{daemonshard}.conf
fi
fi


%files
%{!?_licensedir:%global license %%doc}
%license GNU-AGPL-3.0.txt APACHE-2.0.txt
%doc README
%{_bindir}/mongo
%{_bindir}/mongoperf
%{_bindir}/mongobridge

%{_mandir}/man1/mongo.1*
%{_mandir}/man1/mongoperf.1*


%files server
@ -503,42 +566,11 @@ fi @@ -503,42 +566,11 @@ fi


%changelog
* Thu Dec 06 2018 mskalick@redhat.com - 4.0.3-3
* Wed Dec 05 2018 mskalick@redhat.com - 3.6.6-2
- Fix bytecompilation and missing files in -test subpackage

* Sun Nov 18 2018 Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> - 4.0.3-2
- Use C.UTF-8 locale
See https://fedoraproject.org/wiki/Changes/Remove_glibc-langpacks-all_from_buildroot

* Wed Oct 03 2018 panovotn@redhat.com - 4.0.3-1
- Rebase to upstream release 4.0.3

* Tue Oct 02 2018 mskalick@redhat.com - 4.0.1-2
- Don't force third_party/s2 to be built without optimizations. It's working
with new gcc. Using -O0 failed anobin checks.

* Thu Aug 09 2018 mskalick@redhat.com - 4.0.1-1
- Rebase to upstream release 4.0.1

* Fri Jul 13 2018 Fedora Release Engineering <releng@fedoraproject.org> - 4.0.0-5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild

* Wed Jul 11 2018 mskalick@redhat.com - 4.0.0-4
- Follow upstream suggestion about unittest_test - SERVER-35935 jira ticket
(-fvisibility=hidden is not needed anymore, because bundled mozjs is used on
all arches)

* Wed Jul 11 2018 mskalick@redhat.com - 4.0.0-3
- Fix default storage engine for 32b arches

* Mon Jul 09 2018 Miro Hrončok <mhroncok@redhat.com> - 4.0.0-2
- Rebuilt for Python 3.7

* Mon Jun 25 2018 mskalick@redhat.com - 4.0.0-1
- Rebase to latest upstream version 4.0.0

* Tue Jun 19 2018 Miro Hrončok <mhroncok@redhat.com> - 3.6.4-4
- Rebuilt for Python 3.7
* Mon Aug 13 2018 mskalick@redhat.com - 3.6.6-1
- Rebase to upstream release 3.6.6

* Fri Jun 08 2018 mskalick@redhat.com - 3.6.4-3
- Use bundled mozjs-45 on all architecture

Loading…
Cancel
Save