Skip to content

Commit

Permalink
Try to fix master not found issue
Browse files Browse the repository at this point in the history
  • Loading branch information
celinval committed Jan 3, 2025
1 parent a8e0e41 commit 2f01b79
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions scripts/check_rustc.sh
Original file line number Diff line number Diff line change
Expand Up @@ -46,19 +46,20 @@ cd "$REPO_DIR"
# Get the commit ID from rustc --version
echo "Retrieving commit ID..."
COMMIT_ID=$(rustc --version | sed -e "s/.*(\(.*\) .*/\1/")
echo "$COMMIT_ID for rustc is"

# Get the full commit ID for shallow clone
echo "Full commit id for $COMMIT_ID for is:"
curl -H "Connection: close" -o "${TMP_RUST_DIR}/output.json" -s --show-error \
"https://api.github.com/repos/rust-lang/rust/commits?sha=${COMMIT_ID}&per_page=1"

COMMIT_ID=$(cat "${TMP_RUST_DIR}/output.json" | jq -r '.[0].sha')
echo "- $COMMIT_ID"

# Clone the rust-lang/rust repository
echo "Cloning rust-lang/rust repository into ${TMP_RUST_DIR}..."
pushd "$TMP_RUST_DIR" > /dev/null
git init
git remote add origin https://github.com/rust-lang/rust.git
git fetch --depth 1 origin master # Bootstrap may look for origin/master branch
git fetch --depth 1 origin $COMMIT_ID

echo "Checking out commit $COMMIT_ID..."
Expand All @@ -75,6 +76,7 @@ cp -r "${REPO_DIR}/library" "${TMP_RUST_DIR}"
pushd "${TMP_RUST_DIR}"
./configure --set=llvm.download-ci-llvm=true
export RUSTFLAGS="--check-cfg cfg(kani) --check-cfg cfg(feature,values(any()))"
export RUST_BACKTRACE=1

# Run tidy
if [ "${TIDY_MODE}" == "--bless" ];
Expand Down

0 comments on commit 2f01b79

Please sign in to comment.