-
Notifications
You must be signed in to change notification settings - Fork 70
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
Support casm serialised output #676
Comments
I am taking this one 🙋 |
I'm not entirely sure about this ones; perhaps we should consult this with Ori or Ariel. For CASM it kinda makes sense to still output text as the default, isn't it? |
The only I can think of is that it is for Cairo devs to verify the Casm of some high-level Cairo code is as expected. Beyond that, I really don't see much use. Given the knowledge I have, for casm to make sense it needs to have some metadata that describes it such as Entrypoints, Builtins and Hints that it is using. If it is in something easily parseable format (such as json) it really helps other non-rusty tools. |
I've asked Cairo team about this. |
OK, discussed privately with @orizi. Let's make JSON the default, and add |
Hi @rodrigo-pino ! |
Hi @maciektr, sorry just did an initial scope analysis gathering what I needed to implement, I found in that search that I will need Sierra metadata as well since in order to made a Cairo 1 runner you require metadata that exists on both Sierra and Casm (but that can be another separate PR) I haven't implemented much, but be sure I (or someone from the team) will take on this since we do need it at some point in not the far future. If you want to put it backlog or something, I understand. I'll ping you right here as soon as we are ready to take on this! |
Sure, I understand completely! I will put it back to backlog, but it's still yours! |
Closing as not planned since release of |
Problem
As of now,
lib
target compilation (as opposed to starknet contract targets) is capable of producing CASM artefacts in a textual, human readable format only (equivalent tosierra-compile
compiler cli). In contrast, starknet contract compilation uses serialisable json format instead. It is possible to define a similar serialisable casm format for non-contract projects as well. This alternative should be supported as an artefact oflib
target compilation.Proposed solution
lib
target properties to allow casm artefact format specificationlib
target properties are defined here:scarb/scarb/src/compiler/compilers/lib.rs
Lines 18 to 22 in ba2c455
sierra
artefact, it should allowcasm
andcasm_text
boolean inputs.casm
should create json serialized artefacts, whilecasm-text
should create textual ones.casm
andcasm-text
keys on[lib]
object inScarb.toml
manifest files.lib
target compiler to produce new artefacts.scarb/scarb/src/compiler/compilers/lib.rs
Line 39 in ba2c455
.casm.json
extension into the target directory with target name as filename..casm
extension into the target directory, with the same name.scarb/scarb/tests/build_targets.rs
Line 72 in ba2c455
Notes
See https://github.com/software-mansion/scarb/pull/637/files for similar change introducing new artefact format.
The text was updated successfully, but these errors were encountered: