-
Notifications
You must be signed in to change notification settings - Fork 69
Support Verus verification #759
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
19 commits
Select commit
Hold shift + click to select a range
797529f
Support for Verus verification
jaylorch e84cd6a
Make vstd optional
jaylorch 6f5f10a
Use verus feature in verus workflow
jaylorch 1e7f6ce
Always enable vstd, sometimes without std
jaylorch 5f198a1
Fix dependency audit failures
jaylorch e35eba4
Revert unsafe code change
jaylorch 3881f4f
Fix Verus path issue in workflow
jaylorch ca53954
Have Verus workflow install correct toolchain
jaylorch 9fdda9f
Use specific Verus version, add cargo-verus to PATH
jaylorch c5205a6
Set restrictive permissions for verus.yml
jaylorch 6c20d72
Use vstd only with --features verus
jaylorch 6b18eba
Use absolute paths in verus.yml
jaylorch 62070af
Fix wrong comment about vstd enablement
jaylorch 8c3b5e8
Fix dependency audit issues
jaylorch 6cbf356
Restore unnecessarily removed comment
jaylorch 1d8897f
Use verus feature for conditional compilation
jaylorch e75c01c
Rebase onto main
jaylorch 6df8844
Update Verus release version
jaylorch 0b59fb4
Make memory-leak test robust to GC
jaylorch File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or 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,12 @@ | ||
| ;;; Directory Local Variables -*- no-byte-compile: t; -*- | ||
| ;;; For more information see (info "(emacs) Directory Variables") | ||
|
|
||
| ;; Regorus is a cargo-verus project (package.metadata.verus.verify = true), so | ||
| ;; verus-mode.el runs `cargo verus verify' rather than the raw `verus' binary. | ||
| ;; The cargo-verus path ignores `package.metadata.verus.ide.extra_args' and | ||
| ;; instead reads `verus-cargo-verus-arguments'. We set it here so that Verus is | ||
| ;; invoked with the `verus' Cargo feature enabled. | ||
| ;; | ||
| ;; Everything before `--' is passed to cargo-verus; everything after `--' is | ||
| ;; forwarded to the Verus binary. The `--' is required by verus-mode.el. | ||
| ((verus-mode . ((verus-cargo-verus-arguments . ("--features" "verus" "--"))))) |
This file contains hidden or 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,80 @@ | ||
| # Copyright (c) Microsoft Corporation. All rights reserved. | ||
| # | ||
| name: verus | ||
|
|
||
| on: | ||
| push: | ||
| branches: [ "main" ] | ||
| pull_request: | ||
| branches: [ "main" ] | ||
|
|
||
| env: | ||
| CARGO_TERM_COLOR: always | ||
|
|
||
| # This workflow only checks out code, downloads a pinned Verus release asset, | ||
| # and runs verification. It never writes to the repository, so restrict the | ||
| # GITHUB_TOKEN to read-only access to repository contents. | ||
| permissions: | ||
| contents: read | ||
|
|
||
| jobs: | ||
| verify: | ||
| runs-on: ubuntu-latest | ||
|
|
||
| steps: | ||
| - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | ||
| - name: Setup Rust toolchain | ||
| uses: ./.github/actions/toolchains/rust | ||
| with: | ||
| components: "" | ||
| - name: Cache cargo | ||
| uses: Swatinem/rust-cache@c19371144df3bb44fab255c43d04cbc2ab54d1c4 # v2.9.1 | ||
| with: | ||
| shared-key: ${{ runner.os }}-regorus-verus | ||
| - name: Install Verus and run verification | ||
| shell: bash | ||
| run: | | ||
| set -euxo pipefail | ||
| asset_url=https://github.com/verus-lang/verus/releases/download/release%2F0.2026.07.12.0b42f4c/verus-0.2026.07.12.0b42f4c-x86-linux.zip | ||
| asset_sha256=f6f4f5d08e07d3e1ad721d775bda5ba96b9dd0c73b48fc17f2e071866fbd01c0 | ||
| test -n "$asset_url" | ||
| curl -fsSL "$asset_url" -o verus.zip | ||
|
|
||
| # Verify the download integrity before trusting/executing its contents. | ||
| echo "${asset_sha256} verus.zip" | sha256sum --check --strict | ||
|
|
||
| unzip -q verus.zip -d verus-dist | ||
|
|
||
| # Search under an absolute path so that `find` yields absolute paths; | ||
| # this keeps the PATH entries below valid regardless of the working | ||
| # directory. | ||
| verus_bin="$(find "$PWD/verus-dist" -type f -name verus -perm -u+x | head -n1)" | ||
| cargo_verus_bin="$(find "$PWD/verus-dist" -type f -name cargo-verus -perm -u+x | head -n1)" | ||
| version_json="$(find "$PWD/verus-dist" -type f -name version.json | head -n1)" | ||
| test -n "$verus_bin" | ||
| test -n "$cargo_verus_bin" | ||
| test -n "$version_json" | ||
|
|
||
| # Verus is built against a specific Rust toolchain and refuses to run | ||
| # against any other version. Read the required toolchain from the | ||
| # release metadata so we track it automatically instead of hardcoding. | ||
| required_toolchain="$(sed -n 's/.*"toolchain"[[:space:]]*:[[:space:]]*"\([^"]*\)".*/\1/p' "$version_json")" | ||
| test -n "$required_toolchain" | ||
| echo "Verus requires Rust toolchain: $required_toolchain" | ||
|
|
||
| # Install the exact toolchain Verus expects, including the extra | ||
| # components (rustc-dev, llvm-tools) that Verus links against and that | ||
| # are not part of the default rustup profile. | ||
| rustup toolchain install "$required_toolchain" \ | ||
| --profile minimal \ | ||
| --component rustc-dev --component llvm-tools --component rustfmt | ||
|
|
||
| # Force cargo/rustc to resolve to the Verus toolchain for the commands | ||
| # below, overriding any repository/directory toolchain override. | ||
| export RUSTUP_TOOLCHAIN="$required_toolchain" | ||
|
|
||
| # Put cargo-verus on PATH for the commands below. | ||
| export PATH="$(dirname "$cargo_verus_bin"):$(dirname "$verus_bin"):$PATH" | ||
| cargo verus --help | ||
| cargo fetch --locked | ||
| cargo verus verify --locked --features verus |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains hidden or 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 hidden or 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
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.