Skip to content

Commit

Permalink
Remove corelib from ProjectConfig (#6511)
Browse files Browse the repository at this point in the history
  • Loading branch information
piotmag769 authored Oct 23, 2024
1 parent ce412d8 commit 637351f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 9 deletions.
9 changes: 3 additions & 6 deletions crates/cairo-lang-compiler/src/db.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ use cairo_lang_defs::db::{DefsDatabase, DefsGroup, ext_as_virtual_impl};
use cairo_lang_defs::plugin::{InlineMacroExprPlugin, MacroPlugin};
use cairo_lang_filesystem::cfg::CfgSet;
use cairo_lang_filesystem::db::{
AsFilesGroupMut, CORELIB_CRATE_NAME, CORELIB_VERSION, ExternalFiles, FilesDatabase, FilesGroup,
FilesGroupEx, init_dev_corelib, init_files_group,
AsFilesGroupMut, CORELIB_VERSION, ExternalFiles, FilesDatabase, FilesGroup, FilesGroupEx,
init_dev_corelib, init_files_group,
};
use cairo_lang_filesystem::detect::detect_corelib;
use cairo_lang_filesystem::flag::Flag;
Expand All @@ -23,7 +23,7 @@ use cairo_lang_utils::Upcast;
use cairo_lang_utils::ordered_hash_map::OrderedHashMap;

use crate::InliningStrategy;
use crate::project::{update_crate_root, update_crate_roots_from_project_config};
use crate::project::update_crate_roots_from_project_config;

#[salsa::database(
DefsDatabase,
Expand Down Expand Up @@ -183,9 +183,6 @@ impl RootDatabaseBuilder {

if let Some(config) = &self.project_config {
update_crate_roots_from_project_config(&mut db, config.as_ref());
if let Some(corelib) = &config.corelib {
update_crate_root(&mut db, config, CORELIB_CRATE_NAME.into(), corelib.clone());
}
}
validate_corelib(&db)?;

Expand Down
4 changes: 1 addition & 3 deletions crates/cairo-lang-project/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ mod test;
use std::path::{Path, PathBuf};

use cairo_lang_filesystem::db::CrateSettings;
use cairo_lang_filesystem::ids::Directory;
use cairo_lang_utils::ordered_hash_map::OrderedHashMap;
use serde::{Deserialize, Serialize};
use smol_str::SmolStr;
Expand All @@ -27,7 +26,6 @@ pub const PROJECT_FILE_NAME: &str = "cairo_project.toml";
#[derive(Clone, Debug, PartialEq, Eq)]
pub struct ProjectConfig {
pub base_path: PathBuf,
pub corelib: Option<Directory>,
pub content: ProjectConfigContent,
}

Expand Down Expand Up @@ -70,7 +68,7 @@ impl ProjectConfig {
.ok_or(DeserializationError::PathError)?
.into();
let content = toml::from_str(&std::fs::read_to_string(filename)?)?;
Ok(ProjectConfig { base_path, content, corelib: None })
Ok(ProjectConfig { base_path, content })
}

/// Returns the crate root's absolute path, according to the base path of this project.
Expand Down

0 comments on commit 637351f

Please sign in to comment.