v2.10.0-rc.0
Pre-releaseWelcome 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
- Fix website dead links by @maciektr in #1844
- Use cairo-toolchain-xtasks by @mkaput in #1845
- Add include field to the manifest by @maciektr in #1842
- Bump semver from 1.0.23 to 1.0.24 by @dependabot in #1848
- Fix docs on proc macros by @maciektr in #1850
- Update deps by @maciektr in #1849
- AOT package script by @maciektr in #1836
- feat: executable plugin by @FroyaTheHen in #1839
- feat: compile executable by @FroyaTheHen in #1840
- Support re-exported contracts in build-external by @maciektr in #1773
- Add allowed prebuilts list by @maciektr in #1846
- Load prebuilt macros by @maciektr in #1856
- Bump the non-critical group across 1 directory with 14 updates by @dependabot in #1860
- Bump gix from 0.68.0 to 0.69.1 by @dependabot in #1859
- Bump deno_task_shell from 0.20.2 to 0.20.3 by @dependabot in #1865
- Bump the non-critical group with 3 updates by @dependabot in #1864
- Update Cairo / add missing cairo deps patch by @maciektr in #1862
- Refactor -> move simple resolver to separate mod by @maciektr in #1452
- Add once_map package by @maciektr in #1665
- Use less partitions in Scarb CI by @maciektr in #1869
New Contributors
- @FroyaTheHen made their first contribution in #1839
Full Changelog: v2.9.2...v2.10.0-rc.0