Releases: software-mansion/scarb
v2.7.0-rc.1
Welcome to the release notes for Scarb v2.7.0-rc.1
!
Warning
This version is not supported on Starknet! If you want to develop contracts deployable to the current Starknet, please stick with Scarb v2.6.5
This Scarb release comes with few new developments:
- Filtering tests by type in
cairo-test
- Since this release, you can filter tests that will be compiled and run by type - either unit tests (ones defined in your packagessrc/
directory), or integration tests (defined intests/
directory). This can be done with help of newcairo-test
cli argument--test-kind
which accepts eitherunit
,integration
orall
(default). - Compiler inlining strategy configuration - You can now, you can control the compilers inlining strategy, by chaning the
inlining-strategy
property of compiler manifest config ([cairo]
section). This property can be set to eitherdefault
oravoid
. With the later, only functions withinline(always)
attribute are inlined during the compilation. Warning: while this setting is helpful for particular narrow usecases, in general can cause your programs to be slow and the output files to be large, so please use with caution!
Cairo Version
This version of Scarb comes with Cairo v2.7.0-rc.1
.
What's Changed
- Update website dependencies by @mkaput in #1399
- Add note about --snforge by @maciektr in #1395
- Add missing error context on snforge invocation by @maciektr in #1398
- Doc cairo-run plugin by @maciektr in #1396
- Cairo-test target type argument cli by @maciektr in #1400
- Dedup workspace.profile_names by @maciektr in #1402
- Use gix-path exe_invocation by @maciektr in #1401
- Bump the non-critical group with 4 updates by @dependabot in #1403
- Test asserts plugin by @maciektr in #1390
- Bump starknet-types-core from 0.1.2 to 0.1.5 by @dependabot in #1404
- Update Cairo, add TestCompilationConfig, disable deprecated cairo-doc impl by @maciektr in #1405
- Statement map test: deserialize instead of is_object by @maciektr in #1407
DocGroup
in scarb-doc by @piotmag769 in #1409- Add inlining strategy to compiler config by @maciektr in #1408
- Bump the non-critical group with 2 updates by @dependabot in #1413
- Cairo run fix argument deserialization for numbers larger than u64 by @maciektr in #1410
- Add new/init --snforge e2e test by @maciektr in #1411
- [scarb-doc] Inner attributes by @drknzz in #1315
- Update snforge docs by @piotmag769 in #1416
- Update Cairo by @maciektr in #1418
- Bump the non-critical group with 4 updates by @dependabot in #1422
- Add documentation for inline procedural macros by @maciektr in #1419
- Snapshot tests for
scarb-doc
by @piotmag769 in #1420 - Prepare release
2.7.0-rc.1
by @maciektr in #1431
Full Changelog: v2.7.0-rc.0...v2.7.0-rc.1
v2.7.0-rc.0
Welcome to the release notes for Scarb v2.7.0-rc.0
!
Warning
This version is not supported on Starknet! If you want to develop contracts deployable to the current Starknet, please stick with Scarb v2.6.5
This Scarb release includes multiple new developments:
- Testing without gas calculation - If your package disables gas calculation with
enable-gas
flag on compiler config, no gas calculations will be performed incairo-test
. - Additional resource usage info while testing - You can now use new flag
--print-resource-usage
when testing package withcairo-test
to print more verbose usage info. - Cairo profiler support - statement-function mappings - Scarb can now emit annotations that can be consumed by
cairo-profiler
to trace resource usage. - Diagnostic error codes - Compiler diagnostics (both errors and warnings) are now printed with numerical error code, which makes identification and understanding of root cause easier.
- Stop overwriting existing git checkouts - Checkouts of git dependencies are not anymore overwriten on each Scarb run.
- Stop enabling
cfg(test)
in package tested with integration tests - integration tests (fromtests
directory) incairo-test
should not rely on
But also, the introduction of few new features:
Conditional compilation with Scarb features
Features in Scarb provide a way to conditionally compile specific parts of the code during the build process.
A package defines a set of named features in the [features]
section of the Scarb.toml
file. Each defined feature can list other features that should be enabled with it. For example, a package supporting various hash functions might define features like this:
[features]
poseidon = []
pedersen = []
keccak = []
With these features set, conditional compilation (cfg) attributes can be used to selectively include code to support requested features during compile time, for example: #[cfg(feature: 'poseidon')]
.
You can read more on features in our conditional compilation docs.
Cairo test dependency
Since this release, all packages using cairo-test
as a test runner have to define a dependency on cairo_test
package, with version matching the Scarb version (similarly to the starknet
package). The cairo_test
package should be put in the dev-dependencies
section of Scarb manifest file.
Example of dependency declaration:
[dev-dependencies]
cairo_test = "2.7.0-rc.0"
If you choose to replace cairo-test
with another test runner (like starknet-foundry
) you should remove the cairo_test
package from your dependencies.
Forge project template
If you intend to use Starknet Foundry Forge to test your contracts, you can create an already set up Starknet Foundry project by running:
scarb new hello_world --snforge
This will create a Starknet package, with Forge already set up as your test runner. You can then execute Forge tests by
simply running:
scarb test
You can also build your package, like a regular Starknet package.
Scarb expand command
Before the actual compilation of your Cairo code, the Cairo compiler runs multiple pre-processing steps on it (these are usually called plugins).
Each of these steps takes parsed Cairo code as an input, modifies it and returns modified Cairo code back to the compiler.
Since this Scarb release, you can use scarb expand
to see the Cairo code generated after all preprocessing steps. The expanded Cairo will be saved in a file in target directory.
Choose cairo-run function to execute
Until this release, scarb cairo-run
would always look for a function called main
to execute.
Since this release, a function to run can be specified with --function
argument.
If your build does not include debug names (sierra-replace-ids
set to false), you can now choose function to run by annotating it with #[main]
attribute.
To use the attribute, you need to add cairo_run
with version equal to Scarb version to your dependencies.
You can read more on cairo-run
in our docs.
Merge manifest tool definitions recursively
Tool metadata (defined in the manifest [tool]
section) can be overridden by a profile.
Since this release, merge strategy can be changed with merge-strategy
property.
For example:
[tool.some-tool]
local = false
debug = false
[profile.dev.tool.some-tool]
merge-strategy = "merge"
debug = true
Would be translated to:
[tool.some-tool]
merge-strategy = "merge"
local = false
debug = true
Note, that before introduction of merge-strategy
propery, this would translate to:
[tool.some-tool]
debug = true
You can read more on tool metadata in our docs.
Cairo Version
This version of Scarb comes with Cairo v2.7.0-rc.0
.
What's Changed
- Store file path and file id in token stream metadata by @maciektr in #1192
- Refactor: move cairo-lang-macro types to submodule by @maciektr in #1194
- Register macro expansion capabilities by @maciektr in #1195
- Allow defining multiple macros per package by @maciektr in #1200
- Update Cairo by @maciektr in #1210
- Allow testing without gas calculation by @maciektr in #1211
- Upgrade Vitepress to 1.0.1 by @mkaput in #1223
- Rust update - fix build and clippy erorrs by @maciektr in #1213
- Fix nightlies pipeline after rust package id spec update by @maciektr in #1222
- Downstream cairo-test option to print used resources for tests (cairo… by @maciektr in #1221
- Rename aux data collection to post processing by @maciektr in #1214
- Rewrite cairo-lang-macro docs by @maciektr in #1215
- Fix linkme call for multiple callback definitions by @maciektr in #1216
- Fix: expand with actual expansion name instead of package name by @maciektr in #1217
- Add test case with multiple macros by @maciektr in #1218
- Handle multiple aux data returns from code expansion by @maciektr in #1219
- Add tests for macro name validations by @maciektr in #1220
- Bump deno_task_shell from 0.14.4 to 0.15.0 by @dependabot in #1227
- Consider a case when the test fn return types are actually an empty vec by @Arcticae in #1224
- Bump katex from 0.16.9 to 0.16.10 in /website by @dependabot in #1228
- Fix cairo-lang-macro doctest by @maciektr in #1225
- Update deps by @maciektr in #1229
- Enforce
fuzzer_runs
>= 1 insnforge-test-collector
by @Draggu in #1231 - Bump actions/configure-pages from 4 to 5 by @dependabot in #1237
- Bump the non-critical group with 5 updates by @dependabot in #1238
- Update deno_task_shell by @maciektr in #1240
- Support for rust-like features by @fmkra in #1236
- Bump vite from 5.2.3 to 5.2.8 in /website by @dependabot in #1242
- Fix asserts with time units by @maciektr in #1243
- Add option to generate statements <> functions mapping in compilation by @piotmag769 in #1233
- Implement inline macros expansion by @maciektr in #1235
- Bump h2 from 0.3.24 to 0.3.26 by @dependabot in #1246
- Resolve full path markers by @maciektr in #1244
- Bump the non-critical group with 2 updates by @dependabot in #1250
- Read ui verbosity from env var by @maciektr in #1245
- Prepare scarb-ui release
0.1.4
by @maciektr in #1251 - Prepare scarb-metadata release
1.12.0
by @maciektr in #1252 - Run doc tests in CI by @maciektr in #1253
- Add statements mappings to snforge test artifacts by @piotmag769 in #1241
- Fix log verbosity calculation by @maciektr in #1255
- Update Cairo revision by @maciektr in https://github.com/software-mansion/scarb/...
v2.6.5
Welcome to the release notes for Scarb v2.6.5
!
This quick release is primarily a Cairo upgrade.
Cairo Version
This version of Scarb comes with Cairo v2.6.4
.
What's Changed
- Store file path and file id in token stream metadata by @maciektr in #1192
- Refactor: move cairo-lang-macro types to submodule by @maciektr in #1194
- Rust update - fix build and clippy erorrs by @maciektr in #1213
- Fix nightlies pipeline after rust package id spec update by @maciektr in #1222
- Consider a case when the test fn return types are actually an empty vec by @Arcticae in #1224
- Enforce fuzzer_runs >= 1 in snforge-test-collector by @Draggu in #1231
- Fix ci after rust update by @maciektr in #1291
Full Changelog: v2.6.4...v2.6.5
v2.6.4
Welcome to the release notes for Scarb v2.6.4
!
This release introduces preliminary work on procedural macros and a new configuration flag.
An option to disable gas calculation
This release introduces a new flag in the Cairo compiler configuration, called enable-gas
.
If set to false
, Scarb will not add any instructions related to gas usage calculation during the project compilation. By default, this flag is set to true
. This flag cannot be disabled while compiling the starknet-contract
target.
[cairo]
enable-gas = false
Cairo Version
This version of Scarb comes with Cairo v2.6.3
.
What's Changed
- Remove macro_commons by @maciektr in #1185
- Update telegram invite by @maciektr in #1189
- Update CODEOWNERS by @maciektr in #1191
- Move Scarb StableHash to separate crate by @maciektr in #1187
- Store AuxData as Vec instead of serde/string by @maciektr in #1188
- Update
redb
to2.0.0-beta0
by @mkaput in #1199 - Bump gix from 0.58.0 to 0.61.0 by @dependabot in #1198
- Update deps by @maciektr in #1202
- Implement aux_data callback by @maciektr in #1186
- fix: derive Clone and Debug for CompilationUnit enum by @glihm in #1203
- Fix gas validations for disabled gas casm compilation by @maciektr in #1204
New Contributors
Full Changelog: v2.6.3...v2.6.4
v2.6.3
Welcome to the release notes for Scarb v2.6.3
!
This quick release is primarily a Cairo upgrade.
Cairo Version
This version of Scarb comes with Cairo v2.6.3
.
What's Changed
- Bump the non-critical group with 3 updates by @dependabot in #1180
- Add note about binaries list. by @maciektr in #1181
- Update cairo by @maciektr in #1182
- Implement procedural macro diagnostics by @maciektr in #1159
- Add remove/replace proc macro e2e tests by @maciektr in #1161
- Add collect aux data mechanism by @maciektr in #1165
Full Changelog: v2.6.2...v2.6.3
v2.6.2
Welcome to the release notes for Scarb v2.6.2!
Fix compilation of tests with contracts in dependencies
Since Scarb does not compile tests defined in the dependencies of a tested package, all items with the #[cfg(test)]
attribute are removed from all components in the compilation unit apart from the main component (i.e., the package that is tested).
This behavior implies that there cannot be any expectation in the Cairo test runner, that items defined under the #[cfg(test)]
in dependencies are available to be imported during testing. Unfortunately, the implementation of test runner in recent releases of Scarb in some cases has erroneously expected one of the variables in the contract definition to be available under those circumstances. This meant that for some projects, the test runner failed to execute the test.
This quick release introduces a fix.
Cairo Version
This version of Scarb comes with Cairo v2.6.2
.
What's Changed
Full Changelog: v2.6.1...v2.6.2
v2.6.1
Warning
This version includes an regression, that may cause cairo-test
to fail to start in some projects. Please use thev2.6.2
version instead.
Welcome to the release notes for Scarb v2.6.1!
This quick release is primarily a Cairo upgrade.
Cairo Version
This version of Scarb comes with Cairo v2.6.1
.
What's Changed
- Bump mio from 0.8.10 to 0.8.11 by @dependabot in #1173
- Check enable-gas flag in the db by @maciektr in #1172
- Fix cairo-test for corelib by @maciektr in #1158
- Adjust diagnostics reporter closure argument by @szymmis in #1175
- Fix deps features by @maciektr in #1176
Full Changelog: v2.6.0...v2.6.1
v2.6.0
Welcome to the release notes for Scarb v2.6.0!
This quick release is primarily a Cairo upgrade.
Cairo Version
This version of Scarb comes with Cairo v2.6.0
.
What's Changed
- Rename macro interface crates to cairo-lang namespace by @maciektr in #1145
- Add
scarb cairo-run
tests by @tomek0123456789 in #1113 - Rename cairo-lang-macro-interface to cairo-lang-macro by @maciektr in #1149
- Add
ProcMacroHost
definition by @maciektr in #1060 - Bump semver from 1.0.21 to 1.0.22 by @dependabot in #1154
- Bump the non-critical group with 7 updates by @dependabot in #1153
- Implement procedural macro host
generate_code
for attribute macro by @maciektr in #1091 - Update Cairo by @maciektr in #1160
- Implement loading shared libraries for proc macro plugins by @maciektr in #1093
- Procedural macro compilation by @maciektr in #1110
- Add test case for procedural macro compilation by @maciektr in #1100
- Implement check command for cairo plugins by @maciektr in #1148
- Run cargo fetch on workspace resolve by @maciektr in #1150
- Use json output format in cargo if set in scarb_ui by @maciektr in #1151
- Bump the non-critical group with 4 updates by @dependabot in #1163
- Procedural macros design document by @maciektr in #1109
- Change compilation unit to enum by @maciektr in #1155
- Add aux_data to proc macro result by @maciektr in #1143
- Split cairo-lang-macro crate into two (api <> abi) by @maciektr in #1157
- Bump the non-critical group with 5 updates by @dependabot in #1168
- Update CODEOWNERS by @maciektr in #1170
- Update scarb new/init hello world Cairo code by @maciektr in #1169
- Prepare release
2.6.0
by @maciektr in #1171
Full Changelog: v2.5.4...v2.6.0
v2.6.0-rc.1
Warning
This version is not yet supported on Starknet! If you want to develop contracts deployable to current Starknet, please stick with Scarb v2.5.4
.
Welcome to the release notes for Scarb v2.6.0-rc.1!
This quick release is primarily a Cairo upgrade.
Cairo Version
This version of Scarb comes with Cairo v2.6.0-rc.1
.
What's Changed
- Fix
edition
for main crates in test compilation in test collector by @piotmag769 in #1135 - Bump the non-critical group with 5 updates by @dependabot in #1141
- Exclude cairo-felt from dependabot patterns by @maciektr in #1142
- Create procedural macro interface library by @maciektr in #1139
- Update cairo by @maciektr in #1144
- [
snforge-test-collector
] AddTestDetails
toTestCaseRaw
by @drknzz in #1121
New Contributors
Full Changelog: v2.6.0-rc.0...v2.6.0-rc.1
v2.5.4
Welcome to the release notes for Scarb v2.5.4!
This quick release is primarily a Cairo upgrade.
Cairo Version
This version of Scarb comes with Cairo v2.5.4
.
What's Changed
- Bump the non-critical group with 7 updates by @dependabot in #1114
- Update cairo by @maciektr in #1115
- Allow compilation of packages with
no-core
flag enabled. by @maciektr in #1112 - Add builtin prop on cairo plugin target definition by @maciektr in #1059
- Fix experimental_features deserialization backward compatibility by @maciektr in #1118
- Check backward compatibility of metadata command deserialization by @maciektr in #1119
- Prepare scarb-metadata release
1.11.1
by @maciektr in #1120 - Do not compile tests from dependencies in
scarb test
by @szymmis in #1084 - Set crate-level cfg_set in snforge-test-collector by @maciektr in #1125
- Fix
edition
for main crates in test compilation in test collector by @piotmag769 in #1135 - Bump the non-critical group with 5 updates by @dependabot in #1141
- Exclude cairo-felt from dependabot patterns by @maciektr in #1142
- Create procedural macro interface library by @maciektr in #1139
- Update cairo by @maciektr in #1144
- [
snforge-test-collector
] AddTestDetails
toTestCaseRaw
by @drknzz in #1121
New Contributors
Full Changelog: v2.5.3...v2.5.4