From 715f414d8a073361d6a7271b1ea002c1c950b825 Mon Sep 17 00:00:00 2001 From: maciektr Date: Fri, 29 Nov 2024 11:05:36 +0100 Subject: [PATCH] Update Cairo (#1784) Signed-off-by: maciektr Co-authored-by: Mateusz Kowalski --- Cargo.lock | 64 +++++++++---------- Cargo.toml | 47 ++++++-------- scarb/src/compiler/plugin/proc_macro/host.rs | 67 ++++++++++++++++++-- 3 files changed, 113 insertions(+), 65 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 96c0ee382..a41117340 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -563,7 +563,7 @@ dependencies = [ [[package]] name = "cairo-lang-casm" version = "2.8.5" -source = "git+https://github.com/starkware-libs/cairo?rev=0759c7a43abd8fe8544ad0fce9ceedc1e56eab5d#0759c7a43abd8fe8544ad0fce9ceedc1e56eab5d" +source = "git+https://github.com/starkware-libs/cairo?rev=d453e4197414990ea803190dc2af8375471cbb1f#d453e4197414990ea803190dc2af8375471cbb1f" dependencies = [ "cairo-lang-utils", "indoc", @@ -576,7 +576,7 @@ dependencies = [ [[package]] name = "cairo-lang-compiler" version = "2.8.5" -source = "git+https://github.com/starkware-libs/cairo?rev=0759c7a43abd8fe8544ad0fce9ceedc1e56eab5d#0759c7a43abd8fe8544ad0fce9ceedc1e56eab5d" +source = "git+https://github.com/starkware-libs/cairo?rev=d453e4197414990ea803190dc2af8375471cbb1f#d453e4197414990ea803190dc2af8375471cbb1f" dependencies = [ "anyhow", "cairo-lang-defs", @@ -601,7 +601,7 @@ dependencies = [ [[package]] name = "cairo-lang-debug" version = "2.8.5" -source = "git+https://github.com/starkware-libs/cairo?rev=0759c7a43abd8fe8544ad0fce9ceedc1e56eab5d#0759c7a43abd8fe8544ad0fce9ceedc1e56eab5d" +source = "git+https://github.com/starkware-libs/cairo?rev=d453e4197414990ea803190dc2af8375471cbb1f#d453e4197414990ea803190dc2af8375471cbb1f" dependencies = [ "cairo-lang-utils", ] @@ -609,7 +609,7 @@ dependencies = [ [[package]] name = "cairo-lang-defs" version = "2.8.5" -source = "git+https://github.com/starkware-libs/cairo?rev=0759c7a43abd8fe8544ad0fce9ceedc1e56eab5d#0759c7a43abd8fe8544ad0fce9ceedc1e56eab5d" +source = "git+https://github.com/starkware-libs/cairo?rev=d453e4197414990ea803190dc2af8375471cbb1f#d453e4197414990ea803190dc2af8375471cbb1f" dependencies = [ "cairo-lang-debug", "cairo-lang-diagnostics", @@ -625,7 +625,7 @@ dependencies = [ [[package]] name = "cairo-lang-diagnostics" version = "2.8.5" -source = "git+https://github.com/starkware-libs/cairo?rev=0759c7a43abd8fe8544ad0fce9ceedc1e56eab5d#0759c7a43abd8fe8544ad0fce9ceedc1e56eab5d" +source = "git+https://github.com/starkware-libs/cairo?rev=d453e4197414990ea803190dc2af8375471cbb1f#d453e4197414990ea803190dc2af8375471cbb1f" dependencies = [ "cairo-lang-debug", "cairo-lang-filesystem", @@ -636,7 +636,7 @@ dependencies = [ [[package]] name = "cairo-lang-doc" version = "2.8.5" -source = "git+https://github.com/starkware-libs/cairo?rev=0759c7a43abd8fe8544ad0fce9ceedc1e56eab5d#0759c7a43abd8fe8544ad0fce9ceedc1e56eab5d" +source = "git+https://github.com/starkware-libs/cairo?rev=d453e4197414990ea803190dc2af8375471cbb1f#d453e4197414990ea803190dc2af8375471cbb1f" dependencies = [ "cairo-lang-debug", "cairo-lang-defs", @@ -656,7 +656,7 @@ dependencies = [ [[package]] name = "cairo-lang-eq-solver" version = "2.8.5" -source = "git+https://github.com/starkware-libs/cairo?rev=0759c7a43abd8fe8544ad0fce9ceedc1e56eab5d#0759c7a43abd8fe8544ad0fce9ceedc1e56eab5d" +source = "git+https://github.com/starkware-libs/cairo?rev=d453e4197414990ea803190dc2af8375471cbb1f#d453e4197414990ea803190dc2af8375471cbb1f" dependencies = [ "cairo-lang-utils", "good_lp", @@ -665,7 +665,7 @@ dependencies = [ [[package]] name = "cairo-lang-filesystem" version = "2.8.5" -source = "git+https://github.com/starkware-libs/cairo?rev=0759c7a43abd8fe8544ad0fce9ceedc1e56eab5d#0759c7a43abd8fe8544ad0fce9ceedc1e56eab5d" +source = "git+https://github.com/starkware-libs/cairo?rev=d453e4197414990ea803190dc2af8375471cbb1f#d453e4197414990ea803190dc2af8375471cbb1f" dependencies = [ "cairo-lang-debug", "cairo-lang-utils", @@ -680,7 +680,7 @@ dependencies = [ [[package]] name = "cairo-lang-formatter" version = "2.8.5" -source = "git+https://github.com/starkware-libs/cairo?rev=0759c7a43abd8fe8544ad0fce9ceedc1e56eab5d#0759c7a43abd8fe8544ad0fce9ceedc1e56eab5d" +source = "git+https://github.com/starkware-libs/cairo?rev=d453e4197414990ea803190dc2af8375471cbb1f#d453e4197414990ea803190dc2af8375471cbb1f" dependencies = [ "anyhow", "cairo-lang-diagnostics", @@ -699,7 +699,7 @@ dependencies = [ [[package]] name = "cairo-lang-language-server" version = "2.8.5" -source = "git+https://github.com/starkware-libs/cairo?rev=0759c7a43abd8fe8544ad0fce9ceedc1e56eab5d#0759c7a43abd8fe8544ad0fce9ceedc1e56eab5d" +source = "git+https://github.com/starkware-libs/cairo?rev=d453e4197414990ea803190dc2af8375471cbb1f#d453e4197414990ea803190dc2af8375471cbb1f" dependencies = [ "anyhow", "cairo-lang-compiler", @@ -744,7 +744,7 @@ dependencies = [ [[package]] name = "cairo-lang-lowering" version = "2.8.5" -source = "git+https://github.com/starkware-libs/cairo?rev=0759c7a43abd8fe8544ad0fce9ceedc1e56eab5d#0759c7a43abd8fe8544ad0fce9ceedc1e56eab5d" +source = "git+https://github.com/starkware-libs/cairo?rev=d453e4197414990ea803190dc2af8375471cbb1f#d453e4197414990ea803190dc2af8375471cbb1f" dependencies = [ "cairo-lang-debug", "cairo-lang-defs", @@ -821,7 +821,7 @@ checksum = "c49906d6b1c215e5814be7c5c65ecf2328898b335bee8c2409ec07cfb5530daf" [[package]] name = "cairo-lang-parser" version = "2.8.5" -source = "git+https://github.com/starkware-libs/cairo?rev=0759c7a43abd8fe8544ad0fce9ceedc1e56eab5d#0759c7a43abd8fe8544ad0fce9ceedc1e56eab5d" +source = "git+https://github.com/starkware-libs/cairo?rev=d453e4197414990ea803190dc2af8375471cbb1f#d453e4197414990ea803190dc2af8375471cbb1f" dependencies = [ "cairo-lang-diagnostics", "cairo-lang-filesystem", @@ -840,7 +840,7 @@ dependencies = [ [[package]] name = "cairo-lang-plugins" version = "2.8.5" -source = "git+https://github.com/starkware-libs/cairo?rev=0759c7a43abd8fe8544ad0fce9ceedc1e56eab5d#0759c7a43abd8fe8544ad0fce9ceedc1e56eab5d" +source = "git+https://github.com/starkware-libs/cairo?rev=d453e4197414990ea803190dc2af8375471cbb1f#d453e4197414990ea803190dc2af8375471cbb1f" dependencies = [ "cairo-lang-defs", "cairo-lang-diagnostics", @@ -858,7 +858,7 @@ dependencies = [ [[package]] name = "cairo-lang-proc-macros" version = "2.8.5" -source = "git+https://github.com/starkware-libs/cairo?rev=0759c7a43abd8fe8544ad0fce9ceedc1e56eab5d#0759c7a43abd8fe8544ad0fce9ceedc1e56eab5d" +source = "git+https://github.com/starkware-libs/cairo?rev=d453e4197414990ea803190dc2af8375471cbb1f#d453e4197414990ea803190dc2af8375471cbb1f" dependencies = [ "cairo-lang-debug", "quote", @@ -868,7 +868,7 @@ dependencies = [ [[package]] name = "cairo-lang-project" version = "2.8.5" -source = "git+https://github.com/starkware-libs/cairo?rev=0759c7a43abd8fe8544ad0fce9ceedc1e56eab5d#0759c7a43abd8fe8544ad0fce9ceedc1e56eab5d" +source = "git+https://github.com/starkware-libs/cairo?rev=d453e4197414990ea803190dc2af8375471cbb1f#d453e4197414990ea803190dc2af8375471cbb1f" dependencies = [ "cairo-lang-filesystem", "cairo-lang-utils", @@ -880,7 +880,7 @@ dependencies = [ [[package]] name = "cairo-lang-runnable-utils" version = "2.8.5" -source = "git+https://github.com/starkware-libs/cairo?rev=0759c7a43abd8fe8544ad0fce9ceedc1e56eab5d#0759c7a43abd8fe8544ad0fce9ceedc1e56eab5d" +source = "git+https://github.com/starkware-libs/cairo?rev=d453e4197414990ea803190dc2af8375471cbb1f#d453e4197414990ea803190dc2af8375471cbb1f" dependencies = [ "cairo-lang-casm", "cairo-lang-sierra", @@ -896,7 +896,7 @@ dependencies = [ [[package]] name = "cairo-lang-runner" version = "2.8.5" -source = "git+https://github.com/starkware-libs/cairo?rev=0759c7a43abd8fe8544ad0fce9ceedc1e56eab5d#0759c7a43abd8fe8544ad0fce9ceedc1e56eab5d" +source = "git+https://github.com/starkware-libs/cairo?rev=d453e4197414990ea803190dc2af8375471cbb1f#d453e4197414990ea803190dc2af8375471cbb1f" dependencies = [ "ark-ff", "ark-secp256k1", @@ -925,7 +925,7 @@ dependencies = [ [[package]] name = "cairo-lang-semantic" version = "2.8.5" -source = "git+https://github.com/starkware-libs/cairo?rev=0759c7a43abd8fe8544ad0fce9ceedc1e56eab5d#0759c7a43abd8fe8544ad0fce9ceedc1e56eab5d" +source = "git+https://github.com/starkware-libs/cairo?rev=d453e4197414990ea803190dc2af8375471cbb1f#d453e4197414990ea803190dc2af8375471cbb1f" dependencies = [ "cairo-lang-debug", "cairo-lang-defs", @@ -950,7 +950,7 @@ dependencies = [ [[package]] name = "cairo-lang-sierra" version = "2.8.5" -source = "git+https://github.com/starkware-libs/cairo?rev=0759c7a43abd8fe8544ad0fce9ceedc1e56eab5d#0759c7a43abd8fe8544ad0fce9ceedc1e56eab5d" +source = "git+https://github.com/starkware-libs/cairo?rev=d453e4197414990ea803190dc2af8375471cbb1f#d453e4197414990ea803190dc2af8375471cbb1f" dependencies = [ "anyhow", "cairo-lang-utils", @@ -976,7 +976,7 @@ dependencies = [ [[package]] name = "cairo-lang-sierra-ap-change" version = "2.8.5" -source = "git+https://github.com/starkware-libs/cairo?rev=0759c7a43abd8fe8544ad0fce9ceedc1e56eab5d#0759c7a43abd8fe8544ad0fce9ceedc1e56eab5d" +source = "git+https://github.com/starkware-libs/cairo?rev=d453e4197414990ea803190dc2af8375471cbb1f#d453e4197414990ea803190dc2af8375471cbb1f" dependencies = [ "cairo-lang-eq-solver", "cairo-lang-sierra", @@ -991,7 +991,7 @@ dependencies = [ [[package]] name = "cairo-lang-sierra-gas" version = "2.8.5" -source = "git+https://github.com/starkware-libs/cairo?rev=0759c7a43abd8fe8544ad0fce9ceedc1e56eab5d#0759c7a43abd8fe8544ad0fce9ceedc1e56eab5d" +source = "git+https://github.com/starkware-libs/cairo?rev=d453e4197414990ea803190dc2af8375471cbb1f#d453e4197414990ea803190dc2af8375471cbb1f" dependencies = [ "cairo-lang-eq-solver", "cairo-lang-sierra", @@ -1006,7 +1006,7 @@ dependencies = [ [[package]] name = "cairo-lang-sierra-generator" version = "2.8.5" -source = "git+https://github.com/starkware-libs/cairo?rev=0759c7a43abd8fe8544ad0fce9ceedc1e56eab5d#0759c7a43abd8fe8544ad0fce9ceedc1e56eab5d" +source = "git+https://github.com/starkware-libs/cairo?rev=d453e4197414990ea803190dc2af8375471cbb1f#d453e4197414990ea803190dc2af8375471cbb1f" dependencies = [ "cairo-lang-debug", "cairo-lang-defs", @@ -1029,7 +1029,7 @@ dependencies = [ [[package]] name = "cairo-lang-sierra-to-casm" version = "2.8.5" -source = "git+https://github.com/starkware-libs/cairo?rev=0759c7a43abd8fe8544ad0fce9ceedc1e56eab5d#0759c7a43abd8fe8544ad0fce9ceedc1e56eab5d" +source = "git+https://github.com/starkware-libs/cairo?rev=d453e4197414990ea803190dc2af8375471cbb1f#d453e4197414990ea803190dc2af8375471cbb1f" dependencies = [ "assert_matches", "cairo-lang-casm", @@ -1049,7 +1049,7 @@ dependencies = [ [[package]] name = "cairo-lang-sierra-type-size" version = "2.8.5" -source = "git+https://github.com/starkware-libs/cairo?rev=0759c7a43abd8fe8544ad0fce9ceedc1e56eab5d#0759c7a43abd8fe8544ad0fce9ceedc1e56eab5d" +source = "git+https://github.com/starkware-libs/cairo?rev=d453e4197414990ea803190dc2af8375471cbb1f#d453e4197414990ea803190dc2af8375471cbb1f" dependencies = [ "cairo-lang-sierra", "cairo-lang-utils", @@ -1058,7 +1058,7 @@ dependencies = [ [[package]] name = "cairo-lang-starknet" version = "2.8.5" -source = "git+https://github.com/starkware-libs/cairo?rev=0759c7a43abd8fe8544ad0fce9ceedc1e56eab5d#0759c7a43abd8fe8544ad0fce9ceedc1e56eab5d" +source = "git+https://github.com/starkware-libs/cairo?rev=d453e4197414990ea803190dc2af8375471cbb1f#d453e4197414990ea803190dc2af8375471cbb1f" dependencies = [ "anyhow", "cairo-lang-compiler", @@ -1087,7 +1087,7 @@ dependencies = [ [[package]] name = "cairo-lang-starknet-classes" version = "2.8.5" -source = "git+https://github.com/starkware-libs/cairo?rev=0759c7a43abd8fe8544ad0fce9ceedc1e56eab5d#0759c7a43abd8fe8544ad0fce9ceedc1e56eab5d" +source = "git+https://github.com/starkware-libs/cairo?rev=d453e4197414990ea803190dc2af8375471cbb1f#d453e4197414990ea803190dc2af8375471cbb1f" dependencies = [ "cairo-lang-casm", "cairo-lang-sierra", @@ -1109,7 +1109,7 @@ dependencies = [ [[package]] name = "cairo-lang-syntax" version = "2.8.5" -source = "git+https://github.com/starkware-libs/cairo?rev=0759c7a43abd8fe8544ad0fce9ceedc1e56eab5d#0759c7a43abd8fe8544ad0fce9ceedc1e56eab5d" +source = "git+https://github.com/starkware-libs/cairo?rev=d453e4197414990ea803190dc2af8375471cbb1f#d453e4197414990ea803190dc2af8375471cbb1f" dependencies = [ "cairo-lang-debug", "cairo-lang-filesystem", @@ -1124,7 +1124,7 @@ dependencies = [ [[package]] name = "cairo-lang-syntax-codegen" version = "2.8.5" -source = "git+https://github.com/starkware-libs/cairo?rev=0759c7a43abd8fe8544ad0fce9ceedc1e56eab5d#0759c7a43abd8fe8544ad0fce9ceedc1e56eab5d" +source = "git+https://github.com/starkware-libs/cairo?rev=d453e4197414990ea803190dc2af8375471cbb1f#d453e4197414990ea803190dc2af8375471cbb1f" dependencies = [ "genco", "xshell", @@ -1133,7 +1133,7 @@ dependencies = [ [[package]] name = "cairo-lang-test-plugin" version = "2.8.5" -source = "git+https://github.com/starkware-libs/cairo?rev=0759c7a43abd8fe8544ad0fce9ceedc1e56eab5d#0759c7a43abd8fe8544ad0fce9ceedc1e56eab5d" +source = "git+https://github.com/starkware-libs/cairo?rev=d453e4197414990ea803190dc2af8375471cbb1f#d453e4197414990ea803190dc2af8375471cbb1f" dependencies = [ "anyhow", "cairo-lang-compiler", @@ -1159,7 +1159,7 @@ dependencies = [ [[package]] name = "cairo-lang-test-runner" version = "2.8.5" -source = "git+https://github.com/starkware-libs/cairo?rev=0759c7a43abd8fe8544ad0fce9ceedc1e56eab5d#0759c7a43abd8fe8544ad0fce9ceedc1e56eab5d" +source = "git+https://github.com/starkware-libs/cairo?rev=d453e4197414990ea803190dc2af8375471cbb1f#d453e4197414990ea803190dc2af8375471cbb1f" dependencies = [ "anyhow", "cairo-lang-compiler", @@ -1181,7 +1181,7 @@ dependencies = [ [[package]] name = "cairo-lang-test-utils" version = "2.8.5" -source = "git+https://github.com/starkware-libs/cairo?rev=0759c7a43abd8fe8544ad0fce9ceedc1e56eab5d#0759c7a43abd8fe8544ad0fce9ceedc1e56eab5d" +source = "git+https://github.com/starkware-libs/cairo?rev=d453e4197414990ea803190dc2af8375471cbb1f#d453e4197414990ea803190dc2af8375471cbb1f" dependencies = [ "cairo-lang-formatter", "cairo-lang-utils", @@ -1193,7 +1193,7 @@ dependencies = [ [[package]] name = "cairo-lang-utils" version = "2.8.5" -source = "git+https://github.com/starkware-libs/cairo?rev=0759c7a43abd8fe8544ad0fce9ceedc1e56eab5d#0759c7a43abd8fe8544ad0fce9ceedc1e56eab5d" +source = "git+https://github.com/starkware-libs/cairo?rev=d453e4197414990ea803190dc2af8375471cbb1f#d453e4197414990ea803190dc2af8375471cbb1f" dependencies = [ "env_logger", "hashbrown 0.14.5", diff --git a/Cargo.toml b/Cargo.toml index 1f47abd7f..dfb94a787 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -35,30 +35,25 @@ anyhow = "1" assert_fs = "1" async-trait = "0.1" axum = { version = "0.6", features = ["http2"] } -cairo-lang-casm = { git = "https://github.com/starkware-libs/cairo", rev = "0759c7a43abd8fe8544ad0fce9ceedc1e56eab5d" } -cairo-lang-compiler = { git = "https://github.com/starkware-libs/cairo", rev = "0759c7a43abd8fe8544ad0fce9ceedc1e56eab5d" } -cairo-lang-debug = { git = "https://github.com/starkware-libs/cairo", rev = "0759c7a43abd8fe8544ad0fce9ceedc1e56eab5d" } -cairo-lang-defs = { git = "https://github.com/starkware-libs/cairo", rev = "0759c7a43abd8fe8544ad0fce9ceedc1e56eab5d" } -cairo-lang-diagnostics = { git = "https://github.com/starkware-libs/cairo", rev = "0759c7a43abd8fe8544ad0fce9ceedc1e56eab5d" } -cairo-lang-doc = { git = "https://github.com/starkware-libs/cairo", rev = "0759c7a43abd8fe8544ad0fce9ceedc1e56eab5d" } -cairo-lang-filesystem = { git = "https://github.com/starkware-libs/cairo", rev = "0759c7a43abd8fe8544ad0fce9ceedc1e56eab5d" } -cairo-lang-formatter = { git = "https://github.com/starkware-libs/cairo", rev = "0759c7a43abd8fe8544ad0fce9ceedc1e56eab5d" } -cairo-lang-language-server = { git = "https://github.com/starkware-libs/cairo", rev = "0759c7a43abd8fe8544ad0fce9ceedc1e56eab5d" } -cairo-lang-lowering = { git = "https://github.com/starkware-libs/cairo", rev = "0759c7a43abd8fe8544ad0fce9ceedc1e56eab5d" } -cairo-lang-parser = { git = "https://github.com/starkware-libs/cairo", rev = "0759c7a43abd8fe8544ad0fce9ceedc1e56eab5d" } -cairo-lang-project = { git = "https://github.com/starkware-libs/cairo", rev = "0759c7a43abd8fe8544ad0fce9ceedc1e56eab5d" } -cairo-lang-runner = { git = "https://github.com/starkware-libs/cairo", rev = "0759c7a43abd8fe8544ad0fce9ceedc1e56eab5d" } -cairo-lang-semantic = { git = "https://github.com/starkware-libs/cairo", rev = "0759c7a43abd8fe8544ad0fce9ceedc1e56eab5d" } -cairo-lang-sierra = { git = "https://github.com/starkware-libs/cairo", rev = "0759c7a43abd8fe8544ad0fce9ceedc1e56eab5d" } -cairo-lang-sierra-generator = { git = "https://github.com/starkware-libs/cairo", rev = "0759c7a43abd8fe8544ad0fce9ceedc1e56eab5d" } -cairo-lang-sierra-to-casm = { git = "https://github.com/starkware-libs/cairo", rev = "0759c7a43abd8fe8544ad0fce9ceedc1e56eab5d" } -cairo-lang-sierra-type-size = { git = "https://github.com/starkware-libs/cairo", rev = "0759c7a43abd8fe8544ad0fce9ceedc1e56eab5d" } -cairo-lang-starknet = { git = "https://github.com/starkware-libs/cairo", rev = "0759c7a43abd8fe8544ad0fce9ceedc1e56eab5d" } -cairo-lang-starknet-classes = { git = "https://github.com/starkware-libs/cairo", rev = "0759c7a43abd8fe8544ad0fce9ceedc1e56eab5d" } -cairo-lang-syntax = { git = "https://github.com/starkware-libs/cairo", rev = "0759c7a43abd8fe8544ad0fce9ceedc1e56eab5d" } -cairo-lang-test-plugin = { git = "https://github.com/starkware-libs/cairo", rev = "0759c7a43abd8fe8544ad0fce9ceedc1e56eab5d" } -cairo-lang-test-runner = { git = "https://github.com/starkware-libs/cairo", rev = "0759c7a43abd8fe8544ad0fce9ceedc1e56eab5d" } -cairo-lang-utils = { git = "https://github.com/starkware-libs/cairo", rev = "0759c7a43abd8fe8544ad0fce9ceedc1e56eab5d", features = ["env_logger"] } +cairo-lang-compiler = { git = "https://github.com/starkware-libs/cairo", rev = "d453e4197414990ea803190dc2af8375471cbb1f" } +cairo-lang-defs = { git = "https://github.com/starkware-libs/cairo", rev = "d453e4197414990ea803190dc2af8375471cbb1f" } +cairo-lang-diagnostics = { git = "https://github.com/starkware-libs/cairo", rev = "d453e4197414990ea803190dc2af8375471cbb1f" } +cairo-lang-doc = { git = "https://github.com/starkware-libs/cairo", rev = "d453e4197414990ea803190dc2af8375471cbb1f" } +cairo-lang-filesystem = { git = "https://github.com/starkware-libs/cairo", rev = "d453e4197414990ea803190dc2af8375471cbb1f" } +cairo-lang-formatter = { git = "https://github.com/starkware-libs/cairo", rev = "d453e4197414990ea803190dc2af8375471cbb1f" } +cairo-lang-language-server = { git = "https://github.com/starkware-libs/cairo", rev = "d453e4197414990ea803190dc2af8375471cbb1f" } +cairo-lang-lowering = { git = "https://github.com/starkware-libs/cairo", rev = "d453e4197414990ea803190dc2af8375471cbb1f" } +cairo-lang-parser = { git = "https://github.com/starkware-libs/cairo", rev = "d453e4197414990ea803190dc2af8375471cbb1f" } +cairo-lang-runner = { git = "https://github.com/starkware-libs/cairo", rev = "d453e4197414990ea803190dc2af8375471cbb1f" } +cairo-lang-semantic = { git = "https://github.com/starkware-libs/cairo", rev = "d453e4197414990ea803190dc2af8375471cbb1f" } +cairo-lang-sierra = { git = "https://github.com/starkware-libs/cairo", rev = "d453e4197414990ea803190dc2af8375471cbb1f" } +cairo-lang-sierra-to-casm = { git = "https://github.com/starkware-libs/cairo", rev = "d453e4197414990ea803190dc2af8375471cbb1f" } +cairo-lang-starknet = { git = "https://github.com/starkware-libs/cairo", rev = "d453e4197414990ea803190dc2af8375471cbb1f" } +cairo-lang-starknet-classes = { git = "https://github.com/starkware-libs/cairo", rev = "d453e4197414990ea803190dc2af8375471cbb1f" } +cairo-lang-syntax = { git = "https://github.com/starkware-libs/cairo", rev = "d453e4197414990ea803190dc2af8375471cbb1f" } +cairo-lang-test-plugin = { git = "https://github.com/starkware-libs/cairo", rev = "d453e4197414990ea803190dc2af8375471cbb1f" } +cairo-lang-test-runner = { git = "https://github.com/starkware-libs/cairo", rev = "d453e4197414990ea803190dc2af8375471cbb1f" } +cairo-lang-utils = { git = "https://github.com/starkware-libs/cairo", rev = "d453e4197414990ea803190dc2af8375471cbb1f", features = ["env_logger"] } camino = { version = "1", features = ["serde1"] } cargo_metadata = ">=0.18" clap = { version = "4", features = ["derive", "env", "string"] } @@ -88,10 +83,8 @@ itertools = "0.12" libc = "0.2" libloading = "0.8.5" linkme = "0.3" -log = "0.4" ntest = "0.9" num-bigint = { version = "0.4", features = ["rand"] } -num-traits = "0.2" once_cell = "1" pathdiff = { version = "0.2", features = ["camino"] } petgraph = "0.6" @@ -99,7 +92,6 @@ predicates = "3" proc-macro2 = "1" quote = "1" ra_ap_toolchain = "0.0.218" -rayon = "1.10" redb = "2.2.0" reqwest = { version = "0.11", features = ["gzip", "brotli", "deflate", "json", "stream", "multipart"], default-features = false } salsa = { package = "rust-analyzer-salsa", version = "0.17.0-pre.6" } @@ -128,7 +120,6 @@ toml_edit = { version = "0.22", features = ["serde"] } tower-http = { version = "0.4", features = ["fs"] } tracing = "0.1" tracing-core = "0.1" -tracing-log = "0.2" tracing-subscriber = { version = "0.3", features = ["env-filter"] } typed-builder = ">=0.17" url = { version = "2", features = ["serde"] } diff --git a/scarb/src/compiler/plugin/proc_macro/host.rs b/scarb/src/compiler/plugin/proc_macro/host.rs index 32694ca89..1b868e6db 100644 --- a/scarb/src/compiler/plugin/proc_macro/host.rs +++ b/scarb/src/compiler/plugin/proc_macro/host.rs @@ -30,8 +30,9 @@ use cairo_lang_syntax::node::{ast, Terminal, TypedStablePtr, TypedSyntaxNode}; use convert_case::{Case, Casing}; use itertools::Itertools; use scarb_stable_hash::short_hash; +use smol_str::SmolStr; use std::any::Any; -use std::collections::HashMap; +use std::collections::{HashMap, HashSet}; use std::fmt::Debug; use std::sync::{Arc, OnceLock, RwLock}; use std::vec::IntoIter; @@ -162,6 +163,7 @@ impl ProcMacroHostPlugin { ) -> InnerAttrExpansionResult { let mut context = InnerAttrExpansionContext::new(self); let mut item_builder = PatchBuilder::new(db, &item_ast); + let mut used_attr_names: HashSet = Default::default(); let mut all_none = true; match item_ast.clone() { @@ -191,6 +193,9 @@ impl ProcMacroHostPlugin { let mut func_builder = PatchBuilder::new(db, func); let attrs = func.attributes(db).elements(db); let found = self.parse_attrs(db, &mut func_builder, attrs, func); + if let Some(name) = found.as_name() { + used_attr_names.insert(name); + } func_builder.add_node(func.declaration(db).as_syntax_node()); func_builder.add_node(func.body(db).as_syntax_node()); let token_stream = TokenStream::new(func_builder.build().0); @@ -212,7 +217,11 @@ impl ProcMacroHostPlugin { InnerAttrExpansionResult::None } else { let (code, mappings) = item_builder.build(); - InnerAttrExpansionResult::Some(context.into_result(code, mappings)) + InnerAttrExpansionResult::Some(context.into_result( + code, + mappings, + used_attr_names.into_iter().collect(), + )) } } } @@ -245,6 +254,9 @@ impl ProcMacroHostPlugin { let mut func_builder = PatchBuilder::new(db, &func); let attrs = func.attributes(db).elements(db); let found = self.parse_attrs(db, &mut func_builder, attrs, &func); + if let Some(name) = found.as_name() { + used_attr_names.insert(name); + } func_builder.add_node(func.visibility(db).as_syntax_node()); func_builder.add_node(func.declaration(db).as_syntax_node()); func_builder.add_node(func.body(db).as_syntax_node()); @@ -266,7 +278,11 @@ impl ProcMacroHostPlugin { InnerAttrExpansionResult::None } else { let (code, mappings) = item_builder.build(); - InnerAttrExpansionResult::Some(context.into_result(code, mappings)) + InnerAttrExpansionResult::Some(context.into_result( + code, + mappings, + used_attr_names.into_iter().collect(), + )) } } } @@ -534,7 +550,7 @@ impl ProcMacroHostPlugin { let any_derives = !derives.is_empty(); let mut derived_code = PatchBuilder::new(db, &item_ast); - for derive in derives { + for derive in derives.iter() { let result = self.instance(derive.package_id).generate_code( derive.expansion.name.clone(), TokenStream::empty(), @@ -567,6 +583,16 @@ impl ProcMacroHostPlugin { code: if derived_code.is_empty() { None } else { + let msg = if derives.len() == 1 { + "the derive macro" + } else { + "one of the derive macros" + }; + let derive_names = derives + .iter() + .map(|derive| derive.expansion.name.to_string()) + .join("`, `"); + let note = format!("this error originates in {msg}: `{derive_names}`"); Some(PluginGeneratedFile { name: "proc_macro_derive".into(), code_mappings: Vec::new(), @@ -576,6 +602,7 @@ impl ProcMacroHostPlugin { } else { Some(DynGeneratedFileAuxData::new(aux_data)) }, + diagnostics_note: Some(note), }) }, diagnostics: into_cairo_diagnostics(all_diagnostics, stable_ptr), @@ -643,6 +670,10 @@ impl ProcMacroHostPlugin { name: file_name.into(), code_mappings: Vec::new(), content, + diagnostics_note: Some(format!( + "this error originates in the attribute macro: `{}`", + input.expansion.name + )), aux_data: result.aux_data.map(|new_aux_data| { DynGeneratedFileAuxData::new(EmittedAuxData::new(ProcMacroAuxData::new( new_aux_data.into(), @@ -866,7 +897,19 @@ impl<'a> InnerAttrExpansionContext<'a> { expanded } - pub fn into_result(self, expanded: String, code_mappings: Vec) -> PluginResult { + pub fn into_result( + self, + expanded: String, + code_mappings: Vec, + attr_names: Vec, + ) -> PluginResult { + let msg = if attr_names.len() == 1 { + "the attribute macro" + } else { + "one of the attribute macros" + }; + let derive_names = attr_names.iter().map(ToString::to_string).join("`, `"); + let note = format!("this error originates in {msg}: `{derive_names}`"); PluginResult { code: Some(PluginGeneratedFile { name: "proc_attr_inner".into(), @@ -877,6 +920,7 @@ impl<'a> InnerAttrExpansionContext<'a> { Some(DynGeneratedFileAuxData::new(self.aux_data)) }, code_mappings, + diagnostics_note: Some(note), }), diagnostics: self.diagnostics, remove_original_item: true, @@ -980,6 +1024,15 @@ enum AttrExpansionFound { stable_ptr: SyntaxStablePtrId, }, } +impl AttrExpansionFound { + pub fn as_name(&self) -> Option { + match self { + AttrExpansionFound::Some { expansion, .. } + | AttrExpansionFound::Last { expansion, .. } => Some(expansion.expansion.name.clone()), + AttrExpansionFound::None => None, + } + } +} /// A Cairo compiler inline macro plugin controlling the inline procedural macro execution. /// @@ -1052,6 +1105,10 @@ impl InlineMacroExprPlugin for ProcMacroInlinePlugin { code_mappings: Vec::new(), content, aux_data, + diagnostics_note: Some(format!( + "this error originates in the inline macro: `{}`", + self.expansion.name + )), }), diagnostics, }