Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 1 addition & 16 deletions .evergreen/generated_configs/legacy-config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1652,9 +1652,6 @@ tasks:
add_expansions_to_env: true
shell: bash
script: |-
set -o errexit
env DEBUG="ON" EXTRA_CONFIGURE_FLAGS="-DENABLE_PIC=ON -DENABLE_MONGOC=OFF" SASL="AUTO" SSL="OPENSSL" bash .evergreen/scripts/compile.sh
rm CMakeCache.txt
set -o errexit
env COMPILE_LIBMONGOCRYPT="ON" DEBUG="ON" EXTRA_CONFIGURE_FLAGS="-DENABLE_PIC=ON -DENABLE_CLIENT_SIDE_ENCRYPTION=ON" SASL="AUTO" SSL="OPENSSL" bash .evergreen/scripts/compile.sh
- func: upload build
Expand All @@ -1673,9 +1670,6 @@ tasks:
add_expansions_to_env: true
shell: bash
script: |-
set -o errexit
env DEBUG="ON" EXTRA_CONFIGURE_FLAGS="-DENABLE_PIC=ON -DENABLE_MONGOC=OFF" SASL="AUTO" SSL="OPENSSL_STATIC" bash .evergreen/scripts/compile.sh
rm CMakeCache.txt
set -o errexit
env COMPILE_LIBMONGOCRYPT="ON" DEBUG="ON" EXTRA_CONFIGURE_FLAGS="-DENABLE_PIC=ON -DENABLE_CLIENT_SIDE_ENCRYPTION=ON" SASL="AUTO" SSL="OPENSSL_STATIC" bash .evergreen/scripts/compile.sh
- func: upload build
Expand All @@ -1694,9 +1688,6 @@ tasks:
add_expansions_to_env: true
shell: bash
script: |-
set -o errexit
env DEBUG="ON" EXTRA_CONFIGURE_FLAGS="-DENABLE_PIC=ON -DENABLE_MONGOC=OFF" SASL="AUTO" SSL="DARWIN" bash .evergreen/scripts/compile.sh
rm CMakeCache.txt
set -o errexit
env COMPILE_LIBMONGOCRYPT="ON" DEBUG="ON" EXTRA_CONFIGURE_FLAGS="-DENABLE_PIC=ON -DENABLE_CLIENT_SIDE_ENCRYPTION=ON" SASL="AUTO" SSL="DARWIN" bash .evergreen/scripts/compile.sh
- func: upload build
Expand All @@ -1715,9 +1706,6 @@ tasks:
add_expansions_to_env: true
shell: bash
script: |-
set -o errexit
env DEBUG="ON" EXTRA_CONFIGURE_FLAGS="-DENABLE_PIC=ON -DENABLE_MONGOC=OFF" SASL="AUTO" SSL="WINDOWS" bash .evergreen/scripts/compile.sh
rm CMakeCache.txt
set -o errexit
env COMPILE_LIBMONGOCRYPT="ON" DEBUG="ON" EXTRA_CONFIGURE_FLAGS="-DENABLE_PIC=ON -DENABLE_CLIENT_SIDE_ENCRYPTION=ON" SASL="AUTO" SSL="WINDOWS" bash .evergreen/scripts/compile.sh
- func: upload build
Expand All @@ -1734,9 +1722,6 @@ tasks:
add_expansions_to_env: true
shell: bash
script: |-
set -o errexit
env CFLAGS="-fno-omit-frame-pointer" CHECK_LOG="ON" DEBUG="ON" EXTRA_CONFIGURE_FLAGS="-DENABLE_PIC=ON -DENABLE_MONGOC=OFF -DENABLE_EXTRA_ALIGNMENT=OFF" PATH="/usr/lib/llvm-3.8/bin:$PATH" SANITIZE="address" SSL="OPENSSL" bash .evergreen/scripts/compile.sh
rm CMakeCache.txt
set -o errexit
env CFLAGS="-fno-omit-frame-pointer" CHECK_LOG="ON" COMPILE_LIBMONGOCRYPT="ON" DEBUG="ON" EXTRA_CONFIGURE_FLAGS="-DENABLE_CLIENT_SIDE_ENCRYPTION=ON -DENABLE_EXTRA_ALIGNMENT=OFF" PATH="/usr/lib/llvm-3.8/bin:$PATH" SANITIZE="address" SSL="OPENSSL" bash .evergreen/scripts/compile.sh
- func: upload build
Expand Down Expand Up @@ -21589,7 +21574,7 @@ buildvariants:
- release-compile
- debug-compile-nosasl-nossl
- debug-compile-rdtscp
- .debug-compile !.sspi .openssl
- .debug-compile !.sspi .openssl !.client-side-encryption
- .debug-compile !.sspi .nossl
- .4.0 .openssl !.nosasl .server
- .3.6 .openssl !.nosasl .server
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,50 +94,23 @@ def __init__(self, *args, **kwargs):

class CompileWithClientSideEncryption(CompileTask):
def __init__(self, *args, **kwargs):
# Compiling with ClientSideEncryption support is a little strange.
# It requires linking against the library libmongocrypt. But libmongocrypt
# depends on libbson. So we do the following:
# 1. Build and install libbson normally
# 2. Build and install libmongocrypt (which links against the previously built libbson)
# 3. Build and install libmongoc
# First, compile and install without CSE.
# Then, compile and install libmongocrypt.
compile_with_cse = CompileTask(*args,
COMPILE_LIBMONGOCRYPT="ON",
EXTRA_CONFIGURE_FLAGS="-DENABLE_PIC=ON -DENABLE_CLIENT_SIDE_ENCRYPTION=ON",
**kwargs).to_dict()
extra_script = "rm CMakeCache.txt\n" + \
compile_with_cse["commands"][0]["params"]["script"]

# Skip running mock server tests, because those were already run in the non-CSE build.
# Compiling with ClientSideEncryption support requires linking against the library libmongocrypt.
super(CompileWithClientSideEncryption, self).__init__(*args,
extra_script=extra_script,
EXTRA_CONFIGURE_FLAGS="-DENABLE_PIC=ON -DENABLE_MONGOC=OFF",
COMPILE_LIBMONGOCRYPT="ON",
EXTRA_CONFIGURE_FLAGS="-DENABLE_PIC=ON -DENABLE_CLIENT_SIDE_ENCRYPTION=ON",
**kwargs)
self.add_tags('client-side-encryption', 'special')


class CompileWithClientSideEncryptionAsan(CompileTask):
def __init__(self, *args, **kwargs):
compile_with_cse = CompileTask(*args,
CFLAGS="-fno-omit-frame-pointer",
COMPILE_LIBMONGOCRYPT="ON",
CHECK_LOG="ON",
sanitize=['address'],
EXTRA_CONFIGURE_FLAGS="-DENABLE_CLIENT_SIDE_ENCRYPTION=ON -DENABLE_EXTRA_ALIGNMENT=OFF",
PATH='/usr/lib/llvm-3.8/bin:$PATH',
**kwargs).to_dict()
extra_script = "rm CMakeCache.txt\n" + \
compile_with_cse["commands"][0]["params"]["script"]

# Skip running mock server tests, because those were already run in the non-CSE build.
super(CompileWithClientSideEncryptionAsan, self).__init__(*args,
CFLAGS="-fno-omit-frame-pointer",
extra_script=extra_script,
COMPILE_LIBMONGOCRYPT="ON",
CHECK_LOG="ON",
sanitize=[
'address'],
EXTRA_CONFIGURE_FLAGS="-DENABLE_PIC=ON -DENABLE_MONGOC=OFF -DENABLE_EXTRA_ALIGNMENT=OFF",
EXTRA_CONFIGURE_FLAGS="-DENABLE_CLIENT_SIDE_ENCRYPTION=ON -DENABLE_EXTRA_ALIGNMENT=OFF",
PATH='/usr/lib/llvm-3.8/bin:$PATH',
**kwargs)
self.add_tags('client-side-encryption')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ def days(n):
'release-compile',
'debug-compile-nosasl-nossl',
'debug-compile-rdtscp',
'.debug-compile !.sspi .openssl',
'.debug-compile !.sspi .openssl !.client-side-encryption',
'.debug-compile !.sspi .nossl',
'.4.0 .openssl !.nosasl .server',
'.3.6 .openssl !.nosasl .server'],
Expand Down
20 changes: 4 additions & 16 deletions .evergreen/scripts/compile-unix.sh
Original file line number Diff line number Diff line change
Expand Up @@ -195,22 +195,10 @@ if [[ "${OSTYPE}" == darwin* ]]; then
fi

if [[ "${COMPILE_LIBMONGOCRYPT}" == "ON" ]]; then
# Build libmongocrypt, using the previously fetched installed source.
# TODO(CDRIVER-4394) update to use libmongocrypt 1.7.0 once there is a stable 1.7.0 release.
git clone --depth=1 https://github.com/mongodb/libmongocrypt --branch 1.7.0-alpha1

mkdir libmongocrypt/cmake-build
pushd libmongocrypt/cmake-build
"${CMAKE}" \
-DENABLE_SHARED_BSON=ON \
-DCMAKE_BUILD_TYPE="Debug" \
-DMONGOCRYPT_MONGOC_DIR="${mongoc_dir}" \
-DCMAKE_INSTALL_PREFIX="${install_dir}" \
-DCMAKE_PREFIX_PATH="${cmake_prefix_path}" \
-DBUILD_TESTING=OFF \
..
make -j "$(nproc)" install
popd # libmongocrypt/cmake-build
git clone --depth=1 https://github.com/mongodb/libmongocrypt --branch 1.7.0
MONGOCRYPT_INSTALL_PREFIX=${install_dir} \
DEFAULT_BUILD_ONLY=true \
./libmongocrypt/.evergreen/compile.sh
else
# Avoid symbol collisions with libmongocrypt installed via apt/yum.
# Note: may be overwritten by ${EXTRA_CONFIGURE_FLAGS}.
Expand Down
13 changes: 5 additions & 8 deletions .evergreen/scripts/compile-windows.sh
Original file line number Diff line number Diff line change
Expand Up @@ -99,14 +99,11 @@ declare compile_flags=(
)

if [ "${COMPILE_LIBMONGOCRYPT}" = "ON" ]; then
# Build libmongocrypt, using the previously fetched installed source.
# TODO(CDRIVER-4394) update to use libmongocrypt 1.7.0 once there is a stable 1.7.0 release.
git clone --depth=1 https://github.com/mongodb/libmongocrypt --branch 1.7.0-alpha1
mkdir libmongocrypt/cmake-build
pushd libmongocrypt/cmake-build
"${cmake_binary}" -G "${CC}" "-DCMAKE_PREFIX_PATH=${install_dir}/lib/cmake" -DENABLE_SHARED_BSON=ON -DCMAKE_INSTALL_PREFIX="${install_dir}" ../
"${cmake_binary}" --build . --target INSTALL --config "${build_config}" -- "${compile_flags[@]}"
popd # libmongocrypt/cmake-build
git clone --depth=1 https://github.com/mongodb/libmongocrypt --branch 1.7.0
MONGOCRYPT_INSTALL_PREFIX=${install_dir} \
DEFAULT_BUILD_ONLY=true \
LIBMONGOCRYPT_BUILD_TYPE=${build_config} \
./libmongocrypt/.evergreen/compile.sh
fi

"${cmake_binary}" -G "$CC" "-DCMAKE_PREFIX_PATH=${install_dir}/lib/cmake" "${configure_flags[@]}"
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"fields": [
{
"keyId": {
"$binary": {
"base64": "EjRWeBI0mHYSNBI0VniQEg==",
"subType": "04"
}
},
"path": "encryptedDecimalNoPrecision",
"bsonType": "decimal",
"queries": {
"queryType": "rangePreview",
"sparsity": {
"$numberInt": "1"
}
}
}
]
}

Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
{
"fields": [
{
"keyId": {
"$binary": {
"base64": "EjRWeBI0mHYSNBI0VniQEg==",
"subType": "04"
}
},
"path": "encryptedDecimalPrecision",
"bsonType": "decimal",
"queries": {
"queryType": "rangePreview",
"sparsity": {
"$numberInt": "1"
},
"min": {
"$numberDecimal": "0.0"
},
"max": {
"$numberDecimal": "200.0"
},
"precision": {
"$numberInt": "2"
}
}
}
]
}
Loading