From dd641090904b81fd643e2bd0bc7060003d541baf Mon Sep 17 00:00:00 2001 From: Oliver Gould Date: Fri, 10 Nov 2023 13:11:43 -0800 Subject: [PATCH 1/2] ci: Turn off debuginfo in ci test builds (#2512) We don't consume debuginfo from CI builds, so we can disable debug symbols in these builds. The coverage test is also fixed to address a linking issue with the version of cargo-tarpaulin we have cached. The coverage workflow has all debuginfo enabled since it's used for coverage generation. --- .github/workflows/check-all.yml | 2 +- .github/workflows/check-each.yml | 2 +- .github/workflows/coverage.yml | 6 +++++- .github/workflows/deps.yml | 2 +- .github/workflows/fuzzers.yml | 2 +- .github/workflows/integration.yml | 2 +- .github/workflows/lint.yml | 2 +- .github/workflows/nightly.yml | 2 +- .github/workflows/release.yml | 1 + .github/workflows/test.yml | 2 +- 10 files changed, 14 insertions(+), 9 deletions(-) diff --git a/.github/workflows/check-all.yml b/.github/workflows/check-all.yml index 8953c6a854..3ab742361b 100644 --- a/.github/workflows/check-all.yml +++ b/.github/workflows/check-all.yml @@ -16,7 +16,7 @@ on: - justfile env: - RUSTFLAGS: "-D warnings -A deprecated" + RUSTFLAGS: "-D warnings -A deprecated -C debuginfo=0" jobs: check-all: diff --git a/.github/workflows/check-each.yml b/.github/workflows/check-each.yml index ddc282bc7a..a98a5465e8 100644 --- a/.github/workflows/check-each.yml +++ b/.github/workflows/check-each.yml @@ -21,7 +21,7 @@ env: CARGO_INCREMENTAL: 0 CARGO_NET_RETRY: 10 RUSTUP_MAX_RETRIES: 10 - RUSTFLAGS: "-D warnings -A deprecated" + RUSTFLAGS: "-D warnings -A deprecated -C debuginfo=0" jobs: list-changed-crates: diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml index 197f789f9b..4c869d253e 100644 --- a/.github/workflows/coverage.yml +++ b/.github/workflows/coverage.yml @@ -14,7 +14,7 @@ on: env: CARGO_INCREMENTAL: 0 CARGO_NET_RETRY: 10 - RUSTFLAGS: "-D warnings -A deprecated" + RUSTFLAGS: "-D warnings -A deprecated -C debuginfo=2" RUSTUP_MAX_RETRIES: 10 jobs: @@ -26,6 +26,9 @@ jobs: image: docker://ghcr.io/linkerd/dev:v42-rust options: --security-opt seccomp=unconfined # 🤷 steps: + # XXX(ver) Workaround for a linking problem in the binary we store in the + # devcontainer. + - run: rm -f /usr/local/bin/cargo-tarpaulin && cargo install cargo-tarpaulin - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # XXX(ver) AFAICT, Tarpaulin doesn't allow us to compose a report over multiple invocations, # so we have to choose between getting coverage from unit tests and integration tests (since @@ -35,4 +38,5 @@ jobs: #- run: cargo tarpaulin --locked --workspace --exclude=linkerd2-proxy --exclude=linkerd-app-integration --skip-clean --ignore-tests --no-fail-fast --out=Xml - run: cargo tarpaulin --locked --packages=linkerd-app-integration --no-default-features --skip-clean --no-run - run: cargo tarpaulin --locked --packages=linkerd-app-integration --no-default-features --skip-clean --ignore-tests --no-fail-fast --out=Xml + continue-on-error: true - uses: codecov/codecov-action@d9f34f8cd5cb3b3eb79b3e4b5dae3a16df499a70 diff --git a/.github/workflows/deps.yml b/.github/workflows/deps.yml index 626729fef2..59421f29a8 100644 --- a/.github/workflows/deps.yml +++ b/.github/workflows/deps.yml @@ -15,7 +15,7 @@ on: env: CARGO_INCREMENTAL: 0 CARGO_NET_RETRY: 10 - RUSTFLAGS: "-D warnings -A deprecated" + RUSTFLAGS: "-D warnings -A deprecated -C debuginfo=0" RUSTUP_MAX_RETRIES: 10 jobs: diff --git a/.github/workflows/fuzzers.yml b/.github/workflows/fuzzers.yml index a2ccbffee1..2b4ab8cd05 100644 --- a/.github/workflows/fuzzers.yml +++ b/.github/workflows/fuzzers.yml @@ -17,7 +17,7 @@ env: CARGO_INCREMENTAL: 0 CARGO_NET_RETRY: 10 RUST_BACKTRACE: short - RUSTFLAGS: "-D warnings -A deprecated" + RUSTFLAGS: "-D warnings -A deprecated -C debuginfo=0" RUSTUP_MAX_RETRIES: 10 permissions: diff --git a/.github/workflows/integration.yml b/.github/workflows/integration.yml index edd85489e0..8c83c3e4dc 100644 --- a/.github/workflows/integration.yml +++ b/.github/workflows/integration.yml @@ -16,7 +16,7 @@ on: env: CARGO_INCREMENTAL: 0 CARGO_NET_RETRY: 10 - RUSTFLAGS: "-D warnings -A deprecated" + RUSTFLAGS: "-D warnings -A deprecated -C debuginfo=0" RUSTUP_MAX_RETRIES: 10 # Run only the app-level tests. These may take longer to compile (usually due to very large stack diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index e5df93e53c..e3d641c3fa 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -15,7 +15,7 @@ env: CARGO_INCREMENTAL: 0 CARGO_NET_RETRY: 10 RUSTUP_MAX_RETRIES: 10 - RUSTFLAGS: "-D warnings -A deprecated" + RUSTFLAGS: "-D warnings -A deprecated -C debuginfo=0" jobs: clippy: diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index 60bfd35bd5..18a09b08cf 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -13,7 +13,7 @@ on: env: CARGO_INCREMENTAL: 0 CARGO_NET_RETRY: 10 - RUSTFLAGS: "-D warnings -A opaque_hidden_inferred_bound" + RUSTFLAGS: "-D warnings -A opaque_hidden_inferred_bound -C debuginfo=0" RUSTUP_MAX_RETRIES: 10 permissions: diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 9ac54d9238..913e63e1cb 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -6,6 +6,7 @@ on: - .github/actions/package/* - .github/workflows/release.yml - justfile + - Cargo.toml # For release build settings push: tags: - "release/*" diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index b6cb3f49bc..0a5b62ebe7 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -16,7 +16,7 @@ on: env: CARGO_INCREMENTAL: 0 CARGO_NET_RETRY: 10 - RUSTFLAGS: "-D warnings -A deprecated" + RUSTFLAGS: "-D warnings -A deprecated -C debuginfo=0" RUSTUP_MAX_RETRIES: 10 jobs: From 005e25c41b70f60e031784a0be086b8c5cef72ab Mon Sep 17 00:00:00 2001 From: Oliver Gould Date: Fri, 10 Nov 2023 14:00:29 -0800 Subject: [PATCH 2/2] ci: Fix fuzzer listing (#2513) The fuzzer tests in CI were broken in CI by a change to the file-listing action. This change fixes CI for fuzzer changes. It does not actually fix the fuzzer suites. --- .github/fuzzers-list.sh | 4 +++- .github/list-crates.sh | 4 ++-- justfile | 12 ++++-------- 3 files changed, 9 insertions(+), 11 deletions(-) diff --git a/.github/fuzzers-list.sh b/.github/fuzzers-list.sh index dbe3d03e5a..480a91aae6 100755 --- a/.github/fuzzers-list.sh +++ b/.github/fuzzers-list.sh @@ -1,11 +1,13 @@ #!/usr/bin/env bash +set -euo pipefail + ## Lists the fuzzers that should be run given a set of changed files. # Find the nearest fuzzer crate, or nothing. find_fuzz_dir() { d=${1%/*} - if [ "$d" = . ]; then + if ! [[ "$d" =~ / ]]; then return elif [ -d "$d" ] && [[ "$d" = */fuzz ]]; then echo "$d" diff --git a/.github/list-crates.sh b/.github/list-crates.sh index be861f00ea..c126c9f686 100755 --- a/.github/list-crates.sh +++ b/.github/list-crates.sh @@ -3,8 +3,8 @@ set -eu if [ $# -eq 0 ]; then - echo "Usage: $0 " - exit 1 + echo '[]' + exit 0 fi # Find the nearest Cargo.toml (except the root). diff --git a/justfile b/justfile index d8568faee2..177055cd23 100644 --- a/justfile +++ b/justfile @@ -159,14 +159,10 @@ fuzzers: echo "fuzzers must be run with nightly" >&2 exit 1 fi - - for dir in $(find . -type d -name fuzz); do - echo "cd $dir && {{ _cargo }} fuzz build" - ( - cd $dir - @{{ _cargo }} fuzz build \ - {{ if profile == "release" { "--release" } else { "" } }} - ) + for dir in $(find ./linkerd -type d -name fuzz); do + echo "cd $dir && cargo +nightly fuzz build" + ( cd $dir ; cargo +nightly fuzz build \ + {{ if profile == "release" { "--release" } else { "" } }} ) done export DOCKER_BUILDX_CACHE_DIR := env_var_or_default('DOCKER_BUILDX_CACHE_DIR', '')