-
Notifications
You must be signed in to change notification settings - Fork 581
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
Use cairo-lang-primitive-token from registry not path in unreleased cairo crates #7236
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 3 of 3 files at r1, all commit messages.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @maciektr and @orizi)
a discussion (no related file):
what's the reasoning behind this change?
Previously, mkaput (Marek Kaput) wrote…
Without this change, when you depend on the parser through git dependency, transitive dependency to cairo-lang-primitive-token will be translated into local git dependency, not the remote registry one. In that case, Rustc is unable to determine that both of this crates (local git and registry remote) are identical and fails with an error:
|
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 @maciektr and @orizi)
a discussion (no related file):
Previously, maciektr (maciektr) wrote…
Without this change, when you depend on the parser through git dependency, transitive dependency to cairo-lang-primitive-token will be translated into local git dependency, not the remote registry one. In that case, Rustc is unable to determine that both of this crates (local git and registry remote) are identical and fails with an error:
Compiling some v1.0.0 ([..]Scarb.toml) error[E0271]: expected `SyntaxNodeWithDbIterator<'_, SimpleParserDatabase>` to be an iterator that yields `PrimitiveToken`, but it yields `PrimitiveToken` --> src/lib.rs:45:16 | 45 | let tokens = quote! { | ________________^ 46 | | #syntax_node_with_db 47 | | trait Circle { 48 | | fn print() -> (); ... | 54 | | } 55 | | }; | |___^ expected `PrimitiveToken`, found a different `PrimitiveToken` | = note: `PrimitiveToken` and `PrimitiveToken` have similar names, but are actually distinct types
Can you provide this explanation as a comment here? It's surprising that local crate is not used via local path. 🙏
1618ee8
to
8317e34
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: 1 of 3 files reviewed, 1 unresolved discussion (waiting on @mkaput and @orizi)
a discussion (no related file):
Previously, mkaput (Marek Kaput) wrote…
Can you provide this explanation as a comment here? It's surprising that local crate is not used via local path. 🙏
Done.
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 all commit messages.
Reviewable status: 1 of 3 files reviewed, 1 unresolved discussion (waiting on @mkaput)
a discussion (no related file):
Previously, maciektr (maciektr) wrote…
Done.
this sounds like we should just move this crate out of the crate tree here completely - and ONLY depend on the registry one.
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 r2, all commit messages.
Reviewable status:complete! all files reviewed, all discussions resolved (waiting on @maciektr)
a discussion (no related file):
Previously, orizi wrote…
this sounds like we should just move this crate out of the crate tree here completely - and ONLY depend on the registry one.
Makes sense, although who should host it? I think the repo should be in starkware-libs
, to minimize dependencies on SWM repos here.
Previously, mkaput (Marek Kaput) wrote…
@orizi do you have an opinion here? 🤔 |
8317e34
to
b5fdf14
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 @maciektr)
a discussion (no related file):
Previously, maciektr (maciektr) wrote…
@orizi do you have an opinion here? 🤔
we can have it in the repo - just not as a part of the workspace.
9e0a922
to
81c87f6
Compare
Previously, orizi wrote…
Removed from workspace |
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 r2, 3 of 3 files at r3, all commit messages.
Reviewable status: all files reviewed, 3 unresolved discussions (waiting on @maciektr)
crates/cairo-lang-parser/Cargo.toml
line 14 at r3 (raw file):
# Registry dep is used instead of local path, so the same exact source can be used by crates # depending on this crate, from both registry and git. cairo-lang-primitive-token = "1"
move dep and doc to workspace.
Suggestion:
cairo-lang-primitive-token.worksspace = true
crates/cairo-lang-syntax/Cargo.toml
line 15 at r3 (raw file):
# Registry dep is used instead of local path, so the same exact source can be used by crates # depending on this crate, from both registry and git. cairo-lang-primitive-token = "1"
move dep and doc to workspace.
Suggestion:
cairo-lang-primitive-token.worksspace = true
81c87f6
to
ccc6e7a
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: 2 of 5 files reviewed, 3 unresolved discussions (waiting on @mkaput and @orizi)
crates/cairo-lang-syntax/Cargo.toml
line 15 at r3 (raw file):
Previously, orizi wrote…
move dep and doc to workspace.
Done.
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: 2 of 5 files reviewed, 3 unresolved discussions (waiting on @mkaput and @orizi)
crates/cairo-lang-parser/Cargo.toml
line 14 at r3 (raw file):
Previously, orizi wrote…
move dep and doc to workspace.
Done.
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 r4, all commit messages.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @maciektr)
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 @maciektr)
No description provided.