You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Users happen to get into situation when LS is fed with core crate coming from different compiler release. This results in all analysis actions to panic because the compiler expects existence and particular implementation of various language items in core, that is fulfilled by the exactly same core version, but usually is not happening in past and future releases.
Expected behavior:
Although panicking (at the place that does it) makes sense implementation-wise, we have to think how and implement a feature that will tell users what is the problem and how they could fix it. The exact UX is not decided on right now.
One idea that is the most pleasing right now is to implement a way of checking core and LS' compiler compatibility. Perhaps by comparing versions of both?
Steps to reproduce:
We know of several scenarios that trigger the invalid state, but there are probably more. Users are almost always unable to tell what they did.
The easiest unrealistic reproduction:
Open some regular Cairo codebase in VSCode.
Put the following in .vscode/settings.json (adjust versions to whatever you have installed, but they must be different):
A possible scenario that happens when users are reporting when new release is happening, and then they say that the issue solved magically:
Use asdf local scarb 2.6.4 to set Scarb locally in some Cairo codebase.
Launch VSCode, open some *.cairo file and thus let CairoLS load and analyse the project.
Open terminal panel.
Run asdf local scarb 2.7.0.
Open another *.cairo file and thus let CairoLS call detect_crate_for again and query scarb metadata from a new Scarb installation. This should replace the core crate that is already loaded in analyzer database (2.6.4) with new one that new Scarb provides (2.7.0).
Note: This scenario interferes with New Project Model MVP #6124 that drops detect_crate_for. Perhaps we should resolve this case specifically in this feature implementation?
Note: Reloading VSCode will fix the problem because it will restart with newer CairoLS.
Related code:
Mostly this function panics, but in general, this applies to this entire file:
Bug Report
Cairo version:
2.7.0
Current behavior:
Users happen to get into situation when LS is fed with
core
crate coming from different compiler release. This results in all analysis actions to panic because the compiler expects existence and particular implementation of various language items incore
, that is fulfilled by the exactly samecore
version, but usually is not happening in past and future releases.Expected behavior:
Although panicking (at the place that does it) makes sense implementation-wise, we have to think how and implement a feature that will tell users what is the problem and how they could fix it. The exact UX is not decided on right now.
One idea that is the most pleasing right now is to implement a way of checking
core
and LS' compiler compatibility. Perhaps by comparing versions of both?Steps to reproduce:
We know of several scenarios that trigger the invalid state, but there are probably more. Users are almost always unable to tell what they did.
Open some regular Cairo codebase in VSCode.
Put the following in
.vscode/settings.json
(adjust versions to whatever you have installed, but they must be different):You can also do this with manually built the LS.
asdf local scarb 2.6.4
to set Scarb locally in some Cairo codebase.*.cairo
file and thus let CairoLS load and analyse the project.asdf local scarb 2.7.0
.*.cairo
file and thus let CairoLS calldetect_crate_for
again and queryscarb metadata
from a new Scarb installation. This should replace thecore
crate that is already loaded in analyzer database (2.6.4) with new one that new Scarb provides (2.7.0).detect_crate_for
. Perhaps we should resolve this case specifically in this feature implementation?Related code:
Mostly this function panics, but in general, this applies to this entire file:
cairo/crates/cairo-lang-semantic/src/corelib.rs
Lines 692 to 728 in 106bb50
The text was updated successfully, but these errors were encountered: