Skip to content

Commit

Permalink
Fix corelib finding
Browse files Browse the repository at this point in the history
  • Loading branch information
spapinistarkware committed Jan 26, 2023
1 parent 589dfcb commit 0e3ff18
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 3 additions & 1 deletion crates/cairo-lang-compiler/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,9 @@ pub fn compile_cairo_project_at_path(
path: &Path,
compiler_config: CompilerConfig,
) -> Result<SierraProgram> {
let mut db = RootDatabase::default();
let mut builder = RootDatabase::builder();
builder.with_dev_corelib().unwrap();
let mut db = builder.build();
let main_crate_ids = setup_project(&mut db, path)?;
compile_prepared_db(db, main_crate_ids, compiler_config)
}
Expand Down
4 changes: 3 additions & 1 deletion crates/cairo-lang-runner/src/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,9 @@ struct Args {
fn main() -> anyhow::Result<()> {
let args = Args::parse();

let mut db_val = RootDatabase::default();
let mut builder = RootDatabase::builder();
builder.with_dev_corelib().unwrap();
let mut db_val = builder.build();
let db = &mut db_val;

let main_crate_ids = setup_project(db, Path::new(&args.path))?;
Expand Down

0 comments on commit 0e3ff18

Please sign in to comment.