lambdaclass / cairo-by-example

cairo-by-example.com
https://cairo-by-example.com/
Apache License 2.0
39 stars 23 forks source link

Error: Failed to find development corelib. #112

Closed clacladev closed 1 year ago

clacladev commented 1 year ago

I've used your script to install cairo on my M1 macOS machine (Ventura 15.3.2).

curl -sL https://raw.githubusercontent.com/lambdaclass/cairo-by-example/main/build/installer.sh | bash -s 2.2.0

It installs correctly, but when I try to compile the hello world exercise, I get an error:

cairo-run --single-file hello-world.cairo
Error: Failed to find development corelib.

I am not able to understand why.

If I look for the core lib I find it, though. So it's installed:

ls /opt/homebrew/Cellar/cairo-lang@2.2.0/2.2.0/corelib
Scarb.toml         cairo_project.toml src
pfcrowe commented 1 year ago

hi @clacladev - two things that might be of help, done sequentially

have you set export CARGO_MANIFEST_DIR=<corelib-path> in your shell resource file? (/usr/local/Cellar/cairo-lang@2.2.0/2.2.0/corelib in my case)

if you are working from within vscode, and are trying to run the cairo-run command from its cli, and already had the Cairo 1.0 extension installed, cloning https://github.com/starkware-libs/cairo and following the vscode-cairo/README.md extension install instructions under the first subheader, down to and includingcode --install-extension cairo1*.vsix fixed the same issue for me

clacladev commented 1 year ago

Thank you a lot @pfcrowe for the help. I thought the installer.sh was supposed to export the CARGO_MANIFEST_DIR. But now I manually did it and it just works.

Thanks for the help!