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

feat(blockifier): verify cairo-lang version before Cairo0 compilation #182

Conversation

dorimedini-starkware
Copy link
Collaborator

@dorimedini-starkware dorimedini-starkware commented Jul 29, 2024

This change is Reviewable

Copy link
Contributor

@nimrod-starkware nimrod-starkware left a comment

Choose a reason for hiding this comment

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

Reviewed 1 of 1 files at r1, all commit messages.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @AvivYossef-starkware, @dorimedini-starkware, @meship-starkware, and @TzahiTaub)


crates/blockifier/src/test_utils/cairo_compile.rs line 79 at r1 (raw file):

}

/// Verifies that the required dependencies are available before compiling.

Suggestion:

/// Verifies that the required dependencies are available before compiling; panics if unavailable.

@dorimedini-starkware dorimedini-starkware force-pushed the 07-29-feat_blockifier_verify_cairo-lang_version_before_cairo0_compilation branch from 360c889 to 852ec7b Compare July 30, 2024 13:21
Copy link
Collaborator Author

@dorimedini-starkware dorimedini-starkware left a comment

Choose a reason for hiding this comment

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

Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @AvivYossef-starkware, @meship-starkware, @nimrod-starkware, and @TzahiTaub)


crates/blockifier/src/test_utils/cairo_compile.rs line 79 at r1 (raw file):

}

/// Verifies that the required dependencies are available before compiling.

Done.

Copy link
Contributor

@nimrod-starkware nimrod-starkware left a comment

Choose a reason for hiding this comment

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

:lgtm:

Reviewable status: 0 of 1 files reviewed, all discussions resolved (waiting on @AvivYossef-starkware, @meship-starkware, and @TzahiTaub)

@dorimedini-starkware dorimedini-starkware force-pushed the 07-29-chore_blockifier_fetch_compiler_repo_version branch from 01632aa to c3a164d Compare July 31, 2024 16:34
@dorimedini-starkware dorimedini-starkware force-pushed the 07-29-feat_blockifier_verify_cairo-lang_version_before_cairo0_compilation branch from 852ec7b to cfeb968 Compare July 31, 2024 16:34
@dorimedini-starkware dorimedini-starkware force-pushed the 07-29-chore_blockifier_fetch_compiler_repo_version branch from c3a164d to 2f7cd95 Compare July 31, 2024 16:42
@dorimedini-starkware dorimedini-starkware force-pushed the 07-29-feat_blockifier_verify_cairo-lang_version_before_cairo0_compilation branch from cfeb968 to af3aebb Compare July 31, 2024 16:42
@dorimedini-starkware dorimedini-starkware force-pushed the 07-29-chore_blockifier_fetch_compiler_repo_version branch from 2f7cd95 to b2d7a30 Compare July 31, 2024 16:51
@dorimedini-starkware dorimedini-starkware force-pushed the 07-29-feat_blockifier_verify_cairo-lang_version_before_cairo0_compilation branch from af3aebb to 9c74f42 Compare July 31, 2024 16:51
@dorimedini-starkware dorimedini-starkware force-pushed the 07-29-chore_blockifier_fetch_compiler_repo_version branch from b2d7a30 to 7601648 Compare August 1, 2024 08:50
@dorimedini-starkware dorimedini-starkware force-pushed the 07-29-feat_blockifier_verify_cairo-lang_version_before_cairo0_compilation branch from caacae7 to fa5d93a Compare August 1, 2024 15:57
@dorimedini-starkware dorimedini-starkware force-pushed the 07-29-chore_blockifier_fetch_compiler_repo_version branch from 800878f to 088fb75 Compare August 6, 2024 12:15
@dorimedini-starkware dorimedini-starkware force-pushed the 07-29-feat_blockifier_verify_cairo-lang_version_before_cairo0_compilation branch from fa5d93a to eac83c2 Compare August 6, 2024 12:16
@dorimedini-starkware dorimedini-starkware force-pushed the 07-29-chore_blockifier_fetch_compiler_repo_version branch from 088fb75 to 99a29d0 Compare August 6, 2024 12:28
@dorimedini-starkware dorimedini-starkware force-pushed the 07-29-feat_blockifier_verify_cairo-lang_version_before_cairo0_compilation branch from eac83c2 to 177370c Compare August 6, 2024 12:28
@dorimedini-starkware dorimedini-starkware force-pushed the 07-29-chore_blockifier_fetch_compiler_repo_version branch from 99a29d0 to c6d68f7 Compare August 7, 2024 14:51
@dorimedini-starkware dorimedini-starkware force-pushed the 07-29-feat_blockifier_verify_cairo-lang_version_before_cairo0_compilation branch from 177370c to 8937375 Compare August 7, 2024 14:51
@dorimedini-starkware dorimedini-starkware force-pushed the 07-29-chore_blockifier_fetch_compiler_repo_version branch from c6d68f7 to 4c186a0 Compare August 7, 2024 16:16
@dorimedini-starkware dorimedini-starkware force-pushed the 07-29-feat_blockifier_verify_cairo-lang_version_before_cairo0_compilation branch from 8937375 to 1b47e77 Compare August 7, 2024 16:16
@dorimedini-starkware dorimedini-starkware marked this pull request as ready for review August 8, 2024 09:52
Copy link
Contributor

@TzahiTaub TzahiTaub left a comment

Choose a reason for hiding this comment

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

Reviewed 1 of 1 files at r2, all commit messages.
Reviewable status: all files reviewed, 2 unresolved discussions (waiting on @AvivYossef-starkware, @dorimedini-starkware, and @meship-starkware)

a discussion (no related file):
What happens ATM if we have the package in the wrong version? We fail the comparison, and if we fix we fix the wrong local version we use (and hopefully fails the CI)



crates/blockifier/src/test_utils/cairo_compile.rs line 98 at r2 (raw file):

        cairo_lang_version.trim(),
        expected_cairo_lang_version.trim(),
        "cairo-lang not found. Please run:\npip3.9 install -r {}/{}\nthen rerun the test.",

We might have the package in the wrong version

Suggestion:

cairo-lang version {} not found...., expected_cairo_lang_version.trim().rsplit("=").next().unwrap()

Copy link
Collaborator Author

@dorimedini-starkware dorimedini-starkware left a comment

Choose a reason for hiding this comment

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

Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @AvivYossef-starkware, @meship-starkware, and @TzahiTaub)

a discussion (no related file):

Previously, TzahiTaub (Tzahi) wrote…

What happens ATM if we have the package in the wrong version? We fail the comparison, and if we fix we fix the wrong local version we use (and hopefully fails the CI)

The CI installs whatever is in the requirements.txt file, if that version is "wrong" there's nothing we can check



crates/blockifier/src/test_utils/cairo_compile.rs line 98 at r2 (raw file):

Previously, TzahiTaub (Tzahi) wrote…

We might have the package in the wrong version

better?

@dorimedini-starkware dorimedini-starkware force-pushed the 07-29-chore_blockifier_fetch_compiler_repo_version branch from 4c186a0 to d8b8e73 Compare August 11, 2024 07:45
@dorimedini-starkware dorimedini-starkware force-pushed the 07-29-feat_blockifier_verify_cairo-lang_version_before_cairo0_compilation branch from 1b47e77 to b45df76 Compare August 11, 2024 07:45
@dorimedini-starkware dorimedini-starkware force-pushed the 07-29-chore_blockifier_fetch_compiler_repo_version branch from d8b8e73 to 9e12d56 Compare August 11, 2024 08:55
@dorimedini-starkware dorimedini-starkware force-pushed the 07-29-feat_blockifier_verify_cairo-lang_version_before_cairo0_compilation branch from b45df76 to c095163 Compare August 11, 2024 08:55
Copy link
Contributor

@TzahiTaub TzahiTaub left a comment

Choose a reason for hiding this comment

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

Reviewed 1 of 1 files at r3, all commit messages.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @AvivYossef-starkware, @dorimedini-starkware, and @meship-starkware)

a discussion (no related file):

Previously, dorimedini-starkware wrote…

The CI installs whatever is in the requirements.txt file, if that version is "wrong" there's nothing we can check

I meant if our installed local version doesn't match the requirements file.



crates/blockifier/src/test_utils/cairo_compile.rs line 98 at r2 (raw file):

Previously, dorimedini-starkware wrote…

better?

Yes, though when the package isn't installed, we'll get (installed version: ) then maybe if cairo_lang_version.is_empty() {"not installed"} else { cairo_lang_version}, and raise the trim()` above as you did for the expected one.

Copy link
Contributor

@TzahiTaub TzahiTaub left a comment

Choose a reason for hiding this comment

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

Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @AvivYossef-starkware, @dorimedini-starkware, and @meship-starkware)


crates/blockifier/src/test_utils/cairo_compile.rs line 98 at r2 (raw file):

Previously, TzahiTaub (Tzahi) wrote…

Yes, though when the package isn't installed, we'll get (installed version: ) then maybe if cairo_lang_version.is_empty() {"not installed"} else { cairo_lang_version}, and raise the trim()` above as you did for the expected one.

* and raise the not a part of the code :)

Copy link
Collaborator Author

@dorimedini-starkware dorimedini-starkware left a comment

Choose a reason for hiding this comment

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

Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on @AvivYossef-starkware and @meship-starkware)

a discussion (no related file):

Previously, TzahiTaub (Tzahi) wrote…

I meant if our installed local version doesn't match the requirements file.

the fix command also compares versions (same cairo0_compile is called), so you will also fail to fix



crates/blockifier/src/test_utils/cairo_compile.rs line 98 at r2 (raw file):

Previously, TzahiTaub (Tzahi) wrote…

* and raise the not a part of the code :)

done. however, can't raise the trim ("value dropped"). defined an intermediate var to call trim once

@dorimedini-starkware dorimedini-starkware force-pushed the 07-29-chore_blockifier_fetch_compiler_repo_version branch from 9e12d56 to bfd77eb Compare August 11, 2024 09:34
@dorimedini-starkware dorimedini-starkware force-pushed the 07-29-feat_blockifier_verify_cairo-lang_version_before_cairo0_compilation branch from c095163 to 1f7061e Compare August 11, 2024 09:34
Copy link
Contributor

@TzahiTaub TzahiTaub left a comment

Choose a reason for hiding this comment

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

:lgtm:

Reviewed 1 of 1 files at r4, all commit messages.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on @AvivYossef-starkware and @meship-starkware)

Copy link
Contributor

@TzahiTaub TzahiTaub left a comment

Choose a reason for hiding this comment

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

Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on @AvivYossef-starkware and @meship-starkware)

Copy link
Collaborator Author

dorimedini-starkware commented Aug 11, 2024

Merge activity

@dorimedini-starkware dorimedini-starkware changed the base branch from 07-29-chore_blockifier_fetch_compiler_repo_version to graphite-base/182 August 11, 2024 15:40
@dorimedini-starkware dorimedini-starkware changed the base branch from graphite-base/182 to main August 11, 2024 15:51
@dorimedini-starkware dorimedini-starkware force-pushed the 07-29-feat_blockifier_verify_cairo-lang_version_before_cairo0_compilation branch from 1f7061e to 79f08a0 Compare August 11, 2024 15:52
@dorimedini-starkware dorimedini-starkware merged commit 450f118 into main Aug 11, 2024
14 checks passed
@github-actions github-actions bot locked and limited conversation to collaborators Aug 13, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants