compile_prepared_db_program_artifact

Function compile_prepared_db_program_artifact 

Source
pub fn compile_prepared_db_program_artifact<'db>(
    db: &'db dyn Database,
    main_crate_ids: Vec<CrateId<'db>>,
    compiler_config: CompilerConfig<'_>,
) -> Result<ProgramArtifact>
Expand description

Runs Cairo compiler for specified crates.

Wrapper over compile_prepared_db, but this function returns ProgramArtifact with requested debug info.

§Arguments

  • db - Preloaded compilation database.
  • main_crate_ids - CrateIds to compile. Do not include dependencies here, only pass top-level crates in order to eliminate unused code. Use CrateLongId::Real(name).intern(db) in order to obtain CrateId from its name.
  • compiler_config - The compiler configuration.

§Returns

  • Ok(ProgramArtifact) - The compiled program artifact with requested debug info.
  • Err(anyhow::Error) - Compilation failed.