Skip to content
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

Add --use-local-toolchain to Kani setup #3056

Merged
merged 10 commits into from
Mar 7, 2024

Conversation

jaisnan
Copy link
Contributor

@jaisnan jaisnan commented Mar 4, 2024

Adds --use-local-toolchain to Kani's setup flow, which accepts a local toolchain and then uses that to finish the Kani setup.

Some notes:

  1. Why? This is mainly for installing GPG verified toolchains.
  2. This is missing some cleanup and refactoring work, like ensuring that the user defined toolchain matches the one that Kani was built against etc. Marked as Todo, for later.

Resolves #3058

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 and MIT licenses.

@github-actions github-actions bot added the Z-BenchCI Tag a PR to run benchmark CI label Mar 4, 2024
@jaisnan jaisnan marked this pull request as ready for review March 5, 2024 18:18
@jaisnan jaisnan requested a review from a team as a code owner March 5, 2024 18:18
Copy link
Contributor

@celinval celinval left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. Just have a few smaller improvements.

Question, how did you test this so far?

kani-driver/src/concrete_playback/playback.rs Outdated Show resolved Hide resolved
kani-driver/src/session.rs Outdated Show resolved Hide resolved
src/lib.rs Show resolved Hide resolved
src/setup.rs Show resolved Hide resolved
@jaisnan
Copy link
Contributor Author

jaisnan commented Mar 6, 2024

Looks good. Just have a few smaller improvements.

Question, how did you test this so far?

I have tested it locally so far, but can include a CI test for --use-local-toolchain as well that replicates the setup process.
What I've done locally is the following:

  1. Build Kani using cargo build-dev. This installs the toolchain mentioned in rust-toolchain.toml
  2. Then, delete that nightly toolchain in ~/.rustup/toolchains
  3. Fetch the same toolchain's tarball from the rust lang server
  4. Unzip tarball, install using install script into a specific directory inside kani work directory (though this can be anywhere else as well) using --prefix=/toolchain_path/
  5. setup using `cargo kani setup --use-local-toolchian ./toolchain_path/
  6. Run Kani on a few example crates

So far, this has been a manual process, but I don't see why we can't make it a CI test. Would this process work?

@celinval
Copy link
Contributor

celinval commented Mar 7, 2024

Sure, but please skip step 1 and 2 and maybe download the toolchain into a "random" directory. Also, we had issues with simlink before when the target is in a different partition. Would that be an issue here too?

@jaisnan
Copy link
Contributor Author

jaisnan commented Mar 7, 2024

Sure, but please skip step 1 and 2 and maybe download the toolchain into a "random" directory. Also, we had issues with simlink before when the target is in a different partition. Would that be an issue here too?

I have a test CI run here: https://github.com/jaisnan/kani/actions/runs/8191672753/job/22401403820. I can remove steps 1 and 2 if needed, and the toolchain has been installed in a non "rustup" directory. The tests show that it works as expected.

I do believe there will be the same issue if the target is in a different partition, but i need to double check.

If this looks good enough, I can add this job as a step in our release workflow. (Don't think it should run every PR, added that for testing).

Copy link
Contributor

@celinval celinval left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add a CI job to test the new setup path. It would also be nice to switch to clap derive later.

@jaisnan jaisnan merged commit 45caad4 into model-checking:main Mar 7, 2024
20 checks passed
zhassan-aws added a commit that referenced this pull request Mar 13, 2024
These are the original release notes for the reference:

## What's Changed
* Automatic cargo update to 2024-02-26 by @github-actions in
#3043
* Upgrade rust toolchain to 2024-02-17 by @celinval in
#3040
* Upgrade `windows-targets` crate to version 0.52.4 by @adpaco-aws in
#3049
* Fix `codegen_atomic_binop` for `atomic_ptr` by @qinheping in
#3047
* Upgrade Rust toolchain to `nightly-2024-02-25` by @adpaco-aws in
#3048
* Update s2n-quic submodule by @zhassan-aws in
#3050
* Update s2n-quic submodule weekly through dependabot by @zhassan-aws in
#3053
* Retrieve info for recursion tracker reliably by @feliperodri in
#3045
* Automatic cargo update to 2024-03-04 by @github-actions in
#3055
* Upgrade Rust toolchain to `nightly-2024-03-01` by @adpaco-aws in
#3052
* Add `--use-local-toolchain` to Kani setup by @jaisnan in
#3056
* Replace internal reverse_postorder by a stable one by @celinval in
#3064
* Add option to override `--crate-name` from `kani` by @adpaco-aws in
#3054
* cargo update and fix macos CI by @zhassan-aws in
#3067
* Bump tests/perf/s2n-quic from `d103836` to `1a7faa8` by @dependabot in
#3066
* Upgrade toolchain to 2024-03-11 by @zhassan-aws in
#3071
* Emit `dead` goto-instructions on MIR StatementDead by @karkhaz in
#3063


**Full Changelog**:
kani-0.47.0...kani-0.48.0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Z-BenchCI Tag a PR to run benchmark CI
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add the ability for Kani to use a locally installed toolchain at runtime
2 participants