Skip to content

v2.10.0-rc.0

Pre-release
Pre-release
Compare
Choose a tag to compare
@github-actions github-actions released this 08 Jan 21:54
· 51 commits to main since this release

Cairo release notes ➡️

Welcome to the release notes for Scarb v2.10.0-rc.0!
This release brings few developments.

Support for prebuilt procedural macro plugins

Until now, all procedural macros required to be compiled on the user system before being used by Scarb.
This meant that programmers that wanted to depend on a package utilizing a procedural macro had to install Rust compiler (and Cargo) on their computer.
This release brings an opt-in feature, that enables the user to request a pre-compiled procedural macro to be used instead.

For this to be possible, two conditions need to be met:

  • The procedural macro package has to be published with the precompiled macros included.
  • Usage of the precompiled macro binaries needs to be explicitly allowed in the top-level Scarb toml manifest file.

To include a precompiled macro binaries in your package, you need to place the binary files in target/scarb/cairo-plugin directory of the package, with names adhering to following convention: {package_name}_v{version}_{target_name}.{dll_extension}, where target name describes the target OS in Cargo conventions. For publishing, the include field of the package manifest may be useful, as it can be used to instruct Scarb to include this directory when packaging Scarb package with scarb package/scarb publish.
To allow usage of precompiled procedural macros, you need to add a list of package names under allow-prebuilt-plugins name in the tool.scarb section of Scarb manifest of the compiled (top-level) package. Note this allow list works recursively, so adding a package names allow usage of precompiled macros in the dependency tree of this package.

[tool.scarb]
allow-prebuilt-plugins = ["snforge_std"]

The prebuilt binaries are used in a best-effort manner - if it's not possible to load a prebuilt binary for any reason, it will attempt to compile the macro source code instead.

Support re-exported contracts in build-external-contracts field

The build-external-contracts field now supports building contracts that are re-exported from dependency packages with use of pub use.

Executable target

Since this release, a new Scarb target has been added - [[target.executable]], which can be used to compile into a format accepted by Cairo execute. Dependency on cairo_execute package is required, to provide the #[executable] attribute.

Cairo Version

This version of Scarb comes with Cairo v2.10.0-rc.0.

What's Changed

New Contributors

Full Changelog: v2.9.2...v2.10.0-rc.0