forked from model-checking/verify-rust-std
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'origin/main' into align-harness
- Loading branch information
Showing
7 changed files
with
347 additions
and
59 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
#!/bin/bash | ||
|
||
set -e | ||
|
||
# Set the working directories | ||
VERIFY_RUST_STD_DIR="$1" | ||
KANI_DIR=$(mktemp -d) | ||
|
||
RUNNER_TEMP=$(mktemp -d) | ||
|
||
# Get the OS name | ||
os_name=$(uname -s) | ||
|
||
# Checkout your local repository | ||
echo "Checking out local repository..." | ||
echo | ||
cd "$VERIFY_RUST_STD_DIR" | ||
|
||
# Checkout the Kani repository | ||
echo "Checking out Kani repository..." | ||
echo | ||
git clone --depth 1 -b features/verify-rust-std https://github.com/model-checking/kani.git "$KANI_DIR" | ||
|
||
# Check the OS and | ||
# Setup dependencies for Kani | ||
echo "Setting up dependencies for Kani..." | ||
echo | ||
cd "$KANI_DIR" | ||
if [ "$os_name" == "Linux" ]; then | ||
./scripts/setup/ubuntu/install_deps.sh | ||
elif [ "$os_name" == "Darwin" ]; then | ||
./scripts/setup/macos/install_deps.sh | ||
else | ||
echo "Unknown operating system" | ||
fi | ||
|
||
# Build Kani | ||
echo "Building Kani..." | ||
echo | ||
cargo build-dev --release | ||
# echo "$(pwd)/scripts" >> $PATH | ||
|
||
# Run tests | ||
echo "Running tests..." | ||
echo | ||
cd "$VERIFY_RUST_STD_DIR" | ||
$KANI_DIR/scripts/kani verify-std -Z unstable-options $VERIFY_RUST_STD_DIR/library --target-dir "$RUNNER_TEMP" -Z function-contracts -Z mem-predicates -Z ptr-to-ref-cast-checks | ||
|
||
echo "Tests completed." | ||
echo | ||
|
||
# Clean up the Kani directory (optional) | ||
rm -rf "$KANI_DIR" | ||
rm -rf "$RUNNER_TEMP" | ||
# rm -rf "$VERIFY_RUST_STD_DIR" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
#!/bin/bash | ||
|
||
set -e | ||
|
||
# Set the working directory for your local repository | ||
HEAD_DIR=$1 | ||
|
||
# Temporary directory for upstream repository | ||
TEMP_DIR=$(mktemp -d) | ||
|
||
# Checkout your local repository | ||
echo "Checking out local repository..." | ||
cd "$HEAD_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" | ||
|
||
# Clone the rust-lang/rust repository | ||
echo "Cloning rust-lang/rust repository..." | ||
git clone https://github.com/rust-lang/rust.git "$TEMP_DIR/upstream" | ||
|
||
# Checkout the specific commit | ||
echo "Checking out commit $COMMIT_ID..." | ||
cd "$TEMP_DIR/upstream" | ||
git checkout "$COMMIT_ID" | ||
|
||
# Copy your library to the upstream directory | ||
echo "Copying library to upstream directory..." | ||
rm -rf "$TEMP_DIR/upstream/library" | ||
cp -r "$HEAD_DIR/library" "$TEMP_DIR/upstream" | ||
|
||
# Run the tests | ||
cd "$TEMP_DIR/upstream" | ||
export RUSTFLAGS="--check-cfg cfg(kani) --check-cfg cfg(feature,values(any()))" | ||
echo "Running tests..." | ||
./configure --set=llvm.download-ci-llvm=true | ||
./x test --stage 0 library/std | ||
|
||
echo "Tests completed." | ||
|
||
# Clean up the temporary directory | ||
rm -rf "$TEMP_DIR" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
#!/bin/bash | ||
|
||
set -eux | ||
|
||
cd $1 | ||
|
||
TOOLCHAIN_DATE=$2 | ||
COMMIT_HASH=$3 | ||
|
||
# The checkout and pull itself needs to happen in sync with features/verify-rust-std | ||
# Often times rust is going to be ahead of kani in terms of the toolchain, and both need to point to | ||
# the same commit | ||
SYNC_BRANCH="sync-$TOOLCHAIN_DATE" && echo "--- Fork branch: ${SYNC_BRANCH} ---" | ||
# # 1. Update the upstream/master branch with the latest changes | ||
git fetch upstream | ||
git checkout $COMMIT_HASH | ||
|
||
# # 2. Update the subtree branch | ||
git subtree split --prefix=library --onto subtree/library -b subtree/library | ||
# 3. Update main | ||
git fetch origin | ||
git checkout -b ${SYNC_BRANCH} origin/main | ||
git subtree merge --prefix=library subtree/library --squash | ||
|
||
# TODO: Update origin/subtree/library as well after the process by pushing to it |
Oops, something went wrong.