-
Notifications
You must be signed in to change notification settings - Fork 35
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
chore(cairo_native): make the starknet-native-compile crate a part of the workspace #3021
base: main-v0.13.4
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed 5 of 5 files at r1, all commit messages.
Reviewable status: all files reviewed, 2 unresolved discussions (waiting on @avi-starkware, @meship-starkware, and @Yoni-Starkware)
Cargo.toml
line 60 at r1 (raw file):
] exclude = ["crates/bin/starknet-native-compile"]
What does it mean?
Code quote:
exclude = ["crates/bin/starknet-native-compile"]
crates/bin/starknet-native-compile/src/utils.rs
line 1 at r1 (raw file):
#[cfg(feature = "cairo_native")]
Is it necessary, considering the file already has the feature flag above its declaration? 🤔
Code quote:
#[cfg(feature = "cairo_native")]
There was a problem hiding this 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, 3 unresolved discussions (waiting on @avi-starkware, @meship-starkware, and @Yoni-Starkware)
crates/bin/starknet-native-compile/Cargo.toml
line 11 at r1 (raw file):
[features] cairo_native = [
How do you make sure that the starknet_sierra_compile
crate uses this crate with the cairo_native
feature flag?
Code quote:
cairo_native = [
Benchmark movements: |
e03856d
to
7a03873
Compare
Previously, noaov1 (Noa Oved) wrote…
starknet_sierra_compile does not depend on this crate directly it builds it via |
Previously, noaov1 (Noa Oved) wrote…
It just means that the crate is not part of the workspace and will not be compiled automatically when running |
Benchmark movements: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed 5 of 5 files at r1, 1 of 1 files at r2, all commit messages.
Reviewable status: all files reviewed, 3 unresolved discussions (waiting on @avi-starkware, @noaov1, and @Yoni-Starkware)
There was a problem hiding this 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, 1 unresolved discussion (waiting on @avi-starkware and @Yoni-Starkware)
Previously, noaov1 (Noa Oved) wrote…
If we don't put this over each import that is only used with the feature flag, we will get an |
952e380
to
a88df6a
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed 3 of 3 files at r3, all commit messages.
Reviewable status:complete! all files reviewed, all discussions resolved (waiting on @Yoni-Starkware)
6eb4b19
to
8d48934
Compare
c5a8c5a
to
b3f6e8e
Compare
Benchmark movements: |
797dbab
to
5a9235b
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed 1 of 7 files at r5, 6 of 6 files at r6, all commit messages.
Reviewable status: 8 of 11 files reviewed, 1 unresolved discussion (waiting on @avi-starkware, @meship-starkware, @noaov1, and @Yoni-Starkware)
crates/starknet_sierra_multicompile/build.rs
line 18 at r6 (raw file):
} const REQUIRED_CAIRO_LANG_VERSION: &str = "2.10.0-rc.1";
ok for the current scope, but... this dep is flaky. is there anything that will prevent a dev from changing the compiler crate deps in the root cargo.toml to a version other than this one?
Code quote:
const REQUIRED_CAIRO_LANG_VERSION: &str = "2.10.0-rc.1";
crates/starknet_sierra_multicompile/build.rs
line 20 at r6 (raw file):
const REQUIRED_CAIRO_LANG_VERSION: &str = "2.10.0-rc.1"; #[cfg(feature = "cairo_native")] const REQUIRED_CAIRO_NATIVE_VERSION: &str = env!("CARGO_PKG_VERSION");
this is resolved at compile-time, right?
what does this resolve to during cargo install
from crates.io?
Code quote:
env!("CARGO_PKG_VERSION");
crates/bin/starknet-native-compile/src/main.rs
line 61 at r6 (raw file):
}); } }
probably simpler to split into modules... WDYT?
Suggestion:
#[cfg(feature = "cairo_native")]
pub mod cairo_native_main;
fn main() {
#[cfg(not(feature = "cairo_native"))]
{
eprintln!(
"The `starknet-native-compile` binary was compiled without the 'cairo_native' feature."
);
process::exit(1);
}
#[cfg(feature = "cairo_native")]
cairo_native_main::main()
}
5a9235b
to
b71a8fa
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed 5 of 5 files at r7, all commit messages.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @avi-starkware and @Yoni-Starkware)
crates/starknet_sierra_multicompile/Cargo.toml
line 37 at r7 (raw file):
[build-dependencies] starknet-native-compile.path = "../bin/starknet-native-compile"
build.rs does not run in cargo install
, right?
Code quote:
starknet-native-compile.path = "../bin/starknet-native-compile"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed 1 of 7 files at r5, 3 of 6 files at r6, 4 of 5 files at r7, all commit messages.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @avi-starkware and @Yoni-Starkware)
b71a8fa
to
7a4b217
Compare
There was a problem hiding this 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 @dorimedini-starkware and @Yoni-Starkware)
crates/bin/starknet-native-compile/src/main.rs
line 61 at r6 (raw file):
Previously, dorimedini-starkware wrote…
probably simpler to split into modules... WDYT?
Done.
crates/starknet_sierra_multicompile/build.rs
line 18 at r6 (raw file):
Previously, dorimedini-starkware wrote…
ok for the current scope, but... this dep is flaky. is there anything that will prevent a dev from changing the compiler crate deps in the root cargo.toml to a version other than this one?
We will let the people working on the gateway decide how to manage this version.
crates/starknet_sierra_multicompile/build.rs
line 20 at r6 (raw file):
Previously, dorimedini-starkware wrote…
this is resolved at compile-time, right?
what does this resolve to duringcargo install
from crates.io?
It will be resolved at compile time to the version of the workspace
crates/starknet_sierra_multicompile/Cargo.toml
line 37 at r7 (raw file):
Previously, dorimedini-starkware wrote…
build.rs does not run in
cargo install
, right?
This is an artificial dependency - it doesn't do anything
It is there just to add the dependency to the dependency tree
7a4b217
to
4319405
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed 4 of 4 files at r8, 4 of 4 files at r9, all commit messages.
Reviewable status:complete! all files reviewed, all discussions resolved (waiting on @Yoni-Starkware)
crates/starknet_sierra_multicompile/build.rs
line 20 at r6 (raw file):
Previously, avi-starkware (Avi Cohen) wrote…
It will be resolved at compile time to the version of the workspace
discussed offline (tl;dr: still unclear what happens when externals do cargo install
)
4319405
to
902b823
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewable status: 11 of 13 files reviewed, all discussions resolved (waiting on @dorimedini-starkware and @Yoni-Starkware)
crates/starknet_sierra_multicompile/build.rs
line 20 at r6 (raw file):
Previously, dorimedini-starkware wrote…
discussed offline (tl;dr: still unclear what happens when externals do
cargo install
)
I changed the version to be explicit, and I will make another PR that adds a test that the version in this constant is the same as the workspace version.
There was a problem hiding this 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 r10, all commit messages.
Reviewable status:complete! all files reviewed, all discussions resolved (waiting on @Yoni-Starkware)
902b823
to
d9e3101
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed 3 of 4 files at r8, 1 of 4 files at r9, 2 of 2 files at r10, all commit messages.
Reviewable status:complete! all files reviewed, all discussions resolved (waiting on @Yoni-Starkware)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed 1 of 8 files at r4, 1 of 7 files at r5, 2 of 6 files at r6, 1 of 5 files at r7, 3 of 4 files at r8, 4 of 4 files at r9, 2 of 2 files at r10, all commit messages.
Reviewable status:complete! all files reviewed, all discussions resolved (waiting on @Yoni-Starkware)
No description provided.