Skip to content

Conversation

@celinval
Copy link
Contributor

@celinval celinval commented Sep 27, 2021

This changes the compilation to use crate type lib instead of binary when
we are running rmc on a single .rs file. This allow us to use
any public function as a verification target.

We have also changed the tests to use pub main so it is exported and it
can be used as the entry point of the proof.

Fix cargo-rmc and the current testcase to support library build.

Description of changes:

1- RMC users will need to ensure their main function is public in order to use them as verification harness. Note that this not affect proof harness with attribute #[no_mangle] since this attribute actually exports the function.
2- Users can now invoke rmc with the --function attribute. They can select any public function as their starting point. Note that the function still has to have the #[no_mangle] attribute.

Resolved issues:

Resolves #169

Testing:

  • How is this change tested?

  • Is this a refactor change?

Checklist

  • Each commit message has a non-empty body, explaining why the change was made
  • Methods or procedures are documented
  • Regression or unit tests are included, or existing tests cover the modified code
  • My PR is restricted to a single feature or bugfix

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

Copy link
Contributor

@tedinski tedinski left a comment

Choose a reason for hiding this comment

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

I was just writing docs about --function.

I'll add the note about #[no_mangle] to what I wrote.

Copy link
Contributor

Choose a reason for hiding this comment

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

Should be two dashes.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good catch... I wonder when this gets run. I should check with @adpaco-aws to make sure we have test coverage in our regression.

Copy link
Contributor

Choose a reason for hiding this comment

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

We have the dashboard set to only run after merges. I think there are concerns right now about prolonging CI times.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Can we create a parallel workflow to do those things?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Anyway, I fixed it and I ran the dashboard script locally. The output is a bit hard to parse, but it seemed to work.

This changes the compilation to use crate type lib instead of binary when
we are running rmc on a single .rs file. This allow us to use
any public function as a verification target.

We have also changed the tests to use pub main so it is exported and it
can be used as the entry point of the proof.

Fix cargo-rmc and the current testcase to support library build.
@celinval celinval merged commit a67e3af into model-checking:main Sep 28, 2021
@celinval celinval deleted the issue-169 branch September 28, 2021 17:02
tedinski pushed a commit to tedinski/rmc that referenced this pull request Apr 26, 2022
…-checking#523)

This changes the compilation to use crate type lib instead of binary when
we are running rmc on a single .rs file. This allow us to use
any public function as a verification target.

We have also changed the tests to use pub main so it is exported and it
can be used as the entry point of the proof.

Fix cargo-rmc and the current testcase to support library build.
tedinski pushed a commit that referenced this pull request Apr 27, 2022
This changes the compilation to use crate type lib instead of binary when
we are running rmc on a single .rs file. This allow us to use
any public function as a verification target.

We have also changed the tests to use pub main so it is exported and it
can be used as the entry point of the proof.

Fix cargo-rmc and the current testcase to support library build.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Allow entry-point for rmc other than main

3 participants