-
Notifications
You must be signed in to change notification settings - Fork 185
RUST-1283 Build docs in read-only directory and install cargo in project directory on Evergreen #656
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
Merged
Merged
RUST-1283 Build docs in read-only directory and install cargo in project directory on Evergreen #656
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
#!/bin/sh | ||
#!/bin/bash | ||
|
||
set -o errexit | ||
|
||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,13 @@ | ||
#!/bin/sh | ||
#!/bin/bash | ||
|
||
set -o errexit | ||
|
||
. ~/.cargo/env | ||
source ./.evergreen/configure-rust.sh | ||
# Pin clippy to the lastest version. This should be updated when new versions of Rust are released. | ||
rustup default 1.59.0 | ||
cargo clippy --all-targets -p mongodb -- -D warnings | ||
# check clippy with compressors separately | ||
cargo clippy --all-targets -p mongodb --features zstd-compression,snappy-compression,zlib-compression -- -D warnings | ||
cargo clippy --all-targets --no-default-features --features async-std-runtime -p mongodb -- -D warnings | ||
cargo clippy --all-targets --no-default-features --features sync -p mongodb -- -D warnings | ||
cargo clippy --all-targets --features tokio-sync -p mongodb -- -D warnings | ||
|
||
source ./.evergreen/feature-combinations.sh | ||
|
||
for ((i = 0; i < ${#FEATURE_COMBINATIONS[@]}; i++)); do | ||
cargo clippy --all-targets ${FEATURE_COMBINATIONS[$i]} -p mongodb -- -D warnings | ||
done |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,27 @@ | ||
#!/bin/sh | ||
#!/bin/bash | ||
|
||
set -o errexit | ||
|
||
. ~/.cargo/env | ||
cargo +nightly rustdoc -- -D warnings --cfg docsrs | ||
cargo +nightly rustdoc --no-default-features --features async-std-runtime -- -D warnings --cfg docsrs | ||
cargo +nightly rustdoc --no-default-features --features sync -- -D warnings --cfg docsrs | ||
cargo +nightly rustdoc --features tokio-sync -- -D warnings --cfg docsrs | ||
source ./.evergreen/configure-rust.sh | ||
|
||
# docs.rs builds the driver on a read-only file system. to create a more realistic environment, we first | ||
# build the driver to ensure we have all the deps already in src, and then limit the permissions on that directory | ||
# and rebuild the docs. | ||
# this is to help us avoid introducing problems like those described here | ||
# https://docs.rs/about/builds#read-only-directories where we or a dependency modify source code during the | ||
# build process. | ||
|
||
source ./.evergreen/feature-combinations.sh | ||
|
||
# build with all available features to ensure all optional dependencies are brought in too. | ||
for ((i = 0; i < ${#FEATURE_COMBINATIONS[@]}; i++)); do | ||
cargo +nightly build ${FEATURE_COMBINATIONS[$i]} | ||
done | ||
cargo clean | ||
|
||
chmod -R 555 ${CARGO_HOME}/registry/src | ||
|
||
for ((i = 0; i < ${#FEATURE_COMBINATIONS[@]}; i++)); do | ||
cargo +nightly rustdoc ${FEATURE_COMBINATIONS[$i]} -- -D warnings --cfg docsrs | ||
done | ||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,8 @@ | ||
#!/bin/sh | ||
#!/bin/bash | ||
|
||
set -o errexit | ||
|
||
. ~/.cargo/env | ||
source ./.evergreen/configure-rust.sh | ||
|
||
rustup run $RUST_VERSION cargo build --no-default-features --features async-std-runtime | ||
rustup run $RUST_VERSION cargo build --no-default-features --features sync |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -252,6 +252,7 @@ functions: | |
- command: shell.exec | ||
type: test | ||
params: | ||
shell: bash | ||
working_dir: "src" | ||
script: | | ||
${PREPARE_SHELL} | ||
|
@@ -265,7 +266,7 @@ functions: | |
|
||
# compile mini test project | ||
cd $PROJECT_DIRECTORY/.evergreen/aws-ecs-test | ||
. ~/.cargo/env | ||
. ${PROJECT_DIRECTORY}/.evergreen/configure-rust.sh | ||
cargo build | ||
cd - | ||
|
||
|
@@ -431,6 +432,7 @@ functions: | |
export MONGO_ATLAS_TLS11_URI_SRV='${MONGO_ATLAS_TLS11_URI_SRV}' | ||
export MONGO_ATLAS_TLS12_URI='${MONGO_ATLAS_TLS12_URI}' | ||
export MONGO_ATLAS_TLS12_URI_SRV='${MONGO_ATLAS_TLS12_URI_SRV}' | ||
export PROJECT_DIRECTORY='${PROJECT_DIRECTORY}' | ||
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. this is needed because configure-rust.sh uses it. for all of the other tasks we run $PREPARE_SHELL which already does this for us. |
||
ASYNC_RUNTIME=${ASYNC_RUNTIME} .evergreen/run-atlas-tests.sh | ||
|
||
"run ocsp test": | ||
|
@@ -617,7 +619,6 @@ functions: | |
params: | ||
script: | | ||
${PREPARE_SHELL} | ||
rm -rf ~/.rustup | ||
rm -rf $DRIVERS_TOOLS || true | ||
|
||
"fix absolute paths": | ||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
#!/bin/bash | ||
|
||
export RUSTUP_HOME="${PROJECT_DIRECTORY}/.rustup" | ||
export PATH="${RUSTUP_HOME}/bin:$PATH" | ||
export CARGO_HOME="${PROJECT_DIRECTORY}/.cargo" | ||
export PATH="${CARGO_HOME}/bin:$PATH" | ||
|
||
if [[ "Windows_NT" == "$OS" ]]; then | ||
# rustup/cargo need the native Windows paths; $PROJECT_DIRECTORY is a cygwin path | ||
export RUSTUP_HOME=$(cygpath ${RUSTUP_HOME} --windows) | ||
export CARGO_HOME=$(cygpath ${CARGO_HOME} --windows) | ||
fi | ||
|
||
. ${CARGO_HOME}/env |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
#!/bin/bash | ||
|
||
# Array of feature combinations that, in total, provides complete coverage of the driver. | ||
# This is useful for linting tasks where we want to get coverage of all features. | ||
# Since some of our features are mutually exclusive we cannot just use --all-features. | ||
export FEATURE_COMBINATIONS=( | ||
'' # default features | ||
'--no-default-features --features async-std-runtime,sync' # features that conflict w/ default features | ||
'--features tokio-sync,zstd-compression,snappy-compression,zlib-compression,openssl-tls,aws-auth' # additive features | ||
) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
#!/bin/sh | ||
#!/bin/bash | ||
|
||
set -o errexit | ||
|
||
. ~/.cargo/env | ||
source ./.evergreen/configure-rust.sh | ||
RUST_BACKTRACE=1 cargo test atlas_connectivity --no-default-features --features async-std-runtime | ||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
#!/bin/sh | ||
#!/bin/bash | ||
|
||
set -o errexit | ||
|
||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,7 +2,7 @@ | |
|
||
set -o errexit | ||
|
||
. ~/.cargo/env | ||
source ./.evergreen/configure-rust.sh | ||
|
||
FEATURES="" | ||
|
||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,8 @@ | ||
#!/bin/sh | ||
#!/bin/bash | ||
|
||
set -o errexit | ||
|
||
. ~/.cargo/env | ||
source ./.evergreen/configure-rust.sh | ||
|
||
FEATURES="" | ||
|
||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
#!/bin/sh | ||
#!/bin/bash | ||
|
||
set -o errexit | ||
|
||
. ~/.cargo/env | ||
source ./.evergreen/configure-rust.sh | ||
RUST_BACKTRACE=1 cargo test atlas_connectivity | ||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
the configure-rust script uses bash-only syntax; I took the opportunity to standardize all of our scripts to use bash (even if they don't call configure-rust.sh) to try to avoid any problems around this in the future