Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
4244864
Tweak Node scripts to use top-level scripts
vector-of-bool Dec 8, 2022
8c82925
Basic IntelDFP wrapper, and test tweaks:
vector-of-bool Nov 21, 2022
b7cfe11
More decimal constants, operations, comments
vector-of-bool Dec 7, 2022
9a15b80
Define the OST encoding for Decimal128
vector-of-bool Dec 7, 2022
2c95f31
Fix warnings, tweaks, compiler compat.
vector-of-bool Dec 7, 2022
11edf84
Fix big-endian support.
vector-of-bool Dec 13, 2022
747b793
Tweak bitstring generation and inline clz operations
vector-of-bool Dec 14, 2022
ea6c8f2
Bit operations for u128
vector-of-bool Dec 14, 2022
de2e9ab
Edge generation for Decimal128
vector-of-bool Dec 15, 2022
8ffe378
Modify mincover template to support non-builting types
vector-of-bool Dec 16, 2022
e7cd533
mincover test vector data
vector-of-bool Dec 16, 2022
4aa3849
New mincover impl for Decimal128
vector-of-bool Dec 16, 2022
5764068
add decimal128 tests
kevinAlbs Dec 13, 2022
47e4b78
Implement range-insert for decimal128, fix test data
vector-of-bool Dec 19, 2022
976897f
Implement find-range, more test data fixes
vector-of-bool Dec 19, 2022
e63daff
Fix new conversion warning-errors
vector-of-bool Dec 20, 2022
9665927
Fix new conversion warnings and brace warnings
vector-of-bool Dec 20, 2022
f9a0406
spelling error in IDFP download
vector-of-bool Dec 20, 2022
d866db2
Clang-tidy warnings
vector-of-bool Dec 20, 2022
41e5660
A safer strncpy ensures we write a null terminator
vector-of-bool Dec 21, 2022
bb8b702
Dead/dup code in range encoding
vector-of-bool Jan 5, 2023
16374c4
Python cleanup
vector-of-bool Jan 5, 2023
d05dfc7
Merge branch 'master' into decimal128
vector-of-bool Jan 5, 2023
3254533
Fixes
vector-of-bool Jan 10, 2023
07cdb73
Minor PR tweaks
vector-of-bool Jan 10, 2023
620f9d6
Python cleanup and comments
vector-of-bool Jan 10, 2023
14f12d3
Handle case where 'min' is finer than 'precision'
vector-of-bool Jan 10, 2023
efd68d5
Spelling
vector-of-bool Jan 10, 2023
eeb9dc9
We hit MSVC impl limits on string length:
vector-of-bool Jan 11, 2023
47e9b0e
Too many decimal edges can overflow the stack. Don't do that.
vector-of-bool Jan 11, 2023
a4c845c
typo
vector-of-bool Jan 11, 2023
2524124
Tautalogical compare
vector-of-bool Jan 17, 2023
812dde1
Tweak and comment on array size limits
vector-of-bool Jan 17, 2023
ec7663a
Bump CMake min-required
vector-of-bool Jan 17, 2023
8c7fa49
null-safe checks in string building
vector-of-bool Jan 17, 2023
5126d16
Merge branch 'master' into decimal128
vector-of-bool Jan 17, 2023
f4da51d
PR comments/cleanup:
vector-of-bool Jan 17, 2023
619d64b
Fix formatting arg
vector-of-bool Jan 17, 2023
261934a
Fix UB in IntellRDFP lib
vector-of-bool Jan 18, 2023
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
41 changes: 28 additions & 13 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,14 +1,9 @@
cmake_minimum_required (VERSION 3.5)
cmake_minimum_required (VERSION 3.12)

if (CMAKE_VERSION VERSION_EQUAL 3.12 OR CMAKE_VERSION VERSION_GREATER 3.12)
project (mongocrypt C)
project (mongocrypt C)

# Used for the csfle-markup util:
enable_language (CXX OPTIONAL)
else ()
# GenerateExportHeader only works with C with 3.12 - https://gitlab.kitware.com/cmake/cmake/commit/de348a9638bd51af4523f36c68884b901d4aff18
project (mongocrypt C CXX)
endif ()
# Used for the csfle-markup util:
enable_language (CXX OPTIONAL)

set (CMAKE_C_STANDARD 99)

Expand All @@ -25,6 +20,7 @@ list (APPEND CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake)
include (GNUInstallDirs)

include (ImportBSON)
include (IntelDFP)

if (USE_SHARED_LIBBSON AND ENABLE_BUILD_FOR_PPA)
message (FATAL_ERROR "PPA build requires static linking to libbson")
Expand Down Expand Up @@ -249,6 +245,7 @@ target_link_libraries (
_mongocrypt::libbson_for_shared
Threads::Threads
kms_message_static
mongocrypt::intel_dfp
$<BUILD_INTERFACE:mongo::mlib>
PUBLIC
${CMAKE_DL_LIBS}
Expand Down Expand Up @@ -306,6 +303,7 @@ target_link_libraries (
PRIVATE
_mongocrypt::libbson_for_static
kms_message_static
mongocrypt::intel_dfp
$<BUILD_INTERFACE:mongo::mlib>
PUBLIC
${CMAKE_THREAD_LIBS_INIT}
Expand Down Expand Up @@ -492,10 +490,27 @@ foreach (test IN ITEMS path str)
endforeach ()

if ("cxx_relaxed_constexpr" IN_LIST CMAKE_CXX_COMPILE_FEATURES)
add_executable(mlib.int128.test src/mlib/int128.test.cpp src/mlib/int128.test.c)
add_test (mlib.int128 mlib.int128.test)
target_link_libraries (mlib.int128.test PRIVATE mongo::mlib Threads::Threads)
target_compile_features (mlib.int128.test PRIVATE cxx_relaxed_constexpr)
file (GLOB_RECURSE test_files CONFIGURE_DEPENDS src/*.test.cpp)
foreach (file IN LISTS test_files)
# Compute a nice test name
file (RELATIVE_PATH relpath "${CMAKE_CURRENT_LIST_DIR}/src" "${file}")
file (TO_CMAKE_PATH "${relpath}" relpath)
string (REPLACE "src/" "" relpath "${relpath}")
string (REPLACE "/" "." test_name "${relpath}")
string (REGEX REPLACE "\\.test\\.cpp$" "" test_name "${test_name}")
# Generate a test executable:
set (exe_name "${test_name}.test")
add_executable ("${exe_name}" "${file}")
target_compile_features ("${exe_name}" PRIVATE cxx_relaxed_constexpr)
target_link_libraries ("${exe_name}" PRIVATE
mongocrypt
mongo::mlib
mongocrypt::intel_dfp
Threads::Threads
bson_static
)
add_test ("${test_name}" "${exe_name}")
endforeach ()
endif ()

if ("cxx_std_20" IN_LIST CMAKE_CXX_COMPILE_FEATURES)
Expand Down
48 changes: 0 additions & 48 deletions bindings/node/.evergreen/find_cmake.sh

This file was deleted.

17 changes: 2 additions & 15 deletions bindings/node/.evergreen/setup_environment.sh
Original file line number Diff line number Diff line change
@@ -1,10 +1,5 @@
#!/usr/bin/env bash

if [ -z "$NODE_NVM_USE_VERSION" ]; then
echo "NODE_NVM_USE_VERSION environment variable must be set."
exit 1
fi

set -o xtrace # Write all commands first to stderr
set -o errexit # Exit the script with error if any of the commands fail

Expand All @@ -26,16 +21,8 @@ mkdir -p "${BIN_DIR}"
# Add mongodb toolchain to path
export PATH="$BIN_DIR:/opt/mongodbtoolchain/v2/bin:$PATH"

# locate cmake
if [ "$OS" == "Windows_NT" ]; then
CMAKE=/cygdrive/c/cmake/bin/cmake
if [ "$WINDOWS_32BIT" != "ON" ]; then
ADDITIONAL_CMAKE_FLAGS="-Thost=x64 -A x64"
fi
else
chmod u+x ./.evergreen/find_cmake.sh
IGNORE_SYSTEM_CMAKE=1 . ./.evergreen/find_cmake.sh
fi
test -n "${NODE_NVM_USE_VERSION-}" || echo "Defaulting to using the current Node LTS Release. Set NODE_NVM_USE_VERSION to change."
: "${NODE_NVM_USE_VERSION:="lts"}"

# this needs to be explicitly exported for the nvm install below
export NVM_DIR="${NODE_ARTIFACTS_PATH}/nvm"
Expand Down
4 changes: 2 additions & 2 deletions bindings/node/.evergreen/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ export MONGODB_CLIENT_ENCRYPTION_OVERRIDE="$(pwd)"

# install node dependencies
echo "Installing package dependencies (includes a static build)"
. ./etc/build-static.sh
bash ./etc/build-static.sh
# npm install

# Run tests
Expand All @@ -21,4 +21,4 @@ MONGODB_NODE_SKIP_LIVE_TESTS=true npm test

# Run prebuild and deploy
echo "Running prebuild and deploy"
. ./.evergreen/prebuild.sh
bash ./.evergreen/prebuild.sh
28 changes: 15 additions & 13 deletions bindings/node/etc/build-static.sh
Original file line number Diff line number Diff line change
@@ -1,33 +1,35 @@
#!/usr/bin/env bash -x
#!/usr/bin/env bash

DEPS_PREFIX="$(pwd)/deps"
THIS_DIR="$(dirname "${BASH_SOURCE[0]}")"
. "$THIS_DIR/../../../.evergreen/init.sh"

NODE_DIR="$(abspath "$THIS_DIR/..")"

DEPS_PREFIX="$NODE_DIR/deps"
BUILD_DIR=$DEPS_PREFIX/tmp
LIBMONGOCRYPT_DIR="$(pwd)/../../"
TOP_DIR="$(pwd)/../../../"
: "${CMAKE_FLAGS:=}"
: "${WINDOWS_CMAKE_FLAGS:=}"
: "${NPM_OPTIONS:=}"

export NPM_OPTIONS="${NPM_OPTIONS}"

if [[ -z $CMAKE ]]; then
CMAKE=`type -P cmake`
fi

# build and install libmongocrypt
mkdir -p $BUILD_DIR/libmongocrypt-build
pushd $BUILD_DIR/libmongocrypt-build #./deps/tmp/libmongocrypt-build

CMAKE_FLAGS="-DDISABLE_NATIVE_CRYPTO=1 -DCMAKE_INSTALL_LIBDIR=lib -DENABLE_MORE_WARNINGS_AS_ERRORS=ON"
if [ "$OS" == "Windows_NT" ]; then
if [ "$WINDOWS_32BIT" != "ON" ]; then
if [ "$OS_NAME" == "windows" ]; then
if [ "${WINDOWS_32BIT-}" != "ON" ]; then
WINDOWS_CMAKE_FLAGS="-Thost=x64 -A x64 -DCMAKE_C_FLAGS_RELWITHDEBINFO=\"/MT\""
else
WINDOWS_CMAKE_FLAGS="-DCMAKE_C_FLAGS_RELWITHDEBINFO=\"/MT\""
fi
$CMAKE $CMAKE_FLAGS $WINDOWS_CMAKE_FLAGS -DCMAKE_PREFIX_PATH="`cygpath -w $DEPS_PREFIX`" -DCMAKE_INSTALL_PREFIX="`cygpath -w $DEPS_PREFIX`" "`cygpath -w $LIBMONGOCRYPT_DIR`"
run_cmake $CMAKE_FLAGS $WINDOWS_CMAKE_FLAGS -DCMAKE_PREFIX_PATH="$(native_path "$DEPS_PREFIX")" -DCMAKE_INSTALL_PREFIX="$(native_path "$DEPS_PREFIX")" "$(native_path "$LIBMONGOCRYPT_DIR")"
else
$CMAKE $CMAKE_FLAGS -DCMAKE_PREFIX_PATH=$DEPS_PREFIX -DCMAKE_INSTALL_PREFIX=$DEPS_PREFIX -DCMAKE_OSX_DEPLOYMENT_TARGET="10.12" $LIBMONGOCRYPT_DIR
run_cmake $CMAKE_FLAGS -DCMAKE_PREFIX_PATH=$DEPS_PREFIX -DCMAKE_INSTALL_PREFIX=$DEPS_PREFIX -DCMAKE_OSX_DEPLOYMENT_TARGET="10.12" $LIBMONGOCRYPT_DIR
fi

$CMAKE --build . --target install --config RelWithDebInfo
run_cmake --build . --target install --config RelWithDebInfo

popd #./

Expand Down
Loading