Skip to content

Commit f469ef7

Browse files
Merge pull request #717 from Mark-Simulacrum/assert-single-build
Assert that we invoke rustc once per statistics run
2 parents be31ac4 + 6a205a4 commit f469ef7

File tree

22 files changed

+83
-85
lines changed

22 files changed

+83
-85
lines changed

.github/workflows/ci.yml

Lines changed: 16 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -34,37 +34,20 @@ jobs:
3434
if: github.ref == 'refs/heads/master' || github.ref == 'refs/heads/deploy'
3535

3636
test_benchmarks:
37+
strategy:
38+
matrix:
39+
BENCH_INCLUDE_EXCLUDE_OPTS: [
40+
"--exclude script-servo,webrender-wrench,style-servo",
41+
"--include webrender-wrench,style-servo",
42+
"--include script-servo",
43+
]
44+
BUILD_KINDS: [
45+
"Check,Doc",
46+
"Debug",
47+
"Opt",
48+
]
3749
name: Test benchmarks
3850
runs-on: ubuntu-latest
39-
steps:
40-
- name: Checkout the source code
41-
uses: actions/checkout@v2
42-
with:
43-
fetch-depth: 1
44-
45-
- name: Install latest beta
46-
uses: actions-rs/toolchain@v1
47-
with:
48-
toolchain: beta
49-
override: true
50-
51-
- name: Configure environment
52-
run: |
53-
sudo apt-get update
54-
sudo apt-get install -y linux-tools-common linux-tools-generic linux-tools-`uname -r`
55-
echo -1 | sudo tee /proc/sys/kernel/perf_event_paranoid
56-
57-
- name: Build collector
58-
run: cargo build -p collector
59-
60-
- name: Check benchmarks
61-
run: sh -x -c "ci/check-benchmarks.sh"
62-
env:
63-
BENCH_INCLUDE_EXCLUDE_OPTS: "--exclude script-servo"
64-
65-
test_script_servo:
66-
name: Test benchmark script-servo
67-
runs-on: ubuntu-latest
6851
steps:
6952
- name: Checkout the source code
7053
uses: actions/checkout@v2
@@ -84,15 +67,17 @@ jobs:
8467
echo -1 | sudo tee /proc/sys/kernel/perf_event_paranoid
8568
8669
- name: Install servo dependencies
87-
run: sudo apt-get install -y llvm-dev clang libx11-dev python2.7 autoconf2.13
70+
run: sudo apt-get install -y llvm-dev clang libx11-dev python2.7 autoconf2.13 libjemalloc-dev
8871

8972
- name: Build collector
9073
run: cargo build -p collector
9174

9275
- name: Check benchmarks
9376
run: sh -x -c "ci/check-benchmarks.sh"
9477
env:
95-
BENCH_INCLUDE_EXCLUDE_OPTS: "--include script-servo"
78+
JEMALLOC_OVERRIDE: /usr/lib/x86_64-linux-gnu/libjemalloc.so
79+
BENCH_INCLUDE_EXCLUDE_OPTS: ${{ matrix.BENCH_INCLUDE_EXCLUDE_OPTS }}
80+
BUILD_KINDS: ${{ matrix.BUILD_KINDS }}
9681
SHELL: "/bin/bash"
9782

9883
test_profiling:

ci/check-benchmarks.sh

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,17 @@ PING_LOOP_PID=$!
77
trap 'kill $PING_LOOP_PID' ERR 1 2 3 6
88

99
# Install a toolchain.
10-
RUST_BACKTRACE=1 RUST_LOG=collector_raw_cargo=trace,collector=debug,rust_sysroot=debug \
10+
RUST_BACKTRACE=1 RUST_LOG=raw_cargo_messages=trace,collector=debug,rust_sysroot=debug \
1111
bindir=`cargo run -p collector --bin collector install_next`
1212

1313
# Do some benchmarking.
14-
RUST_BACKTRACE=1 RUST_LOG=collector_raw_cargo=trace,collector=debug,rust_sysroot=debug \
14+
RUST_BACKTRACE=1 \
15+
RUST_LIB_BACKTRACE=0 \
16+
CARGO_LOG=cargo::core::compiler::fingerprint=info \
17+
RUST_LOG=raw_cargo_messages=trace,collector=debug,rust_sysroot=debug \
1518
cargo run -p collector --bin collector -- \
1619
bench_local $bindir/rustc Test \
17-
--builds Check,Doc \
20+
--builds $BUILD_KINDS \
1821
--cargo $bindir/cargo \
1922
--runs All \
2023
--rustdoc $bindir/rustdoc \

ci/check-profiling.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,11 @@ PING_LOOP_PID=$!
1010
trap 'kill $PING_LOOP_PID' ERR 1 2 3 6
1111

1212
# Install a toolchain.
13-
RUST_BACKTRACE=1 RUST_LOG=collector_raw_cargo=trace,collector=debug,rust_sysroot=debug \
13+
RUST_BACKTRACE=1 RUST_LOG=raw_cargo_messages=trace,collector=debug,rust_sysroot=debug \
1414
bindir=`cargo run -p collector --bin collector install_next`
1515

1616
# Profile with eprintln.
17-
RUST_BACKTRACE=1 RUST_LOG=collector_raw_cargo=trace,collector=debug,rust_sysroot=debug \
17+
RUST_BACKTRACE=1 RUST_LOG=raw_cargo_messages=trace,collector=debug,rust_sysroot=debug \
1818
cargo run -p collector --bin collector -- \
1919
profile_local eprintln $bindir/rustc Test \
2020
--cargo $bindir/cargo \
@@ -29,7 +29,7 @@ test -f results/eprintln-Test-helloworld-Opt-Full
2929
test ! -e results/eprintln-Test-helloworld-Doc-Full
3030

3131
# Profile with llvm-lines.
32-
RUST_BACKTRACE=1 RUST_LOG=collector_raw_cargo=trace,collector=debug,rust_sysroot=debug \
32+
RUST_BACKTRACE=1 RUST_LOG=raw_cargo_messages=trace,collector=debug,rust_sysroot=debug \
3333
cargo run -p collector --bin collector -- \
3434
profile_local llvm-lines $bindir/rustc Test \
3535
--builds Debug \
Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
{
22
"cargo_opts": "--lib",
3-
"runs": 1
3+
"runs": 1,
4+
"touch_file": "src/cargo/lib.rs"
45
}
Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
{
2-
"supports_stable": true
2+
"supports_stable": true,
3+
"touch_file": "src/lib.rs"
34
}
Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
{
2-
"supports_stable": true
2+
"supports_stable": true,
3+
"touch_file": "src/lib.rs"
34
}
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"touch_file": "src/lib.rs"
3+
}
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"touch_file": "src/lib.rs"
3+
}
Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
{
2-
"supports_stable": true
2+
"supports_stable": true,
3+
"touch_file": "src/lib.rs"
34
}
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"touch_file": "src/main.rs"
3+
}

0 commit comments

Comments
 (0)