Releases: software-mansion/scarb
v2.3.1
This release is focused solely on bugfixes in Scarb and Cairo. Check out merged PRs list for more detailed information.
Cairo Version
This version of Scarb comes with Cairo v2.3.1
.
What's Changed
- Use FromStr for Lockfile by @maciektr in #810
- Bump the non-critical group with 1 update by @dependabot in #812
- Use requires_gas_counter helper by @maciektr in #814
- Stop lockfile e2e tests from overwriting existing example locks by @maciektr in #813
- Fix release branch naming in maintaining docs by @maciektr in #816
- Allow ignoring example project by name in test_for_each_example macro by @maciektr in #824
- Make profile args take precedence over env by @szymmis in #825
- Include
get_dep_component!
andget_dep_component_mut!
macros in thestarknet
package by @mkaput in #833 - Docs: Use kebab-case for formatting options by @maciektr in #836
- Add lockfile docs by @maciektr in #829
Full Changelog: v2.3.0...v2.3.1
v2.3.0
Lockfiles
Lockfiles are a common mechanism that allows package manager to lock dependencies to concrete versions, ensuring reproducible builds.
When specifying project dependencies, you define version requirements. Usually, those requirements can accept multiple versions. For instance, specifying 1.2.3
would allow all versions >=1.2.3
and <2.0.0
. Similarly, the specification alexandria_math = { git = "https://github.com/keep-starknet-strange/alexandria.git", branch = "next" }
can be resolved to more than one commit hash. Up to this version, Scarb would always pull the latest commit from the branch next
, which may change between Scarb runs. This not recommended, as some regressions or incompatibilities may be introduced in the new commit. Additionally, for security reasons users should control what changes are pulled to their builds. Consequently, users often had to manually lock their dependency revisions, e.g. by specifying the commit hash from the dependency package repository in the manifest file.
Lockfiles automatically lock dependencies to a certain revisions, by writing resolved versions to a file beside the project manifest called Scarb.lock
. This file is then read before Scarb resolves dependencies, and locked versions are used by the resolver. If you change your dependencies specification in the manifest file, lockfile will change as well. Lockfiles contain exact specifications of all packages from full tree of dependencies (including dependencies of dependencies etc.). Scarb lockfiles can easily be reviewed by the user.
Lockfiles should be commited to version control systems, allowing for full tracking of concrete version changes.
Cairo Version
This version of Scarb comes with Cairo v2.3.0
.
What's Changed
- Update
fs4
to0.7.0
and move procmacros dependencies to workspace by @mkaput in #772 - Revert matching parsing errors in git db client contains method by @maciektr in #774
- Ensure git checkout returns existing revision by @maciektr in #775
- Upgrade Cairo to
734a28823
by @mkaput in #784 - Add
Filesystem::into_child
method for easier chaining by @mkaput in #782 - Upgrade Cairo to
9fab18dcc
by @mkaput in #785 - Extract
protected_run_if_not_ok!
macro by @mkaput in #787 - Add tracing instrumentation to package ops by @mkaput in #789
- Update Cairo to
0f0b3786e7
by @mkaput in #795 - Implement base data models for registry index by @mkaput in #767
- Implement
Checksum
andDigest
mechanisms by @mkaput in #783 - Bump semver from 1.0.19 to 1.0.20 by @dependabot in #797
- Bump the non-critical group with 5 updates by @dependabot in #796
- Allow specifying custom source patches by @szymmis in #791
- Fix
ops::package
leaving old path in createdFileLockGuard
by @mkaput in #792 - Add lockfile structure by @maciektr in #777
- Generate lock files by @maciektr in #778
- Resolve with locked versions by @maciektr in #779
- Implement lockfile tests by @maciektr in #780
- Omit std source packages from lockfile by @maciektr in #800
- Generate lockfiles for examples by @maciektr in #781
- Bump rustix from 0.38.13 to 0.38.19 by @dependabot in #804
New Contributors
- @Utilitycoder made their first contribution in #728
Full Changelog: v2.3.0-rc1...v2.3.0
v2.3.0-rc1
Tests compilation is fast again
We have identified several performance regressions in changes related to tests compilation, and we fixed them in this release.
scarb-ui
on crates.io
The scarb-ui
crate has been published to crates.io: https://crates.io/crates/scarb-ui. We do not commit yet to its stability, and expect this crate to be <1.0 for a long time. All breaking changes will cause a major release (i.e. 0.1.0
to 0.2.0
etc.)
Started work on Scarb packages registry and Scarb.lock
This release contains the first changes to Scarb to support package registries and Scarb lockfile. The newly added scarb package
command is unfinished and undocumented yet, and we do not recommend relying on this. You are welcome to experiment with it though 😊
Cairo Version
This version of Scarb comes with Cairo v2.3.0-rc0
.
What's Changed
- Add integration test example by @maciektr in #725
- Document package tarballs by @mkaput in #646
- Scaffold
scarb package
command, implementing--list
arg by @mkaput in #657 - Create actual .tar.zst archive by @mkaput in #675
- DepBuilder DSL by @mkaput in #726
- Bump actions/checkout from 3 to 4 by @dependabot in #729
- Allow passing packages filter with env var by @maciektr in #721
- Build packages filter by @maciektr in #722
- Bump the non-critical group with 3 updates by @dependabot in #731
- Use packages filter env var in cairo-test by @maciektr in #723
- Add more packages filter tests by @maciektr in #727
- Fix GitSource db contains rev parse by @maciektr in #742
- Clippy add dbg macro rule by @maciektr in #747
- Write actual git revision for git source ids by @maciektr in #743
- Remove
indoc
dependency fromscarb-ui
by @mkaput in #749 - Bump postcss from 8.4.27 to 8.4.31 in /website by @dependabot in #754
- Remove dead code in
scarb-ui
by @mkaput in #750 - Fix Clippy
rust_2018_idioms
inscarb-ui
by @mkaput in #751 - Document entirety of
scarb-ui
by @mkaput in #752 - Ignore version pre-release part in nightlies by @szymmis in #756
- Prepare
scarb-ui
release0.1.0
by @mkaput in #753 - Use BufWriter for JSON serialized output files by @maciektr in #761
- Add tracing span for test compilation by @maciektr in #759
- Parse precise part from pretty url by @maciektr in #762
- Fix Clippy 1.73 issues by @mkaput in #764
- Implement normalization of manifests for publishing by @mkaput in #710
- Compile only tests with --test flag by @maciektr in #765
- Implement package source files collection by @mkaput in #732
- Ignore pre-release semver part in bound version test by @szymmis in #766
- Check archive filenames by @mkaput in #697
- Do not include Scarb.lock in packages by @mkaput in #733
- Support
.scarbignore
files when packaging by @mkaput in #746 - Move large struct
DetailedTomlDependency
into aBox
and useCow
to avoid cloning it by @mkaput in #748 - Document wildcards in build-external-contract by @Utilitycoder in #728
- Add
registry
field to dependency schema by @mkaput in #757 - Replace several TODO comments with
todo!
calls in packaging logic by @mkaput in #758 - Fix package op issues on Windows by @mkaput in #768
- Bump the non-critical group with 6 updates by @dependabot in #770
- Prepare release
2.3.0-rc1
by @mkaput in #771
New Contributors
- @Utilitycoder made their first contribution in #728
Full Changelog: v2.3.0-rc0...v2.3.0-rc1
v2.3.0-rc0
Scarb and Cairo releases are getting synchronized
We are happy to announce that starting with this release, Scarb will follow Cairo version numbering! From now on, Scarb vX.Y.Z
will always ship with matching Cairo vX.Y
release. It is possible that we will make patch releases for Scarb that will not come with compiler updates.
BREAKING: New artifacts extensions convention
This Scarb release starts and implements a new convention of file extensions in Cairo & Starknet ecosystems:
- Textual Sierra representation, meant for debugging use and compiler tests, stays as:
crate.sierra
- Textual CASM code of compiled Sierra, executable in Cairo VM, stays as:
crate.casm
- JSON representation of Sierra, used to be much more reliable than textual dump becomes:
crate.sierra.json
- alternative serialization formats will naturally be
crate.sierra.X
- alternative serialization formats will naturally be
- JSON containing Sierra code of Starknet contract class becomes:
contract.contract_class.json
- JSON containing CASM code of Starknet contract class becomes:
contract.compiled_contract_class.json
See the related proposal in Cairo discussions for more elaborate description.
BREAKING: [lib]
target now emits Sierra in new JSON format
The default [lib]
target now by default emits Sierra in a new JSON format (.sierra.json
), that is derived from Cairo compiler data structures instead of textual Sierra (.sierra
).
If you want to emit old format in your packages, add the following to your Scarb.toml
:
[lib]
sierra-text = true
Important
We ask though to migrate your tools & workflows to .sierra.json
immediately, as .sierra
files parser is known to misread programs and the JSON format does not have this issue.
BREAKING: Package names must be lowercase
Starting with this release, Scarb will refuse to work on packages that contain uppercase letters. Technically this is a breaking change, but we have not detected such packages existing in the open-source world, so we expect no affected users.
Moving tests compilation from cairo-test
to scarb build
scarb cairo-test
does not bundle the entire Cairo compiler now, and instead calls scarb build
in order to build Cairo tests. This is now possible thanks to the addition of a new Scarb target: [[test]]
.
This feature is currently mostly behind the scenes. We plan to iterate on it, and make it publicly documented when we'll ensure it is rock solid. As part of this effort, our plan is to standardize generated artefacts for tests, and therefore allow Starknet Foundry to also delegate their build process entirely to Scarb. This will also make it much easier to implement other custom Cairo test runners, as we'll effectively decouple Cairo compilation from actual testing.
The tests
directory
This improvement also allows Scarb to kill two birds with one stone:
- Starknet Foundry's
tests
directory is now properly handled byscarb cairo-language-server
. scarb cairo-test
got support for running tests from thetests
directory.
We will be polishing and documenting this feature in future Scarb releases.
Note
These improvements are only available in Scarb's distributions of cairo-test
and Cairo LS. The low-level binaries generated by Cairo compiler team do not have such capabilities.
Sorting imports in Cairo code
scarb fmt
can now sort use
statements etc. in Cairo code. This feature tends to generate big diffs, so it is disabled by default. To enable it, add the following to your Scarb.toml
:
[tool.fmt]
sort-module-level-items = true
See relevant documentation for more information
Wildcard support in build-external-contracts
The build-external-contracts
property of the starknet-contract
target allows asking Scarb to build contracts from package dependencies as part of proper package build, for example for use in tests. This release adds a possibility to request building many contracts from a module tree at once. For example, the following snippet:
[[target.starknet-contract]]
build-external-contracts = [
"dojo_erc::erc721::components::Balance",
"dojo_erc::erc721::components::OperatorApproval",
"dojo_erc::erc721::components::Owner",
"dojo_erc::erc721::components::TokenApproval",
"dojo_erc::erc721::erc721::ERC721",
"dojo_erc::erc721::systems::erc721_approve",
"dojo_erc::erc721::systems::erc721_burn",
"dojo_erc::erc721::systems::erc721_mint",
"dojo_erc::erc721::systems::erc721_set_approval_for_all",
"dojo_erc::erc721::systems::erc721_transfer_from",
]
can now be written as:
[[target.dojo]]
build-external-contracts = [
"dojo_erc::erc721::*",
]
Thanks to @ametel01 for contribution!
Minor changes
- Commands executed via Scarb scripts may now use coloured output in some cases.
scarb clean
refuses to work if it's executed outside Scarb workspace.- On Linux and macOS, Scarb now uses the
exec(3)
syscall for running subcommands, which means that subcommands now replacescarb
process instead of being wrapped by it. Alongside this, we have improved the corresponding implementation on Windows, which should, among others, improve handling of killing processes. scarb new
/init
now show an error or a warning if created package's name is a Cairo keyword or other ecosystem reserved name.- Added an internal support for target-specific dependencies.
test
targets will now depend on a new magic package:test_plugin
, which providescairo-test
compiler plugin.- This change will manifest itself in
scarb metadata
output.
- Scarb will now attempt to infer the value of
package.readme
field if missing, but a readme file is present.
Cairo Version
This version of Scarb comes with Cairo v2.3.0-rc0
.
What's Changed
- Fix formatting / clippy warning for 1.72 by @maciektr in #613
- Remove
packages_filter
feature fromscarb-metadata
by @mkaput in #605 - Add source-path argument to TomlTarget by @maciektr in #595
- Make inline plugins loadable via CairoPluginRepository by @szymmis in #620
- Set Cargo resolver version to 2 by @maciektr in #618
- Reduce number of scarb build calls in tests by @MrDenkoV in #616
- Bump the non-critical group with 5 updates by @dependabot in #622
- Upgrade Vitepress by @mkaput in #621
- Fix
errors_when_missing_script_and_cairo
test by @szymmis in #625 - Add [[test]] target definition by @maciektr in #596
- Disallow uppercase letters in package name by @MrDenkoV in #632
- Bump the non-critical group with 3 updates by @dependabot in #638
- Cross init templates off the roadmap by @mkaput in #639
- Remove example dependency comment from the template by @mkaput in #641
- Fix logo urls by @mkaput in #642
- Support import sorting via manifest configuration by @szymmis in #633
- Use SerDe to save sierra program by @MrDenkoV in #610
- Add textual Sierra artifact support by @MrDenkoV in #637
- Add reserved and special package names handling by @MrDenkoV in #640
- Run check release tests with ci profile by @szymmis in #648
- Implement wild card contracts selector by @ametel01 in #606
- Add target kind info to manifest dependency by @maciektr in #611
- Fix macos failing on cairo run extensions test by @szymmis in #653
- Adapt
windows_test
test to error wording changes by @szymmis in #656 - Bump the non-critical group with 5 updates by @dependabot in #663
- Bump website dependencies by @mkaput in #665
- Fix init test on windows by @maciektr in #664
- Set cairo version to latest main commit explicitly in nightly workflow by @szymmis in #661
- Update cairo to main by @maciektr in #668
- Update Vitepress by @mkaput in #670
- Ensure scarb clean only works in a workspace by @maciektr in https://github.co...
v0.7.0
Breaking changes
scarb-ui
crate, deprecation of PackagesFilter
in scarb-metadata
The packages_filter
feature in scarb-metadata
is deprecated since freshly released version 1.7.0
. We plan to remove it entirely in scarb-metadata
1.8.0
, if we will not detect active usage of this feature on public repositories (currently this feature is unused outside Software Mansion's codebases).
The entire feature has been moved to a new crate: scarb-ui
, which also provides Scarb's output system. Currently, this crate is not published to crates.io, but we consider doing so if there will be a need for it in the community.
New features
New project template
We have changed the template used by scarb new/init
commands. Newly generated projects will now contain example tests and a main
function, to demonstrate usage of scarb cairo-run
.
scarb cache path
This new command prints a path to Scarb's global cache directory.
Big shout out to @ametel01 for implementing this ❤️
Bugfixes
- Fixed version resolution issue which prevented following snippet from working:
[dependencies] openzeppelin = { git = "https://github.com/OpenZeppelin/cairo-contracts.git", tag = "0.7.0-rc.0" }
scarb cairo-test
can now successfully deploy contracts declared in dependencies
Cairo Version
This version of Scarb comes with Cairo v2.2.0
.
What's Changed
- Backport updates from release 0.6.2 branch by @mkaput in #572
- Fix error message for missing gas by @mkaput in #573
- New init template and examples updates by @mkaput in #574
- added cache-path command by @ametel01 in #566
- Add support for installing nightlies in install script by @szymmis in #571
- Remove unused
tracing-futures
dependency by @mkaput in #580 - Print Sierra version in
scarb --version
by @mkaput in #578 - Refactor write_script duplication in tests by @szymmis in #579
- Extract
scarb-ui
crate by @mkaput in #581 - Move all UI components to a submodule by @mkaput in #582
- Bump the non-critical group with 11 updates by @dependabot in #589
- Copy
PackagesFilter
intoscarb-ui
by @mkaput in #583 - Deprecate
packages_filter
feature inscarb-metadata
by @mkaput in #584 - Increase test parallelism in CI workflow by @mkaput in #593
- Properly use
Status
message when testing workspace by @mkaput in #585 - Basic implementation of
scarb-ui
inscarb cairo-run
by @mkaput in #587 - Test-runner: add unit components to compilation by @maciektr in #594
- Consider prerelease versions if
version
field of a dependency is unspecified by @mkaput in #601 - Prepare
scarb-metadata
release1.7.0
by @mkaput in #602 - Add OZ installation example by @martriay in #570
- Upgrade Cairo to
2.2.0
by @mkaput in #603
New Contributors
Full Changelog: v0.6.0...v0.7.0
v0.6.2
Scarb 0.6.2
Welcome to the release notes for Scarb v0.6.2!
This quick release is primarily Cairo upgrade to v2.1.1
.
Cairo Version
This version of Scarb comes with Cairo v2.1.1
.
What's Changed
Full Changelog: v0.6.1...v0.6.2
v0.6.1
Scarb 0.6.1
Welcome to the release notes for Scarb v0.6.1! This release brings several small quality-of-life improvements:
scarb cairo-run
will automatically callscarb build
code before running- new command:
scarb cache clean
wipes Scarb global cache directory scarb-metadata v.1.6.0
addsScarbCommand
helper for quick shelling into corescarb
CLI
Cairo version
This version of Scarb comes with Cairo v2.1.0
.
What's Changed
- Rewrite website with Vitepress by @mkaput in #501
- Last-minute website fixes by @mkaput in #541
- MAINTAINING.md: stop publishing
scarb
crate to crates.io by @mkaput in #540 - More website fixes by @mkaput in #542
- Another batch of website updates by @mkaput in #545
- Move Windows download instructions to "by os" section by @mkaput in #546
- Various error messages improvements by @mkaput in #549
- Upgrade Cairo to
84f933b
by @mkaput in #552 - Add Scarb command abstraction, build Scarb project before run by @maciektr in #543
- Update Alexandria references to refer to new package structure by @mkaput in #555
- Add scarb cache clean subcommand by @MrDenkoV in #531
- Rename nightly artifacts to be accessible from bash scripts by @szymmis in #556
- Fix global directories casing in documentation by @mkaput in #557
- Update dependabot.yml by @mkaput in #559
- Make Website Deploy workflow always deploy from main when run on release event by @mkaput in #560
- Bump semver from 1.0.17 to 1.0.18 by @dependabot in #562
- Bump the non-critical group with 12 updates by @dependabot in #563
Full Changelog: v0.6.0...v0.6.1
v0.6.0
Scarb 0.6.0
Welcome to the release notes for Scarb v0.6.0! This release brings a new big feature: workspaces, and upgrades Cairo to freshly released stable 2.1.0
version!
Workspaces
Scarb now natively supports projects consisting of multiple packages. Such projects are called workspaces and a denoted by a Scarb.toml
file in root directory which contains a new section: [workspace]
:
# [PROJECT_DIR]/Scarb.toml
[workspace]
members = ["hello_world"]
# [PROJECT_DIR]/hello_world/Scarb.toml
[package]
name = "hello_world" # the name of the package
version = "0.1.0" # the current version, obeying semver
authors = ["Alice <[email protected]>", "Bob <[email protected]>"]
Workspaces are properly handled when pulling dependencies, and all commands and extensions should become aware of them on day one if they use scarb-metadata v1.5.0
.
This feature is almost 1:1 copy-paste of Cargo's Workspaces. Therefore, it should feel familiar to Rust coders. For more information, check out relevant piece of documentation.
scarb
crate
Starting with this release, we publicly announce that the scarb
crate on crates.io is deprecated and will not receive further updates (including this Scarb version). We also announce that we plan to deprecate the scarb
crate altogether in the future, but for this to happen we need to bring feature-parity between this crate and Scarb binaries.
We advise our existing users to pull Scarb directly from Git repository, and new users to avoid using Scarb as Rust crate altogether and instead talk to user-installed scarb
CLI via the scarb-metadata
crate. Scarb documentation will be updated accordingly in coming days, as we're reworking it entirely right now.
The reason for this is that the scarb
crate existence is blocking us from doing several improvements we would like to have in the future, such as isolating Cairo compilation in a separate OS process.
If you have any further questions, please reach to us on our Telegram or Discord channels. We'll be happy to respond :-)
Cairo version
This version of Scarb comes with Cairo v2.1.0
.
What's Changed
- Publish nightlies to release repository by @mkaput in #527
- Fix paths issue on Windows by @mkaput in #529
- Filter hidden dirs found in member glob expansion by @maciektr in #508
- Workspace documentation by @maciektr in #532
- Upgrade Cairo to
2.1.0
by @mkaput in #534 - Revert "Run compiler in a new thread with increased stack size" by @mkaput in #535
- Upgrade various dependencies by @mkaput in #536
- Prepare release
0.6.0
by @mkaput in #537
Full Changelog: v0.6.0-alpha.4...v0.6.0
Changelog since Scarb v0.5.2
: v0.5.2...v0.6.0
0.6.0-alpha.4
Welcome to the release notes for Scarb v0.6.0-alpha.4! This release bumps Cairo, adds scarb fetch
command, fixes some bugs and brings internal changes paving the road for workspaces support.
scarb fetch
This small command is analogous to cargo fetch
. Its job is simple: just pull dependencies of current project and do nothing else. In the future, this command will also update the lock file.
Big thank you to @GianfrancoBazzani for implementing this! 👏🏻
Git interdependencies bug fix
We have fixed a bug which prevented from using following dependency tree:
┌───┐ git ┌───┐
│ X ├─────────►│ A │
└─┬─┘ └───┘
│ ▲
│ │ path = "../a"
│ │
│ git ┌─┴─┐
└───────────►│ B │
└───┘
Workspaces support
We have started merging the PR stack, which implements workspaces. Not everything was merged, and thus we do not advise making use of these changes yet!
Cairo version
This version of Scarb comes with Cairo v2.1.0-rc4
.
What's Changed
- Remove asdf plugin repo link from docs by @maciektr in #505
- Cairo-test: Warn when scarb version does not match by @maciektr in #503
- Converted Protostar references and updated docs links by @MrDenkoV in #507
- Publish the roadmap in readme and update architecture docs by @mkaput in #512
- Add workspace example by @maciektr in #446
- Bump clap from 4.3.10 to 4.3.19 by @dependabot in #521
- Bump camino from 1.1.4 to 1.1.6 by @dependabot in #520
- Bump async-trait from 0.1.68 to 0.1.72 by @dependabot in #519
- Bump thiserror from 1.0.40 to 1.0.44 by @dependabot in #517
- Bump actions/upload-pages-artifact from 1 to 2 by @dependabot in #522
- Format only selected packages by @maciektr in #490
- Make build tests not fail if they run too long by @mkaput in #523
- Patch path dependencies for git sources by @maciektr in #514
- Add runtime check for Core library and Cairo compiler versions by @MrDenkoV in #524
- Update Cairo to
2.1.0-rc4
by @maciektr in #528 - Add compile time check for Core library and Cairo compiler versions by @MrDenkoV in #513
- Add info about .tool-versions and caching to CI docs section by @szymmis in #511
- Adds
scarb fetch
by @GianfrancoBazzani in #509
New Contributors
- @MrDenkoV made their first contribution in #507
- @szymmis made their first contribution in #511
- @GianfrancoBazzani made their first contribution in #509
Full Changelog: v0.6.0-alpha.2...v0.6.0-alpha.4
0.6.0-alpha.2
Scarb 0.6.0-alpha.2
Welcome to the release notes for Scarb v0.6.0-alpha.2! This quick release is primarily Cairo upgrade to v2.1.0-rc2.
It includes some foundational work towards Scarb nightlies. 🌃
Cairo version
This version of Scarb comes with Cairo v2.1.0-rc2
.
What's Changed
Full Changelog: v0.6.0-alpha.1...v0.6.0-alpha.2