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

Added failure for bad types in building an executable. #7129

Merged
merged 1 commit into from
Jan 23, 2025
Merged

Conversation

orizi
Copy link
Collaborator

@orizi orizi commented Jan 21, 2025

Stack:

⚠️ Part of a stack created by spr. Do not merge manually using the UI - doing so may have unexpected results.

@reviewable-StarkWare
Copy link

This change is Reviewable

@orizi orizi force-pushed the spr/main/db822d43 branch 2 times, most recently from 177e84f to 022c26c Compare January 21, 2025 16:14
@ilyalesokhin-starkware
Copy link
Contributor

crates/cairo-lang-runnable-utils/src/builder.rs line 377 at r1 (raw file):

                // Emulated builtins are not supported in compilation for executable.
                return Err(BuildError::DisallowedBuiltinForExecutable(generic_ty.clone()));
            }

I'm guessing
!config.outputting_function
means test mode, but it a bad name in that case.
Maybe add another configuration flag?

Suggestion:

            if config.outputting_function {
                // Emulated builtins are not supported when compiling an executable.
                return Err(BuildError::DisallowedBuiltinForExecutable(generic_ty.clone()));
            }

@orizi orizi force-pushed the spr/main/db822d43 branch from 022c26c to b25d7ff Compare January 23, 2025 07:50
Copy link
Collaborator Author

@orizi orizi 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: 0 of 3 files reviewed, 1 unresolved discussion (waiting on @ilyalesokhin-starkware)


crates/cairo-lang-runnable-utils/src/builder.rs line 377 at r1 (raw file):

Previously, ilyalesokhin-starkware wrote…

I'm guessing
!config.outputting_function
means test mode, but it a bad name in that case.
Maybe add another configuration flag?

Done.

@ilyalesokhin-starkware
Copy link
Contributor

crates/cairo-lang-runnable-utils/src/builder.rs line 377 at r1 (raw file):

Previously, orizi wrote…

Done.

What about the conditioning on outputting_function? at least explain it.

Copy link
Contributor

@ilyalesokhin-starkware ilyalesokhin-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 2 of 3 files at r1.
Reviewable status: 1 of 3 files reviewed, all discussions resolved

@orizi orizi force-pushed the spr/main/db822d43 branch from b25d7ff to fddb99b Compare January 23, 2025 09:10
Copy link
Collaborator Author

@orizi orizi 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: 1 of 3 files reviewed, all discussions resolved (waiting on @ilyalesokhin-starkware)


crates/cairo-lang-runnable-utils/src/builder.rs line 377 at r1 (raw file):

Previously, ilyalesokhin-starkware wrote…

What about the conditioning on outputting_function? at least explain it.

it basically means that emulation makes no sense if we are actually using the output builtin.
trying to add some more info.
Done maybe?

@ilyalesokhin-starkware
Copy link
Contributor

crates/cairo-lang-runnable-utils/src/builder.rs line 377 at r1 (raw file):

Previously, orizi wrote…

it basically means that emulation makes no sense if we are actually using the output builtin.
trying to add some more info.
Done maybe?

"if we use the output builtin, no emulated builtins are allowed."
what does this mean?

Copy link
Collaborator Author

@orizi orizi 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: 1 of 3 files reviewed, all discussions resolved (waiting on @ilyalesokhin-starkware)


crates/cairo-lang-runnable-utils/src/builder.rs line 377 at r1 (raw file):

Previously, ilyalesokhin-starkware wrote…

"if we use the output builtin, no emulated builtins are allowed."
what does this mean?

if we use the output builtin (which is the meaning of the outputting_function flag) - we it means we are actually proving something - so no emulation is required.

@ilyalesokhin-starkware
Copy link
Contributor

crates/cairo-lang-runnable-utils/src/builder.rs line 377 at r1 (raw file):

Previously, orizi wrote…

if we use the output builtin (which is the meaning of the outputting_function flag) - we it means we are actually proving something - so no emulation is required.

the comment above outputting_function does not say anything about proving.

also I would argue that the name of the flag is wrong if it means that this is going to be proved

@orizi orizi force-pushed the spr/main/db822d43 branch from fddb99b to 9e78ef6 Compare January 23, 2025 11:42
@orizi orizi changed the base branch from main to spr/main/2b23af69 January 23, 2025 11:42
@orizi orizi force-pushed the spr/main/db822d43 branch from 9e78ef6 to 9ddf275 Compare January 23, 2025 11:46
Copy link
Collaborator Author

@orizi orizi 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: 1 of 3 files reviewed, all discussions resolved (waiting on @ilyalesokhin-starkware)


crates/cairo-lang-runnable-utils/src/builder.rs line 377 at r1 (raw file):

Previously, ilyalesokhin-starkware wrote…

the comment above outputting_function does not say anything about proving.

also I would argue that the name of the flag is wrong if it means that this is going to be proved

how about now?

Copy link
Contributor

@ilyalesokhin-starkware ilyalesokhin-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:

Reviewed 2 of 2 files at r4, all commit messages.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on @orizi)


crates/cairo-lang-runnable-utils/src/builder.rs line 377 at r1 (raw file):

Previously, orizi wrote…

how about now?

Nice

@orizi orizi force-pushed the spr/main/db822d43 branch from 9ddf275 to b82100f Compare January 23, 2025 14:14
@orizi orizi changed the base branch from spr/main/2b23af69 to main January 23, 2025 14:14
@orizi orizi enabled auto-merge January 23, 2025 14:14
Copy link
Collaborator Author

@orizi orizi left a comment

Choose a reason for hiding this comment

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

Reviewed 2 of 2 files at r5, all commit messages.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on @orizi)

@orizi orizi added this pull request to the merge queue Jan 23, 2025
Merged via the queue into main with commit e90be20 Jan 23, 2025
48 checks passed
@orizi orizi deleted the spr/main/db822d43 branch January 23, 2025 14:57
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.

3 participants