-
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
Conversation
@@ -1,4 +1,4 @@ | |||
#!/bin/sh | |||
#!/bin/bash |
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
.evergreen/check-rustdoc.sh
Outdated
# 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. | ||
cargo +nightly build |
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.
these might not all be strictly necessary but I just copied the exact invocations that we run cargo rustdoc
with below for completeness
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.
Might be worth putting these into their own little script?
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.
I didn't end up doing this since we don't use it anywhere else and the number of scripts we have already feels a little out of hand, but per my comment below I did abstract out the "writing out feature combinations to test" part
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 comment
The 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.
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.
LGTM! One minor suggestion.
.evergreen/check-rustdoc.sh
Outdated
# 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. | ||
cargo +nightly build |
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.
Might be worth putting these into their own little script?
@abr-egn @patrickfreed I gave up on figuring out what docs.rs does, but I did add a new script lmk what you think |
I like this approach! LGTM. |
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.
Yeah I agree, the feature combinator script seems like a big improvement. I think it would be nice to use it for our compile tasks too, but it's okay to defer that. For generally reducing the number of scripts we have further, I filed RUST-1330.
Attempts to better simulate the docs.rs build environment in our check-rustdoc test by making the cargo registry directory read-only.
Since the
chmod
makes the cargo registry unusable for future tasks that need to e.g. download different dependencies than the docs one, this also required changing how we install rustup cargo so that it happens in the project directory and is cleaned up at the end of each task, which is the "right" thing to do on Evergreen anyway rather than writing to the shared home directory.Here's a patch showing that check-rustdoc now fails if using the old version of
rustc_version_runtime
that we ran into issues with.I was concerned this change might lead to our tasks taking a lot longer since we are starting from scratch with rustup and cargo each time now, but the difference between my patch on this PR and the latest commit on main in terms of total runtime across all tasks is 293 hours (mine) vs 283 hours (main) so it doesn't seem to make a huge difference.