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

cache doesn't work snforge_scarb_plugin #37

Open
rnbguy opened this issue Mar 12, 2025 · 4 comments
Open

cache doesn't work snforge_scarb_plugin #37

rnbguy opened this issue Mar 12, 2025 · 4 comments
Labels
bug Something isn't working

Comments

@rnbguy
Copy link

rnbguy commented Mar 12, 2025

Problem

We have a dev-dependency to snforge_std which pulls snforge_scarb_plugin. It seems, the caching doesn't work for it as it is a proc_macro plugin and always starts recompiling using cargo.

(note: this is a dev-dependency and snforge_scarb_plugin shouldn't even be pulled when scarb build is called. but that's a separate issue for scarb)

# scarb build -p starknet_ibc_contracts
  
    Updating crates.io index
 Downloading crates ...
  Downloaded serde_derive v1.0.217
  Downloaded scarb-stable-hash v1.0.0
...
  Downloaded cairo-lang-primitive-token v1.0.0
  Downloaded libc v0.2.[16](https://github.com/informalsystems/ibc-starknet/actions/runs/13809907305/job/38628929334#step:8:17)9
   Compiling snforge_scarb_plugin v0.34.0
   Compiling proc-macro2 v1.0.93
...
   Compiling cairo-lang-parser v2.9.3
   Compiling snforge_scarb_plugin v0.34.0 (/home/runner/.cache/scarb/registry/src/scarbs.xyz-9djtpev4jug5q/snforge_scarb_plugin-0.34.0)
    Finished `release` profile [optimized] target(s) in 1m [23](https://github.com/informalsystems/ibc-starknet/actions/runs/13809907305/job/38628929334#step:8:24)s
   Compiling lib(starknet_ibc_contracts) starknet_ibc_contracts v0.1.0 (/home/runner/work/ibc-starknet/ibc-starknet/cairo-contracts/packages/contracts/Scarb.toml)
   Compiling starknet-contract(starknet_ibc_contracts) starknet_ibc_contracts v0.1.0 (/home/runner/work/ibc-starknet/ibc-starknet/cairo-contracts/packages/contracts/Scarb.toml)
    Finished `dev` profile target(s) in 3 minutes

Note that the cache works fine for other dependencies. It is only snforge_scarb_plugin for which the cache doesn't work.

Steps

No response

Possible Solution(s)

No response

Notes

No response

@mkaput
Copy link
Member

mkaput commented Mar 12, 2025

Hey!

I recommend upgrading your project to the latest Scarb and Foundry and enabling this: https://foundry-rs.github.io/starknet-foundry/appendix/scarb-toml.html?highlight=prebuil#toolscarb. This will Rust compilation altogether for you. Is doing this upgrade OK for your project?

@rnbguy
Copy link
Author

rnbguy commented Mar 12, 2025

We are using [email protected] because we wanted to use starkli with compiler version 2.9.1.

But I noticed, starkli released a new version yesterday, making --compiler-version deprecated.

We are currently deploying the contracts on testnet but soon on mainnet. Do you think, if we compile with latest [email protected] we can deploy the class hashes on testnet and mainnet via starkli?

PS. I may be unaware of Starknet ecosystem versioning convention 😅

@mkaput
Copy link
Member

mkaput commented Mar 12, 2025

Ah, contracts compiled with scarb/cairo >=2.10 can be deployed on starknet 0.13.4 which is gonna happen very soon on mainnet, but is not there yet: https://www.starknet.io/developers/roadmap/


Try clearing caches for your actions here: https://github.com/informalsystems/ibc-starknet/actions/caches. We took a look at your runs, and it looks like our action had some stale cache that it didn't want to invalidate. This action uses Scarb.lock contents as cache key. If you haven't changed it in a while or something, then maybe this is the issue.

@rnbguy
Copy link
Author

rnbguy commented Mar 12, 2025

Thanks for the roadmap link ! Looks good enough for us. We will upgrade the versions soon.

About the cache, you're totally right 😅 I can't find scarb caches in our repo. I think, it was pulling something on your end (or somewhere else). I wasn't aware that Github caches can do something like this.

This is the key of the cache: scarb-cache-linux-04730b7fddb0678d10a7001feb43f7a2367090e57155060caef18eb6a6aef8a8.

Since, we don't have any scarb cache, I guess, I don't have any cache to clear for scarb.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Status: Triage
Development

No branches or pull requests

2 participants