Skip to content

Commit 25e9289

Browse files
committed
fix(release): run cargo check more reliably
Signed-off-by: Pablo Barbáchano <[email protected]> (cherry picked from commit 4d12563)
1 parent cfebc55 commit 25e9289

File tree

2 files changed

+11
-11
lines changed

2 files changed

+11
-11
lines changed

tools/release-prepare.sh

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
# SPDX-License-Identifier: Apache-2.0
55

66
set -eu -o pipefail
7+
shopt -s lastpipe
78

89
FC_TOOLS_DIR=$(dirname $(realpath $0))
910
source "$FC_TOOLS_DIR/functions"
@@ -66,16 +67,15 @@ for file in "${files_to_change[@]}"; do
6667
sed -i "s/$prev_ver/$version/" "$file"
6768
done
6869

69-
# Run `cargo check` to update firecracker and jailer versions in
70+
CHANGED=()
71+
# Run `cargo check` to update firecracker and jailer versions in all
7072
# `Cargo.lock`.
71-
say "Updating lockfile..."
72-
cargo check
73-
CHANGED=(Cargo.lock)
74-
75-
cd tests/integration_tests/security/demo_seccomp
76-
cargo check
77-
cd -
78-
CHANGED+=(tests/integration_tests/security/demo_seccomp/Cargo.lock)
73+
# NOTE: This will break if it finds paths with spaces in them
74+
find . -path ./build -prune -o -name Cargo.lock -print |while read -r cargo_lock; do
75+
say "Updating $cargo_lock ..."
76+
(cd "$(dirname "$cargo_lock")"; cargo check)
77+
CHANGED+=("$cargo_lock")
78+
done
7979

8080
# Update credits.
8181
say "Updating credits..."

tools/release.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,10 +90,10 @@ PROFILE_DIR=$(get-profile-dir "$PROFILE")
9090
CARGO_TARGET=$ARCH-unknown-linux-$LIBC
9191
CARGO_TARGET_DIR=build/cargo_target/$CARGO_TARGET/$PROFILE_DIR
9292

93-
if [[ $VERSION =~ "-dirty$" ]]; then
93+
if [[ $VERSION = *-dirty ]]; then
9494
say_warn "Building dirty version.. dirty because:"
9595
git status -s --untracked-files=no
96-
git diff
96+
git --no-pager diff
9797
fi
9898

9999
CARGO_REGISTRY_DIR="build/cargo_registry"

0 commit comments

Comments
 (0)