Skip to content

Commit

Permalink
[buildomat] Capture per-crate build timing as build-timings.json (#4960)
Browse files Browse the repository at this point in the history
Part of #4471

Captures the per-crate build timing information in a JSON file
  • Loading branch information
smklein authored Feb 2, 2024
1 parent 0619af9 commit 62b2f0b
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 5 deletions.
23 changes: 18 additions & 5 deletions .github/buildomat/build-and-test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,13 @@ curl -sSfL --retry 10 https://get.nexte.st/"$NEXTEST_VERSION"/"$1" | gunzip | ta
# we can check later whether we left detritus around.
#
TEST_TMPDIR='/var/tmp/omicron_tmp'
echo "tests will store output in $TEST_TMPDIR" >&2
echo "tests will store ephemeral output in $TEST_TMPDIR" >&2
mkdir "$TEST_TMPDIR"

OUTPUT_DIR='/work'
echo "tests will store non-ephemeral output in $OUTPUT_DIR" >&2
mkdir -p "$OUTPUT_DIR"

#
# Set up our PATH for the test suite.
#
Expand Down Expand Up @@ -50,18 +54,27 @@ ptime -m bash ./tools/install_builder_prerequisites.sh -y
#
banner build
export RUSTFLAGS="-D warnings"
export RUSTDOCFLAGS="-D warnings"
# When running on illumos we need to pass an additional runpath that is
# usually configured via ".cargo/config" but the `RUSTFLAGS` env variable
# takes precedence. This path contains oxide specific libraries such as
# libipcc.
if [[ $target_os == "illumos" ]]; then
RUSTFLAGS="-D warnings -C link-arg=-R/usr/platform/oxide/lib/amd64"
RUSTFLAGS="$RUSTFLAGS -C link-arg=-R/usr/platform/oxide/lib/amd64"
fi
export RUSTDOCFLAGS="-D warnings"
export TMPDIR=$TEST_TMPDIR
export TMPDIR="$TEST_TMPDIR"
export RUST_BACKTRACE=1
# We're building once, so there's no need to incur the overhead of an incremental build.
export CARGO_INCREMENTAL=0
ptime -m cargo test --locked --verbose --no-run
# This allows us to build with unstable options, which gives us access to some
# timing information.
#
# If we remove "--timings=json" below, this would no longer be needed.
export RUSTC_BOOTSTRAP=1

# Build all the packages and tests, and keep track of how long each took to build.
# We report build progress to stderr, and the "--timings=json" output goes to stdout.
ptime -m cargo build -Z unstable-options --timings=json --workspace --tests --locked --verbose 1> "$OUTPUT_DIR/crate-build-timings.json"

#
# We apply our own timeout to ensure that we get a normal failure on timeout
Expand Down
1 change: 1 addition & 0 deletions .github/buildomat/jobs/build-and-test-helios.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
#: target = "helios-2.0"
#: rust_toolchain = "1.72.1"
#: output_rules = [
#: "%/work/*",
#: "%/var/tmp/omicron_tmp/*",
#: "!/var/tmp/omicron_tmp/crdb-base*",
#: "!/var/tmp/omicron_tmp/rustc*",
Expand Down
1 change: 1 addition & 0 deletions .github/buildomat/jobs/build-and-test-linux.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
#: target = "ubuntu-22.04"
#: rust_toolchain = "1.72.1"
#: output_rules = [
#: "%/work/*",
#: "%/var/tmp/omicron_tmp/*",
#: "!/var/tmp/omicron_tmp/crdb-base*",
#: "!/var/tmp/omicron_tmp/rustc*",
Expand Down

0 comments on commit 62b2f0b

Please sign in to comment.