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

Build custom sysroot #1605

Closed
celinval opened this issue Aug 29, 2022 · 1 comment · Fixed by #1717
Closed

Build custom sysroot #1605

celinval opened this issue Aug 29, 2022 · 1 comment · Fixed by #1717
Assignees

Comments

@celinval
Copy link
Contributor

Kani currently uses rustup sysroot to gather information from the standard library constructs. The artifacts from this sysroot do not include the MIR for items that have already been compiled to the std shared library. We also use a similar method to build kani's custom libraries.

This leaves a gap that cannot be filled by the kani-compiler; thus, we are unable to translate these items into goto-program.

In order to fulfill this gap, we must build a sysroot from scratch. For more details, see #1600

@celinval
Copy link
Contributor Author

I am planning the following changes to the build system in order to accomplish this:

  1. Change make_release_bundle to be a building tool that can also make a bundle.
  2. The new builder tool would take 2 subcommand (dev or release).
  3. For release, it will keep the current behavior + we will include the new sysroot.
  4. For dev, it will build Kani and the sysroot with the options the developer provides. I was thinking about using --out-dir to create the following layout under target/:
target /
├── kani/
│     ├── lib/
│     └── bin/
├── debug/
├── release/

The kani and cargo-kani under script would just call this location instead of the wildcard that fails if there is a debug and a release build. Basically target/kani will have whatever you build last. Note that the build artifacts will still be kept under target/debug and target/release allowing us to switch which one to use it without completely rebuilding it.

  1. Create the following cargo aliases to call the builder tool to build kani:
cargo build-dev
cargo bundle

celinval added a commit that referenced this issue Sep 27, 2022
* Build sysroot and repurpose make-kani-release

This change builds a custom sysroot for Kani. This new sysroot will contain a "lib/" folder with Kani libraries as well as the standard libraries compiled with --always-encode-mir. This enable us to fully traverse the std MIR and fix the missing functions errors.

Other changes to the build were described in the issue here: #1605 (comment)

* Add pre-compiled libraries to the bundle.

The size of the bundle did increase quite a bit on my linux machine. It went from 24MB to 67MB.

This is still pretty far from GitHub's max size of 2GB:
https://docs.github.com/en/repositories/releasing-projects-on-github/about-releases#storage-and-bandwidth-quotas
@celinval celinval moved this to Done in Kani 0.12 Sep 30, 2022
@celinval celinval self-assigned this Sep 30, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
No open projects
Status: Done
Development

Successfully merging a pull request may close this issue.

1 participant