-
Notifications
You must be signed in to change notification settings - Fork 888
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
GODRIVER-2492 use consistent versions of crypt_shared and server #1021
Changes from all commits
2810078
c639acf
758ee2b
a93f716
532df50
9646582
ba9b5b0
49eeaf4
6eae9d9
4e445a6
9756bba
5aed681
c492eeb
02b4f15
4340df2
68dcdc3
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -192,26 +192,42 @@ functions: | |
script: | | ||
${PREPARE_SHELL} | ||
|
||
# Skip the crypt_shared library download if there is no crypt_shared build for the current | ||
# platform. Don't try to determine this automatically to prevent misconfiguration errors | ||
# from silently skipping the crypt_shared download and changing the testing conditions. | ||
if [ "${SKIP_CRYPT_SHARED_LIB_DOWNLOAD}" = "true" ]; then | ||
echo "There is no crypt_shared library for this platform, skipping download..." | ||
exit 0 | ||
MONGODB_VERSION=${VERSION} | ||
if [ -z "$MONGODB_VERSION" ]; then | ||
# default to latest to match behavior of run-orchestration.sh. | ||
MONGODB_VERSION=latest | ||
fi | ||
|
||
# Download the crypt_shared dynamic library for the current platform to the current working | ||
# directory. The run-tests.sh and versioned API test scripts expect to find a | ||
# mongo_crypt_v1.* file in the "src/go.mongodb.org/mongo-driver" working directory. | ||
# TODO(GODRIVER-2437): Update version to "latest-stable" once the crypt_shared library has a | ||
# feature-complete stable release. | ||
${PYTHON3_BINARY} $DRIVERS_TOOLS/.evergreen/mongodl.py \ | ||
--component crypt_shared \ | ||
--version latest \ | ||
--edition enterprise \ | ||
--out . \ | ||
--only "**/mongo_crypt_v1.*" \ | ||
--strip-path-components 1 | ||
. $DRIVERS_TOOLS/.evergreen/download-mongodb.sh | ||
get_distro | ||
# get_distro defines $DISTRO. | ||
get_mongodb_download_url_for "$DISTRO" "$MONGODB_VERSION" | ||
# get_mongodb_download_url_for defines $MONGO_CRYPT_SHARED_DOWNLOAD_URL and $EXTRACT. | ||
if [ -z "$MONGO_CRYPT_SHARED_DOWNLOAD_URL" ]; then | ||
echo "There is no crypt_shared library for distro='$DISTRO' and version='$MONGODB_VERSION'". | ||
touch expansion.yml | ||
else | ||
echo "Downloading crypt_shared package from $MONGO_CRYPT_SHARED_DOWNLOAD_URL" | ||
download_and_extract_crypt_shared "$MONGO_CRYPT_SHARED_DOWNLOAD_URL" "$EXTRACT" | ||
CRYPT_SHARED_LIB_PATH="$(find $(pwd) -maxdepth 1 -type f \ | ||
-name 'mongo_crypt_v1.so' -o \ | ||
-name 'mongo_crypt_v1.dll' -o \ | ||
-name 'mongo_crypt_v1.dylib')" | ||
# Expect that we always find a crypt_shared library file and set the CRYPT_SHARED_LIB_PATH | ||
# environment variable. If we didn't, print an error message and exit. | ||
if [ -z "$CRYPT_SHARED_LIB_PATH" ]; then | ||
echo 'CRYPT_SHARED_LIB_PATH is empty. Exiting.' | ||
exit 1 | ||
fi | ||
# If we're on Windows, convert the "cygdrive" path to Windows-style paths. | ||
if [ "Windows_NT" = "$OS" ]; then | ||
CRYPT_SHARED_LIB_PATH=$(cygpath -m $CRYPT_SHARED_LIB_PATH) | ||
fi | ||
echo "CRYPT_SHARED_LIB_PATH: $CRYPT_SHARED_LIB_PATH" > expansion.yml | ||
fi | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Nice find with There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Good idea. I have updated to move the |
||
- command: expansions.update | ||
params: | ||
file: src/go.mongodb.org/mongo-driver/expansion.yml | ||
|
||
install-linters: | ||
- command: shell.exec | ||
|
@@ -518,31 +534,14 @@ functions: | |
fi | ||
. ${DRIVERS_TOOLS}/.evergreen/csfle/set-temp-creds.sh | ||
|
||
# If the task doesn't have the SKIP_CRYPT_SHARED_LIB_DOWNLOAD variable set, try to find the | ||
# crypt_shared library downloaded in the "prepare-resources" task and set the CRYPT_SHARED_LIB_PATH | ||
# environment variable with a path to the file. | ||
if [ "${SKIP_CRYPT_SHARED_LIB_DOWNLOAD}" != "true" ]; then | ||
# Find the crypt_shared library file in the current directory and set the CRYPT_SHARED_LIB_PATH to | ||
# the path of that file. Only look for .so, .dll, or .dylib files to prevent matching any other | ||
# downloaded files. | ||
export CRYPT_SHARED_LIB_PATH="$(find $(pwd) -maxdepth 1 -type f \ | ||
-name 'mongo_crypt_v1.so' -o \ | ||
-name 'mongo_crypt_v1.dll' -o \ | ||
-name 'mongo_crypt_v1.dylib')" | ||
|
||
# Expect that we always find a crypt_shared library file and set the CRYPT_SHARED_LIB_PATH | ||
# environment variable. If we didn't, print an error message and exit. | ||
if [ -z "$CRYPT_SHARED_LIB_PATH" ]; then | ||
echo 'SKIP_CRYPT_SHARED_LIB_DOWNLOAD is not "true", but CRYPT_SHARED_LIB_PATH is empty. Exiting.' | ||
exit 1 | ||
fi | ||
|
||
# If we're on Windows, convert the "cygdrive" path to Windows-style paths. | ||
if [ "Windows_NT" = "$OS" ]; then | ||
export CRYPT_SHARED_LIB_PATH=$(cygpath -m $CRYPT_SHARED_LIB_PATH) | ||
fi | ||
|
||
echo "CRYPT_SHARED_LIB_PATH=$CRYPT_SHARED_LIB_PATH" | ||
if [ "${SKIP_CRYPT_SHARED_LIB}" = "true" ]; then | ||
CRYPT_SHARED_LIB_PATH="" | ||
echo "crypt_shared library is skipped" | ||
elif [ -z "${CRYPT_SHARED_LIB_PATH}" ]; then | ||
echo "crypt_shared library path is empty" | ||
else | ||
CRYPT_SHARED_LIB_PATH=${CRYPT_SHARED_LIB_PATH} | ||
echo "crypt_shared library will be loaded from path: $CRYPT_SHARED_LIB_PATH" | ||
fi | ||
|
||
export GOFLAGS=-mod=vendor | ||
|
@@ -564,6 +563,7 @@ functions: | |
GCP_EMAIL="${cse_gcp_email}" \ | ||
GCP_PRIVATE_KEY="${cse_gcp_private_key}" \ | ||
REQUIRE_API_VERSION="${REQUIRE_API_VERSION}" \ | ||
CRYPT_SHARED_LIB_PATH="$CRYPT_SHARED_LIB_PATH" \ | ||
make evg-test-versioned-api \ | ||
PKG_CONFIG_PATH=$PKG_CONFIG_PATH \ | ||
LD_LIBRARY_PATH=$LD_LIBRARY_PATH | ||
|
@@ -1638,9 +1638,9 @@ tasks: | |
TOPOLOGY: "replica_set" | ||
AUTH: "auth" | ||
SSL: "ssl" | ||
# Don't download the crypt_shared library, which should cause all of the tests to fall | ||
# Don't use the crypt_shared library, which should cause all of the tests to fall | ||
# back to using mongocryptd instead of crypt_shared. | ||
SKIP_CRYPT_SHARED_LIB_DOWNLOAD: "true" | ||
SKIP_CRYPT_SHARED_LIB: "true" | ||
|
||
- name: test-replicaset-auth-nossl | ||
tags: ["test", "replicaset", "authssl"] | ||
|
@@ -2038,9 +2038,6 @@ axes: | |
# to prevent attempting to link the client-side encryption (libmongocrypt) binaries when | ||
# running Go tests. | ||
GO_BUILD_TAGS: "" | ||
# There is no crypt_shared library download for Ubuntu 14.04. Skip downloading it and let the | ||
# tests use mongocryptd instead. | ||
SKIP_CRYPT_SHARED_LIB_DOWNLOAD: "true" | ||
|
||
# OSes that require >= 3.2 for SSL | ||
- id: os-ssl-32 | ||
|
@@ -2061,9 +2058,6 @@ axes: | |
variables: | ||
GO_DIST: "/opt/golang/go1.17" | ||
PYTHON3_BINARY: "/opt/python/3.8/bin/python3" | ||
# There is no crypt_shared library download for Ubuntu 16.04. Skip downloading it and let the | ||
# tests use mongocryptd instead. | ||
SKIP_CRYPT_SHARED_LIB_DOWNLOAD: "true" | ||
- id: "osx-go-1-17" | ||
display_name: "MacOS 10.15" | ||
run_on: macos-1015 | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Optional: Add a note about where
$MONGO_CRYPT_SHARED_DOWNLOAD_URL
and$EXTRACT
come from. I had to do some searching to figure out thatget_mongodb_download_url_for
sets those env vars.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good thinking. Done.