From 10ee2acdd26a7f1298c6f6d6b7af9b469fe29b87 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sat, 4 May 2024 14:41:41 +0200 Subject: Merging upstream version 1.70.0+dfsg2. Signed-off-by: Daniel Baumann --- src/tools/cargo/ci/clean-test-output.sh | 8 ++++++++ src/tools/cargo/ci/dump-environment.sh | 22 ++++++++++++++++++++++ src/tools/cargo/ci/fetch-smoke-test.sh | 27 +++++++++++++++++++++++++++ src/tools/cargo/ci/validate-man.sh | 26 ++++++++++++++++++++++++++ 4 files changed, 83 insertions(+) create mode 100755 src/tools/cargo/ci/clean-test-output.sh create mode 100755 src/tools/cargo/ci/dump-environment.sh create mode 100755 src/tools/cargo/ci/fetch-smoke-test.sh create mode 100755 src/tools/cargo/ci/validate-man.sh (limited to 'src/tools/cargo/ci') diff --git a/src/tools/cargo/ci/clean-test-output.sh b/src/tools/cargo/ci/clean-test-output.sh new file mode 100755 index 000000000..f1f2ec61c --- /dev/null +++ b/src/tools/cargo/ci/clean-test-output.sh @@ -0,0 +1,8 @@ +#!/bin/bash +# This script remove test and benchmark output and displays disk usage. + +set -euo pipefail + +df -h +rm -rf target/tmp +df -h diff --git a/src/tools/cargo/ci/dump-environment.sh b/src/tools/cargo/ci/dump-environment.sh new file mode 100755 index 000000000..b9b7ec56c --- /dev/null +++ b/src/tools/cargo/ci/dump-environment.sh @@ -0,0 +1,22 @@ +#!/bin/bash +# This script dumps information about the build environment to stdout. + +set -euo pipefail +IFS=$'\n\t' + +echo "environment variables:" +printenv | sort +echo + +echo "disk usage:" +df -h +echo + +echo "CPU info:" +if [[ "${OSTYPE}" = "darwin"* ]]; then + system_profiler SPHardwareDataType || true + sysctl hw || true +else + cat /proc/cpuinfo || true + cat /proc/meminfo || true +fi diff --git a/src/tools/cargo/ci/fetch-smoke-test.sh b/src/tools/cargo/ci/fetch-smoke-test.sh new file mode 100755 index 000000000..17993d1fd --- /dev/null +++ b/src/tools/cargo/ci/fetch-smoke-test.sh @@ -0,0 +1,27 @@ +#!/bin/bash +# This script builds with static curl, and verifies that fetching works. + +set -ex + +if [[ -z "$RUNNER_TEMP" ]] +then + echo "RUNNER_TEMP must be set" + exit 1 +fi + +if [ ! -f Cargo.toml ]; then + echo "Must be run from root of project." + exit 1 +fi + + +# Building openssl on Windows is a pain. +if [[ $(rustc -Vv | grep host:) != *windows* ]]; then + FEATURES='vendored-openssl,curl-sys/static-curl,curl-sys/force-system-lib-on-osx' + export LIBZ_SYS_STATIC=1 +fi + +cargo build --features "$FEATURES" +export CARGO_HOME=$RUNNER_TEMP/chome +target/debug/cargo fetch +rm -rf $CARGO_HOME diff --git a/src/tools/cargo/ci/validate-man.sh b/src/tools/cargo/ci/validate-man.sh new file mode 100755 index 000000000..92df49781 --- /dev/null +++ b/src/tools/cargo/ci/validate-man.sh @@ -0,0 +1,26 @@ +#!/bin/bash +# This script validates that there aren't any changes to the man pages. + +set -e + +cd src/doc + +changes=$(git status --porcelain) +if [ -n "$changes" ] +then + echo "git directory must be clean before running this script." + exit 1 +fi + +./build-man.sh + +changes=$(git status --porcelain) +if [ -n "$changes" ] +then + echo "Detected changes in man pages:" + echo "$changes" + echo + echo "Please run './build-man.sh' in the src/doc directory to rebuild the" + echo "man pages, and commit the changes." + exit 1 +fi -- cgit v1.2.3