Releases: software-mansion/scarb
v2.12.0-rc.1
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
- feat: aggregate_groups - doc by @FroyaTheHen in #2274
- Prepare
scarb-metadata
release1.15.0
by @maciektr in #2305 - Bump the non-critical group with 7 updates by @dependabot[bot] in #2306
- feat: generate md table summary for doc groups by @FroyaTheHen in #2275
- add diagnostic warnings for doc groups by @FroyaTheHen in #2288
- doc groups for module reeksports by @FroyaTheHen in #2291
- Disallow creating
cairo_lang_macro::Diagnostic
without constructor by @maciektr in #2310 - Add a test case for per-crate plugins by @maciektr in #2293
- Use new macro API in proc macro publish tests by @maciektr in #2308
- fix: foregin crates reeksports by @FroyaTheHen in #2307
- change group attr from ShortString to String by @FroyaTheHen in #2312
- Fix code mappings calculation for attribute expansion by @maciektr in #2270
- Bump the non-critical group with 4 updates by @dependabot[bot] in #2318
- Custom span location diagnostic on node with trivia by @maciektr in #2313
- refactor: MarkdownContent to store hash map of files, fix: unify nesting level by @FroyaTheHen in #2322
- Pin nextest version in CI by @DelevoXDG in #2333
- Add docs for Scarb shell completions by @DelevoXDG in #2327
- refactor: separate modules by @FroyaTheHen in #2323
- fix: improve style in docs_generation by @FroyaTheHen in #2324
- improve generated docs style by @FroyaTheHen in #2331
- Add completions setup to the install script by @DelevoXDG in #2328
- Bump the non-critical group with 2 updates by @dependabot[bot] in #2334
- Replace soon-to-be deprecated windows-2019 with latest in release build workflow by @maciektr in #2338
- Pass adapted call site to generate code mappings fn by @maciektr in #2337
- Bump Cairo by @maciektr in #2336
- Basic tests for linter supporting attribute proc macros by @wawel37 in #2325
- Refactor: add types for component targets group by @maciektr in #2320
- Fix no-warnings flag for warnings with error code by @maciektr in #2341
- Add flags to control whether incremental compilation is allowed by @maciektr in #2326
- Define fingerprint structure by @maciektr in #2321
- Fix lints after rust upgrade by @maciektr in #2344
adapted_call_site
in proc macro server by @Arcticae in #2311- Exit early for ast items not using any proc macros in generate code by @maciektr in #2345
- Profiling config by @maciektr in #2342
- Add unsafe-panic to compiler config by @maciektr in #2343
- Bump the non-critical group with 7 updates by @dependabot[bot] in #2352
- [Linter] Fail on --deny-warnings after all packages were linted by @wawel37 in #2356
- Emit and use incremental cache for corelib crate by @maciektr in #2335
- reimplement
exec_replace
by @mkaput in #2351 - Make scarb-test-utils dependency on scarb optional by @maciektr in #2358
- Create two types of fingerprint hashes - one for directory structure, one for freshness check by @maciektr in #2339
- Skip packages instead of throwing error when package has no CUs by @wawel37 in #2365
- Make scarb-extensions-cli for execute independent from Cairo by @maciektr in #2359
- Stop scarb-prove from depending on scarb-execute by @maciektr in #2360
- Reject dependency toml with invalid keywords by @maciektr in #2355
- Bump Cairo by @maciektr in #2361
- Bump the non-critical group with 2 updates by @dependabot[bot] in #2370
- Remove dbg! from scarb-execute, add linter config to extensions by @maciektr in #2368
- scaffold oracle hint processor by @mkaput in #2348
- scaffold oracle connection management by @mkaput in #2353
- introduce logging with
tracing
andtracing-subscriber
in scarb-execute by @mkaput in #2379 - implement feature use yanked packages only if cached by @FroyaTheHen in #2366
- update scarb doc documentation example: mark all items pub by @FroyaTheHen in #2378
- Prepare
cairo-lang-macro
,cairo-lang-macro-attributes
andscarb-proc-macro-server-types
release by @maciektr in #2388 - Update Cairo by @maciektr in #2385
Full Changelog: v2.12.0-rc.0...v2.12.0-rc.1
v2.12.0-rc.0
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
andfeatures
, when packaging for registry publish. - Scarb lint improvements - Lint can now be used with
--features
CLI arguments, will respect theallow-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 toproc_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
- Stop upgrading stwo in nightly by @maciektr in #2067
- Update cairo by @maciektr in #2057
- Fix slack actions webhooks format by @maciektr in #2071
- Move ignore lints based on metadata to linter / add primitive tests by @wawel37 in #2088
- Create empty build-dev job by @maciektr in #2090
- Bump the non-critical group with 9 updates by @dependabot in #2091
- Dev builds by @maciektr in #2089
- Use compilers renderer for cairo lint by @wawel37 in #2098
- Change cairo lint package name by @wawel37 in #2100
- feat: doc links in signature by @FroyaTheHen in #2069
- Update cairo-toolchain-xtasks by @maciektr in #2108
- Bump deno_task_shell from 0.20.3 to 0.21.0 by @dependabot in #2115
- Update deps by @maciektr in #2117
- New procedural macro API by @maciektr in #1750
- Update release check workflow for v2 macros by @maciektr in #2119
- Add --features to lint cli by @wawel37 in #2123
- Add
panic-backtrace
flag by @ksew1 in #2110 - Proc macro server - v1 + v2 api support by @Arcticae in #2120
- feat: doc sematically sorted modules, interactive path by @FroyaTheHen in #2125
- Restore default mapping for v1 derives on expansion by @Arcticae in #2128
- Cairo update by @maciektr in #2127
- Disable trace padding in proof mode by @DelevoXDG in #2126
- feat: doc landing page by @FroyaTheHen in #2121
- Allow warnings for lint cli / respect allow-warnings from manifest by @wawel37 in #2148
- Inform about the source packages for proc macros in PMS by @integraledelebesgue in #2147
- Update deps by @maciektr in #2136
- Bump vite from 5.4.14 to 5.4.16 in /website by @dependabot in #2152
- Fix casing in derive macro lookup by @maciektr in #2151
- Bump openssl from 0.10.71 to 0.10.72 by @dependabot in #2155
- Bump vite from 5.4.16 to 5.4.17 in /website by @dependabot in #2156
- Upgrade Cairo, LS and Lint by @integraledelebesgue in #2159
- Dependency patches by @maciektr in #2154
- Bump crossbeam-channel from 0.5.14 to 0.5.15 by @dependabot in #2163
- Add span to plugin diagnostics by @DelevoXDG in #2145
- Bump Cairo by @integraledelebesgue in #2164
- Fix secrets handling in build-dev.yml and nightly.yml workflows by @mkaput in #2165
- Fix custom highlighting when deploying corelib docs by @maciektr in #2138
- Bump vite from 5.4.17 to 5.4.18 in /website by @dependabot in #2168
- Move MarkdownTargetChecker to scarb test support as ExpectDir by @maciektr in #2171
- Do not mark nightly as latest when building a dev release by @maciektr in #2167
- Add lenient mode to ExpectDir by @maciektr in #2172
- Bump the non-critical group with 4 updates by @dependabot in #2174
- Bump deno_task_shell from 0.22.0 to 0.23.0 by @dependabot in #2175
- Add mdbook builder as extension by @maciektr in #2173
- Patch highlighter for Cairo when building with scarb-mdbook by @maciektr in #2141
- Mark code blocks as Cairo not Rust by @maciektr in #2142
- fix: escape html by @FroyaTheHen in #2180
- Deduplicate proc macro component collection by @maciektr in #2181
- Cairo update by @maciektr in #2185
- Add env bindings to args parser by @maciektr in #2189
- Fix nightly/dev upload setting latest flag by @maciektr in #2190
- feat: improved doc nav by @FroyaTheHen in #2150
- Pass features args to execute by @maciektr in #2184
- Redirect corelib docs to cairo-lang by @maciektr in https://githu...
v2.11.4
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 Cargo1.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
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
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
- Bump ring from 0.17.11 to 0.17.13 by @dependabot in #2051
- Update rust edition to 2024 by @maciektr in #2006
- Bump the non-critical group with 7 updates by @dependabot in #2055
- Add (ignored) test case for lock matching some dep requirements only by @maciektr in #2032
- Split nightly crates tests job to build and run steps by @maciektr in #1984
- Represent a package in Proc Macro Server more reliably by @integraledelebesgue in #2042
- Propagate ui verbosity when using scarbcommand in extensions by @maciektr in #1994
- Fix errors on allow with scarb build by @piotmag769 in #2058
- Prepare release
2.11.2
by @maciektr in #2064 - Pin ring to v0.17.11 by @maciektr in #2066
Full Changelog: v2.11.1...v2.11.2
v2.11.1
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
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
- Implement per-crate plugin collection by @integraledelebesgue in #1920
- Add helpers to obtain
CrateId
of theCompilationUnit
by @integraledelebesgue in #1970 - Update cairo after 2.10.0 merge by @maciektr in #1995
- Update README roadmap by @maciektr in #2005
- Fix clippy lints after rust update by @maciektr in #2002
- Introduce per-crate plugins to the compilation model by @integraledelebesgue in #1913
- Respect per-crate plugins in Proc Macro Server by @integraledelebesgue in #1921
- Bump the non-critical group with 3 updates by @dependabot in #2010
- fix nightly by @maciektr in #2012
- Deduplicate external contracts by full path by @maciektr in #2001
- Fix npm build by @maciektr in #1991
- Prepare
scarb-proc-macro-server-types
release0.2.0
by @maciektr in #2015 - Update cairo-toolchain-xtasks by @maciektr in #2020
- Prepare
scarb-metadata
release1.14.0
by @maciektr in #2014 - Cairo plugin reexports by @maciektr in #2000
- Fix cairo-test dep missing warning by @maciektr in #1993
- Skip plugin dependencies in
scarb-doc
by @integraledelebesgue in #2033 - add starkup installation method by @DelevoXDG in #2030
- Update test ProjectBuilder default Cairo edition to 2024_07 by @maciektr in #2025
- Ignore
debug_info
when emitting file size warnings for contracts compilation by @DelevoXDG in #2029 - Add test for test target contract compilation with error / warnings by @maciektr in #2027
- Do not report warnings second time, when compiling test target contracts by @maciektr in #2028
- Bump foundry-rs/setup-snfoundry from 3 to 4 by @dependabot in #2034
- Update deps by @maciektr in #2039
- Add link to lint docs by @wawel37 in #2040
- Add docs for execute, prove and verify, update docs by @maciektr in #2036
- Fix compiler config collection with profiles by @maciektr in #2041
- Prepare release
2.11
by @maciektr in #2044
Full Changelog: v2.10.1...v2.11.0
v2.10.1
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
- feat: ui print doc dir by @FroyaTheHen in #1979
- Treat Cairo plugins as package dependencies by @integraledelebesgue in #1889
- Add plugin discovery utilities to scarb-metadata by @integraledelebesgue in #1890
- Introduce procedural macro repository by @integraledelebesgue in #1919
Full Changelog: v2.10.0...v2.10.1
v2.9.4
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
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
- Disable gas cfg when
enable-gas=false
by @DelevoXDG in #1904 - Update
enable-gas
docs by @DelevoXDG in #1905 - Run cargo update by @Arcticae in #1907
- Bump semver from 1.0.24 to 1.0.25 by @dependabot in #1903
- Bump vite from 5.4.6 to 5.4.14 in /website by @dependabot in #1911
- Bump katex from 0.16.10 to 0.16.21 in /website by @dependabot in #1899
- feat: exclude pub(crate) from docs by @FroyaTheHen in #1908
- Fix
scarb execute
outputs by @DelevoXDG in #1918 - docs: update formatting by @FroyaTheHen in #1909
- Update Cairo by @maciektr in #1926
- Rename StarkNet to Starknet by @maciektr in #1932
- Scarb execute: support panic reason print by @maciektr in #1933
- Update cairo-toolchain-xtask by @maciektr in #1934
- Require disabled gas in executable target compilation by @maciektr in #1935
- Add deprecation warning to cairo-run by @maciektr in #1936
- Split scarb-execute into subfiles by @DelevoXDG in #1924
- Add
scarb prove
by @DelevoXDG in #1900 - Update Cairo by @maciektr in #1942
- Add
scarb verify
by @DelevoXDG in #1922 - Bump the non-critical group with 4 updates by @dependabot in #1945
- Adapt release workflow for scarb-prove by @maciektr in #1943
- Executable target: allow syscalls flag by @maciektr in #1941
- Bump openssl from 0.10.69 to 0.10.70 by @dependabot in #1946
- Scarb execute: Support printing resource usage, exit with non-zero code on panic by @maciektr in #1940
- Set execute default output format per target by @maciektr in #1947
- Update stwo_cairo_prover rev, use std feature by @maciektr in #1956
- Allow choosing executable by @maciektr in #1951
- Allow hiding warnings in Scarb output by @DelevoXDG in #1689
- take stwo-prover from stwo-cairo by @ohad-starkware in #1959
- Update asdf usage instructions on the website/download page by @stefanalfbo in #1960
- Upgrade stwo-cairo when building nightly release by @maciektr in #1961
- Bump the non-critical group across 1 directory with 5 updates by @dependabot in #1963
- Distinguish between library and plugin IDs in component dependencies by @integraledelebesgue in #1912
- Docs: Update default value in formatter config by @maciektr in #1965
- Print contract stem in size warning by @maciektr in #1958
- Update dependencies, fix cairo-lint imports by @maciektr in #1968
- Add cairo lint docs by @wawel37 in #1971
- Pubgrub lockfile lookup fix by @maciektr in #1957
- Update docs on profile and cairo in workspace context, change manifest path in warning by @maciektr in #1969
- Faster CI by @maciektr in #1972
- chore: fix some typos by @renshuncui in #1973
- Bump @octokit/request-error from 5.0.1 to 5.1.1 in /website by @dependabot in #1980
- Bump dompurify and mermaid in /website by @dependabot in #1983
- Bump @octokit/request and @octokit/core in /website by @dependabot in #1982
- Bump the non-critical group with 4 updates by @dependabot in #1988
- Update Cairo by @maciektr in #1985
New Contributors
- @ohad-starkware made their first contribution in #1959
- @stefanalfbo made their first contribution in #1960
- @integraledelebesgue made their first contribution in #1912
- @renshuncui made their first contribution in #1973
Full Changelog: v2.10.0-rc.1...v2.10.0