Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: bump cairo and scarb to latest nightly #2152

Merged
merged 9 commits into from
Jul 8, 2024
Merged
Show file tree
Hide file tree
Changes from 7 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
18 changes: 9 additions & 9 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ on:

env:
CARGO_TERM_COLOR: always
RUST_VERSION: 1.76.0
RUST_VERSION: 1.79.0

jobs:
build:
Expand All @@ -31,7 +31,7 @@ jobs:
needs: ensure-docker
runs-on: ubuntu-latest-32-cores
container:
image: ghcr.io/dojoengine/dojo-dev:v0.7.2
image: ghcr.io/dojoengine/dojo-dev:ff30e1d
steps:
- uses: actions/checkout@v3
- uses: Swatinem/rust-cache@v2
Expand All @@ -54,7 +54,7 @@ jobs:
ensure-wasm:
runs-on: ubuntu-latest
container:
image: ghcr.io/dojoengine/dojo-dev:v0.7.2
image: ghcr.io/dojoengine/dojo-dev:ff30e1d
steps:
- uses: actions/checkout@v3
- uses: Swatinem/rust-cache@v2
Expand Down Expand Up @@ -114,7 +114,7 @@ jobs:
needs: build
runs-on: ubuntu-latest
container:
image: ghcr.io/dojoengine/dojo-dev:v0.7.2
image: ghcr.io/dojoengine/dojo-dev:ff30e1d
steps:
- uses: actions/download-artifact@v4
with:
Expand All @@ -129,7 +129,7 @@ jobs:
needs: build
runs-on: ubuntu-latest
container:
image: ghcr.io/dojoengine/dojo-dev:v0.7.2
image: ghcr.io/dojoengine/dojo-dev:ff30e1d
steps:
- uses: actions/download-artifact@v4
with:
Expand All @@ -143,7 +143,7 @@ jobs:
dojo-world-bindings-check:
runs-on: ubuntu-latest
container:
image: ghcr.io/dojoengine/dojo-dev:v0.7.2
image: ghcr.io/dojoengine/dojo-dev:ff30e1d
steps:
- uses: actions/checkout@v3
- uses: Swatinem/rust-cache@v2
Expand All @@ -152,7 +152,7 @@ jobs:
clippy:
runs-on: ubuntu-latest-4-cores
container:
image: ghcr.io/dojoengine/dojo-dev:v0.7.2
image: ghcr.io/dojoengine/dojo-dev:ff30e1d
steps:
- uses: actions/checkout@v3
- uses: Swatinem/rust-cache@v2
Expand All @@ -161,7 +161,7 @@ jobs:
fmt:
runs-on: ubuntu-latest
container:
image: ghcr.io/dojoengine/dojo-dev:v0.7.2
image: ghcr.io/dojoengine/dojo-dev:ff30e1d
steps:
- uses: actions/checkout@v3
- uses: Swatinem/rust-cache@v2
Expand All @@ -170,7 +170,7 @@ jobs:
docs:
runs-on: ubuntu-latest
container:
image: ghcr.io/dojoengine/dojo-dev:v0.7.2
image: ghcr.io/dojoengine/dojo-dev:ff30e1d
steps:
- uses: actions/checkout@v3
- uses: Swatinem/rust-cache@v2
Expand Down
1,300 changes: 650 additions & 650 deletions Cargo.lock

Large diffs are not rendered by default.

48 changes: 24 additions & 24 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -115,28 +115,28 @@ auto_impl = "1.2.0"
base64 = "0.21.2"
bigdecimal = "0.4.1"
bytes = "1.6"
cairo-lang-compiler = { git = "https://github.com/starkware-libs/cairo", rev = "d9984ef58e2f704909e271f2f01327f520ded632" }
cairo-lang-debug = { git = "https://github.com/starkware-libs/cairo", rev = "d9984ef58e2f704909e271f2f01327f520ded632" }
cairo-lang-defs = { git = "https://github.com/starkware-libs/cairo", rev = "d9984ef58e2f704909e271f2f01327f520ded632" }
cairo-lang-diagnostics = { git = "https://github.com/starkware-libs/cairo", rev = "d9984ef58e2f704909e271f2f01327f520ded632" }
cairo-lang-filesystem = { git = "https://github.com/starkware-libs/cairo", rev = "d9984ef58e2f704909e271f2f01327f520ded632" }
cairo-lang-formatter = { git = "https://github.com/starkware-libs/cairo", rev = "d9984ef58e2f704909e271f2f01327f520ded632" }
cairo-lang-language-server = { git = "https://github.com/starkware-libs/cairo", rev = "d9984ef58e2f704909e271f2f01327f520ded632" }
cairo-lang-lowering = { git = "https://github.com/starkware-libs/cairo", rev = "d9984ef58e2f704909e271f2f01327f520ded632" }
cairo-lang-parser = { git = "https://github.com/starkware-libs/cairo", rev = "d9984ef58e2f704909e271f2f01327f520ded632" }
cairo-lang-plugins = { git = "https://github.com/starkware-libs/cairo", rev = "d9984ef58e2f704909e271f2f01327f520ded632", features = [ "testing" ] }
cairo-lang-project = { git = "https://github.com/starkware-libs/cairo", rev = "d9984ef58e2f704909e271f2f01327f520ded632" }
cairo-lang-semantic = { git = "https://github.com/starkware-libs/cairo", rev = "d9984ef58e2f704909e271f2f01327f520ded632", features = [ "testing" ] }
cairo-lang-sierra = { git = "https://github.com/starkware-libs/cairo", rev = "d9984ef58e2f704909e271f2f01327f520ded632" }
cairo-lang-sierra-generator = { git = "https://github.com/starkware-libs/cairo", rev = "d9984ef58e2f704909e271f2f01327f520ded632" }
cairo-lang-sierra-to-casm = { git = "https://github.com/starkware-libs/cairo", rev = "d9984ef58e2f704909e271f2f01327f520ded632" }
cairo-lang-starknet = { git = "https://github.com/starkware-libs/cairo", rev = "d9984ef58e2f704909e271f2f01327f520ded632" }
cairo-lang-starknet-classes = { git = "https://github.com/starkware-libs/cairo", rev = "d9984ef58e2f704909e271f2f01327f520ded632" }
cairo-lang-syntax = { git = "https://github.com/starkware-libs/cairo", rev = "d9984ef58e2f704909e271f2f01327f520ded632" }
cairo-lang-test-plugin = { git = "https://github.com/starkware-libs/cairo", rev = "d9984ef58e2f704909e271f2f01327f520ded632" }
cairo-lang-test-runner = { git = "https://github.com/starkware-libs/cairo", rev = "d9984ef58e2f704909e271f2f01327f520ded632" }
cairo-lang-test-utils = { git = "https://github.com/starkware-libs/cairo", rev = "d9984ef58e2f704909e271f2f01327f520ded632" }
cairo-lang-utils = { git = "https://github.com/starkware-libs/cairo", rev = "d9984ef58e2f704909e271f2f01327f520ded632" }
cairo-lang-compiler = { git = "https://github.com/starkware-libs/cairo", rev = "43cf361d9b6b26ec8cd5ee076dd15341bde7577c" }
cairo-lang-debug = { git = "https://github.com/starkware-libs/cairo", rev = "43cf361d9b6b26ec8cd5ee076dd15341bde7577c" }
cairo-lang-defs = { git = "https://github.com/starkware-libs/cairo", rev = "43cf361d9b6b26ec8cd5ee076dd15341bde7577c" }
cairo-lang-diagnostics = { git = "https://github.com/starkware-libs/cairo", rev = "43cf361d9b6b26ec8cd5ee076dd15341bde7577c" }
cairo-lang-filesystem = { git = "https://github.com/starkware-libs/cairo", rev = "43cf361d9b6b26ec8cd5ee076dd15341bde7577c" }
cairo-lang-formatter = { git = "https://github.com/starkware-libs/cairo", rev = "43cf361d9b6b26ec8cd5ee076dd15341bde7577c" }
cairo-lang-language-server = { git = "https://github.com/starkware-libs/cairo", rev = "43cf361d9b6b26ec8cd5ee076dd15341bde7577c" }
cairo-lang-lowering = { git = "https://github.com/starkware-libs/cairo", rev = "43cf361d9b6b26ec8cd5ee076dd15341bde7577c" }
cairo-lang-parser = { git = "https://github.com/starkware-libs/cairo", rev = "43cf361d9b6b26ec8cd5ee076dd15341bde7577c" }
cairo-lang-plugins = { git = "https://github.com/starkware-libs/cairo", rev = "43cf361d9b6b26ec8cd5ee076dd15341bde7577c", features = [ "testing" ] }
cairo-lang-project = { git = "https://github.com/starkware-libs/cairo", rev = "43cf361d9b6b26ec8cd5ee076dd15341bde7577c" }
cairo-lang-semantic = { git = "https://github.com/starkware-libs/cairo", rev = "43cf361d9b6b26ec8cd5ee076dd15341bde7577c", features = [ "testing" ] }
cairo-lang-sierra = { git = "https://github.com/starkware-libs/cairo", rev = "43cf361d9b6b26ec8cd5ee076dd15341bde7577c" }
cairo-lang-sierra-generator = { git = "https://github.com/starkware-libs/cairo", rev = "43cf361d9b6b26ec8cd5ee076dd15341bde7577c" }
cairo-lang-sierra-to-casm = { git = "https://github.com/starkware-libs/cairo", rev = "43cf361d9b6b26ec8cd5ee076dd15341bde7577c" }
cairo-lang-starknet = { git = "https://github.com/starkware-libs/cairo", rev = "43cf361d9b6b26ec8cd5ee076dd15341bde7577c" }
cairo-lang-starknet-classes = { git = "https://github.com/starkware-libs/cairo", rev = "43cf361d9b6b26ec8cd5ee076dd15341bde7577c" }
cairo-lang-syntax = { git = "https://github.com/starkware-libs/cairo", rev = "43cf361d9b6b26ec8cd5ee076dd15341bde7577c" }
cairo-lang-test-plugin = { git = "https://github.com/starkware-libs/cairo", rev = "43cf361d9b6b26ec8cd5ee076dd15341bde7577c" }
cairo-lang-test-runner = { git = "https://github.com/starkware-libs/cairo", rev = "43cf361d9b6b26ec8cd5ee076dd15341bde7577c" }
cairo-lang-test-utils = { git = "https://github.com/starkware-libs/cairo", rev = "43cf361d9b6b26ec8cd5ee076dd15341bde7577c" }
cairo-lang-utils = { git = "https://github.com/starkware-libs/cairo", rev = "43cf361d9b6b26ec8cd5ee076dd15341bde7577c" }
cairo-proof-parser = { git = "https://github.com/cartridge-gg/cairo-proof-parser", branch = "v0.3.0/new-felt" }
cairo-vm = "0.9.2"
camino = { version = "1.1.2", features = [ "serde1" ] }
Expand Down Expand Up @@ -172,8 +172,8 @@ rpassword = "7.2.0"
rstest = "0.18.2"
rstest_reuse = "0.6.0"
salsa = "0.16.1"
scarb = { git = "https://github.com/software-mansion/scarb", rev = "f1aa7b09507a84d209d83b2fa80472c82605cc43" }
scarb-ui = { git = "https://github.com/software-mansion/scarb", rev = "f1aa7b09507a84d209d83b2fa80472c82605cc43" }
scarb = { git = "https://github.com/software-mansion/scarb", rev = "4b75f435f68248a7c096ec0fa5939ecdd92e2d79" }
scarb-ui = { git = "https://github.com/software-mansion/scarb", rev = "4b75f435f68248a7c096ec0fa5939ecdd92e2d79" }
semver = "1.0.5"
serde = { version = "1.0", features = [ "derive" ] }
serde_json = { version = "1.0", features = [ "arbitrary_precision" ] }
Expand Down
5 changes: 3 additions & 2 deletions bin/sozo/src/commands/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,9 @@ impl BuildArgs {
let compile_info = compile_workspace(
config,
CompileOpts {
include_targets: vec![],
exclude_targets: vec![TargetKind::TEST],
include_target_names: vec![],
include_target_kinds: vec![],
exclude_target_kinds: vec![TargetKind::TEST],
features: features_opts,
},
)?;
Expand Down
2 changes: 1 addition & 1 deletion bin/sozo/src/commands/clean.rs
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ impl CleanArgs {
trace!(ws=?ws, "Workspace read successfully.");

let profile_names = if self.all_profiles {
let mut profiles = ws.profile_names().expect("given method never returns an error");
let mut profiles = ws.profile_names();
// currently scarb can return duplicate profiles and since the vector is sorted we can
// remove duplicates by calling dedup
profiles.dedup();
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we can remove this dedup now, since scarb does it now.

Expand Down
4 changes: 2 additions & 2 deletions bin/sozo/src/commands/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,8 @@ pub enum Commands {
Init(InitArgs),
#[command(about = "Remove generated artifacts, manifests and abis")]
Clean(CleanArgs),
#[command(about = "Run a migration, declaring and deploying contracts as necessary to \
update the world")]
#[command(about = "Run a migration, declaring and deploying contracts as necessary to update \
the world")]
Migrate(Box<MigrateArgs>),
#[command(about = "Developer mode: watcher for building and migration")]
Dev(DevArgs),
Expand Down
4 changes: 2 additions & 2 deletions crates/dojo-core/Scarb.lock
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,5 @@ dependencies = [

[[package]]
name = "dojo_plugin"
version = "0.4.1"
source = "git+https://github.com/dojoengine/dojo?tag=v0.7.2#3da5cad9fdd39b81551e0668015d88262e6c5fc4"
version = "0.7.2"
source = "git+https://github.com/dojoengine/dojo?tag=v0.7.3#e8539d5b199efbd51c89c75da32f6592de5d9262"
6 changes: 3 additions & 3 deletions crates/dojo-core/Scarb.toml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
[package]
cairo-version = "=2.6.3"
cairo-version = "=2.6.4"
description = "The Dojo Core library for autonomous worlds."
name = "dojo"
version = "0.7.3"

[dependencies]
dojo_plugin = { git = "https://github.com/dojoengine/dojo", tag = "v0.7.2" }
starknet = "=2.6.3"
dojo_plugin = { git = "https://github.com/dojoengine/dojo", tag = "v0.7.3" }
starknet = "=2.6.4"
2 changes: 1 addition & 1 deletion crates/dojo-core/src/base_test.cairo
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ mod invalid_model {
fn selector(self: @ContractState) -> felt252 {
// NOTE: Need to update this value if address changes
// Pre-computed address of a contract deployed through the world.
0x3f692e9669a95a2ace68e1eec4fdc26594d4b1413d78a62262249d9108c4194
0x1130142d6bff3c9cb891a270922a4c6dbf4c222b675cdc1341905b17341e3ab
}

fn namespace(self: @ContractState) -> ByteArray {
Expand Down
10 changes: 5 additions & 5 deletions crates/dojo-core/src/world.cairo
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ mod world {
contract_address_const, get_caller_address, get_contract_address, get_tx_info,
contract_address::ContractAddressIntoFelt252, ClassHash, Zeroable, ContractAddress,
syscalls::{deploy_syscall, emit_event_syscall, replace_class_syscall}, SyscallResult,
SyscallResultTrait, SyscallResultTraitImpl
SyscallResultTrait, SyscallResultTraitImpl, storage::Map,
};

use dojo::database;
Expand Down Expand Up @@ -227,12 +227,12 @@ mod world {
contract_base: ClassHash,
nonce: usize,
models_count: usize,
resources: LegacyMap::<felt252, ResourceData>,
owners: LegacyMap::<(felt252, ContractAddress), bool>,
writers: LegacyMap::<(felt252, ContractAddress), bool>,
resources: Map::<felt252, ResourceData>,
owners: Map::<(felt252, ContractAddress), bool>,
writers: Map::<(felt252, ContractAddress), bool>,
#[substorage(v0)]
config: Config::Storage,
initialized_contract: LegacyMap::<felt252, bool>,
initialized_contract: Map::<felt252, bool>,
}

#[derive(Drop, starknet::Store, Default, Debug)]
Expand Down
5 changes: 3 additions & 2 deletions crates/dojo-lang/src/compiler_test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,9 @@ fn test_compiler_cairo_features() {
let compile_info = scarb_internal::compile_workspace(
&config,
CompileOpts {
include_targets: vec![],
exclude_targets: vec![TargetKind::TEST],
include_target_names: vec![],
include_target_kinds: vec![],
exclude_target_kinds: vec![TargetKind::TEST],
features: features_opts,
},
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,5 @@ dependencies = [

[[package]]
name = "dojo_plugin"
version = "0.4.1"
source = "git+https://github.com/dojoengine/dojo?tag=v0.7.2#3da5cad9fdd39b81551e0668015d88262e6c5fc4"
version = "0.7.2"
source = "git+https://github.com/dojoengine/dojo?tag=v0.7.3#e8539d5b199efbd51c89c75da32f6592de5d9262"
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
kind = "DojoContract"
class_hash = "0x7468fbf6e47eb66fd898a4a68bbe801560fdd42b0d6909ec4f75fb38c613702"
original_class_hash = "0x7468fbf6e47eb66fd898a4a68bbe801560fdd42b0d6909ec4f75fb38c613702"
class_hash = "0x1b29f38120f222120acf9b3d66f7015d47c0b11d4e9acdfefa243958c60909d"
original_class_hash = "0x1b29f38120f222120acf9b3d66f7015d47c0b11d4e9acdfefa243958c60909d"
base_class_hash = "0x0"
abi = "manifests/dev/abis/base/contracts/ccf-cairo_v240-8d921297.json"
reads = []
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
kind = "DojoContract"
class_hash = "0x4bbfcdc8d95ecfa332201e21f615e98b4d12e08f77d176761e32bb34e3bc333"
original_class_hash = "0x4bbfcdc8d95ecfa332201e21f615e98b4d12e08f77d176761e32bb34e3bc333"
class_hash = "0x412449a631f6652b3bbe27841fb6776639e493baad1a5894daeb9260d1b0a63"
original_class_hash = "0x412449a631f6652b3bbe27841fb6776639e493baad1a5894daeb9260d1b0a63"
base_class_hash = "0x0"
abi = "manifests/dev/abis/base/contracts/ccf-cairo_v260-465ec7fe.json"
reads = []
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
kind = "Class"
class_hash = "0x22f3e55b61d86c2ac5239fa3b3b8761f26b9a5c0b5f61ddbd5d756ced498b46"
original_class_hash = "0x22f3e55b61d86c2ac5239fa3b3b8761f26b9a5c0b5f61ddbd5d756ced498b46"
class_hash = "0x26a4f5d2d9638877a2648297339275df5eaab0adb3cdf0010887c2dbf2be4"
original_class_hash = "0x26a4f5d2d9638877a2648297339275df5eaab0adb3cdf0010887c2dbf2be4"
abi = "manifests/dev/abis/base/dojo-base.json"
tag = "dojo-base"
manifest_name = "dojo-base"
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
kind = "Class"
class_hash = "0x1498dd1197805ec05d37da956d0fc568023a4c25578b0523b4f4f0d0e4f16c2"
original_class_hash = "0x1498dd1197805ec05d37da956d0fc568023a4c25578b0523b4f4f0d0e4f16c2"
class_hash = "0x21341ba6e0d96f909f15c4ed865188afc716563d34593fb443d56cb97ff7b92"
original_class_hash = "0x21341ba6e0d96f909f15c4ed865188afc716563d34593fb443d56cb97ff7b92"
abi = "manifests/dev/abis/base/dojo-world.json"
tag = "dojo-world"
manifest_name = "dojo-world"
4 changes: 4 additions & 0 deletions crates/dojo-lang/src/plugin.rs
Original file line number Diff line number Diff line change
Expand Up @@ -549,6 +549,10 @@ impl MacroPlugin for BuiltinDojoPlugin {
"computed".to_string(),
]
}

fn declared_derives(&self) -> Vec<String> {
vec!["Introspect".to_string(), "IntrospectPacked".to_string()]
}
}

pub struct CairoPluginRepository(scarb::compiler::plugin::CairoPluginRepository);
Expand Down
19 changes: 19 additions & 0 deletions crates/dojo-lang/src/plugin_test_data/print
Original file line number Diff line number Diff line change
Expand Up @@ -113,3 +113,22 @@ Enemy::OtherPlayer(v) => { core::debug::PrintTrait::print('OtherPlayer'); core::
}

//! > expected_diagnostics
error: Unknown derive `Print` - a plugin might be missing.
--> test_src/lib.cairo:4:10
#[derive(Print)]
^***^

error: Unknown derive `Print` - a plugin might be missing.
--> test_src/lib.cairo:12:10
#[derive(Print)]
^***^

error: Unknown derive `Print` - a plugin might be missing.
--> test_src/lib.cairo:19:10
#[derive(Print)]
^***^

error: Unknown derive `Print` - a plugin might be missing.
--> test_src/lib.cairo:28:10
#[derive(Print)]
^***^
Loading
Loading