Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
Add component dependencies to metadata #1655
base: main
Are you sure you want to change the base?
Add component dependencies to metadata #1655
Changes from 2 commits
eb60e59
42e4a5b
ce757da
14f10c1
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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.
Changed discriminator to be serialized
PackageId
instead ofVersion
to be aligned with the comment regardingCompilationUnitComponentDependencyMetadata::id
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.
This requires changes to Cairo to work ^
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.
WDYM?
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.
I mean
ProjectConfig
is a terrible structure that sometimes has duplicated information, but sometimes lacks it (like in this case), so rn inRootDatabaseBuilder
we set the discriminator to always be equal toCrateSetting.version
https://github.com/starkware-libs/cairo/blob/932767340c4b8a762140bf9eba305f437587ac1b/crates/cairo-lang-compiler/src/project.rs#L148-L152
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.
I wonder if we should hide the corelib edge case in cu too.
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.
Definitely. I don't think we want all tools to think about this case
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.
To be fair it doesn't even matter from the compiler's point of view if the corelib discriminator is
None
or not as long ascore
is a dependency for each package (which it is in Scarb)https://github.com/starkware-libs/cairo/blob/932767340c4b8a762140bf9eba305f437587ac1b/crates/cairo-lang-semantic/src/resolve/mod.rs#L1077
I agree though that we should keep it as
None
for consistency, will change it in metadata and Scarb's internal modelThere 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.
Are you sure it does not matter? I know this has not been working without this
if
when we first introduced it. If we can omit this logic, it would be best to do so I think 🤔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.
It does matter because compiler has this assumption: https://github.com/starkware-libs/cairo/blob/5900876001c7d71008cc3d556842c081bc57b094/crates/cairo-lang-filesystem/src/ids.rs#L39-L42