Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion crates/cairo-lang-compiler/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,21 @@ 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
thiserror.workspace = true

# Optional
clap = { workspace = true, optional = true }

[dev-dependencies]
test-log.workspace = true

[features]
binary = ["cairo-lang-utils/env_logger", "dep:clap"]

[[bin]]
name = "cairo-compile"
path = "src/cli.rs"
required-features = ["binary"]
17 changes: 11 additions & 6 deletions crates/cairo-lang-formatter/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,13 @@ 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" }
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
Expand All @@ -26,8 +21,18 @@ log.workspace = true
salsa.workspace = true
smol_str.workspace = true

# Optional
clap = { workspace = true, optional = 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

[features]
binary = ["cairo-lang-utils/env_logger", "dep:clap"]

[[bin]]
name = "cairo-format"
path = "src/bin/cli.rs"
required-features = ["binary"]
12 changes: 8 additions & 4 deletions crates/cairo-lang-language-server/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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" }
Expand Down Expand Up @@ -39,3 +35,11 @@ tower-lsp.workspace = true

[dev-dependencies]
test-log.workspace = true

[features]
binary = ["cairo-lang-utils/env_logger"]

[[bin]]
name = "cairo-language-server"
path = "src/bin/language_server.rs"
required-features = ["binary"]
2 changes: 2 additions & 0 deletions crates/cairo-lang-language-server/src/bin/language_server.rs
Original file line number Diff line number Diff line change
@@ -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;
}
3 changes: 0 additions & 3 deletions crates/cairo-lang-language-server/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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};

Expand Down
14 changes: 9 additions & 5 deletions crates/cairo-lang-sierra-to-casm/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,33 +6,37 @@ 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" }
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
num-bigint.workspace = true
num-traits.workspace = true
thiserror.workspace = true

# Optional
clap = { workspace = true, optional = true }
anyhow = { workspace = true, optional = true }

[dev-dependencies]
env_logger.workspace = true
indoc.workspace = true
pretty_assertions.workspace = true
test-case.workspace = true
test-log.workspace = true

[features]
testing = []
binary = ["cairo-lang-utils/env_logger", "dep:clap", "dep:anyhow"]

[[bin]]
name = "sierra-compile"
path = "src/cli.rs"
required-features = ["binary"]
10 changes: 8 additions & 2 deletions crates/cairo-lang-syntax-codegen/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,21 @@ 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

# Optional
cairo-lang-utils = { path = "../cairo-lang-utils", version = "1.1.0", optional = true }
log = { workspace = true, optional = true }

[dev-dependencies]
env_logger.workspace = true
test-log.workspace = true

[features]
binary = ["cairo-lang-utils/env_logger", "dep:log"]

[[bin]]
name = "generate-syntax"
path = "src/generate_syntax.rs"
required-features = ["binary"]
2 changes: 1 addition & 1 deletion crates/cairo-lang-test-utils/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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
16 changes: 10 additions & 6 deletions crates/cairo-lang-utils/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"]
1 change: 1 addition & 0 deletions crates/cairo-lang-utils/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion scripts/cairo_fmt.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
#!/bin/bash

cargo run --bin cairo-format -- --recursive "$@"
cargo run --bin cairo-format --features="binary" -- --recursive "$@"