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

fix(cairo_native): use current dir in cairo compile #2815

Closed
wants to merge 1 commit into from

Conversation

noaov1
Copy link
Collaborator

@noaov1 noaov1 commented Dec 19, 2024

No description provided.

@reviewable-StarkWare
Copy link

This change is Reviewable

@noaov1 noaov1 force-pushed the noa/use_cairo_native_dir branch from a824d83 to 3be2b64 Compare December 19, 2024 10:06
@noaov1 noaov1 changed the title fix(cairo_native): use current dir in cairo compile. fix(cairo_native): use current dir in cairo compile Dec 19, 2024
@noaov1 noaov1 force-pushed the noa/use_cairo_native_dir branch from 3be2b64 to b34c5ab Compare December 19, 2024 10:23
Copy link
Collaborator

@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.

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


crates/blockifier/build.rs line 9 at r1 (raw file):

    let cairo_native_dir =
        current_dir().expect("Failed to get current directory").join(PathBuf::from("cairo_native"));

this is resolved at runtime, and the resulting dir depends on the calling context; this is desired behavior?

Code quote:

current_dir().expect("Failed to get current directory")

Copy link
Collaborator Author

@noaov1 noaov1 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 @avi-starkware)


crates/blockifier/build.rs line 9 at r1 (raw file):

Previously, dorimedini-starkware wrote…

this is resolved at runtime, and the resulting dir depends on the calling context; this is desired behavior?

@avi-starkware ?
I just reverted the changes in #2289.
Do you have other ideas?

@avi-starkware
Copy link
Contributor

crates/blockifier/build.rs line 9 at r1 (raw file):

Previously, noaov1 (Noa Oved) wrote…

@avi-starkware ?
I just reverted the changes in #2289.
Do you have other ideas?

Why do you want to do this?

The problem with using current_dir is that it depends on the dir from which the crate is built. In particular, running

cargo build --package "blockifier"

and running

cd ~
cargo build --manifest-path ~/workspace/sequencer/crates/blockifier/Cargo.toml

would give you different results.

Which is weird and unexpected behavior that could easily cause bugs in the future.

Why are you doing this PR?

@noaov1 noaov1 closed this Dec 23, 2024
@github-actions github-actions bot locked and limited conversation to collaborators Dec 25, 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.

4 participants