diff --git a/Cargo.lock b/Cargo.lock index 6b079d57206..65089f252a5 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -339,6 +339,17 @@ version = "1.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "dfb24e866b15a1af2a1b663f10c6b6b8f397a84aadb828f12e5b289ec23a3a3c" +[[package]] +name = "cairo-compile" +version = "1.1.0" +dependencies = [ + "anyhow", + "cairo-lang-compiler", + "cairo-lang-utils", + "clap", + "log", +] + [[package]] name = "cairo-felt" version = "0.3.0-rc1" @@ -352,6 +363,19 @@ dependencies = [ "serde", ] +[[package]] +name = "cairo-format" +version = "1.1.0" +dependencies = [ + "anyhow", + "cairo-lang-formatter", + "cairo-lang-utils", + "clap", + "colored", + "ignore", + "log", +] + [[package]] name = "cairo-lang-casm" version = "1.1.0" @@ -386,7 +410,6 @@ dependencies = [ "cairo-lang-sierra-generator", "cairo-lang-syntax", "cairo-lang-utils", - "clap", "log", "salsa", "smol_str", @@ -480,7 +503,6 @@ dependencies = [ "cairo-lang-parser", "cairo-lang-syntax", "cairo-lang-utils", - "clap", "colored", "diffy", "ignore", @@ -648,7 +670,6 @@ dependencies = [ "cairo-lang-starknet", "cairo-lang-utils", "cairo-vm", - "clap", "itertools", "keccak", "num-bigint", @@ -784,7 +805,6 @@ dependencies = [ name = "cairo-lang-sierra-to-casm" version = "1.1.0" dependencies = [ - "anyhow", "assert_matches", "cairo-felt", "cairo-lang-casm", @@ -792,7 +812,6 @@ dependencies = [ "cairo-lang-sierra-ap-change", "cairo-lang-sierra-gas", "cairo-lang-utils", - "clap", "env_logger", "indoc", "itertools", @@ -828,7 +847,6 @@ dependencies = [ "cairo-lang-syntax", "cairo-lang-test-utils", "cairo-lang-utils", - "clap", "convert_case", "env_logger", "genco", @@ -871,10 +889,8 @@ dependencies = [ name = "cairo-lang-syntax-codegen" version = "1.1.0" dependencies = [ - "cairo-lang-utils", "env_logger", "genco", - "log", "test-log", "xshell", ] @@ -903,7 +919,6 @@ dependencies = [ "cairo-lang-syntax", "cairo-lang-utils", "cairo-vm", - "clap", "colored", "itertools", "num-bigint", @@ -942,6 +957,31 @@ dependencies = [ "time", ] +[[package]] +name = "cairo-language-server" +version = "1.1.0" +dependencies = [ + "cairo-lang-language-server", + "cairo-lang-utils", + "log", + "tokio", +] + +[[package]] +name = "cairo-run" +version = "1.1.0" +dependencies = [ + "anyhow", + "cairo-lang-compiler", + "cairo-lang-diagnostics", + "cairo-lang-runner", + "cairo-lang-sierra", + "cairo-lang-sierra-generator", + "cairo-lang-starknet", + "cairo-lang-utils", + "clap", +] + [[package]] name = "cairo-take_until_unbalanced" version = "0.24.2-rc1" @@ -951,6 +991,15 @@ dependencies = [ "nom", ] +[[package]] +name = "cairo-test" +version = "1.1.0" +dependencies = [ + "anyhow", + "cairo-lang-test-runner", + "clap", +] + [[package]] name = "cairo-vm" version = "0.3.0-rc1" @@ -1495,6 +1544,15 @@ dependencies = [ "syn 1.0.103", ] +[[package]] +name = "generate-syntax" +version = "1.1.0" +dependencies = [ + "cairo-lang-syntax-codegen", + "cairo-lang-utils", + "log", +] + [[package]] name = "generic-array" version = "0.14.6" @@ -2578,6 +2636,19 @@ dependencies = [ "keccak", ] +[[package]] +name = "sierra-compile" +version = "1.1.0" +dependencies = [ + "anyhow", + "cairo-lang-sierra", + "cairo-lang-sierra-to-casm", + "cairo-lang-utils", + "clap", + "indoc", + "log", +] + [[package]] name = "signal-hook-registry" version = "1.4.0" @@ -2644,6 +2715,16 @@ dependencies = [ "num-traits 0.1.43", ] +[[package]] +name = "starknet-compile" +version = "1.1.0" +dependencies = [ + "anyhow", + "cairo-lang-compiler", + "cairo-lang-starknet", + "clap", +] + [[package]] name = "starknet-crypto" version = "0.4.2" @@ -2696,6 +2777,16 @@ dependencies = [ "hex", ] +[[package]] +name = "starknet-sierra-compile" +version = "1.1.0" +dependencies = [ + "anyhow", + "cairo-lang-starknet", + "clap", + "serde_json", +] + [[package]] name = "string_cache" version = "0.8.4" diff --git a/Cargo.toml b/Cargo.toml index 28ee0e64454..3addb9f8a6b 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -27,6 +27,15 @@ members = [ "crates/cairo-lang-syntax-codegen", "crates/cairo-lang-test-runner", "crates/cairo-lang-utils", + "crates/bin/cairo-language-server", + "crates/bin/cairo-compile", + "crates/bin/cairo-format", + "crates/bin/cairo-test", + "crates/bin/cairo-run", + "crates/bin/sierra-compile", + "crates/bin/starknet-compile", + "crates/bin/starknet-sierra-compile", + "crates/bin/generate-syntax", "tests", ] @@ -85,7 +94,11 @@ test-case = "2.2.2" test-case-macros = "2.2.2" test-log = "0.2.11" thiserror = "1.0.32" -time = { version = "0.3.20", features = ["formatting", "macros", "local-offset"] } +time = { version = "0.3.20", features = [ + "formatting", + "macros", + "local-offset", +] } tokio = { version = "1.18.2", features = ["full", "sync"] } toml = "0.4.2" tower-lsp = "0.17.0" diff --git a/crates/bin/cairo-compile/Cargo.toml b/crates/bin/cairo-compile/Cargo.toml new file mode 100644 index 00000000000..eb3302bd5aa --- /dev/null +++ b/crates/bin/cairo-compile/Cargo.toml @@ -0,0 +1,16 @@ +[package] +name = "cairo-compile" +version.workspace = true +edition.workspace = true +repository.workspace = true +license-file.workspace = true + +[dependencies] +anyhow.workspace = true +clap.workspace = true +log.workspace = true + +cairo-lang-compiler = { path = "../../cairo-lang-compiler" } +cairo-lang-utils = { path = "../../cairo-lang-utils", features = [ + "env_logger", +] } diff --git a/crates/cairo-lang-compiler/src/cli.rs b/crates/bin/cairo-compile/src/main.rs similarity index 100% rename from crates/cairo-lang-compiler/src/cli.rs rename to crates/bin/cairo-compile/src/main.rs diff --git a/crates/bin/cairo-format/Cargo.toml b/crates/bin/cairo-format/Cargo.toml new file mode 100644 index 00000000000..fe65829837c --- /dev/null +++ b/crates/bin/cairo-format/Cargo.toml @@ -0,0 +1,18 @@ +[package] +name = "cairo-format" +version.workspace = true +edition.workspace = true +repository.workspace = true +license-file.workspace = true + +[dependencies] +anyhow.workspace = true +clap.workspace = true +log.workspace = true +colored.workspace = true +ignore.workspace = true + +cairo-lang-formatter = { path = "../../cairo-lang-formatter" } +cairo-lang-utils = { path = "../../cairo-lang-utils", features = [ + "env_logger", +] } diff --git a/crates/cairo-lang-formatter/src/bin/cli.rs b/crates/bin/cairo-format/src/main.rs similarity index 100% rename from crates/cairo-lang-formatter/src/bin/cli.rs rename to crates/bin/cairo-format/src/main.rs diff --git a/crates/bin/cairo-language-server/Cargo.toml b/crates/bin/cairo-language-server/Cargo.toml new file mode 100644 index 00000000000..71d999320a5 --- /dev/null +++ b/crates/bin/cairo-language-server/Cargo.toml @@ -0,0 +1,15 @@ +[package] +name = "cairo-language-server" +version.workspace = true +edition.workspace = true +repository.workspace = true +license-file.workspace = true + +[dependencies] +tokio.workspace = true +log.workspace = true + +cairo-lang-language-server = { path = "../../cairo-lang-language-server" } +cairo-lang-utils = { path = "../../cairo-lang-utils", features = [ + "env_logger", +] } diff --git a/crates/cairo-lang-language-server/src/bin/language_server.rs b/crates/bin/cairo-language-server/src/main.rs similarity index 59% rename from crates/cairo-lang-language-server/src/bin/language_server.rs rename to crates/bin/cairo-language-server/src/main.rs index a833fc9e95e..8adebad0565 100644 --- a/crates/cairo-lang-language-server/src/bin/language_server.rs +++ b/crates/bin/cairo-language-server/src/main.rs @@ -1,6 +1,8 @@ use cairo_lang_language_server::serve_language_service; +use cairo_lang_utils::logging::init_logging; #[tokio::main] async fn main() { + init_logging(log::LevelFilter::Warn); serve_language_service().await; } diff --git a/crates/bin/cairo-run/Cargo.toml b/crates/bin/cairo-run/Cargo.toml new file mode 100644 index 00000000000..4cb73159daa --- /dev/null +++ b/crates/bin/cairo-run/Cargo.toml @@ -0,0 +1,20 @@ +[package] +name = "cairo-run" +version.workspace = true +edition.workspace = true +repository.workspace = true +license-file.workspace = true + +[dependencies] +anyhow.workspace = true +clap.workspace = true + +cairo-lang-runner = { path = "../../cairo-lang-runner" } +cairo-lang-starknet = { path = "../../cairo-lang-starknet" } +cairo-lang-diagnostics = { path = "../../cairo-lang-diagnostics" } +cairo-lang-sierra = { path = "../../cairo-lang-sierra" } +cairo-lang-sierra-generator = { path = "../../cairo-lang-sierra-generator" } +cairo-lang-compiler = { path = "../../cairo-lang-compiler" } +cairo-lang-utils = { path = "../../cairo-lang-utils", features = [ + "env_logger", +] } diff --git a/crates/cairo-lang-runner/src/cli.rs b/crates/bin/cairo-run/src/main.rs similarity index 100% rename from crates/cairo-lang-runner/src/cli.rs rename to crates/bin/cairo-run/src/main.rs diff --git a/crates/bin/cairo-test/Cargo.toml b/crates/bin/cairo-test/Cargo.toml new file mode 100644 index 00000000000..e1af209bdbd --- /dev/null +++ b/crates/bin/cairo-test/Cargo.toml @@ -0,0 +1,12 @@ +[package] +name = "cairo-test" +version.workspace = true +edition.workspace = true +repository.workspace = true +license-file.workspace = true + +[dependencies] +anyhow.workspace = true +clap.workspace = true + +cairo-lang-test-runner = { path = "../../cairo-lang-test-runner" } diff --git a/crates/cairo-lang-test-runner/src/cli.rs b/crates/bin/cairo-test/src/main.rs similarity index 100% rename from crates/cairo-lang-test-runner/src/cli.rs rename to crates/bin/cairo-test/src/main.rs diff --git a/crates/bin/generate-syntax/Cargo.toml b/crates/bin/generate-syntax/Cargo.toml new file mode 100644 index 00000000000..209296af5b4 --- /dev/null +++ b/crates/bin/generate-syntax/Cargo.toml @@ -0,0 +1,14 @@ +[package] +name = "generate-syntax" +version.workspace = true +edition.workspace = true +repository.workspace = true +license-file.workspace = true + +[dependencies] +log.workspace = true + +cairo-lang-utils = { path = "../../cairo-lang-utils", features = [ + "env_logger", +] } +cairo-lang-syntax-codegen = { path = "../../cairo-lang-syntax-codegen" } diff --git a/crates/cairo-lang-syntax-codegen/src/generate_syntax.rs b/crates/bin/generate-syntax/src/main.rs similarity index 100% rename from crates/cairo-lang-syntax-codegen/src/generate_syntax.rs rename to crates/bin/generate-syntax/src/main.rs diff --git a/crates/bin/sierra-compile/Cargo.toml b/crates/bin/sierra-compile/Cargo.toml new file mode 100644 index 00000000000..eb6b0a57bf9 --- /dev/null +++ b/crates/bin/sierra-compile/Cargo.toml @@ -0,0 +1,18 @@ +[package] +name = "sierra-compile" +version.workspace = true +edition.workspace = true +repository.workspace = true +license-file.workspace = true + +[dependencies] +anyhow.workspace = true +log.workspace = true +clap.workspace = true +indoc.workspace = true + +cairo-lang-sierra = { path = "../../cairo-lang-sierra" } +cairo-lang-sierra-to-casm = { path = "../../cairo-lang-sierra-to-casm" } +cairo-lang-utils = { path = "../../cairo-lang-utils", features = [ + "env_logger", +] } diff --git a/crates/cairo-lang-sierra-to-casm/src/cli.rs b/crates/bin/sierra-compile/src/main.rs similarity index 100% rename from crates/cairo-lang-sierra-to-casm/src/cli.rs rename to crates/bin/sierra-compile/src/main.rs diff --git a/crates/bin/starknet-compile/Cargo.toml b/crates/bin/starknet-compile/Cargo.toml new file mode 100644 index 00000000000..7cae8a45f6d --- /dev/null +++ b/crates/bin/starknet-compile/Cargo.toml @@ -0,0 +1,13 @@ +[package] +name = "starknet-compile" +version.workspace = true +edition.workspace = true +repository.workspace = true +license-file.workspace = true + +[dependencies] +anyhow.workspace = true +clap.workspace = true + +cairo-lang-compiler = { path = "../../cairo-lang-compiler" } +cairo-lang-starknet = { path = "../../cairo-lang-starknet" } diff --git a/crates/cairo-lang-starknet/src/cli.rs b/crates/bin/starknet-compile/src/main.rs similarity index 100% rename from crates/cairo-lang-starknet/src/cli.rs rename to crates/bin/starknet-compile/src/main.rs diff --git a/crates/bin/starknet-sierra-compile/Cargo.toml b/crates/bin/starknet-sierra-compile/Cargo.toml new file mode 100644 index 00000000000..d697b46995d --- /dev/null +++ b/crates/bin/starknet-sierra-compile/Cargo.toml @@ -0,0 +1,13 @@ +[package] +name = "starknet-sierra-compile" +version.workspace = true +edition.workspace = true +repository.workspace = true +license-file.workspace = true + +[dependencies] +anyhow.workspace = true +clap.workspace = true +serde_json.workspace = true + +cairo-lang-starknet = { path = "../../cairo-lang-starknet" } diff --git a/crates/cairo-lang-starknet/src/starknet_sierra_compile.rs b/crates/bin/starknet-sierra-compile/src/main.rs similarity index 100% rename from crates/cairo-lang-starknet/src/starknet_sierra_compile.rs rename to crates/bin/starknet-sierra-compile/src/main.rs diff --git a/crates/cairo-lang-compiler/Cargo.toml b/crates/cairo-lang-compiler/Cargo.toml index d87adec4192..db9d0577b68 100644 --- a/crates/cairo-lang-compiler/Cargo.toml +++ b/crates/cairo-lang-compiler/Cargo.toml @@ -20,7 +20,6 @@ cairo-lang-sierra = { path = "../cairo-lang-sierra", version = "1.1.0" } cairo-lang-sierra-generator = { path = "../cairo-lang-sierra-generator", version = "1.1.0" } cairo-lang-syntax = { path = "../cairo-lang-syntax", version = "1.1.0" } cairo-lang-utils = { path = "../cairo-lang-utils", version = "1.1.0" } -clap.workspace = true log.workspace = true salsa.workspace = true smol_str.workspace = true @@ -28,7 +27,3 @@ thiserror.workspace = true [dev-dependencies] test-log.workspace = true - -[[bin]] -name = "cairo-compile" -path = "src/cli.rs" diff --git a/crates/cairo-lang-formatter/Cargo.toml b/crates/cairo-lang-formatter/Cargo.toml index 2f41853a267..f35b07c932b 100644 --- a/crates/cairo-lang-formatter/Cargo.toml +++ b/crates/cairo-lang-formatter/Cargo.toml @@ -6,10 +6,6 @@ repository.workspace = true license-file.workspace = true description = "Cairo formatter." -[[bin]] -name = "cairo-format" -path = "src/bin/cli.rs" - [dependencies] anyhow.workspace = true cairo-lang-diagnostics = { path = "../cairo-lang-diagnostics", version = "1.1.0" } @@ -17,7 +13,6 @@ cairo-lang-filesystem = { path = "../cairo-lang-filesystem", version = "1.1.0" } cairo-lang-parser = { path = "../cairo-lang-parser", version = "1.1.0" } cairo-lang-syntax = { path = "../cairo-lang-syntax", version = "1.1.0" } cairo-lang-utils = { path = "../cairo-lang-utils", version = "1.1.0" } -clap.workspace = true colored.workspace = true diffy.workspace = true ignore.workspace = true @@ -27,7 +22,6 @@ salsa.workspace = true smol_str.workspace = true [dev-dependencies] -cairo-lang-utils = { path = "../cairo-lang-utils", version = "1.1.0" } pretty_assertions.workspace = true test-case.workspace = true test-log.workspace = true diff --git a/crates/cairo-lang-language-server/Cargo.toml b/crates/cairo-lang-language-server/Cargo.toml index 8c00f2055b5..ce7f421c400 100644 --- a/crates/cairo-lang-language-server/Cargo.toml +++ b/crates/cairo-lang-language-server/Cargo.toml @@ -6,10 +6,6 @@ repository.workspace = true license-file.workspace = true description = "Cairo language server." -[[bin]] -name = "cairo-language-server" -path = "src/bin/language_server.rs" - [dependencies] anyhow.workspace = true cairo-lang-compiler = { path = "../cairo-lang-compiler", version = "1.1.0" } diff --git a/crates/cairo-lang-language-server/src/lib.rs b/crates/cairo-lang-language-server/src/lib.rs index d58074fe9f6..7040acf5fea 100644 --- a/crates/cairo-lang-language-server/src/lib.rs +++ b/crates/cairo-lang-language-server/src/lib.rs @@ -42,7 +42,6 @@ use cairo_lang_syntax::node::kind::SyntaxKind; use cairo_lang_syntax::node::stable_ptr::SyntaxStablePtr; use cairo_lang_syntax::node::utils::is_grandparent_of_kind; use cairo_lang_syntax::node::{ast, SyntaxNode, TypedSyntaxNode}; -use cairo_lang_utils::logging::init_logging; use cairo_lang_utils::ordered_hash_set::OrderedHashSet; use cairo_lang_utils::{try_extract_matches, OptionHelper, Upcast}; use log::warn; @@ -69,8 +68,6 @@ pub mod vfs; const MAX_CRATE_DETECTION_DEPTH: usize = 20; pub async fn serve_language_service() { - init_logging(log::LevelFilter::Warn); - #[cfg(feature = "runtime-agnostic")] use tokio_util::compat::{TokioAsyncReadCompatExt, TokioAsyncWriteCompatExt}; diff --git a/crates/cairo-lang-runner/Cargo.toml b/crates/cairo-lang-runner/Cargo.toml index 3eebb85ee91..1d22471c899 100644 --- a/crates/cairo-lang-runner/Cargo.toml +++ b/crates/cairo-lang-runner/Cargo.toml @@ -27,7 +27,6 @@ cairo-lang-sierra-to-casm = { path = "../cairo-lang-sierra-to-casm", version = " cairo-lang-starknet = { path = "../cairo-lang-starknet", version = "1.1.0" } cairo-lang-utils = { path = "../cairo-lang-utils", version = "1.1.0" } cairo-vm.workspace = true -clap.workspace = true itertools.workspace = true keccak.workspace = true num-bigint.workspace = true @@ -39,7 +38,3 @@ thiserror.workspace = true [dev-dependencies] pretty_assertions.workspace = true test-case.workspace = true - -[[bin]] -name = "cairo-run" -path = "src/cli.rs" diff --git a/crates/cairo-lang-sierra-to-casm/Cargo.toml b/crates/cairo-lang-sierra-to-casm/Cargo.toml index b44a2246507..e92f651b100 100644 --- a/crates/cairo-lang-sierra-to-casm/Cargo.toml +++ b/crates/cairo-lang-sierra-to-casm/Cargo.toml @@ -6,11 +6,7 @@ repository.workspace = true license-file.workspace = true description = "Emitting of CASM instructions from Sierra code." -[features] -testing = [] - [dependencies] -anyhow.workspace = true assert_matches.workspace = true cairo-felt.workspace = true cairo-lang-casm = { path = "../cairo-lang-casm", version = "1.1.0" } @@ -18,7 +14,6 @@ cairo-lang-sierra = { path = "../cairo-lang-sierra", version = "1.1.0" } cairo-lang-sierra-ap-change = { path = "../cairo-lang-sierra-ap-change", version = "1.1.0" } cairo-lang-sierra-gas = { path = "../cairo-lang-sierra-gas", version = "1.1.0" } cairo-lang-utils = { path = "../cairo-lang-utils", version = "1.1.0" } -clap.workspace = true indoc.workspace = true itertools.workspace = true log.workspace = true @@ -33,6 +28,5 @@ pretty_assertions.workspace = true test-case.workspace = true test-log.workspace = true -[[bin]] -name = "sierra-compile" -path = "src/cli.rs" +[features] +testing = [] diff --git a/crates/cairo-lang-starknet/Cargo.toml b/crates/cairo-lang-starknet/Cargo.toml index fbd6b35d909..b6f0e658e86 100644 --- a/crates/cairo-lang-starknet/Cargo.toml +++ b/crates/cairo-lang-starknet/Cargo.toml @@ -25,7 +25,6 @@ cairo-lang-sierra-generator = { path = "../cairo-lang-sierra-generator", version cairo-lang-sierra-to-casm = { path = "../cairo-lang-sierra-to-casm", version = "1.1.0" } cairo-lang-syntax = { path = "../cairo-lang-syntax", version = "1.1.0" } cairo-lang-utils = { path = "../cairo-lang-utils", version = "1.1.0" } -clap.workspace = true convert_case.workspace = true genco.workspace = true indoc.workspace = true @@ -43,17 +42,11 @@ thiserror.workspace = true [dev-dependencies] cairo-lang-diagnostics = { path = "../cairo-lang-diagnostics", version = "1.1.0" } -cairo-lang-semantic = { path = "../cairo-lang-semantic", features = ["testing"] } +cairo-lang-semantic = { path = "../cairo-lang-semantic", features = [ + "testing", +] } cairo-lang-test-utils = { path = "../cairo-lang-test-utils", version = "1.1.0" } env_logger.workspace = true pretty_assertions.workspace = true test-case.workspace = true test-log.workspace = true - -[[bin]] -name = "starknet-compile" -path = "src/cli.rs" - -[[bin]] -name = "starknet-sierra-compile" -path = "src/starknet_sierra_compile.rs" diff --git a/crates/cairo-lang-syntax-codegen/Cargo.toml b/crates/cairo-lang-syntax-codegen/Cargo.toml index efb37468414..b3a7181e99c 100644 --- a/crates/cairo-lang-syntax-codegen/Cargo.toml +++ b/crates/cairo-lang-syntax-codegen/Cargo.toml @@ -10,15 +10,9 @@ description = "Cairo syntax code generation." normal = ["cairo-lang-syntax"] [dependencies] -cairo-lang-utils = { path = "../cairo-lang-utils", version = "1.1.0" } genco.workspace = true -log.workspace = true xshell.workspace = true [dev-dependencies] env_logger.workspace = true test-log.workspace = true - -[[bin]] -name = "generate-syntax" -path = "src/generate_syntax.rs" diff --git a/crates/cairo-lang-test-runner/Cargo.toml b/crates/cairo-lang-test-runner/Cargo.toml index 33952299ec2..46e5958094c 100644 --- a/crates/cairo-lang-test-runner/Cargo.toml +++ b/crates/cairo-lang-test-runner/Cargo.toml @@ -27,7 +27,6 @@ cairo-lang-starknet = { path = "../cairo-lang-starknet", version = "1.1.0" } cairo-lang-syntax = { path = "../cairo-lang-syntax", version = "1.1.0" } cairo-lang-utils = { path = "../cairo-lang-utils", version = "1.1.0" } cairo-vm.workspace = true -clap.workspace = true colored.workspace = true itertools.workspace = true num-bigint.workspace = true @@ -35,7 +34,3 @@ num-traits.workspace = true rayon.workspace = true salsa.workspace = true thiserror.workspace = true - -[[bin]] -name = "cairo-test" -path = "src/cli.rs" diff --git a/crates/cairo-lang-test-utils/Cargo.toml b/crates/cairo-lang-test-utils/Cargo.toml index 34f8bdee6e9..ebfc0abc07c 100644 --- a/crates/cairo-lang-test-utils/Cargo.toml +++ b/crates/cairo-lang-test-utils/Cargo.toml @@ -9,8 +9,8 @@ description = "Utilities for writing tests in the Cairo compiler project." [dependencies] cairo-lang-utils = { path = "../cairo-lang-utils", version = "1.1.0" } log.workspace = true -env_logger.workspace = true pretty_assertions.workspace = true [dev-dependencies] test-log.workspace = true +env_logger.workspace = true diff --git a/crates/cairo-lang-utils/Cargo.toml b/crates/cairo-lang-utils/Cargo.toml index 002724f60e7..a8767d3fccf 100644 --- a/crates/cairo-lang-utils/Cargo.toml +++ b/crates/cairo-lang-utils/Cargo.toml @@ -6,21 +6,25 @@ repository.workspace = true license-file.workspace = true description = "General utilities for the Cairo compiler project." -[features] -testing = [] - [dependencies] -env_logger.workspace = true indexmap.workspace = true itertools.workspace = true -log.workspace = true num-bigint.workspace = true num-integer.workspace = true num-traits.workspace = true serde.workspace = true -time.workspace = true + +# Optional +env_logger = { workspace = true, optional = true } +time = { workspace = true, optional = true } +log = { workspace = true, optional = true } [dev-dependencies] serde_json.workspace = true test-case.workspace = true test-log.workspace = true +env_logger.workspace = true + +[features] +testing = [] +env_logger = ["dep:env_logger", "dep:time", "dep:log"] diff --git a/crates/cairo-lang-utils/src/lib.rs b/crates/cairo-lang-utils/src/lib.rs index 5c5a976dccc..f30ac0ef525 100644 --- a/crates/cairo-lang-utils/src/lib.rs +++ b/crates/cairo-lang-utils/src/lib.rs @@ -7,6 +7,7 @@ pub mod collection_arithmetics; pub mod extract_matches; pub mod graph_algos; pub mod iterators; +#[cfg(feature = "env_logger")] pub mod logging; pub mod ordered_hash_map; pub mod ordered_hash_set;