Skip to content

Commit

Permalink
Prepare release 2.6.0-rc.0
Browse files Browse the repository at this point in the history
  • Loading branch information
maciektr committed Feb 7, 2024
1 parent 7e127a9 commit 2e3e748
Show file tree
Hide file tree
Showing 12 changed files with 146 additions and 102 deletions.
157 changes: 93 additions & 64 deletions Cargo.lock

Large diffs are not rendered by default.

44 changes: 22 additions & 22 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ members = [
"resolver" = "2"

[workspace.package]
version = "2.5.3"
version = "2.6.0-rc.0"
edition = "2021"

authors = ["Software Mansion <[email protected]>"]
Expand All @@ -31,27 +31,27 @@ assert_fs = "1"
async-trait = "0.1"
axum = { version = "0.6", features = ["http2"] }
cairo-felt = "0.9.1"
cairo-lang-casm = { git = "https://github.com/starkware-libs/cairo", rev = "7bf91178ad4a775943da53f1dab94068e5d70e31" }
cairo-lang-compiler = { git = "https://github.com/starkware-libs/cairo", rev = "7bf91178ad4a775943da53f1dab94068e5d70e31" }
cairo-lang-debug = { git = "https://github.com/starkware-libs/cairo", rev = "7bf91178ad4a775943da53f1dab94068e5d70e31" }
cairo-lang-defs = { git = "https://github.com/starkware-libs/cairo", rev = "7bf91178ad4a775943da53f1dab94068e5d70e31" }
cairo-lang-diagnostics = { git = "https://github.com/starkware-libs/cairo", rev = "7bf91178ad4a775943da53f1dab94068e5d70e31" }
cairo-lang-filesystem = { git = "https://github.com/starkware-libs/cairo", rev = "7bf91178ad4a775943da53f1dab94068e5d70e31" }
cairo-lang-formatter = { git = "https://github.com/starkware-libs/cairo", rev = "7bf91178ad4a775943da53f1dab94068e5d70e31" }
cairo-lang-language-server = { git = "https://github.com/starkware-libs/cairo", rev = "7bf91178ad4a775943da53f1dab94068e5d70e31" }
cairo-lang-lowering = { git = "https://github.com/starkware-libs/cairo", rev = "7bf91178ad4a775943da53f1dab94068e5d70e31" }
cairo-lang-project = { git = "https://github.com/starkware-libs/cairo", rev = "7bf91178ad4a775943da53f1dab94068e5d70e31" }
cairo-lang-runner = { git = "https://github.com/starkware-libs/cairo", rev = "7bf91178ad4a775943da53f1dab94068e5d70e31" }
cairo-lang-semantic = { git = "https://github.com/starkware-libs/cairo", rev = "7bf91178ad4a775943da53f1dab94068e5d70e31" }
cairo-lang-sierra = { git = "https://github.com/starkware-libs/cairo", rev = "7bf91178ad4a775943da53f1dab94068e5d70e31" }
cairo-lang-sierra-generator = { git = "https://github.com/starkware-libs/cairo", rev = "7bf91178ad4a775943da53f1dab94068e5d70e31" }
cairo-lang-sierra-to-casm = { git = "https://github.com/starkware-libs/cairo", rev = "7bf91178ad4a775943da53f1dab94068e5d70e31" }
cairo-lang-starknet = { git = "https://github.com/starkware-libs/cairo", rev = "7bf91178ad4a775943da53f1dab94068e5d70e31" }
cairo-lang-starknet-classes = { git = "https://github.com/starkware-libs/cairo", rev = "7bf91178ad4a775943da53f1dab94068e5d70e31" }
cairo-lang-syntax = { git = "https://github.com/starkware-libs/cairo", rev = "7bf91178ad4a775943da53f1dab94068e5d70e31" }
cairo-lang-test-plugin = { git = "https://github.com/starkware-libs/cairo", rev = "7bf91178ad4a775943da53f1dab94068e5d70e31" }
cairo-lang-test-runner = { git = "https://github.com/starkware-libs/cairo", rev = "7bf91178ad4a775943da53f1dab94068e5d70e31" }
cairo-lang-utils = { git = "https://github.com/starkware-libs/cairo", rev = "7bf91178ad4a775943da53f1dab94068e5d70e31", version = "2.5.3", features = ["env_logger"] }
cairo-lang-casm = "2.6.0-rc.0"
cairo-lang-compiler = "2.6.0-rc.0"
cairo-lang-debug = "2.6.0-rc.0"
cairo-lang-defs = "2.6.0-rc.0"
cairo-lang-diagnostics = "2.6.0-rc.0"
cairo-lang-filesystem = "2.6.0-rc.0"
cairo-lang-formatter = "2.6.0-rc.0"
cairo-lang-language-server = "2.6.0-rc.0"
cairo-lang-lowering = "2.6.0-rc.0"
cairo-lang-project = "2.6.0-rc.0"
cairo-lang-runner = "2.6.0-rc.0"
cairo-lang-semantic = "2.6.0-rc.0"
cairo-lang-sierra = "2.6.0-rc.0"
cairo-lang-sierra-generator = "2.6.0-rc.0"
cairo-lang-sierra-to-casm = "2.6.0-rc.0"
cairo-lang-starknet = "2.6.0-rc.0"
cairo-lang-starknet-classes = "2.6.0-rc.0"
cairo-lang-syntax = "2.6.0-rc.0"
cairo-lang-test-plugin = "2.6.0-rc.0"
cairo-lang-test-runner = "2.6.0-rc.0"
cairo-lang-utils = { version = "2.6.0-rc.0", features = ["env_logger"] }
camino = { version = "1", features = ["serde1"] }
cargo_metadata = ">=0.18"
clap = { version = "4", features = ["derive", "env", "string"] }
Expand Down
2 changes: 1 addition & 1 deletion examples/starknet_hello_world/Scarb.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@ version = "0.1.0"
# See more keys and their definitions at https://docs.swmansion.com/scarb/docs/reference/manifest.html

[dependencies]
starknet = "2.5.0"
starknet = "2.6.0-rc.0"

[[target.starknet-contract]]
2 changes: 1 addition & 1 deletion examples/starknet_multiple_contracts/Scarb.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@ version = "0.1.0"
# See more keys and their definitions at https://docs.swmansion.com/scarb/docs/reference/manifest.html

[dependencies]
starknet = "2.5.0"
starknet = "2.6.0-rc.0"

[[target.starknet-contract]]
2 changes: 1 addition & 1 deletion examples/workspaces/Scarb.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ test = "snforge"
exit_first = true

[workspace.dependencies]
starknet = "2.5.0"
starknet = "2.6.0-rc.0"

[workspace.package]
version = "0.1.0"
Expand Down
2 changes: 1 addition & 1 deletion extensions/scarb-cairo-run/tests/examples.rs
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ fn can_limit_gas() {
Finished release target(s) in [..]
Running hello_world
Run completed successfully, returning [987]
Remaining gas: 67840
Remaining gas: 75140
"#});
}

Expand Down
3 changes: 3 additions & 0 deletions extensions/scarb-snforge-test-collector/src/metadata.rs
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,9 @@ impl CompilationUnit<'_> {
negative_impls: pkg
.experimental_features
.contains(&String::from("negative_impls")),
// TODO(maciektr): Fix corelib config and remove the override.
coupons: pkg.name == "core"
|| pkg.experimental_features.contains(&String::from("coupons")),
},
},
)
Expand Down
8 changes: 7 additions & 1 deletion scarb/src/compiler/compilers/lib.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
use anyhow::{Context, Result};
use cairo_lang_compiler::db::RootDatabase;
use cairo_lang_sierra_to_casm::compiler::SierraToCasmConfig;
use cairo_lang_sierra_to_casm::metadata::calc_metadata;
use serde::{Deserialize, Serialize};
use tracing::trace_span;

use crate::compiler::compilers::MAX_BYTECODE_SIZE;
use crate::compiler::helpers::{
build_compiler_config, collect_main_crate_ids, write_json, write_string,
};
Expand Down Expand Up @@ -97,7 +99,11 @@ impl Compiler for LibCompiler {

let cairo_program = {
let _ = trace_span!("compile_casm").enter();
cairo_lang_sierra_to_casm::compiler::compile(&program, &metadata, gas_usage_check)?
let config = SierraToCasmConfig {
gas_usage_check,
max_bytecode_size: MAX_BYTECODE_SIZE,
};
cairo_lang_sierra_to_casm::compiler::compile(&program, &metadata, config)?
};

write_string(
Expand Down
2 changes: 2 additions & 0 deletions scarb/src/compiler/compilers/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,5 @@ pub use test::*;
mod lib;
mod starknet_contract;
mod test;

const MAX_BYTECODE_SIZE: usize = usize::MAX;
2 changes: 2 additions & 0 deletions scarb/src/compiler/compilers/starknet_contract.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ use serde::{Deserialize, Serialize};
use smol_str::SmolStr;
use tracing::{debug, trace, trace_span};

use crate::compiler::compilers::MAX_BYTECODE_SIZE;
use crate::compiler::helpers::{build_compiler_config, collect_main_crate_ids, write_json};
use crate::compiler::{CompilationUnit, Compiler};
use crate::core::{PackageName, TargetKind, Utf8PathWorkspaceExt, Workspace};
Expand Down Expand Up @@ -253,6 +254,7 @@ impl Compiler for StarknetContractCompiler {
let casm_class = CasmContractClass::from_contract_class(
class.clone(),
props.casm_add_pythonic_hints,
MAX_BYTECODE_SIZE,
)
.with_context(|| {
format!("{contract_name}: failed to compile Sierra contract to CASM")
Expand Down
11 changes: 9 additions & 2 deletions scarb/src/compiler/db.rs
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,12 @@ fn build_project_config(unit: &CompilationUnit) -> Result<ProjectConfig> {
.components
.iter()
.map(|component| {
let experimental_features = component.package.manifest.experimental_features.clone();
let experimental_features = component
.package
.manifest
.experimental_features
.clone()
.unwrap_or_default();
(
component.cairo_package_name(),
CrateSettings {
Expand All @@ -102,8 +107,10 @@ fn build_project_config(unit: &CompilationUnit) -> Result<ProjectConfig> {
// TODO (#1040): replace this with a macro
experimental_features: cairo_lang_filesystem::db::ExperimentalFeaturesConfig {
negative_impls: experimental_features
.unwrap_or_default()
.contains(&SmolStr::new_inline("negative_impls")),
// TODO(maciektr): Fix corelib config and remove the override.
coupons: component.package.id.is_core()
|| experimental_features.contains(&SmolStr::new_inline("coupons")),
},
},
)
Expand Down
13 changes: 4 additions & 9 deletions scarb/tests/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -625,16 +625,11 @@ fn workspace_as_dep() {
);
second_t.child("target/dev/third.sierra.json").assert(
predicates::str::contains(r#""debug_name":"third::example""#)
.and(predicates::str::contains(r#""debug_name":"third::hello""#))
.and(predicates::str::contains(
r#""debug_name":"withdraw_gas_all""#,
)),
);
second_t.child("target/dev/third.sierra.json").assert(
predicates::str::contains(r#""debug_name":"second::fib""#).and(predicates::str::contains(
r#""debug_name":"get_builtin_costs""#,
)),
.and(predicates::str::contains(r#""debug_name":"third::hello""#)),
);
second_t
.child("target/dev/third.sierra.json")
.assert(predicates::str::contains(r#""debug_name":"second::fib""#));
}

#[test]
Expand Down

0 comments on commit 2e3e748

Please sign in to comment.