Skip to content

Commit 1022251

Browse files
authored
RUST-1951 Use a workspace for the driver repo (#1528)
1 parent ea6c048 commit 1022251

File tree

332 files changed

+563
-321
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

332 files changed

+563
-321
lines changed

.evergreen/build-static-test-tarball.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ cp ${TEST_FILES}/* test_files
1010

1111
export RUSTFLAGS="-C target-feature=+crt-static"
1212
cargo test ${BUILD_FEATURES} --target x86_64-unknown-linux-gnu get_exe_name
13-
TEST_BINARY=$(cat exe_name.txt)
13+
TEST_BINARY=$(cat driver/exe_name.txt)
1414
TEST_TARBALL="/tmp/mongo-rust-driver.tar.gz"
1515
tar czvf ${TEST_TARBALL} ${TEST_BINARY} ./.evergreen test_files
1616

.evergreen/check-rustdoc.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,11 @@ source ./.evergreen/env.sh
1212
# build process.
1313

1414
# build with all available features to ensure all optional dependencies are brought in too.
15-
cargo +nightly build --all-features
15+
cargo +nightly build --package mongodb --all-features
1616
cargo clean
1717

1818
chmod -R 555 ${CARGO_HOME}/registry/src
1919

2020
# this invocation mirrors the way docs.rs builds our documentation (see the [package.metadata.docs.rs] section
2121
# in Cargo.toml).
22-
cargo +nightly rustdoc --all-features -- -D warnings --cfg docsrs
22+
cargo +nightly rustdoc --package mongodb --all-features -- -D warnings --cfg docsrs

.evergreen/check-rustfmt.sh

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,4 @@
33
set -o errexit
44

55
source ./.evergreen/env.sh
6-
rustfmt +nightly --unstable-features --check src/**/*.rs
7-
rustfmt +nightly --unstable-features --check src/*.rs
6+
cargo +nightly fmt --check -- --unstable-features

.evergreen/compile-only.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ if [ "$RUST_VERSION" != "" ]; then
1212

1313
# The MSRV resolver does not properly select an MSRV-compliant version
1414
# for this transient dependency.
15-
cargo add aws-sdk-sts@1.73
15+
cargo add --package mongodb aws-sdk-sts@1.73
1616

1717
CARGO_RESOLVER_INCOMPATIBLE_RUST_VERSIONS=fallback cargo +nightly -Zmsrv-policy generate-lockfile
1818
fi
@@ -21,7 +21,7 @@ fi
2121
cargo $TOOLCHAIN build
2222

2323
# Test with all features.
24-
cargo $TOOLCHAIN build --all-features
24+
cargo $TOOLCHAIN build --package mongodb --all-features
2525

2626
# Test with no default features.
27-
cargo $TOOLCHAIN build --no-default-features --features compat-3-3-0,bson-3,rustls-tls
27+
cargo $TOOLCHAIN build --package mongodb --no-default-features --features compat-3-3-0,bson-3,rustls-tls

.evergreen/release-danger-do-not-run-manually.sh

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -26,13 +26,9 @@ if [[ "${DRY_RUN}" == "yes" ]]; then
2626
fi
2727

2828
if [[ "${PACKAGE_ONLY}" == "yes" ]]; then
29-
pushd macros
30-
cargo package --no-verify --allow-dirty
31-
popd
32-
cargo package --no-verify --allow-dirty
29+
cargo package --package mongodb-internal-macros --no-verify --allow-dirty
30+
cargo package --package mongodb --no-verify --allow-dirty
3331
else
34-
pushd macros
35-
cargo publish ${EXTRA}
36-
popd
37-
cargo publish ${EXTRA}
32+
cargo publish --package mongodb-internal-macros ${EXTRA}
33+
cargo publish --package mongodb ${EXTRA}
3834
fi

.evergreen/release-sign.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,4 +22,4 @@ docker run \
2222
-v $(pwd):$(pwd) \
2323
-w $(pwd) \
2424
901841024863.dkr.ecr.us-east-1.amazonaws.com/release-infrastructure/garasign-gpg \
25-
/bin/bash -c "gpgloader && gpg --yes -v --armor -o mongodb-internal-macros-${CRATE_VERSION}.sig --detach-sign macros/target/package/mongodb-internal-macros-${CRATE_VERSION}.crate"
25+
/bin/bash -c "gpgloader && gpg --yes -v --armor -o mongodb-internal-macros-${CRATE_VERSION}.sig --detach-sign target/package/mongodb-internal-macros-${CRATE_VERSION}.crate"

.evergreen/run-gssapi-tests.sh

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ set +o errexit
2121
# is similar to but distinct from (KRB5) GSSAPI. Therefore, we only
2222
# run the following steps if we are not on Windows.
2323
if [[ "cygwin" != "$OSTYPE" ]]; then
24+
pushd driver
2425
# Create a krb5 config file with relevant
2526
touch krb5.conf
2627
echo "[realms]
@@ -45,13 +46,15 @@ if [[ "cygwin" != "$OSTYPE" ]]; then
4546
echo "Authenticating $PRINCIPAL"
4647
echo "$SASL_PASS" | kinit -p $PRINCIPAL
4748
klist
49+
popd
4850
fi
4951

5052
# Run end-to-end auth tests for "$PRINCIPAL" user
5153
TEST_OPTIONS+=("--skip with_service_realm_and_host_options")
5254
cargo_test test::auth::gssapi_skip_local
5355

5456
if [[ "cygwin" != "$OSTYPE" ]]; then
57+
pushd driver
5558
# Unauthenticate
5659
echo "Unauthenticating $PRINCIPAL"
5760
kdestroy
@@ -60,15 +63,18 @@ if [[ "cygwin" != "$OSTYPE" ]]; then
6063
echo "Authenticating $PRINCIPAL_CROSS"
6164
echo "$SASL_PASS_CROSS" | kinit -p $PRINCIPAL_CROSS
6265
klist
66+
popd
6367
fi
6468

6569
TEST_OPTIONS=()
6670
cargo_test test::auth::gssapi_skip_local::with_service_realm_and_host_options
6771

6872
if [[ "cygwin" != "$OSTYPE" ]]; then
73+
pushd driver
6974
# Unauthenticate
7075
echo "Unauthenticating $PRINCIPAL_CROSS"
7176
kdestroy
77+
popd
7278
fi
7379

7480
# Run remaining tests

.semgrepignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
benchmarks/
2-
src/test/
2+
driver/src/test/
33
etc/

0 commit comments

Comments
 (0)