From 4a4ebf9317ad514d0cadcb9c91749c682d582d7e Mon Sep 17 00:00:00 2001 From: maciektr Date: Mon, 26 Aug 2024 07:22:09 -0700 Subject: [PATCH] Do not show warnings from dependencies (#1547) --- Cargo.lock | 62 +++++++++---------- Cargo.toml | 48 +++++++------- scarb/src/compiler/compilers/lib.rs | 4 +- .../compiler/compilers/starknet_contract.rs | 4 +- scarb/src/compiler/compilers/test.rs | 3 +- scarb/src/compiler/helpers.rs | 18 ++++-- scarb/src/ops/compile.rs | 5 +- scarb/src/ops/expand.rs | 6 +- scarb/tests/build.rs | 1 - 9 files changed, 80 insertions(+), 71 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 97b006694..96fce1cfb 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -568,7 +568,7 @@ dependencies = [ [[package]] name = "cairo-lang-casm" version = "2.7.1" -source = "git+https://github.com/starkware-libs/cairo?rev=444e535c4ecbdd4b7d498bcab136b8025bdfafa7#444e535c4ecbdd4b7d498bcab136b8025bdfafa7" +source = "git+https://github.com/starkware-libs/cairo?rev=1d7785c288fbb43c6ae8db04eab1b212ecb0963f#1d7785c288fbb43c6ae8db04eab1b212ecb0963f" dependencies = [ "cairo-lang-utils", "indoc", @@ -581,7 +581,7 @@ dependencies = [ [[package]] name = "cairo-lang-compiler" version = "2.7.1" -source = "git+https://github.com/starkware-libs/cairo?rev=444e535c4ecbdd4b7d498bcab136b8025bdfafa7#444e535c4ecbdd4b7d498bcab136b8025bdfafa7" +source = "git+https://github.com/starkware-libs/cairo?rev=1d7785c288fbb43c6ae8db04eab1b212ecb0963f#1d7785c288fbb43c6ae8db04eab1b212ecb0963f" dependencies = [ "anyhow", "cairo-lang-defs", @@ -606,7 +606,7 @@ dependencies = [ [[package]] name = "cairo-lang-debug" version = "2.7.1" -source = "git+https://github.com/starkware-libs/cairo?rev=444e535c4ecbdd4b7d498bcab136b8025bdfafa7#444e535c4ecbdd4b7d498bcab136b8025bdfafa7" +source = "git+https://github.com/starkware-libs/cairo?rev=1d7785c288fbb43c6ae8db04eab1b212ecb0963f#1d7785c288fbb43c6ae8db04eab1b212ecb0963f" dependencies = [ "cairo-lang-utils", ] @@ -614,7 +614,7 @@ dependencies = [ [[package]] name = "cairo-lang-defs" version = "2.7.1" -source = "git+https://github.com/starkware-libs/cairo?rev=444e535c4ecbdd4b7d498bcab136b8025bdfafa7#444e535c4ecbdd4b7d498bcab136b8025bdfafa7" +source = "git+https://github.com/starkware-libs/cairo?rev=1d7785c288fbb43c6ae8db04eab1b212ecb0963f#1d7785c288fbb43c6ae8db04eab1b212ecb0963f" dependencies = [ "cairo-lang-debug", "cairo-lang-diagnostics", @@ -630,7 +630,7 @@ dependencies = [ [[package]] name = "cairo-lang-diagnostics" version = "2.7.1" -source = "git+https://github.com/starkware-libs/cairo?rev=444e535c4ecbdd4b7d498bcab136b8025bdfafa7#444e535c4ecbdd4b7d498bcab136b8025bdfafa7" +source = "git+https://github.com/starkware-libs/cairo?rev=1d7785c288fbb43c6ae8db04eab1b212ecb0963f#1d7785c288fbb43c6ae8db04eab1b212ecb0963f" dependencies = [ "cairo-lang-debug", "cairo-lang-filesystem", @@ -641,7 +641,7 @@ dependencies = [ [[package]] name = "cairo-lang-doc" version = "2.7.1" -source = "git+https://github.com/starkware-libs/cairo?rev=444e535c4ecbdd4b7d498bcab136b8025bdfafa7#444e535c4ecbdd4b7d498bcab136b8025bdfafa7" +source = "git+https://github.com/starkware-libs/cairo?rev=1d7785c288fbb43c6ae8db04eab1b212ecb0963f#1d7785c288fbb43c6ae8db04eab1b212ecb0963f" dependencies = [ "cairo-lang-defs", "cairo-lang-formatter", @@ -655,7 +655,7 @@ dependencies = [ [[package]] name = "cairo-lang-eq-solver" version = "2.7.1" -source = "git+https://github.com/starkware-libs/cairo?rev=444e535c4ecbdd4b7d498bcab136b8025bdfafa7#444e535c4ecbdd4b7d498bcab136b8025bdfafa7" +source = "git+https://github.com/starkware-libs/cairo?rev=1d7785c288fbb43c6ae8db04eab1b212ecb0963f#1d7785c288fbb43c6ae8db04eab1b212ecb0963f" dependencies = [ "cairo-lang-utils", "good_lp", @@ -664,7 +664,7 @@ dependencies = [ [[package]] name = "cairo-lang-filesystem" version = "2.7.1" -source = "git+https://github.com/starkware-libs/cairo?rev=444e535c4ecbdd4b7d498bcab136b8025bdfafa7#444e535c4ecbdd4b7d498bcab136b8025bdfafa7" +source = "git+https://github.com/starkware-libs/cairo?rev=1d7785c288fbb43c6ae8db04eab1b212ecb0963f#1d7785c288fbb43c6ae8db04eab1b212ecb0963f" dependencies = [ "cairo-lang-debug", "cairo-lang-utils", @@ -678,7 +678,7 @@ dependencies = [ [[package]] name = "cairo-lang-formatter" version = "2.7.1" -source = "git+https://github.com/starkware-libs/cairo?rev=444e535c4ecbdd4b7d498bcab136b8025bdfafa7#444e535c4ecbdd4b7d498bcab136b8025bdfafa7" +source = "git+https://github.com/starkware-libs/cairo?rev=1d7785c288fbb43c6ae8db04eab1b212ecb0963f#1d7785c288fbb43c6ae8db04eab1b212ecb0963f" dependencies = [ "anyhow", "cairo-lang-diagnostics", @@ -698,7 +698,7 @@ dependencies = [ [[package]] name = "cairo-lang-language-server" version = "2.7.1" -source = "git+https://github.com/starkware-libs/cairo?rev=444e535c4ecbdd4b7d498bcab136b8025bdfafa7#444e535c4ecbdd4b7d498bcab136b8025bdfafa7" +source = "git+https://github.com/starkware-libs/cairo?rev=1d7785c288fbb43c6ae8db04eab1b212ecb0963f#1d7785c288fbb43c6ae8db04eab1b212ecb0963f" dependencies = [ "anyhow", "cairo-lang-compiler", @@ -733,7 +733,7 @@ dependencies = [ [[package]] name = "cairo-lang-lowering" version = "2.7.1" -source = "git+https://github.com/starkware-libs/cairo?rev=444e535c4ecbdd4b7d498bcab136b8025bdfafa7#444e535c4ecbdd4b7d498bcab136b8025bdfafa7" +source = "git+https://github.com/starkware-libs/cairo?rev=1d7785c288fbb43c6ae8db04eab1b212ecb0963f#1d7785c288fbb43c6ae8db04eab1b212ecb0963f" dependencies = [ "cairo-lang-debug", "cairo-lang-defs", @@ -797,7 +797,7 @@ checksum = "c49906d6b1c215e5814be7c5c65ecf2328898b335bee8c2409ec07cfb5530daf" [[package]] name = "cairo-lang-parser" version = "2.7.1" -source = "git+https://github.com/starkware-libs/cairo?rev=444e535c4ecbdd4b7d498bcab136b8025bdfafa7#444e535c4ecbdd4b7d498bcab136b8025bdfafa7" +source = "git+https://github.com/starkware-libs/cairo?rev=1d7785c288fbb43c6ae8db04eab1b212ecb0963f#1d7785c288fbb43c6ae8db04eab1b212ecb0963f" dependencies = [ "cairo-lang-diagnostics", "cairo-lang-filesystem", @@ -816,7 +816,7 @@ dependencies = [ [[package]] name = "cairo-lang-plugins" version = "2.7.1" -source = "git+https://github.com/starkware-libs/cairo?rev=444e535c4ecbdd4b7d498bcab136b8025bdfafa7#444e535c4ecbdd4b7d498bcab136b8025bdfafa7" +source = "git+https://github.com/starkware-libs/cairo?rev=1d7785c288fbb43c6ae8db04eab1b212ecb0963f#1d7785c288fbb43c6ae8db04eab1b212ecb0963f" dependencies = [ "cairo-lang-defs", "cairo-lang-diagnostics", @@ -834,7 +834,7 @@ dependencies = [ [[package]] name = "cairo-lang-proc-macros" version = "2.7.1" -source = "git+https://github.com/starkware-libs/cairo?rev=444e535c4ecbdd4b7d498bcab136b8025bdfafa7#444e535c4ecbdd4b7d498bcab136b8025bdfafa7" +source = "git+https://github.com/starkware-libs/cairo?rev=1d7785c288fbb43c6ae8db04eab1b212ecb0963f#1d7785c288fbb43c6ae8db04eab1b212ecb0963f" dependencies = [ "cairo-lang-debug", "quote", @@ -844,7 +844,7 @@ dependencies = [ [[package]] name = "cairo-lang-project" version = "2.7.1" -source = "git+https://github.com/starkware-libs/cairo?rev=444e535c4ecbdd4b7d498bcab136b8025bdfafa7#444e535c4ecbdd4b7d498bcab136b8025bdfafa7" +source = "git+https://github.com/starkware-libs/cairo?rev=1d7785c288fbb43c6ae8db04eab1b212ecb0963f#1d7785c288fbb43c6ae8db04eab1b212ecb0963f" dependencies = [ "cairo-lang-filesystem", "cairo-lang-utils", @@ -857,7 +857,7 @@ dependencies = [ [[package]] name = "cairo-lang-runner" version = "2.7.1" -source = "git+https://github.com/starkware-libs/cairo?rev=444e535c4ecbdd4b7d498bcab136b8025bdfafa7#444e535c4ecbdd4b7d498bcab136b8025bdfafa7" +source = "git+https://github.com/starkware-libs/cairo?rev=1d7785c288fbb43c6ae8db04eab1b212ecb0963f#1d7785c288fbb43c6ae8db04eab1b212ecb0963f" dependencies = [ "ark-ff", "ark-secp256k1", @@ -887,7 +887,7 @@ dependencies = [ [[package]] name = "cairo-lang-semantic" version = "2.7.1" -source = "git+https://github.com/starkware-libs/cairo?rev=444e535c4ecbdd4b7d498bcab136b8025bdfafa7#444e535c4ecbdd4b7d498bcab136b8025bdfafa7" +source = "git+https://github.com/starkware-libs/cairo?rev=1d7785c288fbb43c6ae8db04eab1b212ecb0963f#1d7785c288fbb43c6ae8db04eab1b212ecb0963f" dependencies = [ "cairo-lang-debug", "cairo-lang-defs", @@ -912,7 +912,7 @@ dependencies = [ [[package]] name = "cairo-lang-sierra" version = "2.7.1" -source = "git+https://github.com/starkware-libs/cairo?rev=444e535c4ecbdd4b7d498bcab136b8025bdfafa7#444e535c4ecbdd4b7d498bcab136b8025bdfafa7" +source = "git+https://github.com/starkware-libs/cairo?rev=1d7785c288fbb43c6ae8db04eab1b212ecb0963f#1d7785c288fbb43c6ae8db04eab1b212ecb0963f" dependencies = [ "anyhow", "cairo-lang-utils", @@ -938,7 +938,7 @@ dependencies = [ [[package]] name = "cairo-lang-sierra-ap-change" version = "2.7.1" -source = "git+https://github.com/starkware-libs/cairo?rev=444e535c4ecbdd4b7d498bcab136b8025bdfafa7#444e535c4ecbdd4b7d498bcab136b8025bdfafa7" +source = "git+https://github.com/starkware-libs/cairo?rev=1d7785c288fbb43c6ae8db04eab1b212ecb0963f#1d7785c288fbb43c6ae8db04eab1b212ecb0963f" dependencies = [ "cairo-lang-eq-solver", "cairo-lang-sierra", @@ -953,7 +953,7 @@ dependencies = [ [[package]] name = "cairo-lang-sierra-gas" version = "2.7.1" -source = "git+https://github.com/starkware-libs/cairo?rev=444e535c4ecbdd4b7d498bcab136b8025bdfafa7#444e535c4ecbdd4b7d498bcab136b8025bdfafa7" +source = "git+https://github.com/starkware-libs/cairo?rev=1d7785c288fbb43c6ae8db04eab1b212ecb0963f#1d7785c288fbb43c6ae8db04eab1b212ecb0963f" dependencies = [ "cairo-lang-eq-solver", "cairo-lang-sierra", @@ -968,7 +968,7 @@ dependencies = [ [[package]] name = "cairo-lang-sierra-generator" version = "2.7.1" -source = "git+https://github.com/starkware-libs/cairo?rev=444e535c4ecbdd4b7d498bcab136b8025bdfafa7#444e535c4ecbdd4b7d498bcab136b8025bdfafa7" +source = "git+https://github.com/starkware-libs/cairo?rev=1d7785c288fbb43c6ae8db04eab1b212ecb0963f#1d7785c288fbb43c6ae8db04eab1b212ecb0963f" dependencies = [ "cairo-lang-debug", "cairo-lang-defs", @@ -991,7 +991,7 @@ dependencies = [ [[package]] name = "cairo-lang-sierra-to-casm" version = "2.7.1" -source = "git+https://github.com/starkware-libs/cairo?rev=444e535c4ecbdd4b7d498bcab136b8025bdfafa7#444e535c4ecbdd4b7d498bcab136b8025bdfafa7" +source = "git+https://github.com/starkware-libs/cairo?rev=1d7785c288fbb43c6ae8db04eab1b212ecb0963f#1d7785c288fbb43c6ae8db04eab1b212ecb0963f" dependencies = [ "assert_matches", "cairo-lang-casm", @@ -1011,7 +1011,7 @@ dependencies = [ [[package]] name = "cairo-lang-sierra-type-size" version = "2.7.1" -source = "git+https://github.com/starkware-libs/cairo?rev=444e535c4ecbdd4b7d498bcab136b8025bdfafa7#444e535c4ecbdd4b7d498bcab136b8025bdfafa7" +source = "git+https://github.com/starkware-libs/cairo?rev=1d7785c288fbb43c6ae8db04eab1b212ecb0963f#1d7785c288fbb43c6ae8db04eab1b212ecb0963f" dependencies = [ "cairo-lang-sierra", "cairo-lang-utils", @@ -1020,7 +1020,7 @@ dependencies = [ [[package]] name = "cairo-lang-starknet" version = "2.7.1" -source = "git+https://github.com/starkware-libs/cairo?rev=444e535c4ecbdd4b7d498bcab136b8025bdfafa7#444e535c4ecbdd4b7d498bcab136b8025bdfafa7" +source = "git+https://github.com/starkware-libs/cairo?rev=1d7785c288fbb43c6ae8db04eab1b212ecb0963f#1d7785c288fbb43c6ae8db04eab1b212ecb0963f" dependencies = [ "anyhow", "cairo-lang-compiler", @@ -1049,7 +1049,7 @@ dependencies = [ [[package]] name = "cairo-lang-starknet-classes" version = "2.7.1" -source = "git+https://github.com/starkware-libs/cairo?rev=444e535c4ecbdd4b7d498bcab136b8025bdfafa7#444e535c4ecbdd4b7d498bcab136b8025bdfafa7" +source = "git+https://github.com/starkware-libs/cairo?rev=1d7785c288fbb43c6ae8db04eab1b212ecb0963f#1d7785c288fbb43c6ae8db04eab1b212ecb0963f" dependencies = [ "cairo-lang-casm", "cairo-lang-sierra", @@ -1071,7 +1071,7 @@ dependencies = [ [[package]] name = "cairo-lang-syntax" version = "2.7.1" -source = "git+https://github.com/starkware-libs/cairo?rev=444e535c4ecbdd4b7d498bcab136b8025bdfafa7#444e535c4ecbdd4b7d498bcab136b8025bdfafa7" +source = "git+https://github.com/starkware-libs/cairo?rev=1d7785c288fbb43c6ae8db04eab1b212ecb0963f#1d7785c288fbb43c6ae8db04eab1b212ecb0963f" dependencies = [ "cairo-lang-debug", "cairo-lang-filesystem", @@ -1086,7 +1086,7 @@ dependencies = [ [[package]] name = "cairo-lang-syntax-codegen" version = "2.7.1" -source = "git+https://github.com/starkware-libs/cairo?rev=444e535c4ecbdd4b7d498bcab136b8025bdfafa7#444e535c4ecbdd4b7d498bcab136b8025bdfafa7" +source = "git+https://github.com/starkware-libs/cairo?rev=1d7785c288fbb43c6ae8db04eab1b212ecb0963f#1d7785c288fbb43c6ae8db04eab1b212ecb0963f" dependencies = [ "genco", "xshell", @@ -1095,7 +1095,7 @@ dependencies = [ [[package]] name = "cairo-lang-test-plugin" version = "2.7.1" -source = "git+https://github.com/starkware-libs/cairo?rev=444e535c4ecbdd4b7d498bcab136b8025bdfafa7#444e535c4ecbdd4b7d498bcab136b8025bdfafa7" +source = "git+https://github.com/starkware-libs/cairo?rev=1d7785c288fbb43c6ae8db04eab1b212ecb0963f#1d7785c288fbb43c6ae8db04eab1b212ecb0963f" dependencies = [ "anyhow", "cairo-lang-compiler", @@ -1121,7 +1121,7 @@ dependencies = [ [[package]] name = "cairo-lang-test-runner" version = "2.7.1" -source = "git+https://github.com/starkware-libs/cairo?rev=444e535c4ecbdd4b7d498bcab136b8025bdfafa7#444e535c4ecbdd4b7d498bcab136b8025bdfafa7" +source = "git+https://github.com/starkware-libs/cairo?rev=1d7785c288fbb43c6ae8db04eab1b212ecb0963f#1d7785c288fbb43c6ae8db04eab1b212ecb0963f" dependencies = [ "anyhow", "cairo-lang-compiler", @@ -1143,7 +1143,7 @@ dependencies = [ [[package]] name = "cairo-lang-test-utils" version = "2.7.1" -source = "git+https://github.com/starkware-libs/cairo?rev=444e535c4ecbdd4b7d498bcab136b8025bdfafa7#444e535c4ecbdd4b7d498bcab136b8025bdfafa7" +source = "git+https://github.com/starkware-libs/cairo?rev=1d7785c288fbb43c6ae8db04eab1b212ecb0963f#1d7785c288fbb43c6ae8db04eab1b212ecb0963f" dependencies = [ "cairo-lang-formatter", "cairo-lang-utils", @@ -1155,7 +1155,7 @@ dependencies = [ [[package]] name = "cairo-lang-utils" version = "2.7.1" -source = "git+https://github.com/starkware-libs/cairo?rev=444e535c4ecbdd4b7d498bcab136b8025bdfafa7#444e535c4ecbdd4b7d498bcab136b8025bdfafa7" +source = "git+https://github.com/starkware-libs/cairo?rev=1d7785c288fbb43c6ae8db04eab1b212ecb0963f#1d7785c288fbb43c6ae8db04eab1b212ecb0963f" dependencies = [ "env_logger", "hashbrown 0.14.5", diff --git a/Cargo.toml b/Cargo.toml index 404e24c2d..1664e90ea 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -35,30 +35,30 @@ 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 = "444e535c4ecbdd4b7d498bcab136b8025bdfafa7" } -cairo-lang-compiler = { git = "https://github.com/starkware-libs/cairo", rev = "444e535c4ecbdd4b7d498bcab136b8025bdfafa7" } -cairo-lang-debug = { git = "https://github.com/starkware-libs/cairo", rev = "444e535c4ecbdd4b7d498bcab136b8025bdfafa7" } -cairo-lang-defs = { git = "https://github.com/starkware-libs/cairo", rev = "444e535c4ecbdd4b7d498bcab136b8025bdfafa7" } -cairo-lang-diagnostics = { git = "https://github.com/starkware-libs/cairo", rev = "444e535c4ecbdd4b7d498bcab136b8025bdfafa7" } -cairo-lang-doc = { git = "https://github.com/starkware-libs/cairo", rev = "444e535c4ecbdd4b7d498bcab136b8025bdfafa7" } -cairo-lang-filesystem = { git = "https://github.com/starkware-libs/cairo", rev = "444e535c4ecbdd4b7d498bcab136b8025bdfafa7" } -cairo-lang-formatter = { git = "https://github.com/starkware-libs/cairo", rev = "444e535c4ecbdd4b7d498bcab136b8025bdfafa7" } -cairo-lang-language-server = { git = "https://github.com/starkware-libs/cairo", rev = "444e535c4ecbdd4b7d498bcab136b8025bdfafa7" } -cairo-lang-lowering = { git = "https://github.com/starkware-libs/cairo", rev = "444e535c4ecbdd4b7d498bcab136b8025bdfafa7" } -cairo-lang-parser = { git = "https://github.com/starkware-libs/cairo", rev = "444e535c4ecbdd4b7d498bcab136b8025bdfafa7" } -cairo-lang-project = { git = "https://github.com/starkware-libs/cairo", rev = "444e535c4ecbdd4b7d498bcab136b8025bdfafa7" } -cairo-lang-runner = { git = "https://github.com/starkware-libs/cairo", rev = "444e535c4ecbdd4b7d498bcab136b8025bdfafa7" } -cairo-lang-semantic = { git = "https://github.com/starkware-libs/cairo", rev = "444e535c4ecbdd4b7d498bcab136b8025bdfafa7" } -cairo-lang-sierra = { git = "https://github.com/starkware-libs/cairo", rev = "444e535c4ecbdd4b7d498bcab136b8025bdfafa7" } -cairo-lang-sierra-generator = { git = "https://github.com/starkware-libs/cairo", rev = "444e535c4ecbdd4b7d498bcab136b8025bdfafa7" } -cairo-lang-sierra-to-casm = { git = "https://github.com/starkware-libs/cairo", rev = "444e535c4ecbdd4b7d498bcab136b8025bdfafa7" } -cairo-lang-sierra-type-size = { git = "https://github.com/starkware-libs/cairo", rev = "444e535c4ecbdd4b7d498bcab136b8025bdfafa7" } -cairo-lang-starknet = { git = "https://github.com/starkware-libs/cairo", rev = "444e535c4ecbdd4b7d498bcab136b8025bdfafa7" } -cairo-lang-starknet-classes = { git = "https://github.com/starkware-libs/cairo", rev = "444e535c4ecbdd4b7d498bcab136b8025bdfafa7" } -cairo-lang-syntax = { git = "https://github.com/starkware-libs/cairo", rev = "444e535c4ecbdd4b7d498bcab136b8025bdfafa7" } -cairo-lang-test-plugin = { git = "https://github.com/starkware-libs/cairo", rev = "444e535c4ecbdd4b7d498bcab136b8025bdfafa7" } -cairo-lang-test-runner = { git = "https://github.com/starkware-libs/cairo", rev = "444e535c4ecbdd4b7d498bcab136b8025bdfafa7" } -cairo-lang-utils = { git = "https://github.com/starkware-libs/cairo", rev = "444e535c4ecbdd4b7d498bcab136b8025bdfafa7", features = ["env_logger"] } +cairo-lang-casm = { git = "https://github.com/starkware-libs/cairo", rev = "1d7785c288fbb43c6ae8db04eab1b212ecb0963f" } +cairo-lang-compiler = { git = "https://github.com/starkware-libs/cairo", rev = "1d7785c288fbb43c6ae8db04eab1b212ecb0963f" } +cairo-lang-debug = { git = "https://github.com/starkware-libs/cairo", rev = "1d7785c288fbb43c6ae8db04eab1b212ecb0963f" } +cairo-lang-defs = { git = "https://github.com/starkware-libs/cairo", rev = "1d7785c288fbb43c6ae8db04eab1b212ecb0963f" } +cairo-lang-diagnostics = { git = "https://github.com/starkware-libs/cairo", rev = "1d7785c288fbb43c6ae8db04eab1b212ecb0963f" } +cairo-lang-doc = { git = "https://github.com/starkware-libs/cairo", rev = "1d7785c288fbb43c6ae8db04eab1b212ecb0963f" } +cairo-lang-filesystem = { git = "https://github.com/starkware-libs/cairo", rev = "1d7785c288fbb43c6ae8db04eab1b212ecb0963f" } +cairo-lang-formatter = { git = "https://github.com/starkware-libs/cairo", rev = "1d7785c288fbb43c6ae8db04eab1b212ecb0963f" } +cairo-lang-language-server = { git = "https://github.com/starkware-libs/cairo", rev = "1d7785c288fbb43c6ae8db04eab1b212ecb0963f" } +cairo-lang-lowering = { git = "https://github.com/starkware-libs/cairo", rev = "1d7785c288fbb43c6ae8db04eab1b212ecb0963f" } +cairo-lang-parser = { git = "https://github.com/starkware-libs/cairo", rev = "1d7785c288fbb43c6ae8db04eab1b212ecb0963f" } +cairo-lang-project = { git = "https://github.com/starkware-libs/cairo", rev = "1d7785c288fbb43c6ae8db04eab1b212ecb0963f" } +cairo-lang-runner = { git = "https://github.com/starkware-libs/cairo", rev = "1d7785c288fbb43c6ae8db04eab1b212ecb0963f" } +cairo-lang-semantic = { git = "https://github.com/starkware-libs/cairo", rev = "1d7785c288fbb43c6ae8db04eab1b212ecb0963f" } +cairo-lang-sierra = { git = "https://github.com/starkware-libs/cairo", rev = "1d7785c288fbb43c6ae8db04eab1b212ecb0963f" } +cairo-lang-sierra-generator = { git = "https://github.com/starkware-libs/cairo", rev = "1d7785c288fbb43c6ae8db04eab1b212ecb0963f" } +cairo-lang-sierra-to-casm = { git = "https://github.com/starkware-libs/cairo", rev = "1d7785c288fbb43c6ae8db04eab1b212ecb0963f" } +cairo-lang-sierra-type-size = { git = "https://github.com/starkware-libs/cairo", rev = "1d7785c288fbb43c6ae8db04eab1b212ecb0963f" } +cairo-lang-starknet = { git = "https://github.com/starkware-libs/cairo", rev = "1d7785c288fbb43c6ae8db04eab1b212ecb0963f" } +cairo-lang-starknet-classes = { git = "https://github.com/starkware-libs/cairo", rev = "1d7785c288fbb43c6ae8db04eab1b212ecb0963f" } +cairo-lang-syntax = { git = "https://github.com/starkware-libs/cairo", rev = "1d7785c288fbb43c6ae8db04eab1b212ecb0963f" } +cairo-lang-test-plugin = { git = "https://github.com/starkware-libs/cairo", rev = "1d7785c288fbb43c6ae8db04eab1b212ecb0963f" } +cairo-lang-test-runner = { git = "https://github.com/starkware-libs/cairo", rev = "1d7785c288fbb43c6ae8db04eab1b212ecb0963f" } +cairo-lang-utils = { git = "https://github.com/starkware-libs/cairo", rev = "1d7785c288fbb43c6ae8db04eab1b212ecb0963f", features = ["env_logger"] } camino = { version = "1", features = ["serde1"] } cargo_metadata = ">=0.18" clap = { version = "4", features = ["derive", "env", "string"] } diff --git a/scarb/src/compiler/compilers/lib.rs b/scarb/src/compiler/compilers/lib.rs index 948969022..458c5f5f9 100644 --- a/scarb/src/compiler/compilers/lib.rs +++ b/scarb/src/compiler/compilers/lib.rs @@ -56,10 +56,10 @@ impl Compiler for LibCompiler { let target_dir = unit.target_dir(ws); - let compiler_config = build_compiler_config(&unit, ws); - let main_crate_ids = collect_main_crate_ids(&unit, db); + let compiler_config = build_compiler_config(db, &unit, &main_crate_ids, ws); + validate_compiler_config(db, &compiler_config, &unit, ws); let sierra_program: VersionedProgram = { diff --git a/scarb/src/compiler/compilers/starknet_contract.rs b/scarb/src/compiler/compilers/starknet_contract.rs index 1e626a7cf..977dffeb0 100644 --- a/scarb/src/compiler/compilers/starknet_contract.rs +++ b/scarb/src/compiler/compilers/starknet_contract.rs @@ -227,10 +227,10 @@ impl Compiler for StarknetContractCompiler { let target_dir = unit.target_dir(ws); - let compiler_config = build_compiler_config(&unit, ws); - let main_crate_ids = collect_main_crate_ids(&unit, db); + let compiler_config = build_compiler_config(db, &unit, &main_crate_ids, ws); + let contracts = find_project_contracts( db.upcast_mut(), ws.config().ui(), diff --git a/scarb/src/compiler/compilers/test.rs b/scarb/src/compiler/compilers/test.rs index 10e3b856e..0f056964c 100644 --- a/scarb/src/compiler/compilers/test.rs +++ b/scarb/src/compiler/compilers/test.rs @@ -32,7 +32,8 @@ impl Compiler for TestCompiler { && plugin.package.id.source_id == SourceId::for_std() }); - let diagnostics_reporter = build_compiler_config(&unit, ws).diagnostics_reporter; + let diagnostics_reporter = + build_compiler_config(db, &unit, &main_crate_ids, ws).diagnostics_reporter; diagnostics_reporter .with_crates(&main_crate_ids) diff --git a/scarb/src/compiler/helpers.rs b/scarb/src/compiler/helpers.rs index 899d0d43a..6cf585c46 100644 --- a/scarb/src/compiler/helpers.rs +++ b/scarb/src/compiler/helpers.rs @@ -1,5 +1,8 @@ //! Various utility functions helpful for interacting with Cairo compiler. +use crate::compiler::{CairoCompilationUnit, CompilationUnitAttributes}; +use crate::core::{InliningStrategy, Workspace}; +use crate::flock::Filesystem; use anyhow::{Context, Result}; use cairo_lang_compiler::db::RootDatabase; use cairo_lang_compiler::diagnostics::DiagnosticsReporter; @@ -7,17 +10,21 @@ use cairo_lang_compiler::CompilerConfig; use cairo_lang_diagnostics::{FormattedDiagnosticEntry, Severity}; use cairo_lang_filesystem::db::FilesGroup; use cairo_lang_filesystem::ids::{CrateId, CrateLongId}; +use itertools::Itertools; use serde::Serialize; use std::io::{BufWriter, Write}; -use crate::compiler::{CairoCompilationUnit, CompilationUnitAttributes}; -use crate::core::{InliningStrategy, Workspace}; -use crate::flock::Filesystem; - pub fn build_compiler_config<'c>( + db: &RootDatabase, unit: &CairoCompilationUnit, + main_crate_ids: &[CrateId], ws: &Workspace<'c>, ) -> CompilerConfig<'c> { + let ignore_warnings_crates = db + .crates() + .into_iter() + .filter(|crate_id| !main_crate_ids.contains(crate_id)) + .collect_vec(); let diagnostics_reporter = DiagnosticsReporter::callback({ let config = ws.config(); @@ -43,7 +50,8 @@ pub fn build_compiler_config<'c>( } }; } - }); + }) + .with_ignore_warnings_crates(&ignore_warnings_crates); CompilerConfig { diagnostics_reporter: if unit.compiler_config.allow_warnings { diagnostics_reporter.allow_warnings() diff --git a/scarb/src/ops/compile.rs b/scarb/src/ops/compile.rs index 01aeb1648..63e6b115d 100644 --- a/scarb/src/ops/compile.rs +++ b/scarb/src/ops/compile.rs @@ -11,7 +11,7 @@ use scarb_ui::components::Status; use scarb_ui::HumanDuration; use crate::compiler::db::{build_scarb_root_database, has_starknet_plugin, ScarbDatabase}; -use crate::compiler::helpers::build_compiler_config; +use crate::compiler::helpers::{build_compiler_config, collect_main_crate_ids}; use crate::compiler::plugin::proc_macro; use crate::compiler::{CairoCompilationUnit, CompilationUnit, CompilationUnitAttributes}; use crate::core::{ @@ -193,8 +193,9 @@ fn check_unit(unit: CompilationUnit, ws: &Workspace<'_>) -> Result<()> { CompilationUnit::ProcMacro(unit) => proc_macro::check_unit(unit, ws), CompilationUnit::Cairo(unit) => { let ScarbDatabase { db, .. } = build_scarb_root_database(&unit, ws)?; + let main_crate_ids = collect_main_crate_ids(&unit, &db); check_starknet_dependency(&unit, ws, &db, &package_name); - let mut compiler_config = build_compiler_config(&unit, ws); + let mut compiler_config = build_compiler_config(&db, &unit, &main_crate_ids, ws); compiler_config .diagnostics_reporter .ensure(&db) diff --git a/scarb/src/ops/expand.rs b/scarb/src/ops/expand.rs index dad0c228e..4af261ac7 100644 --- a/scarb/src/ops/expand.rs +++ b/scarb/src/ops/expand.rs @@ -158,12 +158,12 @@ fn do_expand( ws: &Workspace<'_>, ) -> Result<()> { let ScarbDatabase { db, .. } = build_scarb_root_database(compilation_unit, ws)?; - let mut compiler_config = build_compiler_config(compilation_unit, ws); - // Report diagnostics, but do not fail. - let _ = compiler_config.diagnostics_reporter.check(&db); let main_crate_id = db.intern_crate(CrateLongId::Real( compilation_unit.main_component().cairo_package_name(), )); + let mut compiler_config = build_compiler_config(&db, compilation_unit, &[main_crate_id], ws); + // Report diagnostics, but do not fail. + let _ = compiler_config.diagnostics_reporter.check(&db); let main_module = ModuleId::CrateRoot(main_crate_id); let module_file = db .module_main_file(main_module) diff --git a/scarb/tests/build.rs b/scarb/tests/build.rs index 13c5153ae..28827472b 100644 --- a/scarb/tests/build.rs +++ b/scarb/tests/build.rs @@ -908,7 +908,6 @@ fn does_show_errors_from_deps() { } #[test] -#[ignore = "fix(maciektr): hide warnings from dependencies"] fn does_not_show_warnings_from_deps() { let t = TempDir::new().unwrap(); let first = t.child("first");