0.1.0-alpha.2
Pre-releaseScarb 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