Releases: software-mansion/scarb
0.1.0-rc.1
Scarb 0.1 Release candidate 1
Welcome to the second release candidate of Scarb v0.1.0. We find Scarb to be ready for writing Cairo code and StarkNet contracts, and this release only updates Cairo and brings fixes since last release candidate.
NOTE: This release will not be published to crates.io, because Cairo Alpha 4 pushed there has a malformed Scarb.toml for core
package. This will be fixed in Cairo Alpha 5 and one more RC of Scarb.
Cairo version
This version of Scarb comes with Cairo v0.1.0-alpha.4
.
Pull requests
- Skip downloading corelib for docs.rs by @maciektr in #147
- Fix clippy error by @maciektr in #170
- Update Cairo to 1.0.0-alpha.4 by @mkaput in #175
Full Changelog: v0.1.0-rc.0...v0.1.0-rc.1
0.1.0-rc.0
Scarb 0.1 Release Candidate
Welcome to the first release candidate of Scarb v0.1.0. We find Scarb to be ready for writing Cairo code and StarkNet contracts, and this release mostly brings small quality of life improvements:
- Ready for Cairo Language Server -
scarb metadata
now outputs necessary information needed for Cairo Language Server to load Scarb projects. scarb rm
- Counterpart toscarb add
, remove dependencies from the project.- Automatically initialize VCS in new projects -
scarb new
/init
can now performgit init
automatically. - Hardened semantics of dependencies' targets - Dependency packages now are checked for having
lib
target turned on. - Override paths to important directories - Use environment variables or CLI flags to override paths to
target
, global cache and global config directories. - Scarb as library new APIs -
Config::builder()
andCompilerRepository
now enables, although in not the most elegant way, to define custom targets in custombuild
commands. - Scarb has been published to crates.io - https://crates.io/crates/scarb/0.1.0-rc.0 🎉
What's next?
This release marks that we believe that Scarb is ready for development of Cairo code and StarkNet contracts. Apart from fixing any arisen issues, we plan to release one more release candidate with Cairo Alpha 4. Then, around time when StarkNet 0.11 will reach Mainnet, we plan to release stable Scarb 0.1.0 🎉
And as always, if you are interested, we maintain a public roadmap.
Cairo version
This version of Scarb comes with Cairo v0.1.0-alpha.3
.
Pull requests
- Allow overriding target directory by @mkaput in #102
- Fix manifest env variable by @maciektr in #103
- Refactor
Config
construction by employing Builder pattern by @mkaput in #104 - fix: manifest impl path by @tarrencev in #106
- Fix issues blocking from publishing to crates.io by @mkaput in #107
- Add some more documentation pieces by @mkaput in #109
- Allow listing installed subcommands by @maciektr in #95
- Add CompilerRepository in Config by @mkaput in #113
- Increase flock test timeout by @maciektr in #112
- Bump gix from 0.37.1 to 0.37.2 by @dependabot in #117
- Bump toml_edit from 0.19.3 to 0.19.4 by @dependabot in #116
- Bump tempfile from 3.3.0 to 3.4.0 by @dependabot in #115
- Prevent non-lib packages from being used as dependencies in other packages by @mkaput in #121
- Add
scarb rm
by @kariy in #122 - Add compilation units to metadata by @maciektr in #114
- Initialize Git repository on
scarb new
&scarb init
by @kariy in #124 - Implement registry caching by @mkaput in #123
Thank you
- @tarrencev made their first contribution in #106
- @kariy made their first contribution in #122
Welcome and a big Thank You!
Full Changelog: v0.1.0-alpha.2...v0.1.0-rc.0
0.1.0-alpha.2
Scarb Third Alpha
Welcome to the third (and hopefully last) alpha release of Scarb. There are two highlights of this version:
- Git dependencies support - Pull dependencies from Git repositories.
scarb add
- Add entries to the[dependencies]
section inScarb.toml
from command line.
Git dependencies support
Scarb is now capable of pulling dependencies from Git repositories. The syntax for specifying such dependencies in Scarb.toml
is identical to one in Cargo:
[dependencies]
quaireaux = { git = "https://github.com/keep-starknet-strange/quaireaux.git" }
As seen in this example, Quaireaux already is a Scarb package 🎉
You can also specify a particular Git reference:
-
Branch:
quaireaux = { git = "https://github.com/keep-starknet-strange/quaireaux.git", branch = "feature/stack" }
-
Tag:
quaireaux = { git = "https://github.com/keep-starknet-strange/quaireaux.git", tag = "v0.1.0" }
-
GitHub pull request:
quaireaux = { git = "https://github.com/keep-starknet-strange/quaireaux.git", rev = "refs/pull/36/head" }
-
Commit hash:
quaireaux = { git = "https://github.com/keep-starknet-strange/quaireaux.git", rev = "e03c883" }
Note: Because there is no Scarb.lock
file yet, Scarb will attempt to git fetch
and update dependencies on each invocation.
scarb add
To ease adoption, we decided to promptly add scarb add
command, which adds requested dependencies to Scarb.toml
file. The interface of this command is almost identical to cargo add
, but one noticeable difference is that Scarb does not yet try to download the dependency to gather its real version (in order to put it in the manifest instead of user-provided version requirement). This interface allows adding any valid dependency specification.
$ scarb add -h
Add dependencies to a Scarb.toml manifest file
Usage: scarb add [OPTIONS] [DEP_ID]...
Arguments:
[DEP_ID]... Reference to a package to add as a dependency
Options:
--dry-run Do not actually write the manifest
--manifest-path <MANIFEST_PATH> Override path to a directory containing a Scarb.toml file [env: SCARB_MANIFEST_PATH=]
-p, --package <PACKAGE> Specify package to modify
-v, --verbose... More output per occurrence
-q, --quiet... Less output per occurrence
--json Print machine-readable output in NDJSON format
--offline Run without accessing the network [env: SCARB_OFFLINE=]
-h, --help Print help (see more with '--help')
Source:
--path <PATH> Filesystem path to local package to add
--git <URI> Git repository location
--branch <BRANCH> Git branch to download the package from
--tag <TAG> Git tag to download the package from
--rev <REV> Git reference to download the package from
For example, to add Quaireaux dependency, you can run:
scarb add quaireaux --git https://github.com/keep-starknet-strange/quaireaux.git
Notable minor changes
- Scarb passes some more information about execution environment via environment variables to subcommands.
- Both
scarb --help
andscarb metadata
will now contain information about Cairo language version bundled with Scarb. - We don't vendor Cairo's
core
library in Scarb's repo any more, instead we pull it from upstream during build time. This still is not the final solution, but it's a step forward. - Added
--offline
flag, which prevents Scarb from doing any network access. scarb -q
will not silent any messages printed to standard output; similarly,scarb -v
will print a little bit more.- Slightly tweaked handling of
.gitignore
file inscarb new
.
Cairo version
This version of Scarb comes with Cairo v0.1.0-alpha.3
.
Pull requests
- Git source support by @mkaput in #69
- Minor QoL improvements in scarb new/init by @mkaput in #81
- Include information what Cairo version is bundled in --version output by @mkaput in #82
- Include Scarb and Cairo versions in metadata output by @mkaput in #83
- Upgrade to Gitoxide 0.36 by @mkaput in #85
- Bump clap from 4.1.4 to 4.1.6 by @dependabot in #87
- Bump once_cell from 1.17.0 to 1.17.1 by @dependabot in #88
- Bump snapbox from 0.4.4 to 0.4.6 by @dependabot in #86
- Update Gitoxide to 0.37.1 by @mkaput in #89
- Pull
core
from starkware-libs/cairo.git by @mkaput in #84 - Pass scarb env vars by @maciektr in #71
- scarb add by @mkaput in #94
Full Changelog: v0.1.0-alpha.1...v0.1.0-alpha.2
0.1.0-alpha.1
Scarb Second Alpha
Welcome to the second alpha release of Scarb. There are two significant updates in this version, that we hope you'll like:
- Multi target architecture - A capability of building various kinds of artefacts, via a notion of package targets:
- Starknet contract target - Build Starknet contracts with the multi-target architecture.
- Built-in CASM compiler - Build CASM code along Sierra.
scarb fmt
- Run Cairo1 formatter over Scarb projects.
Multi target architecture
Like Cargo, Scarb can now treat a package as a library that can also be compiled to several more sophisticated kinds of artefacts. While Cargo is building binaries, tests, benchmarks etc., and this set is hardcoded Scarb can currently build Starknet contracts and the system here is prepared for extensibility by adding custom target kinds via future Scarb extensions.
The most basic aspect of building Sierra code is also a target, called lib
, which is the default one. You can explicitly enable it by adding the following line to Scarb.toml
:
[lib]
Other targets can be added by adding entries to the targets
table, for example in the future you could hypothetically do:
[[targets.dojo-game]]
[[targets.starknet-os]]
All targets have names, which default to the package name. They are used in logs and when naming output artefacts. Note, that for each target kind, each target name must be unique (otherwise targets would overwrite each other). For example, if your package is named foo
, and you want to build it to a file called bar.sierra
, you can add the following snippet to Scarb.toml
:
[lib]
name = "bar"
Note: We are not particularly happy with the fact that all targets share the same crate root. This brings some interesting problems, for example it is not possible to build both lib
and starknet-contract
targets from the single package, because they use mutually incompatible compilers. We plan to tackle this before Scarb release candidate release.
Starknet contract target
Scarb is now capable of building Cairo contracts, if package's Scarb.toml
contains [[target.starknet-contract]]
line:
[package]
name = "hello"
version = "0.1.0"
[[target.starknet-contract]]
Enabling Starknet contract target will cause the compiler to look for contract modules in source, and will emit a contract JSON file in the target/release
directory, instead of raw Sierra, for each found contract.
For more examples, check out related test from Scarb's codebase.
Built-in CASM compiler
In the default lib
target, we added a possibility to automatically compile generated Sierra code to CASM. Simply add these lines to your Scarb.toml
:
[lib]
casm = true
You can also disable generation of Sierra code with:
[lib]
sierra = false
casm = true
scarb fmt
The scarb fmt
command formats all Cairo source files in the project using the official formatter. It also has the --check
argument for use in CI checks. Shortly speaking, scarb fmt
works just exactly the same as cargo fmt
. We tried to mimic its behaviour as close as possible.
Notable minor changes
Better release archives
We have also done some serious release engineering, thanks to which:
-
Release archives now have POSIX-style directory layout. This is a very forward-looking change, as we expect the amount of bundled files to grow in future releases. Scarb binary now resides in the
bin
directory. -
We now publish checksums of release archives. You can verify integrity of downloaded archives with:
sha256sum --ignore-missing --check checksums.sha256
-
We added builds for Linux AArch64 platform.
OpenSSL dependency
This release does not depend on OpenSSL, so it should work on any Linux distribution, no matter whether it is OpenSSL 1.1 or 3.0-based.
Cairo version
This version of Scarb comes with Cairo starkware-libs/cairo@e0665d8.
Pull requests
- Make
create-output-dir
crate not depend oncargo-util
. Releasecreate-output-dir
1.0.0 by @mkaput in #53 - Bump indoc from 1.0.8 to 1.0.9 by @dependabot in #56
- Bump clap from 4.1.1 to 4.1.4 by @dependabot in #57
- Fix fixed durations in flock tests by actively listening to stdout by @mkaput in #59
- Multi-target architecture by @mkaput in #55
- Rework release workflow by @mkaput in #62
- Build StarkNet contracts by @mkaput in #61
- Bump toml_edit version by @maciektr in #68
- scarb fmt by @maciektr in #66
Full Changelog: v0.1.0-alpha.0...v0.1.0-alpha.1
0.1.0-alpha.0
Introducing Scarb!
We are pleased to announce the first alpha release of Scarb, a build toolchain and package manager for everything Cairo 1.0!
Scarb is being developed by a team at @software-mansion, spun off the software-mansion/protostar team, and we are closely collaborating with @starkware-libs while working on this project.
See our annoucement blog post for more information!
OpenSSL on Linux
Linux package depends on OpenSSL version 1.1. If you use a newer distro with is based on OpenSSL 3 (such as latest Ubuntu releases), you will have to install OpenSSL 1.1 before running Scarb. We plan to fix this in next alpha release.
New Contributors
- @mkaput made their first contribution in #1
- @maciektr made their first contribution in #16
- @dependabot made their first contribution in #44
Full Changelog: https://github.com/software-mansion/scarb/commits/v0.1.0-alpha.0