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
Do not provide any path, diagnostic reporter can be found in compiler_config.diagnostics_reporter
Wrap compilation result into Executable struct with Executable::new
Serialize the executable struct into JSON with serde
Write the result of serialization to the target directory with .executable.json extension.
Add created compiler to the CompilerRepository so Scarb can find it when compiling targets.
Add a test case to check if your new compiler can be used by users. It can be added to build_targets.rs test file. When creating a test project with ProjectBuilder, add [[target.executable]] to manifest with manifest_extra. Your lib.cairo (can be set with lib_cairo) should define a Cairo function with #[executable] attribute. Check if files in output directory are created properly.
Notes
Try dividing this work into consecutive PRs.
The text was updated successfully, but these errors were encountered:
Problem
Should compile project with use of compile_executable_in_prepared_db API.
This target should create new json output file with
Executable
of a function compiled before.The main crate should have exactly one function marked as #[executable] (this is enforced by the compiler).
This functionality will heavily rely on the API exposed by
cairo-lang-execuable
crate in Cairo repo.Proposed Solution
Add new pre-defined TargetKind called
executable
.Add new compiler to compilers dir, called executable.
target_kind
.compiler_config.diagnostics_reporter
Wrap compilation result into
Executable
struct withExecutable::new
Serialize the executable struct into JSON with serde
Write the result of serialization to the target directory with
.executable.json
extension.Add created compiler to the CompilerRepository so Scarb can find it when compiling targets.
Add a test case to check if your new compiler can be used by users. It can be added to build_targets.rs test file. When creating a test project with
ProjectBuilder
, add[[target.executable]]
to manifest withmanifest_extra
. Yourlib.cairo
(can be set with lib_cairo) should define a Cairo function with#[executable]
attribute. Check if files in output directory are created properly.Notes
Try dividing this work into consecutive PRs.
The text was updated successfully, but these errors were encountered: