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 CLI option to specify entrypoint #220

Merged
merged 5 commits into from
Aug 17, 2022

Conversation

Bernardstanislas
Copy link
Contributor

Configurable entrypoint

Description

As described in #180, it might be useful to be able to run another function than the main function as an entrypoint.

Checklist

  • Linked to Github Issue
  • Unit tests added
  • Integration tests added.

@Bernardstanislas Bernardstanislas force-pushed the customize-entrypoint branch 2 times, most recently from a7f8471 to 54a1e80 Compare July 1, 2022 12:13
@Juan-M-V
Copy link
Contributor

Juan-M-V commented Jul 1, 2022

Thank you for taking the time implementing a new feature. The team and I will review the RP

src/main.rs Show resolved Hide resolved
let program_json: ProgramJson = deserialize_program_json(path)?;

let main_pc = match program_json
Copy link
Member

Choose a reason for hiding this comment

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

For consistency this could be named entrypoint_pc.

Copy link
Member

@unbalancedparentheses unbalancedparentheses Jul 1, 2022

Choose a reason for hiding this comment

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

+1

@Oppen
Copy link
Member

Oppen commented Jul 1, 2022

Hi @Bernardstanislas. Thanks for sending this feature. I'd suggest you add a test that proves the right entrypoint is called. It could simply be copy-pasting some of the examples with a renamed main function instead, or replacing in the JSON before use in memory.

@Bernardstanislas
Copy link
Contributor Author

Hi @Bernardstanislas. Thanks for sending this feature. I'd suggest you add a test that proves the right entrypoint is called. It could simply be copy-pasting some of the examples with a renamed main function instead, or replacing in the JSON before use in memory.

For sure, I'm a bit busy these days but I'm not forgetting this PR :)

@Oppen
Copy link
Member

Oppen commented Jul 12, 2022

For sure, I'm a bit busy these days but I'm not forgetting this PR :)

I've got a bit of time for this, would you like it if I made a PR against your branch with a test?

@Oppen
Copy link
Member

Oppen commented Jul 13, 2022

Hi @Bernardstanislas, I just sent you a PR against your branch with proposed changes.

@Bernardstanislas
Copy link
Contributor Author

Hi @Bernardstanislas, I just sent you a PR against your branch with proposed changes.

Thanks a lot, just merged your PR

@Oppen
Copy link
Member

Oppen commented Jul 13, 2022

Hmmm, it looks like I didn't include the test in the PR for some reason 🤦
It's nearly end of day for me, is it OK for you if I send a new one tomorrow?

@Oppen
Copy link
Member

Oppen commented Jul 25, 2022

Hi @Bernardstanislas. Did you find the time to look into the new PR I sent you? Sorry for not mentioning it here, I assumed you'd get notified by GitHub. Then I remembered those tend to be rather easy to miss (it happens to me a lot).

@Bernardstanislas
Copy link
Contributor Author

Hi @Bernardstanislas. Did you find the time to look into the new PR I sent you? Sorry for not mentioning it here, I assumed you'd get notified by GitHub. Then I remembered those tend to be rather easy to miss (it happens to me a lot).

Wow I'm really sorry @Oppen I did actually miss it. So if I understand correctly, you need to include the tests and we're good to go?

@Oppen
Copy link
Member

Oppen commented Jul 25, 2022

Wow I'm really sorry @Oppen I did actually miss it. So if I understand correctly, you need to include the tests and we're good to go?

Yes, it's included in the PR. I'm not sure if any new merge conflicts were introduced in the meantime tho, but I expect not.

@Bernardstanislas
Copy link
Contributor Author

@Oppen I am mot sure I understood correctly, do we need your rebase to be able to merge this PR? Do you need something on my side? Sorry for the seemingly misunderstanding.

@Juan-M-V
Copy link
Contributor

Hi @Bernardstanislas! @Oppen is on vacation for a few weeks. What we need is for you to accept his PR with the tests into your PR.
After that, there are conflicts to resolve with the main branch and we should be good to go. If you could look into solving the conflicts that would be awesome, since I don't know if we can do it for you on a timely manner.

@Bernardstanislas
Copy link
Contributor Author

Hi @Juan-M-V , I merged the PR on my branch and it is now up to date and rebased!

@Juan-M-V
Copy link
Contributor

Perfect! I'll run the tests and talk with the rest of the team to merge your changes

@codecov-commenter
Copy link

codecov-commenter commented Aug 16, 2022

Codecov Report

Merging #220 (0d0c62e) into main (b805afa) will decrease coverage by 0.01%.
The diff coverage is 92.30%.

@@            Coverage Diff             @@
##             main     #220      +/-   ##
==========================================
- Coverage   97.88%   97.87%   -0.02%     
==========================================
  Files          44       44              
  Lines       11600    11619      +19     
==========================================
+ Hits        11355    11372      +17     
- Misses        245      247       +2     
Impacted Files Coverage Δ
src/main.rs 5.00% <0.00%> (-0.56%) ⬇️
src/cairo_run.rs 86.06% <100.00%> (+1.24%) ⬆️
src/serde/deserialize_program.rs 91.80% <100.00%> (+0.32%) ⬆️
src/types/program.rs 100.00% <100.00%> (ø)
tests/bitwise_test.rs 100.00% <100.00%> (ø)
tests/cairo_run_test.rs 98.40% <100.00%> (ø)
tests/pedersen_test.rs 100.00% <100.00%> (ø)
tests/struct_test.rs 100.00% <100.00%> (ø)

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@igaray igaray merged commit 8328185 into lambdaclass:main Aug 17, 2022
@Bernardstanislas Bernardstanislas deleted the customize-entrypoint branch August 17, 2022 16:02
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.

None yet

7 participants