diff --git a/Cargo.lock b/Cargo.lock index b86c7e049..4b50c9649 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -531,28 +531,12 @@ dependencies = [ "serde", ] -[[package]] -name = "cairo-lang-casm" -version = "2.3.0" -source = "git+https://github.com/starkware-libs/cairo?tag=v2.3.0#0c67a87fb24131f21fd4b8709b88e15eaeaf18de" -dependencies = [ - "cairo-lang-utils 2.3.0 (git+https://github.com/starkware-libs/cairo?tag=v2.3.0)", - "indoc", - "num-bigint", - "num-traits 0.2.16", - "parity-scale-codec", - "parity-scale-codec-derive", - "schemars", - "serde", - "thiserror", -] - [[package]] name = "cairo-lang-casm" version = "2.3.0" source = "git+https://github.com/starkware-libs/cairo?rev=bf91adecc5a1cb2ced041ba383d7b7c38dd2fa7f#bf91adecc5a1cb2ced041ba383d7b7c38dd2fa7f" dependencies = [ - "cairo-lang-utils 2.3.0 (git+https://github.com/starkware-libs/cairo?rev=bf91adecc5a1cb2ced041ba383d7b7c38dd2fa7f)", + "cairo-lang-utils", "indoc", "num-bigint", "num-traits 0.2.16", @@ -563,82 +547,35 @@ dependencies = [ "thiserror", ] -[[package]] -name = "cairo-lang-compiler" -version = "2.3.0" -source = "git+https://github.com/starkware-libs/cairo?tag=v2.3.0#0c67a87fb24131f21fd4b8709b88e15eaeaf18de" -dependencies = [ - "anyhow", - "cairo-lang-defs 2.3.0 (git+https://github.com/starkware-libs/cairo?tag=v2.3.0)", - "cairo-lang-diagnostics 2.3.0 (git+https://github.com/starkware-libs/cairo?tag=v2.3.0)", - "cairo-lang-filesystem 2.3.0 (git+https://github.com/starkware-libs/cairo?tag=v2.3.0)", - "cairo-lang-lowering 2.3.0 (git+https://github.com/starkware-libs/cairo?tag=v2.3.0)", - "cairo-lang-parser 2.3.0 (git+https://github.com/starkware-libs/cairo?tag=v2.3.0)", - "cairo-lang-plugins 2.3.0 (git+https://github.com/starkware-libs/cairo?tag=v2.3.0)", - "cairo-lang-project 2.3.0 (git+https://github.com/starkware-libs/cairo?tag=v2.3.0)", - "cairo-lang-semantic 2.3.0 (git+https://github.com/starkware-libs/cairo?tag=v2.3.0)", - "cairo-lang-sierra 2.3.0 (git+https://github.com/starkware-libs/cairo?tag=v2.3.0)", - "cairo-lang-sierra-generator 2.3.0 (git+https://github.com/starkware-libs/cairo?tag=v2.3.0)", - "cairo-lang-syntax 2.3.0 (git+https://github.com/starkware-libs/cairo?tag=v2.3.0)", - "cairo-lang-utils 2.3.0 (git+https://github.com/starkware-libs/cairo?tag=v2.3.0)", - "itertools 0.11.0", - "salsa", - "thiserror", -] - [[package]] name = "cairo-lang-compiler" version = "2.3.0" source = "git+https://github.com/starkware-libs/cairo?rev=bf91adecc5a1cb2ced041ba383d7b7c38dd2fa7f#bf91adecc5a1cb2ced041ba383d7b7c38dd2fa7f" dependencies = [ "anyhow", - "cairo-lang-defs 2.3.0 (git+https://github.com/starkware-libs/cairo?rev=bf91adecc5a1cb2ced041ba383d7b7c38dd2fa7f)", - "cairo-lang-diagnostics 2.3.0 (git+https://github.com/starkware-libs/cairo?rev=bf91adecc5a1cb2ced041ba383d7b7c38dd2fa7f)", - "cairo-lang-filesystem 2.3.0 (git+https://github.com/starkware-libs/cairo?rev=bf91adecc5a1cb2ced041ba383d7b7c38dd2fa7f)", - "cairo-lang-lowering 2.3.0 (git+https://github.com/starkware-libs/cairo?rev=bf91adecc5a1cb2ced041ba383d7b7c38dd2fa7f)", - "cairo-lang-parser 2.3.0 (git+https://github.com/starkware-libs/cairo?rev=bf91adecc5a1cb2ced041ba383d7b7c38dd2fa7f)", - "cairo-lang-plugins 2.3.0 (git+https://github.com/starkware-libs/cairo?rev=bf91adecc5a1cb2ced041ba383d7b7c38dd2fa7f)", - "cairo-lang-project 2.3.0 (git+https://github.com/starkware-libs/cairo?rev=bf91adecc5a1cb2ced041ba383d7b7c38dd2fa7f)", - "cairo-lang-semantic 2.3.0 (git+https://github.com/starkware-libs/cairo?rev=bf91adecc5a1cb2ced041ba383d7b7c38dd2fa7f)", - "cairo-lang-sierra 2.3.0 (git+https://github.com/starkware-libs/cairo?rev=bf91adecc5a1cb2ced041ba383d7b7c38dd2fa7f)", - "cairo-lang-sierra-generator 2.3.0 (git+https://github.com/starkware-libs/cairo?rev=bf91adecc5a1cb2ced041ba383d7b7c38dd2fa7f)", - "cairo-lang-syntax 2.3.0 (git+https://github.com/starkware-libs/cairo?rev=bf91adecc5a1cb2ced041ba383d7b7c38dd2fa7f)", - "cairo-lang-utils 2.3.0 (git+https://github.com/starkware-libs/cairo?rev=bf91adecc5a1cb2ced041ba383d7b7c38dd2fa7f)", + "cairo-lang-defs", + "cairo-lang-diagnostics", + "cairo-lang-filesystem", + "cairo-lang-lowering", + "cairo-lang-parser", + "cairo-lang-plugins", + "cairo-lang-project", + "cairo-lang-semantic", + "cairo-lang-sierra", + "cairo-lang-sierra-generator", + "cairo-lang-syntax", + "cairo-lang-utils", "itertools 0.11.0", "salsa", "thiserror", ] -[[package]] -name = "cairo-lang-debug" -version = "2.3.0" -source = "git+https://github.com/starkware-libs/cairo?tag=v2.3.0#0c67a87fb24131f21fd4b8709b88e15eaeaf18de" -dependencies = [ - "cairo-lang-utils 2.3.0 (git+https://github.com/starkware-libs/cairo?tag=v2.3.0)", -] - [[package]] name = "cairo-lang-debug" version = "2.3.0" source = "git+https://github.com/starkware-libs/cairo?rev=bf91adecc5a1cb2ced041ba383d7b7c38dd2fa7f#bf91adecc5a1cb2ced041ba383d7b7c38dd2fa7f" dependencies = [ - "cairo-lang-utils 2.3.0 (git+https://github.com/starkware-libs/cairo?rev=bf91adecc5a1cb2ced041ba383d7b7c38dd2fa7f)", -] - -[[package]] -name = "cairo-lang-defs" -version = "2.3.0" -source = "git+https://github.com/starkware-libs/cairo?tag=v2.3.0#0c67a87fb24131f21fd4b8709b88e15eaeaf18de" -dependencies = [ - "cairo-lang-debug 2.3.0 (git+https://github.com/starkware-libs/cairo?tag=v2.3.0)", - "cairo-lang-diagnostics 2.3.0 (git+https://github.com/starkware-libs/cairo?tag=v2.3.0)", - "cairo-lang-filesystem 2.3.0 (git+https://github.com/starkware-libs/cairo?tag=v2.3.0)", - "cairo-lang-parser 2.3.0 (git+https://github.com/starkware-libs/cairo?tag=v2.3.0)", - "cairo-lang-syntax 2.3.0 (git+https://github.com/starkware-libs/cairo?tag=v2.3.0)", - "cairo-lang-utils 2.3.0 (git+https://github.com/starkware-libs/cairo?tag=v2.3.0)", - "itertools 0.11.0", - "salsa", - "smol_str", + "cairo-lang-utils", ] [[package]] @@ -646,77 +583,44 @@ name = "cairo-lang-defs" version = "2.3.0" source = "git+https://github.com/starkware-libs/cairo?rev=bf91adecc5a1cb2ced041ba383d7b7c38dd2fa7f#bf91adecc5a1cb2ced041ba383d7b7c38dd2fa7f" dependencies = [ - "cairo-lang-debug 2.3.0 (git+https://github.com/starkware-libs/cairo?rev=bf91adecc5a1cb2ced041ba383d7b7c38dd2fa7f)", - "cairo-lang-diagnostics 2.3.0 (git+https://github.com/starkware-libs/cairo?rev=bf91adecc5a1cb2ced041ba383d7b7c38dd2fa7f)", - "cairo-lang-filesystem 2.3.0 (git+https://github.com/starkware-libs/cairo?rev=bf91adecc5a1cb2ced041ba383d7b7c38dd2fa7f)", - "cairo-lang-parser 2.3.0 (git+https://github.com/starkware-libs/cairo?rev=bf91adecc5a1cb2ced041ba383d7b7c38dd2fa7f)", - "cairo-lang-syntax 2.3.0 (git+https://github.com/starkware-libs/cairo?rev=bf91adecc5a1cb2ced041ba383d7b7c38dd2fa7f)", - "cairo-lang-utils 2.3.0 (git+https://github.com/starkware-libs/cairo?rev=bf91adecc5a1cb2ced041ba383d7b7c38dd2fa7f)", + "cairo-lang-debug", + "cairo-lang-diagnostics", + "cairo-lang-filesystem", + "cairo-lang-parser", + "cairo-lang-syntax", + "cairo-lang-utils", "itertools 0.11.0", "salsa", "smol_str", ] -[[package]] -name = "cairo-lang-diagnostics" -version = "2.3.0" -source = "git+https://github.com/starkware-libs/cairo?tag=v2.3.0#0c67a87fb24131f21fd4b8709b88e15eaeaf18de" -dependencies = [ - "cairo-lang-debug 2.3.0 (git+https://github.com/starkware-libs/cairo?tag=v2.3.0)", - "cairo-lang-filesystem 2.3.0 (git+https://github.com/starkware-libs/cairo?tag=v2.3.0)", - "cairo-lang-utils 2.3.0 (git+https://github.com/starkware-libs/cairo?tag=v2.3.0)", - "itertools 0.11.0", -] - [[package]] name = "cairo-lang-diagnostics" version = "2.3.0" source = "git+https://github.com/starkware-libs/cairo?rev=bf91adecc5a1cb2ced041ba383d7b7c38dd2fa7f#bf91adecc5a1cb2ced041ba383d7b7c38dd2fa7f" dependencies = [ - "cairo-lang-debug 2.3.0 (git+https://github.com/starkware-libs/cairo?rev=bf91adecc5a1cb2ced041ba383d7b7c38dd2fa7f)", - "cairo-lang-filesystem 2.3.0 (git+https://github.com/starkware-libs/cairo?rev=bf91adecc5a1cb2ced041ba383d7b7c38dd2fa7f)", - "cairo-lang-utils 2.3.0 (git+https://github.com/starkware-libs/cairo?rev=bf91adecc5a1cb2ced041ba383d7b7c38dd2fa7f)", + "cairo-lang-debug", + "cairo-lang-filesystem", + "cairo-lang-utils", "itertools 0.11.0", ] -[[package]] -name = "cairo-lang-eq-solver" -version = "2.3.0" -source = "git+https://github.com/starkware-libs/cairo?tag=v2.3.0#0c67a87fb24131f21fd4b8709b88e15eaeaf18de" -dependencies = [ - "cairo-lang-utils 2.3.0 (git+https://github.com/starkware-libs/cairo?tag=v2.3.0)", - "good_lp", -] - [[package]] name = "cairo-lang-eq-solver" version = "2.3.0" source = "git+https://github.com/starkware-libs/cairo?rev=bf91adecc5a1cb2ced041ba383d7b7c38dd2fa7f#bf91adecc5a1cb2ced041ba383d7b7c38dd2fa7f" dependencies = [ - "cairo-lang-utils 2.3.0 (git+https://github.com/starkware-libs/cairo?rev=bf91adecc5a1cb2ced041ba383d7b7c38dd2fa7f)", + "cairo-lang-utils", "good_lp", ] -[[package]] -name = "cairo-lang-filesystem" -version = "2.3.0" -source = "git+https://github.com/starkware-libs/cairo?tag=v2.3.0#0c67a87fb24131f21fd4b8709b88e15eaeaf18de" -dependencies = [ - "cairo-lang-debug 2.3.0 (git+https://github.com/starkware-libs/cairo?tag=v2.3.0)", - "cairo-lang-utils 2.3.0 (git+https://github.com/starkware-libs/cairo?tag=v2.3.0)", - "path-clean", - "salsa", - "serde", - "smol_str", -] - [[package]] name = "cairo-lang-filesystem" version = "2.3.0" source = "git+https://github.com/starkware-libs/cairo?rev=bf91adecc5a1cb2ced041ba383d7b7c38dd2fa7f#bf91adecc5a1cb2ced041ba383d7b7c38dd2fa7f" dependencies = [ - "cairo-lang-debug 2.3.0 (git+https://github.com/starkware-libs/cairo?rev=bf91adecc5a1cb2ced041ba383d7b7c38dd2fa7f)", - "cairo-lang-utils 2.3.0 (git+https://github.com/starkware-libs/cairo?rev=bf91adecc5a1cb2ced041ba383d7b7c38dd2fa7f)", + "cairo-lang-debug", + "cairo-lang-utils", "path-clean", "salsa", "serde", @@ -729,11 +633,11 @@ version = "2.3.0" source = "git+https://github.com/starkware-libs/cairo?rev=bf91adecc5a1cb2ced041ba383d7b7c38dd2fa7f#bf91adecc5a1cb2ced041ba383d7b7c38dd2fa7f" dependencies = [ "anyhow", - "cairo-lang-diagnostics 2.3.0 (git+https://github.com/starkware-libs/cairo?rev=bf91adecc5a1cb2ced041ba383d7b7c38dd2fa7f)", - "cairo-lang-filesystem 2.3.0 (git+https://github.com/starkware-libs/cairo?rev=bf91adecc5a1cb2ced041ba383d7b7c38dd2fa7f)", - "cairo-lang-parser 2.3.0 (git+https://github.com/starkware-libs/cairo?rev=bf91adecc5a1cb2ced041ba383d7b7c38dd2fa7f)", - "cairo-lang-syntax 2.3.0 (git+https://github.com/starkware-libs/cairo?rev=bf91adecc5a1cb2ced041ba383d7b7c38dd2fa7f)", - "cairo-lang-utils 2.3.0 (git+https://github.com/starkware-libs/cairo?rev=bf91adecc5a1cb2ced041ba383d7b7c38dd2fa7f)", + "cairo-lang-diagnostics", + "cairo-lang-filesystem", + "cairo-lang-parser", + "cairo-lang-syntax", + "cairo-lang-utils", "diffy", "ignore", "itertools 0.11.0", @@ -742,44 +646,20 @@ dependencies = [ "smol_str", ] -[[package]] -name = "cairo-lang-lowering" -version = "2.3.0" -source = "git+https://github.com/starkware-libs/cairo?tag=v2.3.0#0c67a87fb24131f21fd4b8709b88e15eaeaf18de" -dependencies = [ - "cairo-lang-debug 2.3.0 (git+https://github.com/starkware-libs/cairo?tag=v2.3.0)", - "cairo-lang-defs 2.3.0 (git+https://github.com/starkware-libs/cairo?tag=v2.3.0)", - "cairo-lang-diagnostics 2.3.0 (git+https://github.com/starkware-libs/cairo?tag=v2.3.0)", - "cairo-lang-filesystem 2.3.0 (git+https://github.com/starkware-libs/cairo?tag=v2.3.0)", - "cairo-lang-parser 2.3.0 (git+https://github.com/starkware-libs/cairo?tag=v2.3.0)", - "cairo-lang-proc-macros 2.3.0 (git+https://github.com/starkware-libs/cairo?tag=v2.3.0)", - "cairo-lang-semantic 2.3.0 (git+https://github.com/starkware-libs/cairo?tag=v2.3.0)", - "cairo-lang-syntax 2.3.0 (git+https://github.com/starkware-libs/cairo?tag=v2.3.0)", - "cairo-lang-utils 2.3.0 (git+https://github.com/starkware-libs/cairo?tag=v2.3.0)", - "id-arena", - "indexmap 2.0.2", - "itertools 0.11.0", - "log", - "num-bigint", - "num-traits 0.2.16", - "once_cell", - "salsa", -] - [[package]] name = "cairo-lang-lowering" version = "2.3.0" source = "git+https://github.com/starkware-libs/cairo?rev=bf91adecc5a1cb2ced041ba383d7b7c38dd2fa7f#bf91adecc5a1cb2ced041ba383d7b7c38dd2fa7f" dependencies = [ - "cairo-lang-debug 2.3.0 (git+https://github.com/starkware-libs/cairo?rev=bf91adecc5a1cb2ced041ba383d7b7c38dd2fa7f)", - "cairo-lang-defs 2.3.0 (git+https://github.com/starkware-libs/cairo?rev=bf91adecc5a1cb2ced041ba383d7b7c38dd2fa7f)", - "cairo-lang-diagnostics 2.3.0 (git+https://github.com/starkware-libs/cairo?rev=bf91adecc5a1cb2ced041ba383d7b7c38dd2fa7f)", - "cairo-lang-filesystem 2.3.0 (git+https://github.com/starkware-libs/cairo?rev=bf91adecc5a1cb2ced041ba383d7b7c38dd2fa7f)", - "cairo-lang-parser 2.3.0 (git+https://github.com/starkware-libs/cairo?rev=bf91adecc5a1cb2ced041ba383d7b7c38dd2fa7f)", - "cairo-lang-proc-macros 2.3.0 (git+https://github.com/starkware-libs/cairo?rev=bf91adecc5a1cb2ced041ba383d7b7c38dd2fa7f)", - "cairo-lang-semantic 2.3.0 (git+https://github.com/starkware-libs/cairo?rev=bf91adecc5a1cb2ced041ba383d7b7c38dd2fa7f)", - "cairo-lang-syntax 2.3.0 (git+https://github.com/starkware-libs/cairo?rev=bf91adecc5a1cb2ced041ba383d7b7c38dd2fa7f)", - "cairo-lang-utils 2.3.0 (git+https://github.com/starkware-libs/cairo?rev=bf91adecc5a1cb2ced041ba383d7b7c38dd2fa7f)", + "cairo-lang-debug", + "cairo-lang-defs", + "cairo-lang-diagnostics", + "cairo-lang-filesystem", + "cairo-lang-parser", + "cairo-lang-proc-macros", + "cairo-lang-semantic", + "cairo-lang-syntax", + "cairo-lang-utils", "id-arena", "indexmap 2.0.2", "itertools 0.11.0", @@ -791,35 +671,16 @@ dependencies = [ "smol_str", ] -[[package]] -name = "cairo-lang-parser" -version = "2.3.0" -source = "git+https://github.com/starkware-libs/cairo?tag=v2.3.0#0c67a87fb24131f21fd4b8709b88e15eaeaf18de" -dependencies = [ - "cairo-lang-diagnostics 2.3.0 (git+https://github.com/starkware-libs/cairo?tag=v2.3.0)", - "cairo-lang-filesystem 2.3.0 (git+https://github.com/starkware-libs/cairo?tag=v2.3.0)", - "cairo-lang-syntax 2.3.0 (git+https://github.com/starkware-libs/cairo?tag=v2.3.0)", - "cairo-lang-syntax-codegen 2.3.0 (git+https://github.com/starkware-libs/cairo?tag=v2.3.0)", - "cairo-lang-utils 2.3.0 (git+https://github.com/starkware-libs/cairo?tag=v2.3.0)", - "colored", - "itertools 0.11.0", - "num-bigint", - "num-traits 0.2.16", - "salsa", - "smol_str", - "unescaper", -] - [[package]] name = "cairo-lang-parser" version = "2.3.0" source = "git+https://github.com/starkware-libs/cairo?rev=bf91adecc5a1cb2ced041ba383d7b7c38dd2fa7f#bf91adecc5a1cb2ced041ba383d7b7c38dd2fa7f" dependencies = [ - "cairo-lang-diagnostics 2.3.0 (git+https://github.com/starkware-libs/cairo?rev=bf91adecc5a1cb2ced041ba383d7b7c38dd2fa7f)", - "cairo-lang-filesystem 2.3.0 (git+https://github.com/starkware-libs/cairo?rev=bf91adecc5a1cb2ced041ba383d7b7c38dd2fa7f)", - "cairo-lang-syntax 2.3.0 (git+https://github.com/starkware-libs/cairo?rev=bf91adecc5a1cb2ced041ba383d7b7c38dd2fa7f)", - "cairo-lang-syntax-codegen 2.3.0 (git+https://github.com/starkware-libs/cairo?rev=bf91adecc5a1cb2ced041ba383d7b7c38dd2fa7f)", - "cairo-lang-utils 2.3.0 (git+https://github.com/starkware-libs/cairo?rev=bf91adecc5a1cb2ced041ba383d7b7c38dd2fa7f)", + "cairo-lang-diagnostics", + "cairo-lang-filesystem", + "cairo-lang-syntax", + "cairo-lang-syntax-codegen", + "cairo-lang-utils", "colored", "itertools 0.11.0", "num-bigint", @@ -829,35 +690,17 @@ dependencies = [ "unescaper", ] -[[package]] -name = "cairo-lang-plugins" -version = "2.3.0" -source = "git+https://github.com/starkware-libs/cairo?tag=v2.3.0#0c67a87fb24131f21fd4b8709b88e15eaeaf18de" -dependencies = [ - "cairo-lang-defs 2.3.0 (git+https://github.com/starkware-libs/cairo?tag=v2.3.0)", - "cairo-lang-diagnostics 2.3.0 (git+https://github.com/starkware-libs/cairo?tag=v2.3.0)", - "cairo-lang-filesystem 2.3.0 (git+https://github.com/starkware-libs/cairo?tag=v2.3.0)", - "cairo-lang-parser 2.3.0 (git+https://github.com/starkware-libs/cairo?tag=v2.3.0)", - "cairo-lang-syntax 2.3.0 (git+https://github.com/starkware-libs/cairo?tag=v2.3.0)", - "cairo-lang-utils 2.3.0 (git+https://github.com/starkware-libs/cairo?tag=v2.3.0)", - "indent", - "indoc", - "itertools 0.11.0", - "salsa", - "smol_str", -] - [[package]] name = "cairo-lang-plugins" version = "2.3.0" source = "git+https://github.com/starkware-libs/cairo?rev=bf91adecc5a1cb2ced041ba383d7b7c38dd2fa7f#bf91adecc5a1cb2ced041ba383d7b7c38dd2fa7f" dependencies = [ - "cairo-lang-defs 2.3.0 (git+https://github.com/starkware-libs/cairo?rev=bf91adecc5a1cb2ced041ba383d7b7c38dd2fa7f)", - "cairo-lang-diagnostics 2.3.0 (git+https://github.com/starkware-libs/cairo?rev=bf91adecc5a1cb2ced041ba383d7b7c38dd2fa7f)", - "cairo-lang-filesystem 2.3.0 (git+https://github.com/starkware-libs/cairo?rev=bf91adecc5a1cb2ced041ba383d7b7c38dd2fa7f)", - "cairo-lang-parser 2.3.0 (git+https://github.com/starkware-libs/cairo?rev=bf91adecc5a1cb2ced041ba383d7b7c38dd2fa7f)", - "cairo-lang-syntax 2.3.0 (git+https://github.com/starkware-libs/cairo?rev=bf91adecc5a1cb2ced041ba383d7b7c38dd2fa7f)", - "cairo-lang-utils 2.3.0 (git+https://github.com/starkware-libs/cairo?rev=bf91adecc5a1cb2ced041ba383d7b7c38dd2fa7f)", + "cairo-lang-defs", + "cairo-lang-diagnostics", + "cairo-lang-filesystem", + "cairo-lang-parser", + "cairo-lang-syntax", + "cairo-lang-utils", "indent", "indoc", "itertools 0.11.0", @@ -865,46 +708,23 @@ dependencies = [ "smol_str", ] -[[package]] -name = "cairo-lang-proc-macros" -version = "2.3.0" -source = "git+https://github.com/starkware-libs/cairo?tag=v2.3.0#0c67a87fb24131f21fd4b8709b88e15eaeaf18de" -dependencies = [ - "cairo-lang-debug 2.3.0 (git+https://github.com/starkware-libs/cairo?tag=v2.3.0)", - "quote", - "syn 2.0.37", -] - [[package]] name = "cairo-lang-proc-macros" version = "2.3.0" source = "git+https://github.com/starkware-libs/cairo?rev=bf91adecc5a1cb2ced041ba383d7b7c38dd2fa7f#bf91adecc5a1cb2ced041ba383d7b7c38dd2fa7f" dependencies = [ - "cairo-lang-debug 2.3.0 (git+https://github.com/starkware-libs/cairo?rev=bf91adecc5a1cb2ced041ba383d7b7c38dd2fa7f)", + "cairo-lang-debug", "quote", "syn 2.0.37", ] -[[package]] -name = "cairo-lang-project" -version = "2.3.0" -source = "git+https://github.com/starkware-libs/cairo?tag=v2.3.0#0c67a87fb24131f21fd4b8709b88e15eaeaf18de" -dependencies = [ - "cairo-lang-filesystem 2.3.0 (git+https://github.com/starkware-libs/cairo?tag=v2.3.0)", - "cairo-lang-utils 2.3.0 (git+https://github.com/starkware-libs/cairo?tag=v2.3.0)", - "serde", - "smol_str", - "thiserror", - "toml 0.7.8", -] - [[package]] name = "cairo-lang-project" version = "2.3.0" source = "git+https://github.com/starkware-libs/cairo?rev=bf91adecc5a1cb2ced041ba383d7b7c38dd2fa7f#bf91adecc5a1cb2ced041ba383d7b7c38dd2fa7f" dependencies = [ - "cairo-lang-filesystem 2.3.0 (git+https://github.com/starkware-libs/cairo?rev=bf91adecc5a1cb2ced041ba383d7b7c38dd2fa7f)", - "cairo-lang-utils 2.3.0 (git+https://github.com/starkware-libs/cairo?rev=bf91adecc5a1cb2ced041ba383d7b7c38dd2fa7f)", + "cairo-lang-filesystem", + "cairo-lang-utils", "serde", "smol_str", "thiserror", @@ -914,21 +734,21 @@ dependencies = [ [[package]] name = "cairo-lang-runner" version = "2.3.0" -source = "git+https://github.com/starkware-libs/cairo?tag=v2.3.0#0c67a87fb24131f21fd4b8709b88e15eaeaf18de" +source = "git+https://github.com/starkware-libs/cairo?rev=bf91adecc5a1cb2ced041ba383d7b7c38dd2fa7f#bf91adecc5a1cb2ced041ba383d7b7c38dd2fa7f" dependencies = [ "ark-ff", "ark-secp256k1", "ark-secp256r1", "ark-std 0.4.0", "cairo-felt", - "cairo-lang-casm 2.3.0 (git+https://github.com/starkware-libs/cairo?tag=v2.3.0)", - "cairo-lang-sierra 2.3.0 (git+https://github.com/starkware-libs/cairo?tag=v2.3.0)", - "cairo-lang-sierra-ap-change 2.3.0 (git+https://github.com/starkware-libs/cairo?tag=v2.3.0)", - "cairo-lang-sierra-gas 2.3.0 (git+https://github.com/starkware-libs/cairo?tag=v2.3.0)", - "cairo-lang-sierra-to-casm 2.3.0 (git+https://github.com/starkware-libs/cairo?tag=v2.3.0)", - "cairo-lang-sierra-type-size 2.3.0 (git+https://github.com/starkware-libs/cairo?tag=v2.3.0)", - "cairo-lang-starknet 2.3.0 (git+https://github.com/starkware-libs/cairo?tag=v2.3.0)", - "cairo-lang-utils 2.3.0 (git+https://github.com/starkware-libs/cairo?tag=v2.3.0)", + "cairo-lang-casm", + "cairo-lang-sierra", + "cairo-lang-sierra-ap-change", + "cairo-lang-sierra-gas", + "cairo-lang-sierra-to-casm", + "cairo-lang-sierra-type-size", + "cairo-lang-starknet", + "cairo-lang-utils", "cairo-vm", "itertools 0.11.0", "keccak", @@ -938,41 +758,19 @@ dependencies = [ "thiserror", ] -[[package]] -name = "cairo-lang-semantic" -version = "2.3.0" -source = "git+https://github.com/starkware-libs/cairo?tag=v2.3.0#0c67a87fb24131f21fd4b8709b88e15eaeaf18de" -dependencies = [ - "cairo-lang-debug 2.3.0 (git+https://github.com/starkware-libs/cairo?tag=v2.3.0)", - "cairo-lang-defs 2.3.0 (git+https://github.com/starkware-libs/cairo?tag=v2.3.0)", - "cairo-lang-diagnostics 2.3.0 (git+https://github.com/starkware-libs/cairo?tag=v2.3.0)", - "cairo-lang-filesystem 2.3.0 (git+https://github.com/starkware-libs/cairo?tag=v2.3.0)", - "cairo-lang-parser 2.3.0 (git+https://github.com/starkware-libs/cairo?tag=v2.3.0)", - "cairo-lang-proc-macros 2.3.0 (git+https://github.com/starkware-libs/cairo?tag=v2.3.0)", - "cairo-lang-syntax 2.3.0 (git+https://github.com/starkware-libs/cairo?tag=v2.3.0)", - "cairo-lang-utils 2.3.0 (git+https://github.com/starkware-libs/cairo?tag=v2.3.0)", - "id-arena", - "itertools 0.11.0", - "num-bigint", - "num-traits 0.2.16", - "once_cell", - "salsa", - "smol_str", -] - [[package]] name = "cairo-lang-semantic" version = "2.3.0" source = "git+https://github.com/starkware-libs/cairo?rev=bf91adecc5a1cb2ced041ba383d7b7c38dd2fa7f#bf91adecc5a1cb2ced041ba383d7b7c38dd2fa7f" dependencies = [ - "cairo-lang-debug 2.3.0 (git+https://github.com/starkware-libs/cairo?rev=bf91adecc5a1cb2ced041ba383d7b7c38dd2fa7f)", - "cairo-lang-defs 2.3.0 (git+https://github.com/starkware-libs/cairo?rev=bf91adecc5a1cb2ced041ba383d7b7c38dd2fa7f)", - "cairo-lang-diagnostics 2.3.0 (git+https://github.com/starkware-libs/cairo?rev=bf91adecc5a1cb2ced041ba383d7b7c38dd2fa7f)", - "cairo-lang-filesystem 2.3.0 (git+https://github.com/starkware-libs/cairo?rev=bf91adecc5a1cb2ced041ba383d7b7c38dd2fa7f)", - "cairo-lang-parser 2.3.0 (git+https://github.com/starkware-libs/cairo?rev=bf91adecc5a1cb2ced041ba383d7b7c38dd2fa7f)", - "cairo-lang-proc-macros 2.3.0 (git+https://github.com/starkware-libs/cairo?rev=bf91adecc5a1cb2ced041ba383d7b7c38dd2fa7f)", - "cairo-lang-syntax 2.3.0 (git+https://github.com/starkware-libs/cairo?rev=bf91adecc5a1cb2ced041ba383d7b7c38dd2fa7f)", - "cairo-lang-utils 2.3.0 (git+https://github.com/starkware-libs/cairo?rev=bf91adecc5a1cb2ced041ba383d7b7c38dd2fa7f)", + "cairo-lang-debug", + "cairo-lang-defs", + "cairo-lang-diagnostics", + "cairo-lang-filesystem", + "cairo-lang-parser", + "cairo-lang-proc-macros", + "cairo-lang-syntax", + "cairo-lang-utils", "id-arena", "itertools 0.11.0", "num-bigint", @@ -982,36 +780,13 @@ dependencies = [ "smol_str", ] -[[package]] -name = "cairo-lang-sierra" -version = "2.3.0" -source = "git+https://github.com/starkware-libs/cairo?tag=v2.3.0#0c67a87fb24131f21fd4b8709b88e15eaeaf18de" -dependencies = [ - "anyhow", - "cairo-lang-utils 2.3.0 (git+https://github.com/starkware-libs/cairo?tag=v2.3.0)", - "const-fnv1a-hash", - "convert_case", - "derivative", - "itertools 0.11.0", - "lalrpop", - "lalrpop-util", - "num-bigint", - "num-traits 0.2.16", - "regex", - "salsa", - "serde", - "sha3", - "smol_str", - "thiserror", -] - [[package]] name = "cairo-lang-sierra" version = "2.3.0" source = "git+https://github.com/starkware-libs/cairo?rev=bf91adecc5a1cb2ced041ba383d7b7c38dd2fa7f#bf91adecc5a1cb2ced041ba383d7b7c38dd2fa7f" dependencies = [ "anyhow", - "cairo-lang-utils 2.3.0 (git+https://github.com/starkware-libs/cairo?rev=bf91adecc5a1cb2ced041ba383d7b7c38dd2fa7f)", + "cairo-lang-utils", "const-fnv1a-hash", "convert_case", "derivative", @@ -1029,41 +804,15 @@ dependencies = [ "thiserror", ] -[[package]] -name = "cairo-lang-sierra-ap-change" -version = "2.3.0" -source = "git+https://github.com/starkware-libs/cairo?tag=v2.3.0#0c67a87fb24131f21fd4b8709b88e15eaeaf18de" -dependencies = [ - "cairo-lang-eq-solver 2.3.0 (git+https://github.com/starkware-libs/cairo?tag=v2.3.0)", - "cairo-lang-sierra 2.3.0 (git+https://github.com/starkware-libs/cairo?tag=v2.3.0)", - "cairo-lang-sierra-type-size 2.3.0 (git+https://github.com/starkware-libs/cairo?tag=v2.3.0)", - "cairo-lang-utils 2.3.0 (git+https://github.com/starkware-libs/cairo?tag=v2.3.0)", - "itertools 0.11.0", - "thiserror", -] - [[package]] name = "cairo-lang-sierra-ap-change" version = "2.3.0" source = "git+https://github.com/starkware-libs/cairo?rev=bf91adecc5a1cb2ced041ba383d7b7c38dd2fa7f#bf91adecc5a1cb2ced041ba383d7b7c38dd2fa7f" dependencies = [ - "cairo-lang-eq-solver 2.3.0 (git+https://github.com/starkware-libs/cairo?rev=bf91adecc5a1cb2ced041ba383d7b7c38dd2fa7f)", - "cairo-lang-sierra 2.3.0 (git+https://github.com/starkware-libs/cairo?rev=bf91adecc5a1cb2ced041ba383d7b7c38dd2fa7f)", - "cairo-lang-sierra-type-size 2.3.0 (git+https://github.com/starkware-libs/cairo?rev=bf91adecc5a1cb2ced041ba383d7b7c38dd2fa7f)", - "cairo-lang-utils 2.3.0 (git+https://github.com/starkware-libs/cairo?rev=bf91adecc5a1cb2ced041ba383d7b7c38dd2fa7f)", - "itertools 0.11.0", - "thiserror", -] - -[[package]] -name = "cairo-lang-sierra-gas" -version = "2.3.0" -source = "git+https://github.com/starkware-libs/cairo?tag=v2.3.0#0c67a87fb24131f21fd4b8709b88e15eaeaf18de" -dependencies = [ - "cairo-lang-eq-solver 2.3.0 (git+https://github.com/starkware-libs/cairo?tag=v2.3.0)", - "cairo-lang-sierra 2.3.0 (git+https://github.com/starkware-libs/cairo?tag=v2.3.0)", - "cairo-lang-sierra-type-size 2.3.0 (git+https://github.com/starkware-libs/cairo?tag=v2.3.0)", - "cairo-lang-utils 2.3.0 (git+https://github.com/starkware-libs/cairo?tag=v2.3.0)", + "cairo-lang-eq-solver", + "cairo-lang-sierra", + "cairo-lang-sierra-type-size", + "cairo-lang-utils", "itertools 0.11.0", "thiserror", ] @@ -1073,51 +822,29 @@ name = "cairo-lang-sierra-gas" version = "2.3.0" source = "git+https://github.com/starkware-libs/cairo?rev=bf91adecc5a1cb2ced041ba383d7b7c38dd2fa7f#bf91adecc5a1cb2ced041ba383d7b7c38dd2fa7f" dependencies = [ - "cairo-lang-eq-solver 2.3.0 (git+https://github.com/starkware-libs/cairo?rev=bf91adecc5a1cb2ced041ba383d7b7c38dd2fa7f)", - "cairo-lang-sierra 2.3.0 (git+https://github.com/starkware-libs/cairo?rev=bf91adecc5a1cb2ced041ba383d7b7c38dd2fa7f)", - "cairo-lang-sierra-type-size 2.3.0 (git+https://github.com/starkware-libs/cairo?rev=bf91adecc5a1cb2ced041ba383d7b7c38dd2fa7f)", - "cairo-lang-utils 2.3.0 (git+https://github.com/starkware-libs/cairo?rev=bf91adecc5a1cb2ced041ba383d7b7c38dd2fa7f)", + "cairo-lang-eq-solver", + "cairo-lang-sierra", + "cairo-lang-sierra-type-size", + "cairo-lang-utils", "itertools 0.11.0", "thiserror", ] -[[package]] -name = "cairo-lang-sierra-generator" -version = "2.3.0" -source = "git+https://github.com/starkware-libs/cairo?tag=v2.3.0#0c67a87fb24131f21fd4b8709b88e15eaeaf18de" -dependencies = [ - "cairo-lang-debug 2.3.0 (git+https://github.com/starkware-libs/cairo?tag=v2.3.0)", - "cairo-lang-defs 2.3.0 (git+https://github.com/starkware-libs/cairo?tag=v2.3.0)", - "cairo-lang-diagnostics 2.3.0 (git+https://github.com/starkware-libs/cairo?tag=v2.3.0)", - "cairo-lang-filesystem 2.3.0 (git+https://github.com/starkware-libs/cairo?tag=v2.3.0)", - "cairo-lang-lowering 2.3.0 (git+https://github.com/starkware-libs/cairo?tag=v2.3.0)", - "cairo-lang-parser 2.3.0 (git+https://github.com/starkware-libs/cairo?tag=v2.3.0)", - "cairo-lang-semantic 2.3.0 (git+https://github.com/starkware-libs/cairo?tag=v2.3.0)", - "cairo-lang-sierra 2.3.0 (git+https://github.com/starkware-libs/cairo?tag=v2.3.0)", - "cairo-lang-syntax 2.3.0 (git+https://github.com/starkware-libs/cairo?tag=v2.3.0)", - "cairo-lang-utils 2.3.0 (git+https://github.com/starkware-libs/cairo?tag=v2.3.0)", - "itertools 0.11.0", - "num-bigint", - "once_cell", - "salsa", - "smol_str", -] - [[package]] name = "cairo-lang-sierra-generator" version = "2.3.0" source = "git+https://github.com/starkware-libs/cairo?rev=bf91adecc5a1cb2ced041ba383d7b7c38dd2fa7f#bf91adecc5a1cb2ced041ba383d7b7c38dd2fa7f" dependencies = [ - "cairo-lang-debug 2.3.0 (git+https://github.com/starkware-libs/cairo?rev=bf91adecc5a1cb2ced041ba383d7b7c38dd2fa7f)", - "cairo-lang-defs 2.3.0 (git+https://github.com/starkware-libs/cairo?rev=bf91adecc5a1cb2ced041ba383d7b7c38dd2fa7f)", - "cairo-lang-diagnostics 2.3.0 (git+https://github.com/starkware-libs/cairo?rev=bf91adecc5a1cb2ced041ba383d7b7c38dd2fa7f)", - "cairo-lang-filesystem 2.3.0 (git+https://github.com/starkware-libs/cairo?rev=bf91adecc5a1cb2ced041ba383d7b7c38dd2fa7f)", - "cairo-lang-lowering 2.3.0 (git+https://github.com/starkware-libs/cairo?rev=bf91adecc5a1cb2ced041ba383d7b7c38dd2fa7f)", - "cairo-lang-parser 2.3.0 (git+https://github.com/starkware-libs/cairo?rev=bf91adecc5a1cb2ced041ba383d7b7c38dd2fa7f)", - "cairo-lang-semantic 2.3.0 (git+https://github.com/starkware-libs/cairo?rev=bf91adecc5a1cb2ced041ba383d7b7c38dd2fa7f)", - "cairo-lang-sierra 2.3.0 (git+https://github.com/starkware-libs/cairo?rev=bf91adecc5a1cb2ced041ba383d7b7c38dd2fa7f)", - "cairo-lang-syntax 2.3.0 (git+https://github.com/starkware-libs/cairo?rev=bf91adecc5a1cb2ced041ba383d7b7c38dd2fa7f)", - "cairo-lang-utils 2.3.0 (git+https://github.com/starkware-libs/cairo?rev=bf91adecc5a1cb2ced041ba383d7b7c38dd2fa7f)", + "cairo-lang-debug", + "cairo-lang-defs", + "cairo-lang-diagnostics", + "cairo-lang-filesystem", + "cairo-lang-lowering", + "cairo-lang-parser", + "cairo-lang-semantic", + "cairo-lang-sierra", + "cairo-lang-syntax", + "cairo-lang-utils", "indexmap 2.0.2", "itertools 0.11.0", "num-bigint", @@ -1126,26 +853,6 @@ dependencies = [ "smol_str", ] -[[package]] -name = "cairo-lang-sierra-to-casm" -version = "2.3.0" -source = "git+https://github.com/starkware-libs/cairo?tag=v2.3.0#0c67a87fb24131f21fd4b8709b88e15eaeaf18de" -dependencies = [ - "assert_matches", - "cairo-felt", - "cairo-lang-casm 2.3.0 (git+https://github.com/starkware-libs/cairo?tag=v2.3.0)", - "cairo-lang-sierra 2.3.0 (git+https://github.com/starkware-libs/cairo?tag=v2.3.0)", - "cairo-lang-sierra-ap-change 2.3.0 (git+https://github.com/starkware-libs/cairo?tag=v2.3.0)", - "cairo-lang-sierra-gas 2.3.0 (git+https://github.com/starkware-libs/cairo?tag=v2.3.0)", - "cairo-lang-sierra-type-size 2.3.0 (git+https://github.com/starkware-libs/cairo?tag=v2.3.0)", - "cairo-lang-utils 2.3.0 (git+https://github.com/starkware-libs/cairo?tag=v2.3.0)", - "indoc", - "itertools 0.11.0", - "num-bigint", - "num-traits 0.2.16", - "thiserror", -] - [[package]] name = "cairo-lang-sierra-to-casm" version = "2.3.0" @@ -1153,12 +860,12 @@ source = "git+https://github.com/starkware-libs/cairo?rev=bf91adecc5a1cb2ced041b dependencies = [ "assert_matches", "cairo-felt", - "cairo-lang-casm 2.3.0 (git+https://github.com/starkware-libs/cairo?rev=bf91adecc5a1cb2ced041ba383d7b7c38dd2fa7f)", - "cairo-lang-sierra 2.3.0 (git+https://github.com/starkware-libs/cairo?rev=bf91adecc5a1cb2ced041ba383d7b7c38dd2fa7f)", - "cairo-lang-sierra-ap-change 2.3.0 (git+https://github.com/starkware-libs/cairo?rev=bf91adecc5a1cb2ced041ba383d7b7c38dd2fa7f)", - "cairo-lang-sierra-gas 2.3.0 (git+https://github.com/starkware-libs/cairo?rev=bf91adecc5a1cb2ced041ba383d7b7c38dd2fa7f)", - "cairo-lang-sierra-type-size 2.3.0 (git+https://github.com/starkware-libs/cairo?rev=bf91adecc5a1cb2ced041ba383d7b7c38dd2fa7f)", - "cairo-lang-utils 2.3.0 (git+https://github.com/starkware-libs/cairo?rev=bf91adecc5a1cb2ced041ba383d7b7c38dd2fa7f)", + "cairo-lang-casm", + "cairo-lang-sierra", + "cairo-lang-sierra-ap-change", + "cairo-lang-sierra-gas", + "cairo-lang-sierra-type-size", + "cairo-lang-utils", "indoc", "itertools 0.11.0", "num-bigint", @@ -1166,57 +873,13 @@ dependencies = [ "thiserror", ] -[[package]] -name = "cairo-lang-sierra-type-size" -version = "2.3.0" -source = "git+https://github.com/starkware-libs/cairo?tag=v2.3.0#0c67a87fb24131f21fd4b8709b88e15eaeaf18de" -dependencies = [ - "cairo-lang-sierra 2.3.0 (git+https://github.com/starkware-libs/cairo?tag=v2.3.0)", - "cairo-lang-utils 2.3.0 (git+https://github.com/starkware-libs/cairo?tag=v2.3.0)", -] - [[package]] name = "cairo-lang-sierra-type-size" version = "2.3.0" source = "git+https://github.com/starkware-libs/cairo?rev=bf91adecc5a1cb2ced041ba383d7b7c38dd2fa7f#bf91adecc5a1cb2ced041ba383d7b7c38dd2fa7f" dependencies = [ - "cairo-lang-sierra 2.3.0 (git+https://github.com/starkware-libs/cairo?rev=bf91adecc5a1cb2ced041ba383d7b7c38dd2fa7f)", - "cairo-lang-utils 2.3.0 (git+https://github.com/starkware-libs/cairo?rev=bf91adecc5a1cb2ced041ba383d7b7c38dd2fa7f)", -] - -[[package]] -name = "cairo-lang-starknet" -version = "2.3.0" -source = "git+https://github.com/starkware-libs/cairo?tag=v2.3.0#0c67a87fb24131f21fd4b8709b88e15eaeaf18de" -dependencies = [ - "anyhow", - "cairo-felt", - "cairo-lang-casm 2.3.0 (git+https://github.com/starkware-libs/cairo?tag=v2.3.0)", - "cairo-lang-compiler 2.3.0 (git+https://github.com/starkware-libs/cairo?tag=v2.3.0)", - "cairo-lang-defs 2.3.0 (git+https://github.com/starkware-libs/cairo?tag=v2.3.0)", - "cairo-lang-diagnostics 2.3.0 (git+https://github.com/starkware-libs/cairo?tag=v2.3.0)", - "cairo-lang-filesystem 2.3.0 (git+https://github.com/starkware-libs/cairo?tag=v2.3.0)", - "cairo-lang-lowering 2.3.0 (git+https://github.com/starkware-libs/cairo?tag=v2.3.0)", - "cairo-lang-semantic 2.3.0 (git+https://github.com/starkware-libs/cairo?tag=v2.3.0)", - "cairo-lang-sierra 2.3.0 (git+https://github.com/starkware-libs/cairo?tag=v2.3.0)", - "cairo-lang-sierra-generator 2.3.0 (git+https://github.com/starkware-libs/cairo?tag=v2.3.0)", - "cairo-lang-sierra-to-casm 2.3.0 (git+https://github.com/starkware-libs/cairo?tag=v2.3.0)", - "cairo-lang-syntax 2.3.0 (git+https://github.com/starkware-libs/cairo?tag=v2.3.0)", - "cairo-lang-utils 2.3.0 (git+https://github.com/starkware-libs/cairo?tag=v2.3.0)", - "const_format", - "convert_case", - "indent", - "indoc", - "itertools 0.11.0", - "num-bigint", - "num-integer", - "num-traits 0.2.16", - "once_cell", - "serde", - "serde_json", - "sha3", - "smol_str", - "thiserror", + "cairo-lang-sierra", + "cairo-lang-utils", ] [[package]] @@ -1226,18 +889,18 @@ source = "git+https://github.com/starkware-libs/cairo?rev=bf91adecc5a1cb2ced041b dependencies = [ "anyhow", "cairo-felt", - "cairo-lang-casm 2.3.0 (git+https://github.com/starkware-libs/cairo?rev=bf91adecc5a1cb2ced041ba383d7b7c38dd2fa7f)", - "cairo-lang-compiler 2.3.0 (git+https://github.com/starkware-libs/cairo?rev=bf91adecc5a1cb2ced041ba383d7b7c38dd2fa7f)", - "cairo-lang-defs 2.3.0 (git+https://github.com/starkware-libs/cairo?rev=bf91adecc5a1cb2ced041ba383d7b7c38dd2fa7f)", - "cairo-lang-diagnostics 2.3.0 (git+https://github.com/starkware-libs/cairo?rev=bf91adecc5a1cb2ced041ba383d7b7c38dd2fa7f)", - "cairo-lang-filesystem 2.3.0 (git+https://github.com/starkware-libs/cairo?rev=bf91adecc5a1cb2ced041ba383d7b7c38dd2fa7f)", - "cairo-lang-lowering 2.3.0 (git+https://github.com/starkware-libs/cairo?rev=bf91adecc5a1cb2ced041ba383d7b7c38dd2fa7f)", - "cairo-lang-semantic 2.3.0 (git+https://github.com/starkware-libs/cairo?rev=bf91adecc5a1cb2ced041ba383d7b7c38dd2fa7f)", - "cairo-lang-sierra 2.3.0 (git+https://github.com/starkware-libs/cairo?rev=bf91adecc5a1cb2ced041ba383d7b7c38dd2fa7f)", - "cairo-lang-sierra-generator 2.3.0 (git+https://github.com/starkware-libs/cairo?rev=bf91adecc5a1cb2ced041ba383d7b7c38dd2fa7f)", - "cairo-lang-sierra-to-casm 2.3.0 (git+https://github.com/starkware-libs/cairo?rev=bf91adecc5a1cb2ced041ba383d7b7c38dd2fa7f)", - "cairo-lang-syntax 2.3.0 (git+https://github.com/starkware-libs/cairo?rev=bf91adecc5a1cb2ced041ba383d7b7c38dd2fa7f)", - "cairo-lang-utils 2.3.0 (git+https://github.com/starkware-libs/cairo?rev=bf91adecc5a1cb2ced041ba383d7b7c38dd2fa7f)", + "cairo-lang-casm", + "cairo-lang-compiler", + "cairo-lang-defs", + "cairo-lang-diagnostics", + "cairo-lang-filesystem", + "cairo-lang-lowering", + "cairo-lang-semantic", + "cairo-lang-sierra", + "cairo-lang-sierra-generator", + "cairo-lang-sierra-to-casm", + "cairo-lang-syntax", + "cairo-lang-utils", "const_format", "convert_case", "indent", @@ -1254,29 +917,14 @@ dependencies = [ "thiserror", ] -[[package]] -name = "cairo-lang-syntax" -version = "2.3.0" -source = "git+https://github.com/starkware-libs/cairo?tag=v2.3.0#0c67a87fb24131f21fd4b8709b88e15eaeaf18de" -dependencies = [ - "cairo-lang-debug 2.3.0 (git+https://github.com/starkware-libs/cairo?tag=v2.3.0)", - "cairo-lang-filesystem 2.3.0 (git+https://github.com/starkware-libs/cairo?tag=v2.3.0)", - "cairo-lang-utils 2.3.0 (git+https://github.com/starkware-libs/cairo?tag=v2.3.0)", - "num-bigint", - "num-traits 0.2.16", - "salsa", - "smol_str", - "unescaper", -] - [[package]] name = "cairo-lang-syntax" version = "2.3.0" source = "git+https://github.com/starkware-libs/cairo?rev=bf91adecc5a1cb2ced041ba383d7b7c38dd2fa7f#bf91adecc5a1cb2ced041ba383d7b7c38dd2fa7f" dependencies = [ - "cairo-lang-debug 2.3.0 (git+https://github.com/starkware-libs/cairo?rev=bf91adecc5a1cb2ced041ba383d7b7c38dd2fa7f)", - "cairo-lang-filesystem 2.3.0 (git+https://github.com/starkware-libs/cairo?rev=bf91adecc5a1cb2ced041ba383d7b7c38dd2fa7f)", - "cairo-lang-utils 2.3.0 (git+https://github.com/starkware-libs/cairo?rev=bf91adecc5a1cb2ced041ba383d7b7c38dd2fa7f)", + "cairo-lang-debug", + "cairo-lang-filesystem", + "cairo-lang-utils", "num-bigint", "num-traits 0.2.16", "salsa", @@ -1284,15 +932,6 @@ dependencies = [ "unescaper", ] -[[package]] -name = "cairo-lang-syntax-codegen" -version = "2.3.0" -source = "git+https://github.com/starkware-libs/cairo?tag=v2.3.0#0c67a87fb24131f21fd4b8709b88e15eaeaf18de" -dependencies = [ - "genco", - "xshell", -] - [[package]] name = "cairo-lang-syntax-codegen" version = "2.3.0" @@ -1302,30 +941,6 @@ dependencies = [ "xshell", ] -[[package]] -name = "cairo-lang-test-plugin" -version = "2.3.0" -source = "git+https://github.com/starkware-libs/cairo?tag=v2.3.0#0c67a87fb24131f21fd4b8709b88e15eaeaf18de" -dependencies = [ - "anyhow", - "cairo-felt", - "cairo-lang-compiler 2.3.0 (git+https://github.com/starkware-libs/cairo?tag=v2.3.0)", - "cairo-lang-debug 2.3.0 (git+https://github.com/starkware-libs/cairo?tag=v2.3.0)", - "cairo-lang-defs 2.3.0 (git+https://github.com/starkware-libs/cairo?tag=v2.3.0)", - "cairo-lang-diagnostics 2.3.0 (git+https://github.com/starkware-libs/cairo?tag=v2.3.0)", - "cairo-lang-filesystem 2.3.0 (git+https://github.com/starkware-libs/cairo?tag=v2.3.0)", - "cairo-lang-lowering 2.3.0 (git+https://github.com/starkware-libs/cairo?tag=v2.3.0)", - "cairo-lang-semantic 2.3.0 (git+https://github.com/starkware-libs/cairo?tag=v2.3.0)", - "cairo-lang-sierra 2.3.0 (git+https://github.com/starkware-libs/cairo?tag=v2.3.0)", - "cairo-lang-sierra-generator 2.3.0 (git+https://github.com/starkware-libs/cairo?tag=v2.3.0)", - "cairo-lang-starknet 2.3.0 (git+https://github.com/starkware-libs/cairo?tag=v2.3.0)", - "cairo-lang-syntax 2.3.0 (git+https://github.com/starkware-libs/cairo?tag=v2.3.0)", - "cairo-lang-utils 2.3.0 (git+https://github.com/starkware-libs/cairo?tag=v2.3.0)", - "itertools 0.11.0", - "num-traits 0.2.16", - "serde", -] - [[package]] name = "cairo-lang-test-plugin" version = "2.3.0" @@ -1333,18 +948,18 @@ source = "git+https://github.com/starkware-libs/cairo?rev=bf91adecc5a1cb2ced041b dependencies = [ "anyhow", "cairo-felt", - "cairo-lang-compiler 2.3.0 (git+https://github.com/starkware-libs/cairo?rev=bf91adecc5a1cb2ced041ba383d7b7c38dd2fa7f)", - "cairo-lang-debug 2.3.0 (git+https://github.com/starkware-libs/cairo?rev=bf91adecc5a1cb2ced041ba383d7b7c38dd2fa7f)", - "cairo-lang-defs 2.3.0 (git+https://github.com/starkware-libs/cairo?rev=bf91adecc5a1cb2ced041ba383d7b7c38dd2fa7f)", - "cairo-lang-diagnostics 2.3.0 (git+https://github.com/starkware-libs/cairo?rev=bf91adecc5a1cb2ced041ba383d7b7c38dd2fa7f)", - "cairo-lang-filesystem 2.3.0 (git+https://github.com/starkware-libs/cairo?rev=bf91adecc5a1cb2ced041ba383d7b7c38dd2fa7f)", - "cairo-lang-lowering 2.3.0 (git+https://github.com/starkware-libs/cairo?rev=bf91adecc5a1cb2ced041ba383d7b7c38dd2fa7f)", - "cairo-lang-semantic 2.3.0 (git+https://github.com/starkware-libs/cairo?rev=bf91adecc5a1cb2ced041ba383d7b7c38dd2fa7f)", - "cairo-lang-sierra 2.3.0 (git+https://github.com/starkware-libs/cairo?rev=bf91adecc5a1cb2ced041ba383d7b7c38dd2fa7f)", - "cairo-lang-sierra-generator 2.3.0 (git+https://github.com/starkware-libs/cairo?rev=bf91adecc5a1cb2ced041ba383d7b7c38dd2fa7f)", - "cairo-lang-starknet 2.3.0 (git+https://github.com/starkware-libs/cairo?rev=bf91adecc5a1cb2ced041ba383d7b7c38dd2fa7f)", - "cairo-lang-syntax 2.3.0 (git+https://github.com/starkware-libs/cairo?rev=bf91adecc5a1cb2ced041ba383d7b7c38dd2fa7f)", - "cairo-lang-utils 2.3.0 (git+https://github.com/starkware-libs/cairo?rev=bf91adecc5a1cb2ced041ba383d7b7c38dd2fa7f)", + "cairo-lang-compiler", + "cairo-lang-debug", + "cairo-lang-defs", + "cairo-lang-diagnostics", + "cairo-lang-filesystem", + "cairo-lang-lowering", + "cairo-lang-semantic", + "cairo-lang-sierra", + "cairo-lang-sierra-generator", + "cairo-lang-starknet", + "cairo-lang-syntax", + "cairo-lang-utils", "itertools 0.11.0", "num-bigint", "num-traits 0.2.16", @@ -1354,38 +969,24 @@ dependencies = [ [[package]] name = "cairo-lang-test-runner" version = "2.3.0" -source = "git+https://github.com/starkware-libs/cairo?tag=v2.3.0#0c67a87fb24131f21fd4b8709b88e15eaeaf18de" +source = "git+https://github.com/starkware-libs/cairo?rev=bf91adecc5a1cb2ced041ba383d7b7c38dd2fa7f#bf91adecc5a1cb2ced041ba383d7b7c38dd2fa7f" dependencies = [ "anyhow", "cairo-felt", - "cairo-lang-compiler 2.3.0 (git+https://github.com/starkware-libs/cairo?tag=v2.3.0)", - "cairo-lang-filesystem 2.3.0 (git+https://github.com/starkware-libs/cairo?tag=v2.3.0)", + "cairo-lang-compiler", + "cairo-lang-filesystem", "cairo-lang-runner", - "cairo-lang-sierra 2.3.0 (git+https://github.com/starkware-libs/cairo?tag=v2.3.0)", - "cairo-lang-sierra-to-casm 2.3.0 (git+https://github.com/starkware-libs/cairo?tag=v2.3.0)", - "cairo-lang-starknet 2.3.0 (git+https://github.com/starkware-libs/cairo?tag=v2.3.0)", - "cairo-lang-test-plugin 2.3.0 (git+https://github.com/starkware-libs/cairo?tag=v2.3.0)", - "cairo-lang-utils 2.3.0 (git+https://github.com/starkware-libs/cairo?tag=v2.3.0)", + "cairo-lang-sierra", + "cairo-lang-sierra-to-casm", + "cairo-lang-starknet", + "cairo-lang-test-plugin", + "cairo-lang-utils", "colored", "itertools 0.11.0", "num-traits 0.2.16", "rayon 1.8.0", ] -[[package]] -name = "cairo-lang-utils" -version = "2.3.0" -source = "git+https://github.com/starkware-libs/cairo?tag=v2.3.0#0c67a87fb24131f21fd4b8709b88e15eaeaf18de" -dependencies = [ - "indexmap 2.0.2", - "itertools 0.11.0", - "num-bigint", - "num-traits 0.2.16", - "parity-scale-codec", - "schemars", - "serde", -] - [[package]] name = "cairo-lang-utils" version = "2.3.0" @@ -4638,16 +4239,16 @@ source = "git+https://github.com/software-mansion/scarb#7eb2819a2a2ad5ce8d1c3f76 dependencies = [ "anyhow", "async-trait", - "cairo-lang-compiler 2.3.0 (git+https://github.com/starkware-libs/cairo?rev=bf91adecc5a1cb2ced041ba383d7b7c38dd2fa7f)", - "cairo-lang-defs 2.3.0 (git+https://github.com/starkware-libs/cairo?rev=bf91adecc5a1cb2ced041ba383d7b7c38dd2fa7f)", - "cairo-lang-filesystem 2.3.0 (git+https://github.com/starkware-libs/cairo?rev=bf91adecc5a1cb2ced041ba383d7b7c38dd2fa7f)", + "cairo-lang-compiler", + "cairo-lang-defs", + "cairo-lang-filesystem", "cairo-lang-formatter", - "cairo-lang-semantic 2.3.0 (git+https://github.com/starkware-libs/cairo?rev=bf91adecc5a1cb2ced041ba383d7b7c38dd2fa7f)", - "cairo-lang-sierra 2.3.0 (git+https://github.com/starkware-libs/cairo?rev=bf91adecc5a1cb2ced041ba383d7b7c38dd2fa7f)", - "cairo-lang-sierra-to-casm 2.3.0 (git+https://github.com/starkware-libs/cairo?rev=bf91adecc5a1cb2ced041ba383d7b7c38dd2fa7f)", - "cairo-lang-starknet 2.3.0 (git+https://github.com/starkware-libs/cairo?rev=bf91adecc5a1cb2ced041ba383d7b7c38dd2fa7f)", - "cairo-lang-test-plugin 2.3.0 (git+https://github.com/starkware-libs/cairo?rev=bf91adecc5a1cb2ced041ba383d7b7c38dd2fa7f)", - "cairo-lang-utils 2.3.0 (git+https://github.com/starkware-libs/cairo?rev=bf91adecc5a1cb2ced041ba383d7b7c38dd2fa7f)", + "cairo-lang-semantic", + "cairo-lang-sierra", + "cairo-lang-sierra-to-casm", + "cairo-lang-starknet", + "cairo-lang-test-plugin", + "cairo-lang-utils", "camino", "clap", "clap-verbosity-flag", @@ -5058,7 +4659,9 @@ dependencies = [ "ark-std 0.3.0", "assert_cmd", "cairo-felt", - "cairo-lang-test-plugin 2.3.0 (git+https://github.com/starkware-libs/cairo?tag=v2.3.0)", + "cairo-lang-runner", + "cairo-lang-sierra", + "cairo-lang-test-plugin", "cairo-lang-test-runner", "camino", "clap", diff --git a/Cargo.toml b/Cargo.toml index f3e07b39a..e690a3cc9 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -24,8 +24,10 @@ glob = "0.3.0" cairo-felt = "0.8.2" # Cairo runner dependencies -cairo-lang-test-runner = {git = "https://github.com/starkware-libs/cairo", tag = "v2.3.0"} -cairo-lang-test-plugin = {git = "https://github.com/starkware-libs/cairo", tag = "v2.3.0"} +cairo-lang-test-runner = {git = "https://github.com/starkware-libs/cairo", rev = "bf91adecc5a1cb2ced041ba383d7b7c38dd2fa7f"} +cairo-lang-test-plugin = {git = "https://github.com/starkware-libs/cairo", rev = "bf91adecc5a1cb2ced041ba383d7b7c38dd2fa7f"} +cairo-lang-runner = {git = "https://github.com/starkware-libs/cairo", rev = "bf91adecc5a1cb2ced041ba383d7b7c38dd2fa7f"} +cairo-lang-sierra = {git = "https://github.com/starkware-libs/cairo", rev = "bf91adecc5a1cb2ced041ba383d7b7c38dd2fa7f"} scarb = { git = "https://github.com/software-mansion/scarb", version = "2.3.0" } scarb-ui = { git = "https://github.com/software-mansion/scarb", version = "0.1.0" } diff --git a/info.toml b/info.toml index bf18f4e01..9642012f1 100644 --- a/info.toml +++ b/info.toml @@ -3,7 +3,7 @@ [[exercises]] name = "intro1" path = "exercises/intro/intro1.cairo" -mode = "build" +mode = "run" hint = """ No hints this time ;) """ @@ -11,7 +11,7 @@ No hints this time ;) [[exercises]] name = "intro2" path = "exercises/intro/intro2.cairo" -mode = "build" +mode = "run" hint = """ No hints this time ;) """ @@ -21,7 +21,7 @@ No hints this time ;) [[exercises]] name = "variables1" path = "exercises/variables/variables1.cairo" -mode = "build" +mode = "run" hint = """ The declaration on line 8 is missing a keyword that is needed in Cairo to create a new variable binding.""" @@ -29,7 +29,7 @@ to create a new variable binding.""" [[exercises]] name = "variables2" path = "exercises/variables/variables2.cairo" -mode = "build" +mode = "run" hint = """ What happens if you annotate line 7 with a type annotation? What if you give x a value? @@ -40,7 +40,7 @@ What if x is the same type as 10? What if it's a different type? (e.g. a u8)""" [[exercises]] name = "variables3" path = "exercises/variables/variables3.cairo" -mode = "build" +mode = "run" hint = """ Oops! In this exercise, we have a variable binding that we've created on line 7, and we're trying to use it on line 8, but we haven't given it a @@ -51,7 +51,7 @@ programming language -- thankfully the Cairo compiler has caught this for us!""" [[exercises]] name = "variables4" path = "exercises/variables/variables4.cairo" -mode = "build" +mode = "run" hint = """ In Cairo, variable bindings are immutable by default. But here we're trying to reassign a different value to x! There's a keyword we can use to make @@ -60,7 +60,7 @@ a variable binding mutable instead.""" [[exercises]] name = "variables5" path = "exercises/variables/variables5.cairo" -mode = "build" +mode = "run" hint = """ In variables4 we already learned how to make an immutable variable mutable using a special keyword. Unfortunately this doesn't help us much in this exercise @@ -75,7 +75,7 @@ Try to solve this exercise afterwards using this technique.""" [[exercises]] name = "variables6" path = "exercises/variables/variables6.cairo" -mode = "build" +mode = "run" hint = """ We know about variables and mutability, but there is another important type of variable available: constants. @@ -90,19 +90,19 @@ You can read about the constants here: https://book.cairo-lang.org/ch02-01-varia [[exercises]] name = "primitive_types1" path = "exercises/primitive_types/primitive_types1.cairo" -mode = "build" +mode = "run" hint = "No hints this time ;)" [[exercises]] name = "primitive_types2" path = "exercises/primitive_types/primitive_types2.cairo" -mode = "build" +mode = "run" hint = "No hints this time ;)" [[exercises]] name = "primitive_types3" path = "exercises/primitive_types/primitive_types3.cairo" -mode = "build" +mode = "run" hint = """ You'll need to make a pattern to bind `name` and `age` to the appropriate parts of the tuple. @@ -168,7 +168,7 @@ conditions checking different input values.""" [[exercises]] name = "functions1" path = "exercises/functions/functions1.cairo" -mode = "build" +mode = "run" hint = """ This main function is calling a function that it expects to exist, but the function doesn't exist. It expects this function to have the name `call_me`. @@ -178,7 +178,7 @@ Sounds a lot like `main`, doesn't it?""" [[exercises]] name = "functions2" path = "exercises/functions/functions2.cairo" -mode = "build" +mode = "run" hint = """ Cairo requires that all parts of a function's signature have type annotations, but `call_me` is missing the type annotation of `num`. What is the basic type in Cairo?""" @@ -186,7 +186,7 @@ but `call_me` is missing the type annotation of `num`. What is the basic type in [[exercises]] name = "functions3" path = "exercises/functions/functions3.cairo" -mode = "build" +mode = "run" hint = """ This time, the function *declaration* is okay, but there's something wrong with the place where we're calling the function. @@ -197,7 +197,7 @@ Watch mode will only jump to the next exercise if you remove the I AM NOT DONE c [[exercises]] name = "functions4" path = "exercises/functions/functions4.cairo" -mode = "build" +mode = "run" hint = """ The error message points to line 18 and says it expects a type after the `->`. This is where the function's return type should be -- take a look at @@ -235,13 +235,13 @@ You can return values from loops by adding the value you want returned after the [[exercises]] name = "enums1" path = "exercises/enums/enums1.cairo" -mode = "build" +mode = "run" hint = "https://book.cairo-lang.org/ch06-01-enums.html" [[exercises]] name = "enums2" path = "exercises/enums/enums2.cairo" -mode = "build" +mode = "run" hint = """ You can create enumerations that have different variants with different types such as no data, structs, a single felt string, tuples, ...etc @@ -385,7 +385,7 @@ This section will help you understanding more about methods https://book.cairo-l [[exercises]] name = "move_semantics1" path = "exercises/move_semantics/move_semantics1.cairo" -mode = "build" +mode = "run" hint = """ So you've got the "ref argument must be a mutable variable." error on line 17, right? The fix for this is going to be adding one keyword, and the addition is NOT on line 17 @@ -399,7 +399,7 @@ Read more about move semantics and ownership here: https://book.cairo-lang.org/c [[exercises]] name = "move_semantics2" path = "exercises/move_semantics/move_semantics2.cairo" -mode = "build" +mode = "run" hint = """ So, `arr0` is passed into the `fill_arr` function as an argument. In Cairo, when an argument is passed to a function and it's not explicitly returned, @@ -420,7 +420,7 @@ There's a few ways to fix this, try them all if you want: [[exercises]] name = "move_semantics3" path = "exercises/move_semantics/move_semantics3.cairo" -mode = "build" +mode = "run" hint = """ The difference between this one and the previous ones is that the first line of `fn fill_arr` that had `let mut arr = arr;` is no longer there. You can, @@ -430,7 +430,7 @@ an existing binding to be a mutable binding instead of an immutable one :)""" [[exercises]] name = "move_semantics4" path = "exercises/move_semantics/move_semantics4.cairo" -mode = "build" +mode = "run" hint = """ Stop reading whenever you feel like you have enough direction :) Or try doing one step and then fixing the compiler errors that result! @@ -456,7 +456,7 @@ Can we still use it later on? [[exercises]] name = "move_semantics6" path = "exercises/move_semantics/move_semantics6.cairo" -mode = "build" +mode = "run" hint = """ The first problem is that `get_value` is taking ownership of the Number struct. So `Number` is moved and can't be used for `set_value` diff --git a/src/exercise.rs b/src/exercise.rs index 1de1bb50e..013778455 100755 --- a/src/exercise.rs +++ b/src/exercise.rs @@ -7,7 +7,7 @@ use std::io::Read; use std::path::PathBuf; use std::process::{self}; -use crate::scarb::{scarb_build, scarb_test}; +use crate::scarb::{scarb_build, scarb_run, scarb_test}; const I_AM_DONE_REGEX: &str = r"(?m)^\s*///?\s*I\s+AM\s+NOT\s+DONE"; const CONTEXT: usize = 2; @@ -29,6 +29,8 @@ fn temp_file() -> String { pub enum Mode { // Indicates that the exercise should be compiled as a binary Build, + // Indicates that the exercise should run + Run, // Indicates that the exercise should be tested Test, } @@ -95,6 +97,10 @@ impl Exercise { scarb_build(&self.path) } + pub fn run(&self) -> anyhow::Result { + scarb_run(&self.path) + } + pub fn test(&self) -> anyhow::Result { scarb_test(&self.path) } diff --git a/src/run.rs b/src/run.rs index 05cbbf424..8b00273a7 100755 --- a/src/run.rs +++ b/src/run.rs @@ -8,7 +8,8 @@ use crate::exercise::{Exercise, Mode}; // the output from the test harnesses (if the mode of the exercise is test) pub fn run(exercise: &Exercise) -> Result<(), ()> { match exercise.mode { - Mode::Build => run_cairo(exercise)?, + Mode::Build => build_cairo(exercise)?, + Mode::Run => run_cairo(exercise)?, Mode::Test => test_cairo(exercise)?, } Ok(()) @@ -30,8 +31,8 @@ pub fn reset(exercise: &Exercise) -> Result<(), ()> { // Invoke the rust compiler on the path of the given exercise // and run the ensuing binary. // This is strictly for non-test binaries, so output is displayed -fn run_cairo(exercise: &Exercise) -> Result<(), ()> { - println!("\nRunning {exercise}...\n"); +fn build_cairo(exercise: &Exercise) -> Result<(), ()> { + println!("\nBuilding {exercise}...\n"); let output = exercise.build(); if let Some(error) = output.as_ref().err() { @@ -45,6 +46,24 @@ fn run_cairo(exercise: &Exercise) -> Result<(), ()> { } } +// Invoke the rust compiler on the path of the given exercise +// and run the ensuing binary. +// This is strictly for non-test binaries, so output is displayed +fn run_cairo(exercise: &Exercise) -> Result<(), ()> { + println!("\nRunning {exercise}...\n"); + let output = exercise.run(); + + if let Some(error) = output.as_ref().err() { + println!("{error}"); + Err(()) + } else { + let message = output.unwrap(); + println!("{message}"); + success!("Successfully ran {}", exercise); + Ok(()) + } +} + // Invoke the rust compiler on the path of the given exercise // and run the ensuing binary. // This is strictly for non-test binaries, so output is displayed @@ -58,7 +77,7 @@ fn test_cairo(exercise: &Exercise) -> Result<(), ()> { } else { let message = output.unwrap(); println!("{message}"); - success!("Successfully built {}", exercise); + success!("Successfully tested {}", exercise); Ok(()) } } diff --git a/src/scarb.rs b/src/scarb.rs index a61ef598b..f6806379c 100644 --- a/src/scarb.rs +++ b/src/scarb.rs @@ -1,10 +1,13 @@ use std::{env::current_dir, fs, path::PathBuf}; use anyhow::Context; +use cairo_lang_runner::{RunResultValue, SierraCasmRunner, StarknetState}; +use cairo_lang_sierra::program::VersionedProgram; use cairo_lang_test_plugin::TestCompilation; use cairo_lang_test_runner::{CompiledTestRunner, TestRunConfig}; use camino::Utf8PathBuf; +use itertools::Itertools; use scarb::{ core::{Config, TargetKind}, ops::{self, collect_metadata, CompileOpts, MetadataOptions}, @@ -39,6 +42,87 @@ pub fn scarb_build(file_path: &PathBuf) -> anyhow::Result { } } +// Runs the crate with scarb +pub fn scarb_run(file_path: &PathBuf) -> anyhow::Result { + let crate_path = prepare_crate_for_exercise(file_path); + let config = scarb_config(crate_path); + + let ws = ops::read_workspace(config.manifest_path(), &config)?; + + // Compile before running tests, with test targets true + compile(&config, false)?; + + let metadata = collect_metadata( + &MetadataOptions { + version: 1, + no_deps: false, + }, + &ws, + )?; + + let profile = "dev"; + let default_target_dir = metadata.runtime_manifest.join("target"); + + let target_dir = metadata + .target_dir + .clone() + .unwrap_or(default_target_dir) + .join(profile); + + // Process 'exercise_crate' targets + // Largely same as this + // https://github.com/software-mansion/scarb/blob/50e5d942f72a7b756c36fdc57b7899ad8b6ff7c7/extensions/scarb-cairo-run/src/main.rs#L61 + for package in metadata.packages.iter() { + if package.name != "exercise_crate" { + continue; + } + // Loop through targets and run compiled file tests + for target in package.targets.iter() { + // Skip test targets + if target.kind == "test" { + continue; + } + + let file_path = target_dir.join(format!("{}.sierra.json", target.name.clone())); + + assert!( + file_path.exists(), + "File {file_path} missing, please compile the project." + ); + + let sierra_program = serde_json::from_str::( + &fs::read_to_string(file_path.clone()) + .with_context(|| format!("failed to read Sierra file: {file_path}"))?, + ) + .with_context(|| format!("failed to deserialize Sierra program: {file_path}"))? + .into_v1() + .with_context(|| format!("failed to load Sierra program: {file_path}"))?; + + let runner = SierraCasmRunner::new(sierra_program.program, None, Default::default())?; + + let result = runner + .run_function_with_starknet_context( + runner.find_function("::main")?, + &[], + None, + StarknetState::default(), + ) + .context("failed to run the function")?; + + return match result.value { + RunResultValue::Success(return_val) => { + Ok(return_val.iter().map(|el| el.to_string()).join(",")) + } + RunResultValue::Panic(error) => { + anyhow::bail!(format!("error running the code, {:?}", error)) + } + }; + } + } + + Ok("".into()) +} + // Runs tests on the testing crate with scarb pub fn scarb_test(file_path: &PathBuf) -> anyhow::Result { let crate_path = prepare_crate_for_exercise(file_path); diff --git a/src/verify.rs b/src/verify.rs index b798ae5bd..6312cfb08 100755 --- a/src/verify.rs +++ b/src/verify.rs @@ -26,7 +26,8 @@ pub fn verify<'a>( ); bar.set_position(num_done as u64); let compile_result = match exercise.mode { - Mode::Build => compile_and_run_interactively(exercise), + Mode::Build => build_interactively(exercise), + Mode::Run => compile_and_run_interactively(exercise), Mode::Test => compile_and_test_interactively(exercise), }; if !compile_result.unwrap_or(false) { @@ -40,9 +41,18 @@ pub fn verify<'a>( } // Build the given Exercise -fn compile_and_run_interactively(exercise: &Exercise) -> Result { +fn build_interactively(exercise: &Exercise) -> Result { println!("Building {exercise} exercise..."); + let run_state = build_cairo_sierra(exercise)?; + + Ok(prompt_for_completion(exercise, Some(run_state))) +} + +// Build the given Exercise +fn compile_and_run_interactively(exercise: &Exercise) -> Result { + println!("Running {exercise} exercise..."); + let run_state = compile_and_run_cairo(exercise)?; Ok(prompt_for_completion(exercise, Some(run_state))) @@ -59,7 +69,7 @@ fn compile_and_test_interactively(exercise: &Exercise) -> Result { // Build the given Exercise and return an object with information // about the state of the compilation -fn compile_and_run_cairo(exercise: &Exercise) -> Result { +fn build_cairo_sierra(exercise: &Exercise) -> Result { let compilation_result = exercise.build(); if let Err(error) = compilation_result { @@ -72,6 +82,21 @@ fn compile_and_run_cairo(exercise: &Exercise) -> Result { } } +// Build the given Exercise and return an object with information +// about the state of the compilation +fn compile_and_run_cairo(exercise: &Exercise) -> Result { + let compilation_result = exercise.run(); + + if let Err(error) = compilation_result { + eprintln!("{error}"); + + warn!("Failed to run {}! Please try again.", exercise); + Err(()) + } else { + Ok(compilation_result.unwrap()) + } +} + // Tests the given Exercise and return an object with information // about the state of the tests fn compile_and_test_cairo(exercise: &Exercise) -> Result { @@ -97,6 +122,7 @@ fn prompt_for_completion(exercise: &Exercise, prompt_output: Option) -> match exercise.mode { Mode::Build => success!("Successfully built {}!", exercise), + Mode::Run => success!("Successfully ran {}!", exercise), Mode::Test => success!("Successfully tested {}!", exercise), // Mode::Clippy => success!("Successfully compiled {}!", exercise), } @@ -107,6 +133,7 @@ fn prompt_for_completion(exercise: &Exercise, prompt_output: Option) -> let success_msg = match exercise.mode { Mode::Build => "The code is compiling!", + Mode::Run => "The code is compiling!", Mode::Test => "The code is compiling, and the tests pass!", // Mode::Clippy => clippy_success_msg, }; diff --git a/tests/fixture/cairo/info.toml b/tests/fixture/cairo/info.toml index 240caec95..3bcee515a 100644 --- a/tests/fixture/cairo/info.toml +++ b/tests/fixture/cairo/info.toml @@ -1,13 +1,13 @@ [[exercises]] name = "cairoPass" path = "compilePass.cairo" -mode = "build" +mode = "run" hint = "" [[exercises]] name = "cairoFail" path = "compileFail.cairo" -mode = "build" +mode = "run" hint = "" [[exercises]]