Skip to content

Releases: software-mansion/scarb

v2.12.0-rc.1

11 Jul 09:50
dd49208
Compare
Choose a tag to compare
v2.12.0-rc.1 Pre-release
Pre-release

Cairo release notes ➡️

Welcome to the release notes for Scarb v2.12.0-rc.1!
This release finally brings full pre-release of the new procedural macros API.

  • Scarb toml dependency specification - will now reject unknown fields during parsing. If the field is not in the spec, an error will be returned. See specifying dependencies for valid configuration options.
  • Registry yanking - A bug that caused yanked package versions to be used regardless of the yank has been fixed.
  • Shell completions installation - If you install Scarb via starkup or the installation script, it will automatically install Scarb shell completions on your system.

Scarb doc groups

When writing docs for your package, you can now instruct Scarb doc to group some doc items in a separate, collapsible section. This can be done with help of #[doc(group: "group name")] attribute. This can be helpful to make the docs easier to navigate for the user, if your documentation contains a lot of items of the same kind that cannot be moved to separate modules.

New procedural macros API release candidate

The new API has been promoted to release candidate!
This means, you can try it out by using Scarb 2.12.0-rc.1 (or newer) and cairo-lang-macro 0.2.0-rc.1.
Note that the older macro API is still supported by Scarb.
The new macro API brings some quality of life improvements (like the quote! macro) and support for propper diagnostics locations in the macro-generated code.

Cairo Version

This version of Scarb comes with Cairo v2.12.0-rc.1.

What's Changed

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

v2.12.0-rc.0

09 Jun 08:46
a7969cd
Compare
Choose a tag to compare
v2.12.0-rc.0 Pre-release
Pre-release

Cairo release notes ➡️

Welcome to the release notes for Scarb v2.12.0-rc.0!

This release is all about polish, and productivity. We’ve introduced several improvements across doc generation, linting, packaging, other tooling and Scarb itself. This release also includes a preview of the new procedural macro API.

  • 🧱️ New scarb tree command – Quickly visualize your package's dependency tree from the CLI.
  • 📚 Improved navigation in generated documentation – Scarb doc will now generated documentation with navigation based on modules tree, interactive links in paths and signatures and a shiny new module landing pages.
  • 📘 Builtin mdBook support – Scarb doc can now build your docs with mdbook for you, providing full support for Cairo syntax highlighting out of the box. You can try it out by running scarb doc --build.
  • 🧩 CLI completions – Scarb can now generate completions script, you can use with the shell of your choice. Navigating Scarb CLI has never been easier!
  • 📦 Resolver improvements – The depedency resolver now supports dependency patches, specyfing features for dependencies and automatic upgrade of locked versions on conflicts.
  • 📦 Packaging improvements – Scarb will now include information about dev-dependencies and features, when packaging for registry publish.
  • Scarb lint improvements - Lint can now be used with --features CLI arguments, will respect the allow-warnings set in manifest and can specify files / directories to modify by path.
  • Procedural macro related changes - Usage of procedural macros and/or prebuilt procedural macros can now be disabled through CLI flags / enviromental variables. The macro::full_path_marker attribute has been renamed to proc_macro::full_path_marker.
  • New procedural macro API - You can check out preview version of the new procedural macro API.

📦 scarb tree Command

You can now inspect your dependencies through the all-new scarb tree command! This view is perfect for understanding the depth and structure of your project’s dependency tree.

📚 Enhanced Documentation Experience

Documentation in Scarb just got a major facelift! This release introduces:

  • A new landing page as the entry point to your project's docs.
  • Navigation based on module tree structure.
  • Links directly in function signatures to associated documentation items.

Taken together, these features improve discoverability and make your documentation way more readable for your users.

Dependency features

Features of dependencies can now be enabled within the dependency declaration.

[dependencies]
example = { version = "*", features = ["poseidon"] }

The default features can be disabled using default-features = false:

[dependencies]
example = { version = "*", default-features = false, features = ["poseidon"] }

See more on features page of our docs.

Dependency patches

The new [patch] section of Scarb.toml manifest can be used to override dependencies with other versions. The syntax is similar to the [dependencies] section:

[patch.scarbs-xyz]
foo = { git = 'https://github.com/example/foo.git' }
bar = { path = 'my/local/bar' }

[patch.'https://github.com/example/baz']
baz = { git = 'https://github.com/example/patched-baz.git', branch = 'my-branch' }

The [patch] table is made of dependency-like sub-tables. Each key after [patch] is a URL of the source that is being patched, or the name of a registry. The name scarbs-xyz may be used to override the default registry scarbs.xyz. The first [patch] in the example above demonstrates overriding scarbs.xyz, and the second [patch] demonstrates overriding a git source.

Cairo Version

This version of Scarb comes with Cairo v2.12.0-rc.0.

What's Changed

Read more

v2.11.4

09 Apr 14:05
c0ef5ec
Compare
Choose a tag to compare

Cairo release notes ➡️

Welcome to the release notes for Scarb v2.11.4!

This release is primarily a Cairo update.

Bug fixes included:

  • Procedural macros not used by any Cairo compilation unit will not be compiled preemptively.
  • Procedural macro packages will be packaged with Cargo.lock when packaged with Cargo 1.84 or newer.
  • Dev dependencies propagation in workspaces has been fixed for edge cases.

Cairo Version

This version of Scarb comes with Cairo v2.11.4.

What's Changed

  • ref: scarb doc formatting signature by @FroyaTheHen in #2065
  • Update docs to suggest using registry dependencies instead of Git ones by @DelevoXDG in #2076
  • Add docs for prebuilt plugins and inlining strategy by weight by @maciektr in #2097
  • Do not compile unused proc macros when called with packages filter by @maciektr in #2007
  • Include Cargo.lock when packaging proc macros by @DelevoXDG in #2092
  • Check Cargo.lock exists before packaging it by @DelevoXDG in #2116
  • Fix dev-deps propagation of compiler plugins for ws members by @maciektr in #2099
  • Warn about missing Cargo.lock in package by @maciektr in #2157
  • Fix formatting after rust update by @maciektr in #2153

Full Changelog: v2.11.3...v2.11.4

v2.11.3

13 Mar 13:45
1576415
Compare
Choose a tag to compare

Cairo release notes ➡️

Welcome to the release notes for Scarb v2.11.3!

This release:

  • Updates Cairo Lint to v2.11.3.
  • Includes a Cairo language server fix.

Cairo Version

This version of Scarb comes with Cairo v2.11.2.

What's Changed

Full Changelog: v2.11.2...v2.11.3

v2.11.2

11 Mar 22:42
9c1873c
Compare
Choose a tag to compare

Cairo release notes ➡️

Welcome to the release notes for Scarb v2.11.2!

This release is primarily a Cairo update.

Cairo Version

This version of Scarb comes with Cairo v2.11.2.

What's Changed

Full Changelog: v2.11.1...v2.11.2

v2.11.1

06 Mar 15:40
6619e74
Compare
Choose a tag to compare

Cairo release notes ➡️

Welcome to the release notes for Scarb v2.11.1!

This release is primarily a Cairo update.

Cairo Version

This version of Scarb comes with Cairo v2.11.1.

What's Changed

Full Changelog: v2.11.0...v2.11.1

v2.11.0

06 Mar 09:20
b245d76
Compare
Choose a tag to compare

Cairo release notes ➡️

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

Bug fixes included in this release:

  • The debug_info field is omitted during size calculation for contract size warnings.
  • Warnings are no longer duplicated when compiling contracts for tests.
  • Compiler config collection is fixed with regard to [profile.name.cairo] and [cairo] precedence. See [cairo] section docs for more information.
  • Contract compilation no longer reports contract names duplicates erroneously, when compiling a package with contract re-exports.
  • And more!

Per-crate compiler plugins

Since this release, Cairo compiler plugins apply changes only to packages in a compilation unit that depend on them directly. In contrast to previous releases, plugins are no longer applied to all packages in the compilation unit. This change applies to both built-in compiler plugins and procedural macro packages.

Scarb metadata exposes information about dependency on compiler plugins in dependencies field of CompilationUnitComponentMetadata. The plugins are still listed in cairo_plugins field of CompilationUnitMetadata.

A Cairo package can re-export a procedural macro from it's dependencies by adding re-export-cairo-plugins = ["dependency_name"] key to it's [package] section of the toml manifest.

Cairo Version

This version of Scarb comes with Cairo v2.11.0.

What's Changed

Full Changelog: v2.10.1...v2.11.0

v2.10.1

20 Feb 10:06
Compare
Choose a tag to compare

Cairo release notes ➡️

Welcome to the release notes for Scarb v2.10.1!

This release is primarily a Cairo update.

Cairo Version

This version of Scarb comes with Cairo v2.10.1.

What's Changed

Full Changelog: v2.10.0...v2.10.1

v2.9.4

19 Feb 23:19
d3be9eb
Compare
Choose a tag to compare

Cairo release notes ➡️

This release is only a Cairo update.

Cairo Version

This version of Scarb comes with Cairo v2.9.4.

Full Changelog: v2.9.3...v2.9.4

v2.10.0

18 Feb 08:55
Compare
Choose a tag to compare

Cairo release notes ➡️

Welcome to the release notes for Scarb v2.10.0!

Cairo Lint

Cairo-lint is a static code analysis tool for the Cairo language, which is now integrated into Scarb!

It can help you improve your code quality and consistency by checking the codebase against a set of predefined rules, called lints.
It can also automatically fix some of the issues found.

To run lint in the current project, just type:

scarb lint

Take a look at Scarb lint documentation for more information.

Scarb Execute / Prove / Verify

It's now possible to use stwo-cairo prover and verifier to prove Cairo programs through Scarb.

To make your program provable, create an executable package

[package]
name = "test_execute"
version = "0.1.0"
edition = "2024_07"

[[target.executable]]

[cairo]
enable-gas = false

[dependencies]
cairo_execute = "2.10.0"
#[executable]
fn main(num: u8) -> u8 {
    num
}

You can then prove it with following commands:

scarb execute
scarb prove --execution_id=1
scarb verify <path_to_proof_json>

You can also check out this guide on Proving Fibonacci with Stwo.

Note: This functionality is still work in progress and it's output not be trusted in real world applications yet.

Pubgrub dependency resolver

Since this release, Scarb will use a more sophisticated dependency version resolver based on the PubGrub algorithm. Version resolution is the process of choosing concrete dependency package versions (e.g. v2.10.0) with respect to dependency version specifications defined by the user (e.g ~2.9.0 & =2.10.0) from all available package versions. This change will make the resolution possible for more complex dependency trees and if it is not possible, it should produce easier to understand errors.

Small improvements

  • You can now use --no-warnings flag to hide Scarb / compiler warnings when working with Scarb.
  • When building docs with scarb doc, pub(crate) items are now treated like private items, thus they are not included in the generated docs. This is motivated by the fact, that those items are not part of the public package API. To include private items in generated docs, please use --document-private-items.

Cairo Version

This version of Scarb comes with Cairo v2.10.0.

What's Changed

New Contributors

Full Changelog: v2.10.0-rc.1...v2.10.0