Skip to content

Releases: software-mansion/scarb

v2.7.0-rc.1

08 Jul 20:59
bd0f131
Compare
Choose a tag to compare
v2.7.0-rc.1 Pre-release
Pre-release

Cairo release notes ➡️

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 packages src/ directory), or integration tests (defined in tests/ directory). This can be done with help of new cairo-test cli argument --test-kind which accepts either unit, integration or all (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 either default or avoid. With the later, only functions with inline(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

Full Changelog: v2.7.0-rc.0...v2.7.0-rc.1

v2.7.0-rc.0

26 Jun 14:59
00ef88e
Compare
Choose a tag to compare
v2.7.0-rc.0 Pre-release
Pre-release

Cairo release notes ➡️

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 in cairo-test.
  • Additional resource usage info while testing - You can now use new flag --print-resource-usage when testing package with cairo-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 (from tests directory) in cairo-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

Read more

v2.6.5

11 Jun 16:36
d49f543
Compare
Choose a tag to compare

Cairo release notes ➡️

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

19 Mar 22:32
c4c7c0b
Compare
Choose a tag to compare

Cairo release notes ➡️

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

New Contributors

Full Changelog: v2.6.3...v2.6.4

v2.6.3

13 Mar 10:43
e6f921d
Compare
Choose a tag to compare

Cairo release notes ➡️

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

Full Changelog: v2.6.2...v2.6.3

v2.6.2

08 Mar 22:19
dfbe885
Compare
Choose a tag to compare

Cairo release notes ➡️

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

07 Mar 08:07
8f50bee
Compare
Choose a tag to compare

Cairo release notes ➡️

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

Full Changelog: v2.6.0...v2.6.1

v2.6.0

05 Mar 09:44
850b938
Compare
Choose a tag to compare

Cairo release notes ➡️

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

Full Changelog: v2.5.4...v2.6.0

v2.6.0-rc.1

14 Feb 18:13
f9e2853
Compare
Choose a tag to compare
v2.6.0-rc.1 Pre-release
Pre-release

Cairo release notes ➡️

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

New Contributors

Full Changelog: v2.6.0-rc.0...v2.6.0-rc.1

v2.5.4

14 Feb 18:09
28dee92
Compare
Choose a tag to compare

Cairo release notes ➡️

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

New Contributors

Full Changelog: v2.5.3...v2.5.4