Skip to content

Commit 6eafab7

Browse files
committed
Fix jq error and master not found issue
1 parent 0ebb862 commit 6eafab7

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

scripts/check_rustc.sh

+7-3
Original file line numberDiff line numberDiff line change
@@ -46,12 +46,14 @@ cd "$REPO_DIR"
4646
# Get the commit ID from rustc --version
4747
echo "Retrieving commit ID..."
4848
COMMIT_ID=$(rustc --version | sed -e "s/.*(\(.*\) .*/\1/")
49-
echo "$COMMIT_ID for rustc is"
5049

5150
# Get the full commit ID for shallow clone
52-
curl -H "Connection: close" -o "${TMP_RUST_DIR}/output.json" -s --show-error \
51+
echo "Full commit id for $COMMIT_ID for is:"
52+
curl -o "${TMP_RUST_DIR}/output.json" -s --show-error \
5353
"https://api.github.com/repos/rust-lang/rust/commits?sha=${COMMIT_ID}&per_page=1"
54-
COMMIT_ID=$(jq -r '.[0].sha' "${TMP_RUST_DIR}/output.json")
54+
cat "${TMP_RUST_DIR}/output.json" # Dump the file in case `jq` fails.
55+
COMMIT_ID=$(cat "${TMP_RUST_DIR}/output.json" | jq -r '.[0].sha')
56+
echo "- $COMMIT_ID"
5557

5658
# Clone the rust-lang/rust repository
5759
echo "Cloning rust-lang/rust repository into ${TMP_RUST_DIR}..."
@@ -74,6 +76,8 @@ cp -r "${REPO_DIR}/library" "${TMP_RUST_DIR}"
7476
pushd "${TMP_RUST_DIR}"
7577
./configure --set=llvm.download-ci-llvm=true
7678
export RUSTFLAGS="--check-cfg cfg(kani) --check-cfg cfg(feature,values(any()))"
79+
export RUST_BACKTRACE=1
80+
unset GITHUB_ACTIONS # Bootstrap script requires specific repo layout when run from an action. Disable that.
7781

7882
# Run tidy
7983
if [ "${TIDY_MODE}" == "--bless" ];

0 commit comments

Comments
 (0)