foundry-rs / starknet-foundry

Blazing fast toolkit for developing Starknet contracts.
https://foundry-rs.github.io/starknet-foundry/
MIT License
308 stars 150 forks source link

snforge_std version conflicts with counter-workshop #2087

Closed hanpham32 closed 3 months ago

hanpham32 commented 5 months ago

Which component is your bug related to?

snforge

Foundry Version

0.22.0

What operating system are you using?

MacOS

What system architecture are you using?

arm

What happened

Failed to build even when I've set my starknet version to be >=2.4.0 as required

#  Scarb.toml
[package]
name = "counter"
version = "0.1.0"

[project]
edition = "2023_01"

# See more keys and their definitions at https://docs.swmansion.com/scarb/docs/reference/manifest.html

[dependencies]
snforge_std = { git = "https://github.com/foundry-rs/starknet-foundry", tag = "v0.22.0" }
starknet = ">=2.4.0"

[[target.starknet-contract]]
# Enable CASM codegen.
casm = false

[casm]
generate_contract_class = true

Trace

error: Version solving failed:
- counter v0.1.0 (/Users/hanpham/Developer/Starknet/counter-workshop/counter/Scarb.toml) cannot use starknet v2.1.1 (std), because counter requires starknet >=2.4.0
- snforge_std v0.22.0 (git+https://github.com/foundry-rs/starknet-foundry?tag=v0.22.0) cannot use starknet v2.1.1 (std), because snforge_std requires starknet ^2.4.0

Scarb does not have real version solving algorithm yet.
Perhaps in the future this conflict could be resolved, but currently,
please upgrade your dependencies to use latest versions of their dependencies.

Is there an existing issue for this?

piotmag769 commented 3 months ago

You are using Scarb version that comes with starknet 2.1.1, that's why the solving fails. Try using Scarb >= 2.4.0 (the version of starknet bundled with Scarb is usually equal to the version of Scarb)

Closing bcs it is not a bug and it is not Starknet Foundry related