v2.8.3
Welcome to the release notes for Scarb v2.8.3
!
The primary aim of this release is to bring changes that will make test targets compilation faster.
This release also includes several interface changes and developments.
Contracts from dependencies no longer compiled by default with cairo-test
Warning
If your cairo-test
tests use contracts defined in dependencies, an action is required!
Until this Scarb release, cairo-test
has been implicitly building all contracts from all dependencies of the tested package.
This strategy has been seen as convenient for it's users (as no action has been required from them to use those contracts in their tests). However, as Cairo codebases grew, it became unsustainably suboptimal. Since this release, only contracts defined in build-external-contracts
property on [[target.starknet-contract]]
section are built when compiling tests. See Scarb documentation for more details. This is the same strategy, that has been already used by Starknet Foundry Forge, as described in docs.
Print profile names in finished build message
From this release, the message printed on finished build now includes the name of the profile used.
For example:
Finished `dev` profile target(s) in 4 seconds
Support Trait and Impl inner functions in Scarb procedural macro attributes
It is now possible, to use attribute procedural macros on functions defined in traits or impls.
For instance, following syntax is now supported to expand some_attribute
attribute.
#[abi(embed_v0)]
impl SomeImpl of ISomeInterface<ContractState> {
fn get(self: @ContractState) -> u128 {
self.counter.read()
}
#[some_attribute]
fn increase(ref self: ContractState) {
self.counter.write( self.counter.read() + 1 );
}
}
Features validation in a workspace bug fix
Due to a bug in features validation logic, it has been observed that features defined in a single package of a workspace failed to resolved if not defined in other workspace packages. This logic has been fixed now.
Minor interface changes
- Target kinds filter in
scarb build
- This version introduces new optional argument--target-kinds
which accepts a coma separated list of target kind names. If present, only specified target kinds will be built. - Cairo run arguments file - This version introduces new optional argument
--arguments-file
, which can be used to provide program arguments through file on host os.
Cairo Version
This version of Scarb comes with Cairo v2.8.2
.
What's Changed
- Bump the non-critical group with 6 updates by @dependabot in #1583
- Update Cairo by @maciektr in #1584
- Update CODEOWNERS by @maciektr in #1588
- Print profile name in finished targets message by @maciektr in #1587
- Add target-kinds filter argument to build by @maciektr in #1589
- Feat: cairo-run extension: support --arguments-file optional parameter by @m-kus in #1591
- Bump the non-critical group with 3 updates by @dependabot in #1594
- Bump dompurify from 3.0.5 to 3.1.6 in /website by @dependabot in #1595
- Make paths displed on left nav bar if duplicated by @wawel37 in #1592
- Fix single package features in a workspace by @maciektr in #1593
- Bump vite from 5.2.12 to 5.4.6 in /website by @dependabot in #1602
- Support more ModuleItems in proc macro attribute expansion by @maciektr in #1556
- Adjust tests to new trait types and consts signatures by @wawel37 in #1600
- Remove redundant call to DiagnosticsReporter::ensure by @maciektr in #1604
- Compile contract artifacts in test targets by @maciektr in #1585
- Bump thiserror from 1.0.63 to 1.0.64 in the non-critical group by @dependabot in #1607
- Update docs by @maciektr in #1606
- Only search build-external-contracts for contracts in test target compilation by @maciektr in #1612
- Bump starknet-types-core from 0.1.5 to 0.1.6 by @dependabot in #1608
- Bump rollup from 4.21.3 to 4.22.4 in /website by @dependabot in #1614
New Contributors
Full Changelog: v2.8.2...v2.8.3