Skip to content

Releases: software-mansion/scarb

v2.8.2

09 Sep 12:12
Compare
Choose a tag to compare

Cairo release notes ➡️

Welcome to the release notes for Scarb v2.8.2!
This release includes several bug fixes and new developments.

  • Scarb publish support - Scarb now supports publishing packages to the registry! To upload a package to the official scarbs.xyz registry, you can now simply do scarb publish. The authentication token for the registry interactions can be obtained through the registry and provided by environmental variable. Please see the "Publishing" page in our documentation for more information.
  • Hidden line support in doc snippets - documentation generated with scarb doc now supports hidding code lines in Cairo code snippets. The highlight.js highlighter modified for use with scarb doc generated docs supports highligthing snippets with hidden lines.
  • Unnecessary registry downloads fix - Due to a bug in registry client implementation, some packages would end up being unnecessarly downloaded multiple times. Since this release, this should not happen no more.

Cairo Version

This version of Scarb comes with Cairo v2.8.2.

What's Changed

Full Changelog: v2.8.1...v2.8.2

v2.8.1

30 Aug 10:21
Compare
Choose a tag to compare

Cairo release notes ➡️

Welcome to the release notes for Scarb v2.8.1!
This is a quick fix release which does not include any new features - only bug fixes.

  • The assert_macros package version change - the assert_macros package that contains macros like assert_eq! is now versioned with the same version as Cairo compiler used by Scarb.

Cairo Version

This version of Scarb comes with Cairo v2.8.0.

What's Changed

Full Changelog: v2.8.0...v2.8.1

v2.8.0

28 Aug 09:18
09590f5
Compare
Choose a tag to compare

Cairo release notes ➡️

Welcome to the release notes for Scarb v2.8.0!
This release includes several bug fixes and new developments.

  • Scarb features support in scarb-doc - you can now control conditional compilation while generating docs!
  • Document only public items - the documentation is now only generated for public items by scarb-doc (unless used with --document-private-items flag).
  • Cairo coverage support - Scarb now includes an unstable-add-statements-code-locations-debug-info Cairo config key that enables generating mappings used by cairo-coverage.
  • Dev dependencies propagation fix - due to an error in Scarb dependency resolver, in some cases dev-deps from other workspace members would end up being used during compilation.
  • Diagnostics fix - in some cases, diagnostics from package dependencies could be missing, resulting in a panic during package build.
  • The assert_macros package version change - the assert_macros package that contains macros like assert_eq! is now versioned with the same version as Scarb. (fixed in 2.8.1)

Cairo Version

This version of Scarb comes with Cairo v2.8.0.

What's Changed

New Contributors

Full Changelog: v2.7.1...v2.8.0

v2.7.1

14 Aug 09:00
e288874
Compare
Choose a tag to compare

Cairo release notes ➡️

Welcome to the release notes for Scarb v2.7.1!

This release is primarily a Cairo update.

It also introduces an mdBook compatible Cairo code highlighter, that can be useful for docs generated with scarb-doc.

Cairo Version

This version of Scarb comes with Cairo v2.7.1.

What's Changed

New Contributors

Full Changelog: v2.7.0...v2.7.1

v2.7.0

01 Aug 14:08
e9a2b87
Compare
Choose a tag to compare

Cairo release notes ➡️

Welcome to the release notes for Scarb v2.7.0!

This release comes with several new developments.

Procedural macros

Since this release, we now officially support code generation! You can write your own macros in Rust, that modify the Cairo code of your project during compilation.

Learn more by reading our docs.

Generating documentation with scarb-doc

With this release, it is now possible to automatically generate documentation for your project by running scarb doc command. This documentation will include all doc comments you add to your code with /// prefix. The collected documentation is output to the target/doc/<package-name> directory, in either custom JSON, or mdBook compatible markdown format.

Learn more by reading our docs.

Cairo Version

This version of Scarb comes with Cairo v2.7.0.

What's Changed

New Contributors

Full Changelog: v2.7.0-rc.4...v2.7.0

v2.7.0-rc.4

19 Jul 20:11
88bf935
Compare
Choose a tag to compare
v2.7.0-rc.4 Pre-release
Pre-release

Cairo release notes ➡️

Welcome to the release notes for Scarb v2.7.0-rc.4!

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 quick release changes the default registry url used by Scarb.

Cairo Version

This version of Scarb comes with Cairo v2.7.0-rc.3.

What's Changed

New Contributors

Full Changelog: v2.7.0-rc.3...v2.7.0-rc.4

v2.7.0-rc.3

17 Jul 08:30
be95601
Compare
Choose a tag to compare
v2.7.0-rc.3 Pre-release
Pre-release

Cairo release notes ➡️

Welcome to the release notes for Scarb v2.7.0-rc.3!

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 quick release is primarily a Cairo upgrade.

Cairo Version

This version of Scarb comes with Cairo v2.7.0-rc.3.

What's Changed

Full Changelog: v2.7.0-rc.2...v2.7.0-rc.3

v2.7.0-rc.2

12 Jul 16:10
55754b5
Compare
Choose a tag to compare
v2.7.0-rc.2 Pre-release
Pre-release

Cairo release notes ➡️

Welcome to the release notes for Scarb v2.7.0-rc.2!

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 quick release is primarily a Cairo upgrade.

Cairo Version

This version of Scarb comes with Cairo v2.7.0-rc.2.

What's Changed

New Contributors

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

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