Skip to content

Commit b245d76

Browse files
authored
Prepare release 2.11 (#2044)
- **Prepare release `2.11.0`** - **Allow specifying inlining-strategy via weight** - **Update test expects** - **Temp: use forked ls**
1 parent a157fa5 commit b245d76

File tree

21 files changed

+322
-208
lines changed

21 files changed

+322
-208
lines changed

Cargo.lock

+149-101
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

+25-83
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ members = [
2525
"resolver" = "2"
2626

2727
[workspace.package]
28-
version = "2.10.1"
28+
version = "2.11.0"
2929
edition = "2021"
3030

3131
authors = ["Software Mansion <[email protected]>"]
@@ -34,49 +34,34 @@ license = "MIT"
3434
readme = "README.md"
3535
repository = "https://github.com/software-mansion/scarb"
3636

37-
# Managing dependencies on crates from starkware-libs/cairo repository:
38-
#
39-
# The Cairo compiler is made of a bunch of crates that inter-depend on each other and have
40-
# synchronised versioning.
41-
# It is very important to use a single revision of these crates in the entire Cairo toolchain,
42-
# which consists of Cairo compiler, Scarb, CairoLS and other tools.
43-
# The toolchain is eventually built by Scarb, which depends on everything other as regular crates.
44-
# To ensure that all crates in the toolchain use the same revision of Cairo crates, we use a patch
45-
# mechanism that Cargo provides.
46-
# Because Cargo requires patches to change the crate source, we have an unspoken contract that
47-
# all tools *always* depend on some crates.io versions of Cairo crates and Scarb uses
48-
# [patch.crates.io] table to set final git revision for everything.
49-
#
50-
# To keep our Cargo.toml following this contract, always use `cargo xtask upgrade`
51-
# for manipulating these dependencies.
5237
[workspace.dependencies]
5338
anyhow = "1"
5439
assert_fs = "1"
5540
async-trait = "0.1"
5641
axum = { version = "0.6", features = ["http2"] }
5742
bincode = "2.0.0-rc.3"
58-
cairo-lang-compiler = "*"
59-
cairo-lang-defs = "*"
60-
cairo-lang-diagnostics = "*"
61-
cairo-lang-doc = "*"
62-
cairo-lang-executable = "*"
63-
cairo-lang-filesystem = "*"
64-
cairo-lang-formatter = "*"
65-
cairo-lang-lowering = "*"
66-
cairo-lang-parser = "*"
67-
cairo-lang-runner = "*"
68-
cairo-lang-semantic = "*"
69-
cairo-lang-sierra = "*"
70-
cairo-lang-sierra-generator = "*"
71-
cairo-lang-sierra-to-casm = "*"
72-
cairo-lang-starknet = "*"
73-
cairo-lang-starknet-classes = "*"
74-
cairo-lang-syntax = "*"
75-
cairo-lang-test-plugin = "*"
76-
cairo-lang-test-runner = "*"
77-
cairo-lang-utils = { version = "*", features = ["env_logger"] }
78-
cairo-language-server = "*"
79-
cairo-lint-core = "*"
43+
cairo-lang-compiler = "2.11"
44+
cairo-lang-defs = "2.11"
45+
cairo-lang-diagnostics = "2.11"
46+
cairo-lang-doc = "2.11"
47+
cairo-lang-executable = "2.11"
48+
cairo-lang-filesystem = "2.11"
49+
cairo-lang-formatter = "2.11"
50+
cairo-lang-lowering = "2.11"
51+
cairo-lang-parser = "2.11"
52+
cairo-lang-runner = "2.11"
53+
cairo-lang-semantic = "2.11"
54+
cairo-lang-sierra = "2.11"
55+
cairo-lang-sierra-generator = "2.11"
56+
cairo-lang-sierra-to-casm = "2.11"
57+
cairo-lang-starknet = "2.11"
58+
cairo-lang-starknet-classes = "2.11"
59+
cairo-lang-syntax = "2.11"
60+
cairo-lang-test-plugin = "2.11"
61+
cairo-lang-test-runner = "2.11"
62+
cairo-lang-utils = { version = "2.11", features = ["env_logger"] }
63+
cairo-language-server = { git = "https://github.com/software-mansion/cairols.git", branch = "2.11" }
64+
cairo-lint-core = "2.11"
8065
cairo-vm = "1.0.1"
8166
camino = { version = "1", features = ["serde1"] }
8267
cargo_metadata = ">=0.18"
@@ -135,8 +120,8 @@ smallvec = "1"
135120
smol_str = { version = "0.3", features = ["serde"] }
136121
snapbox = { version = "0.4", features = ["cmd", "path"] }
137122
starknet-types-core = "0.1"
138-
stwo_cairo_prover = { version = "*" }
139-
stwo-cairo-adapter = { version = "*", features = ["std"] }
123+
stwo_cairo_prover = { git = "https://github.com/starkware-libs/stwo-cairo", rev = "71a214aa5cb5b199e1da156a3672bcc99de21fc2" }
124+
stwo-cairo-adapter = { git = "https://github.com/starkware-libs/stwo-cairo", rev = "71a214aa5cb5b199e1da156a3672bcc99de21fc2", features = ["std"] }
140125
syn = "2"
141126
tar = "0.4"
142127
target-triple = "0.1"
@@ -162,49 +147,6 @@ xxhash-rust = { version = "0.8", features = ["xxh3"] }
162147
zip = { version = "0.6", default-features = false, features = ["deflate"] }
163148
zstd = "0.13"
164149

165-
# Here we specify real dependency specifications for Cairo crates *if* currently we want to use
166-
# a particular unreleased commit (which is frequent mid-development).
167-
# We list all Cairo crates that go into Scarb's compilation unit even if Scarb itself does not depend
168-
# on some of them directly.
169-
# This ensures no duplicate instances of Cairo crates are pulled in by mistake.
170-
[patch.crates-io]
171-
cairo-lang-casm = { git = "https://github.com/starkware-libs/cairo", rev = "01cdc6e5866fffc68f7d123ef54520b7cafafb9f" }
172-
cairo-lang-compiler = { git = "https://github.com/starkware-libs/cairo", rev = "01cdc6e5866fffc68f7d123ef54520b7cafafb9f" }
173-
cairo-lang-debug = { git = "https://github.com/starkware-libs/cairo", rev = "01cdc6e5866fffc68f7d123ef54520b7cafafb9f" }
174-
cairo-lang-defs = { git = "https://github.com/starkware-libs/cairo", rev = "01cdc6e5866fffc68f7d123ef54520b7cafafb9f" }
175-
cairo-lang-diagnostics = { git = "https://github.com/starkware-libs/cairo", rev = "01cdc6e5866fffc68f7d123ef54520b7cafafb9f" }
176-
cairo-lang-doc = { git = "https://github.com/starkware-libs/cairo", rev = "01cdc6e5866fffc68f7d123ef54520b7cafafb9f" }
177-
cairo-lang-eq-solver = { git = "https://github.com/starkware-libs/cairo", rev = "01cdc6e5866fffc68f7d123ef54520b7cafafb9f" }
178-
cairo-lang-executable = { git = "https://github.com/starkware-libs/cairo", rev = "01cdc6e5866fffc68f7d123ef54520b7cafafb9f" }
179-
cairo-lang-filesystem = { git = "https://github.com/starkware-libs/cairo", rev = "01cdc6e5866fffc68f7d123ef54520b7cafafb9f" }
180-
cairo-lang-formatter = { git = "https://github.com/starkware-libs/cairo", rev = "01cdc6e5866fffc68f7d123ef54520b7cafafb9f" }
181-
cairo-lang-lowering = { git = "https://github.com/starkware-libs/cairo", rev = "01cdc6e5866fffc68f7d123ef54520b7cafafb9f" }
182-
cairo-lang-parser = { git = "https://github.com/starkware-libs/cairo", rev = "01cdc6e5866fffc68f7d123ef54520b7cafafb9f" }
183-
cairo-lang-plugins = { git = "https://github.com/starkware-libs/cairo", rev = "01cdc6e5866fffc68f7d123ef54520b7cafafb9f" }
184-
cairo-lang-proc-macros = { git = "https://github.com/starkware-libs/cairo", rev = "01cdc6e5866fffc68f7d123ef54520b7cafafb9f" }
185-
cairo-lang-project = { git = "https://github.com/starkware-libs/cairo", rev = "01cdc6e5866fffc68f7d123ef54520b7cafafb9f" }
186-
cairo-lang-runnable-utils = { git = "https://github.com/starkware-libs/cairo", rev = "01cdc6e5866fffc68f7d123ef54520b7cafafb9f" }
187-
cairo-lang-runner = { git = "https://github.com/starkware-libs/cairo", rev = "01cdc6e5866fffc68f7d123ef54520b7cafafb9f" }
188-
cairo-lang-semantic = { git = "https://github.com/starkware-libs/cairo", rev = "01cdc6e5866fffc68f7d123ef54520b7cafafb9f" }
189-
cairo-lang-sierra = { git = "https://github.com/starkware-libs/cairo", rev = "01cdc6e5866fffc68f7d123ef54520b7cafafb9f" }
190-
cairo-lang-sierra-ap-change = { git = "https://github.com/starkware-libs/cairo", rev = "01cdc6e5866fffc68f7d123ef54520b7cafafb9f" }
191-
cairo-lang-sierra-gas = { git = "https://github.com/starkware-libs/cairo", rev = "01cdc6e5866fffc68f7d123ef54520b7cafafb9f" }
192-
cairo-lang-sierra-generator = { git = "https://github.com/starkware-libs/cairo", rev = "01cdc6e5866fffc68f7d123ef54520b7cafafb9f" }
193-
cairo-lang-sierra-to-casm = { git = "https://github.com/starkware-libs/cairo", rev = "01cdc6e5866fffc68f7d123ef54520b7cafafb9f" }
194-
cairo-lang-sierra-type-size = { git = "https://github.com/starkware-libs/cairo", rev = "01cdc6e5866fffc68f7d123ef54520b7cafafb9f" }
195-
cairo-lang-starknet = { git = "https://github.com/starkware-libs/cairo", rev = "01cdc6e5866fffc68f7d123ef54520b7cafafb9f" }
196-
cairo-lang-starknet-classes = { git = "https://github.com/starkware-libs/cairo", rev = "01cdc6e5866fffc68f7d123ef54520b7cafafb9f" }
197-
cairo-lang-syntax = { git = "https://github.com/starkware-libs/cairo", rev = "01cdc6e5866fffc68f7d123ef54520b7cafafb9f" }
198-
cairo-lang-syntax-codegen = { git = "https://github.com/starkware-libs/cairo", rev = "01cdc6e5866fffc68f7d123ef54520b7cafafb9f" }
199-
cairo-lang-test-plugin = { git = "https://github.com/starkware-libs/cairo", rev = "01cdc6e5866fffc68f7d123ef54520b7cafafb9f" }
200-
cairo-lang-test-runner = { git = "https://github.com/starkware-libs/cairo", rev = "01cdc6e5866fffc68f7d123ef54520b7cafafb9f" }
201-
cairo-lang-test-utils = { git = "https://github.com/starkware-libs/cairo", rev = "01cdc6e5866fffc68f7d123ef54520b7cafafb9f" }
202-
cairo-lang-utils = { git = "https://github.com/starkware-libs/cairo", rev = "01cdc6e5866fffc68f7d123ef54520b7cafafb9f" }
203-
cairo-language-server = { git = "https://github.com/software-mansion/cairols", rev = "ac5cfde0372fce38e24bb4266b4ada3ddd457483" }
204-
cairo-lint-core = { git = "https://github.com/software-mansion/cairo-lint", rev = "a418ae7680caec87c176b9ad391f012e23a6d9ca" }
205-
stwo_cairo_prover = { git = "https://github.com/starkware-libs/stwo-cairo", rev = "4f16a586138170f9c565a424fec75df2b8cee750" }
206-
stwo-cairo-adapter = { git = "https://github.com/starkware-libs/stwo-cairo", rev = "4f16a586138170f9c565a424fec75df2b8cee750" }
207-
208150
[profile.release]
209151
lto = true
210152

examples/dependencies/Scarb.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,4 @@ version = "0.1.0"
88
alexandria_math = { git = "https://github.com/keep-starknet-strange/alexandria.git" }
99

1010
[dev-dependencies]
11-
cairo_test = "2.8.0"
11+
cairo_test = "2.11.0"

examples/hello_world/Scarb.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,4 @@ edition = "2023_10"
88
[dependencies]
99

1010
[dev-dependencies]
11-
cairo_test = "2.8.0"
11+
cairo_test = "2.11.0"

examples/starknet_hello_world/Scarb.toml

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@ version = "0.1.0"
55
# See more keys and their definitions at https://docs.swmansion.com/scarb/docs/reference/manifest.html
66

77
[dependencies]
8-
starknet = "2.8.0"
8+
starknet = "2.11.0"
99

1010
[dev-dependencies]
11-
cairo_test = "2.8.0"
11+
cairo_test = "2.11.0"
1212

1313
[[target.starknet-contract]]

examples/starknet_multiple_contracts/Scarb.toml

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@ version = "0.1.0"
55
# See more keys and their definitions at https://docs.swmansion.com/scarb/docs/reference/manifest.html
66

77
[dependencies]
8-
starknet = "2.8.0"
8+
starknet = "2.11.0"
99

1010
[dev-dependencies]
11-
cairo_test = "2.8.0"
11+
cairo_test = "2.11.0"
1212

1313
[[target.starknet-contract]]

examples/workspaces/Scarb.toml

+2-2
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ test = "snforge"
1010
exit_first = true
1111

1212
[workspace.dependencies]
13-
cairo_test = "2.8.0"
14-
starknet = "2.8.0"
13+
cairo_test = "2.11.0"
14+
starknet = "2.11.0"
1515

1616
[workspace.package]
1717
version = "0.1.0"

extensions/scarb-doc/tests/data/hello_world_no_features/src/hello_world-CircleDrop.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,6 @@
33
Fully qualified path: `hello_world::CircleDrop`
44

55
```rust
6-
impl CircleDrop of core::traits::Drop<Circle>;
6+
impl CircleDrop<> of core::traits::Drop<Circle>;
77
```
88

extensions/scarb-doc/tests/data/hello_world_no_features/src/hello_world-CirclePartialEq.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
Fully qualified path: `hello_world::CirclePartialEq`
44

55
```rust
6-
impl CirclePartialEq of core::traits::PartialEq<Circle>
6+
impl CirclePartialEq<> of core::traits::PartialEq<Circle>
77
```
88

99
## Impl functions

extensions/scarb-doc/tests/data/hello_world_no_features/src/hello_world-CircleSerde.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
Fully qualified path: `hello_world::CircleSerde`
44

55
```rust
6-
impl CircleSerde of core::serde::Serde<Circle>
6+
impl CircleSerde<> of core::serde::Serde<Circle>
77
```
88

99
## Impl functions

extensions/scarb-doc/tests/data/hello_world_with_features/src/hello_world-CircleDrop.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,6 @@
33
Fully qualified path: `hello_world::CircleDrop`
44

55
```rust
6-
impl CircleDrop of core::traits::Drop<Circle>;
6+
impl CircleDrop<> of core::traits::Drop<Circle>;
77
```
88

extensions/scarb-doc/tests/data/hello_world_with_features/src/hello_world-CirclePartialEq.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
Fully qualified path: `hello_world::CirclePartialEq`
44

55
```rust
6-
impl CirclePartialEq of core::traits::PartialEq<Circle>
6+
impl CirclePartialEq<> of core::traits::PartialEq<Circle>
77
```
88

99
## Impl functions

extensions/scarb-doc/tests/data/hello_world_with_features/src/hello_world-CircleSerde.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
Fully qualified path: `hello_world::CircleSerde`
44

55
```rust
6-
impl CircleSerde of core::serde::Serde<Circle>
6+
impl CircleSerde<> of core::serde::Serde<Circle>
77
```
88

99
## Impl functions

extensions/scarb-execute/src/lib.rs

+1
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,7 @@ pub fn execute(
123123
syscalls_used_resources: Default::default(),
124124
no_temporary_segments: false,
125125
markers: Default::default(),
126+
panic_traceback: Default::default(),
126127
};
127128

128129
let cairo_run_config = CairoRunConfig {

extensions/scarb-execute/tests/arguments.rs

-2
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,6 @@ fn can_take_big_number_as_arg() {
3939
[..]Finished `dev` profile target(s) in [..]
4040
[..]Executing hello
4141
Program output:
42-
0
4342
1129815197211541481934112806673325772687763881719835256646064516195041515616
4443
Saving output to: target/execute/hello/execution1
4544
"#});
@@ -83,7 +82,6 @@ fn can_read_arguments_from_file() {
8382
[..]Finished `dev` profile target(s) in [..]
8483
[..]Executing hello
8584
Program output:
86-
0
8785
1129815197211541481934112806673325772687763881719835256646064516195041515616
8886
Saving output to: target/execute/hello/execution1
8987
"#});

extensions/scarb-execute/tests/build.rs

-2
Original file line numberDiff line numberDiff line change
@@ -367,7 +367,6 @@ fn can_choose_build_target() {
367367
[..]Finished `dev` profile target(s) in [..]
368368
[..]Executing hello_world
369369
Program output:
370-
0
371370
42
372371
Saving output to: target/execute/hello_world/execution1
373372
"#});
@@ -384,7 +383,6 @@ fn can_choose_build_target() {
384383
.stdout_matches(indoc! {r#"
385384
[..]Executing hello_world
386385
Program output:
387-
0
388386
24
389387
Saving output to: target/execute/hello_world/execution2
390388
"#});

extensions/scarb-prove/src/main.rs

+3-4
Original file line numberDiff line numberDiff line change
@@ -117,10 +117,9 @@ fn main_inner(args: Args, ui: Ui) -> Result<()> {
117117
let prover_input = adapt_vm_output(pub_input_path.as_std_path(), priv_input_path.as_std_path())
118118
.context("failed to adapt VM output")?;
119119

120-
let config = ProverConfig::builder()
121-
.track_relations(args.prover.track_relations)
122-
.display_components(args.prover.display_components)
123-
.build();
120+
let config = ProverConfig {
121+
display_components: args.prover.display_components,
122+
};
124123

125124
let ProverParameters { pcs_config } = default_prod_prover_parameters();
126125
let proof = prove_cairo::<Blake2sMerkleChannel>(prover_input, config, pcs_config)

scarb/src/compiler/helpers.rs

+6
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,9 @@ impl From<InliningStrategy> for cairo_lang_lowering::utils::InliningStrategy {
101101
match value {
102102
InliningStrategy::Default => cairo_lang_lowering::utils::InliningStrategy::Default,
103103
InliningStrategy::Avoid => cairo_lang_lowering::utils::InliningStrategy::Avoid,
104+
InliningStrategy::InlineSmallFunctions(weight) => {
105+
cairo_lang_lowering::utils::InliningStrategy::InlineSmallFunctions(weight)
106+
}
104107
}
105108
}
106109
}
@@ -111,6 +114,9 @@ impl From<cairo_lang_lowering::utils::InliningStrategy> for InliningStrategy {
111114
match value {
112115
cairo_lang_lowering::utils::InliningStrategy::Default => InliningStrategy::Default,
113116
cairo_lang_lowering::utils::InliningStrategy::Avoid => InliningStrategy::Avoid,
117+
cairo_lang_lowering::utils::InliningStrategy::InlineSmallFunctions(weight) => {
118+
InliningStrategy::InlineSmallFunctions(weight)
119+
}
114120
}
115121
}
116122
}

scarb/src/core/manifest/compiler_config.rs

+52-1
Original file line numberDiff line numberDiff line change
@@ -37,13 +37,64 @@ pub struct ManifestCompilerConfig {
3737
}
3838

3939
#[derive(Debug, Default, Deserialize, Serialize, Eq, PartialEq, Hash, Clone)]
40-
#[serde(rename_all = "kebab-case")]
40+
#[serde(
41+
rename_all = "kebab-case",
42+
try_from = "serdex::InliningStrategy",
43+
into = "serdex::InliningStrategy"
44+
)]
4145
pub enum InliningStrategy {
4246
/// Do not override inlining strategy.
4347
#[default]
4448
Default,
4549
/// Inline only in the case of an `inline(always)` annotation.
4650
Avoid,
51+
/// Should inline small functions up to the given weight.
52+
///
53+
/// Note: the weight exact definition is subject to change.
54+
InlineSmallFunctions(usize),
55+
}
56+
57+
mod serdex {
58+
use serde::{Deserialize, Serialize};
59+
60+
#[derive(Debug, Deserialize, Serialize)]
61+
#[serde(untagged)]
62+
pub enum InliningStrategy {
63+
InlineSmallFunctions(usize),
64+
Predefined(String),
65+
}
66+
67+
impl TryFrom<InliningStrategy> for super::InliningStrategy {
68+
type Error = serde::de::value::Error;
69+
70+
fn try_from(value: InliningStrategy) -> Result<Self, Self::Error> {
71+
match value {
72+
InliningStrategy::InlineSmallFunctions(weight) => {
73+
Ok(Self::InlineSmallFunctions(weight))
74+
}
75+
InliningStrategy::Predefined(name) => match name.as_str() {
76+
"default" => Ok(Self::Default),
77+
"avoid" => Ok(Self::Avoid),
78+
_ => Err(serde::de::Error::custom(format!(
79+
"unknown inlining strategy: `{}`\nuse one of: `default`, `avoid` or a number",
80+
name
81+
))),
82+
},
83+
}
84+
}
85+
}
86+
87+
impl From<super::InliningStrategy> for InliningStrategy {
88+
fn from(strategy: super::InliningStrategy) -> Self {
89+
match strategy {
90+
super::InliningStrategy::Default => Self::Predefined("default".to_string()),
91+
super::InliningStrategy::Avoid => Self::Predefined("avoid".to_string()),
92+
super::InliningStrategy::InlineSmallFunctions(weight) => {
93+
Self::InlineSmallFunctions(weight)
94+
}
95+
}
96+
}
97+
}
4798
}
4899

49100
impl DefaultForProfile for ManifestCompilerConfig {

scarb/tests/build_cairo_plugin.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1369,7 +1369,7 @@ fn can_be_expanded() {
13691369
13701370
#[derive(CustomDerive, Drop)]
13711371
struct SomeType {}
1372-
impl SomeTypeDrop of core::traits::Drop<SomeType>;
1372+
impl SomeTypeDrop<> of core::traits::Drop<SomeType>;
13731373
impl SomeImpl of Hello<SomeType> {
13741374
fn world(self: @SomeType) -> u32 {
13751375
32

0 commit comments

Comments
 (0)