Releases: software-mansion/scarb
0.2.1
Scarb 0.2.1
Welcome to the release notes for Scarb v0.2.1!
This is a quick release that fixes the scarb-metadata
crate version used by the Language Server. We are sorry for any inconveniences.
Cairo version
This version of Scarb comes with Cairo v1.0.0
.
What's Changed
- Port
sub_dependencies
test fromhex_solver
by @mkaput in #338 - Minor imports reformat by @mkaput in #339
- Reorder code by @mkaput in #340
- Fix scarb metadata version by @maciektr in #347
- Document cairo-version field in manifest reference by @mkaput in #336
- Parse
[cairo-plugin]
inScarb.toml
by @mkaput in #355
Full Changelog: v0.2.0...v0.2.1
0.2.0
Scarb 0.2.0
Welcome to the release notes for Scarb v0.2.0! This release brings several improvements coming from the recent iteration:
- Cairo 1.0.0
- macOS and Linux installer
cairo-version
field inScarb.toml
- Globs in scripts
Cairo 1.0.0
In preparation for the upcoming upgrades of Starknet, Cairo 1.0.0 has been released. This version of Scarb includes it now.
New installation flow for macOS and Linux
We have released the new install script-based method of installing Scarb on Unix-like platforms: macOS and Linux. Here's what you see on Scarb's website, when running these systems:
The download page also lists all downloadable files for current stable and preview releases. In the future, we also aim to publish these release notes directly on Scarb's website. What the installer does, its internals and our future plans have been outlined in detail in this Twitter thread.
cairo-version
field in Scarb.toml
The cairo-version
field is an optional key that tells Scarb what version of the Cairo compiler your package can be compiled with. If the currently selected version of the Cairo compiler is older than the stated version, Scarb will exit with an error. This field is analogous to Rust's rust-version
.
[package]
name = "example"
version = "1.0.0"
cairo-version = "1.0.0"
Updated deno_task_shell
to 0.12.0
Upgraded deno_task_shell
brings support for globs in Scarb scripts! This means you can now write in your Scarb.toml:
[scripts]
example = "cp test/* other"
scarb-metadata
deprecated code removal
The CompilationUnitMetadata.components_legacy
field has been removed in scarb-metadata v1.3.0
as significant time has passed since deprecation. In future Scarb release, we will proceed with renaming the current components
field underlying field components_data
back to components
.
Experimental: Linux MUSL builds
This release brings builds for two new platforms: x86_64-unknown-linux-musl
and aarch64-unknown-linux-musl
. These binaries have statically linked-in MUSL instead of Glibc, which theoretically makes them runnable on any Linux distributions running a reasonably modern kernel, such as Alpine or Nix OS. These builds are experimental and Scarb team is not serving support for them though, as we are unsure how MUSL will play with our plan for supporting compiler plugins as packages.
Cairo version
This version of Scarb comes with Cairo v1.0.0
.
What's Changed
- Compilation Model docs by @maciektr in #303
- Bump clap from 4.2.5 to 4.2.7 by @dependabot in #306
- Bump serde from 1.0.160 to 1.0.162 by @dependabot in #308
- Bump fs4 from 0.6.3 to 0.6.4 by @dependabot in #309
- Bump libc from 0.2.142 to 0.2.143 by @dependabot in #307
- Bump serde_test from 1.0.160 to 1.0.162 by @dependabot in #311
- Create Unix installer by @mkaput in #312
- Make install.sh not crash if
$SHELL
is not present by @mkaput in #316 - New download flow on the website by @mkaput in #315
- Make install.sh follow
XDG_DATA_HOME
by @mkaput in #317 - Update architecture docs by @maciektr in #305
- Bump tokio from 1.28.0 to 1.28.1 by @dependabot in #320
- Bump serde from 1.0.162 to 1.0.163 by @dependabot in #321
- Fix copy button for Unix install command on the frontpage by @mkaput in #319
- Bump serde_test from 1.0.162 to 1.0.163 by @dependabot in #323
- Bump libc from 0.2.143 to 0.2.144 by @dependabot in #322
- Update Cairo to 1.0.0 and deno_task_shell to 0.12.0 by @mkaput in #327
- Use Bash instead of Python in scripts tests by @mkaput in #328
- Fix download tables scrolling by @mkaput in #331
- Docs: Use Scarb installer in CI workflows example by @maciektr in #329
- Publish MUSL builds by @mkaput in #332
- Add cairo-version to Scarb.toml and comparing it with current cairo version by @4rgorok in #290
- Remove deprecated
CompilationUnitMetadata.components_legacy
by @mkaput in #333 - Bump zip from 0.6.4 to 0.6.6 by @dependabot in #335
Full Changelog: v0.2.0-alpha.2...v0.2.0
0.2.0-alpha.2
Scarb 0.2.0-alpha.2
This is a quick release that now really includes the Scarb's bundled CairoLS binary. We are sorry for any inconveniences.
What's Changed
- Clarify information about package names in docs by @mkaput in #296
- Update: CLI command in working-on-an-existing-package.mdx by @0xKubitus in #301
- Add scarb ci examples for circleci and gitlabci by @maciektr in #300
- Remove invalid sentence that package names cannot start with
_
by @mkaput in #302
New Contributors
- @0xKubitus made their first contribution in #301
Full Changelog: v0.2.0-alpha.1...v0.2.0-alpha.2
0.2.0-alpha.1
Scarb 0.2.0-alpha.1
Note: This version is not yet supported on Starknet! Scarb v0.2 will target Starknet v0.12. If you want to develop contracts deployable to current Starknet v0.11, please stick with Scarb v0.1.
Welcome to the release notes for Scarb v0.2! Here's what has changed these two weeks:
- Cairo
1.0.0-rc0
- we have updated Cairo to the latest release - Cairo LS now comes bundled with Scarb - editor plugins now get access to the always-working revision of the LSP
- Conditional compilation -
#[cfg(target: 'starknet-contract')]
- Work towards compiler plugins
- Breaking change: the
Compiler
interface has been redone
- Breaking change: the
Cairo LS now comes bundled with Scarb
The cairo-lang-language-server
crate from Starkware implements a language server (refered to as Cairo LS) used by the Cairo extension for Visual Studio Code.
Since this release, the Cairo LS comes bundled into Scarb as a subcommand under cairo-language-server
name (see Subcommands for more information). The Cairo extension is now capable of detecting and using the bundled Cairo LS binary. This allows Scarb to ensure both the extension and itself work with the same version of Cairo language, providing more consistent developer experience to extension users. There is no longer need to install the language server separately from Scarb.
Conditional compilation
Conditionally compiled source code is source code that may or may not be considered a part of the source code depending on certain conditions. Source code can be conditionally compiled using the cfg
attribute.
The cfg
attribute conditionally includes the thing it is attached to based on a configuration predicate. If the predicate is true, the item is rewritten to not have the cfg
attribute on it. Otherwise, the item is removed from the source code.
For example, this attribute can be used to provide different implementations of a function depending on current Scarb target:
#[cfg(target: 'lib')]
fn example() -> felt252 {
42
}
#[cfg(target: 'starknet-contract')]
fn example() -> felt252 {
512
}
Which configuration options are set is determined statically during the compilation of the compilation unit of the compiled package. It is not possible to set a configuration option from within the source code of the package being compiled.
See Conditional Compilation reference page for more information.
Work towards compiler plugins
As part of our roadmap, we plan to support user defined Cairo compiler plugins, ideally distributed outside of Scarb source code and required as package dependencies. While this feature is not fully implemented yet, this release includes some ground work required to make this goal achievable in the future.
Cairo plugin is a special Scarb package that defines a cairo-plugin
target and provides additional interface for instantiating compiler Semantic plugins. When using Scarb as a library, Cairo plugins can now be defined with configuration builder. If not specified otherwise, Scarb comes with predefined StarkNet Cairo plugin. The mechanism for requiring Cairo plugins as package dependencies or compiling them in Scarb runtime is not implemented yet.
See RFC: Scarb compiler plugins for more information.
Minor changes
- We have added a documentation page about using Scarb in CI workflows. It starts with a template usage for GitHub Actions, GitLab CI and CircleCI.
scarb --version
will now explicitly tell you if you're running a published Cairo version pulled from crates.io.
Cairo version
This version of Scarb comes with Cairo v1.0.0-rc0
.
What's Changed
- Update various sub-dependencies by @mkaput in #256
- Change references to
quirenox
in our website toquaireaux_math
by @4rgorok in #257 - Fix invalid regex for package names in docs by @mkaput in #259
- Bump snapbox from 0.4.10 to 0.4.11 by @dependabot in #262
- Bump clap from 4.2.1 to 4.2.2 by @dependabot in #263
- Bump assert_fs from 1.0.12 to 1.0.13 by @dependabot in #264
- Bump predicates from 3.0.2 to 3.0.3 by @dependabot in #261
- Conditional compilation by @mkaput in #266
- Docs: Add section about ignoring files in fmt by @maciektr in #267
- Fix recent CI issues by @mkaput in #275
- Add link to Cairo compiler crate if commit hash is unknown by @mkaput in #276
- Search directory containing Scarb binary for subcommands by @maciektr in #277
- Add github actions example to docs by @maciektr in #279
- Bump dunce from 1.0.3 to 1.0.4 by @dependabot in #281
- Bump libc from 0.2.141 to 0.2.142 by @dependabot in #282
- Bump tracing-subscriber from 0.3.16 to 0.3.17 by @dependabot in #283
- Bump clap from 4.2.2 to 4.2.4 by @dependabot in #284
- Add cairo-language-server binary by @maciektr in #260
- List subcommands from Scarb exe dir by @maciektr in #289
- Bump clap from 4.2.4 to 4.2.5 by @dependabot in #291
- Bump anyhow from 1.0.70 to 1.0.71 by @dependabot in #293
- Bump directories from 5.0.0 to 5.0.1 by @dependabot in #294
- Bump tokio from 1.27.0 to 1.28.0 by @dependabot in #292
- Prepare for compiler plugins packages by @mkaput in #297
- Update Cairo to
1.0.0-rc0
by @mkaput in #298
New Contributors
Full Changelog: v0.2.0-alpha.0...v0.2.0-alpha.1
0.2.0-alpha.0
Scarb 0.2.0-alpha.0
Note: This version is not yet supported on Starknet! Scarb v0.2 will target Starknet v0.12. If you want to develop contracts deployable to current Starknet v0.11, please stick with Scarb v0.1.
Note: Compilation outputs will now land in target/dev/
directory by default. This is a result of introducing profiles to Scarb, and our decision to set dev
as the default one instead of release
.
Welcome to the release notes for Scarb v0.2.0-alpha.0! This is the first preview release in Scarb v0.2 release cycle. The main focus was to quickly deliver Cairo Alpha 7 to our users, but it already includes several features that we work on for the next version of Scarb:
- Profiles - Profiles provide a way to alter the compiler settings.
- CASM contract classes - Everything is awesome.
- Starknet compiler plugin enabled for
[lib]
target
Profiles
Profiles provide a way to alter the compiler settings, influencing things like optimizations and debugging information. When running Scarb commands, like scarb build
, you can specify a profile to use with the --profile
(-P
) flag. Scarb has now 2 built-in profiles: dev
and release
. The profile defaults to dev
if a profile is not specified on the command-line. In addition to the built-in profiles, custom user-defined profiles can also be specified.
For example, to replace all names in generated Sierra code with dummy counterparts, but only in dev
profile, you can now write in your Scarb.toml:
[profile.dev.cairo]
sierra-replace-ids = true
See Defining Custom Profiles guide and Profiles reference page for more information.
CASM contract classes
Historically, contract classes have been defined in terms of Cairo assembly, or CASM for short (the class definition also included more information needed for execution, e.g., hint data). The novelty of Cairo 1.0 is the introduction of Sierra, an intermediate layer between Cairo 1.0 and CASM.
If there is a need to compile Sierra contract to CASM locally, Scarb can now do that by adding casm = true
under [[targets.starknet-contract]]
. Scarb will emit then the CASM Contract Class file in the target directory to a file named: [package name]_[contract name].casm.json
.
See the expanded Starknet Contract Target reference page for more information.
Starknet compiler plugin enabled for [lib]
target
As a temporary measure, Scarb v0.2 now explicitly enables the StarknetPlugin
and Starknet specific implicits precedence for the generic [lib]
target. This enables mixing lib
and starknet-contract
targets in a single package, which in Scarb v0.1 would almost always cause compilation errors, due to pure Cairo compiler not being able to expand the Starknet-specific #[contract]
attribute.
In simpler words: it is now feasible to develop contract libraries!
Cairo version
This version of Scarb comes with Cairo v1.0.0-alpha.7
.
Pull requests
- Enable
StarknetPlugin
onlib
targets by @mkaput in #232 - Generate CasmContractClass in starknet-contract target by @mkaput in #235
- State how targets influence dependencies in docs by @mkaput in #243
- Add manifest profiles definition by @maciektr in #211
- Docs for manifest profiles by @maciektr in #246
- Allow tool metadata overriding with profiles by @maciektr in #253
Full Changelog: v0.1.0...v0.2.0-alpha.0
0.1.0
Welcome to the release notes for Scarb v0.1.0! To commemorate that, Cairo 1.0 is reaching Starknet Mainnet tomorrow, on Wednesday 26th March, we are happy to finally drop the prerelease tag from Scarb 🚀 In comparison with Scarb 0.1.0-rc.2, this release brings one new feature:
- Scripts - Packages can now define custom, cross-platform commands aiding in development.
Scripts
This feature should feel familiar to anyone who ever worked in JavaScript ecosystem. Since the popular Cairo 1.0 project template uses make
for defining custom tasks, many projects started doing so. By introducing scripts, we hope to remove one extra dependency users need to have installed on their machines in order to work on Cairo 1.0 projects, and thus, make progress towards our goal of making Scarb the only software you have to install on your machine in order to write Cairo!
To get started, define your scripts in your codebase's Scarb.toml
file under a [scripts]
section:
[scripts]
foo = "echo 'Hello, world!'"
You can now run the foo
script using the new scarb run
command:
scarb run foo
Under the hood, we use deno_task_shell
, which solves a big pain point of NPM scripts: Scarb scripts are cross-platform, and the same commands will run on Linux, macOS and Windows (no need for rimraf
, rm
just works).
See the guide and reference pages in Scarb documentation for more information.
What's next?
We are already working on Scarb 0.2. The main highlights of this release will be profiles (aka debug, release and custom ones) and first steps towards enabling packages to declare dependencies on Cairo compiler plugins. All of these are steps towards making Scarb integrate well with Protostar and other ecosystem tools.
As always, we keep our roadmap public here. Recently, it has undergone quite a sizeable refinement, and we hope you will like what we are cooking for Scarb!
Cairo version
This version of Scarb comes with Cairo v0.1.0-alpha.6
.
Pull requests
- Update
gix
by @mkaput in #199 - Update
directories
by @mkaput in #200 - Update
assert_fs
andpredicates
by @mkaput in #197 - Migrate from Smol to Tokio by @maciektr in #176
- Minor docs improvements by @mkaput in #202
- Use SmolStr for tools manifest by @maciektr in #203
- Add scripts runner by @maciektr in #164
- Scarb branding by @mkaput in #204
- Write MAINTAINING.md by @mkaput in #210
- Add scripts docs by @maciektr in #209
- Bump toml_edit from 0.19.7 to 0.19.8 by @dependabot in #216
- Bump predicates from 3.0.1 to 3.0.2 by @dependabot in #217
- Bump async-trait from 0.1.67 to 0.1.68 by @dependabot in #218
- Prepare release
0.1.0
by @mkaput in #220
Full Changelog: v0.1.0-rc.2...v0.1.0
0.1.0-rc.2
Scarb 0.1 Release Candidate 2
Welcome to the third release candidate of Scarb v0.1.0! We find Scarb to be ready for writing Cairo code and StarkNet contracts, and this release not only updates Cairo to Alpha 6, but also brings several new features that we merged recently:
scarb-metadata
crate - A Rust crate to ease generating and consuming output ofscarb metadata
command.- Breaking changes in metadata format - Several nonsense fields have been removed and several have been added along the way.
[tool.*]
section - Standardized place for adding custom tool-specific fields to `Scarb.toml.[cairo]
section - Pass configuration parameters to Cairo compiler.- Improvements to
scarb add
- This command now sorts dependencies and cleans up added Git repository URLs. - Scarb crate new APIs - Accessors for targets and tool sections, revamp of
CompilationUnit
data structure.
NOTE: This release is back on crates.io.
scarb-metadata
crate
This crate provides structured access to the output of scarb metadata
command. It is meant to be a go-to choice when trying to get information about the workspace from Scarb in extensions.
See crate documentation on docs.rs for more information.
We have already submitted a PR to Cairo Language Server to use this crate, and we advise doing this as well in your projects.
While working on this, we should several missing opportunities or even nonsensical fields in the schema. The changes resulted in a situation that scarb-metadata
will fail to parse outputs of older Scarb versions and vice versa, but Cairo Language Server up to Cairo Alpha 6 has not been affected (because it worked on a subset of the entire schema, that we carefully avoided breaking).
[tool.*]
section
Scarb extensions and other tools now have a place to put their custom configuration data in Scarb.toml
, the [tool]
table. Tools must put their configuration fields in a subtable, and they should use tool name as the key. For example, Protostar will soon use:
[tool.protostar.test]
report-slowest-tests = 5
For more information, checkout the section about [tool]
table in Scarb documentation.
[cairo]
section
Currently, the Cairo compiler has one configuration option, and it was not possible to enable it while using Scarb: an ability to replace IDs in generated Sierra code with their human-readable counterparts. New versions of Cairo will introduce new flags, which brings a need for a possibility to add extra switches in a clear place in the future. Hence, the [cairo]
section has been added to Scarb.toml
.
To enable this feature, now you can simply add the following snippet to Scarb.toml
:
[cairo]
sierra-replace-ids = true
For more information, checkout the section about [cairo]
section in Scarb documentation.
Improvements to scarb add
The scarb add
command has been polished this cycle:
- If the order of entries in
[dependencies]
section is already sorted, it will add new dependencies alphabetically. - It will try to normalize GitHub repository URLs, to slightly improve consistency of dependency entries. Scarb already performed same normalization procedures while pulling dependencies from Git, there is no behaviour difference here.
Thanks to @kariy for contributing these improvements!
Scarb crate new APIs
We added several methods to core data models to ease access to some popular information hidden deep in Manifest
data structure. See merged pull request for a diff of what's added and Scarb crate documentation on docs.rs for more information about these.
Cairo version
This version of Scarb comes with Cairo v0.1.0-alpha.6
.
Pull requests
- Bump actions/add-to-project from 0.4.0 to 0.4.1 by @dependabot in #140
- Sort
[dependencies]
section onscarb add
by @kariy in #143 - Bump serde_json from 1.0.93 to 1.0.94 by @dependabot in #153
- Bump snapbox from 0.4.7 to 0.4.8 by @dependabot in #157
- Bump thiserror from 1.0.38 to 1.0.39 by @dependabot in #156
- Bump indoc from 2.0.0 to 2.0.1 by @dependabot in #155
- Bump clap from 4.1.6 to 4.1.8 by @dependabot in #154
- Generalize logic for getting selected package by @kariy in #152
- Move exit code handling to error types system by @maciektr in #146
- Pass absolute path to read workspace on Scarb new by @maciektr in #161
- Scarb website by @mkaput in #150
- Bump libc from 0.2.139 to 0.2.140 by @dependabot in #168
- Bump async-trait from 0.1.64 to 0.1.66 by @dependabot in #167
- Bump camino from 1.1.3 to 1.1.4 by @dependabot in #165
- Bump serde from 1.0.152 to 1.0.156 by @dependabot in #172
- Bump toml_edit from 0.19.4 to 0.19.6 by @dependabot in #171
- Add tool metadata to manifest by @maciektr in #163
- Canonicalize Git URL in
scarb add
by @kariy in #162 - Add tool section to docs by @maciektr in #182
- Add
[cairo]
section to Scarb.toml by @mkaput in #180 - Create
scarb-metadata
crate by @mkaput in #183 - Add getters for tool metadata tables by @mkaput in #185
- Polish
scarb-metadata
package by @mkaput in #186 - Bump snapbox from 0.4.8 to 0.4.10 by @dependabot in #191
- Bump toml_edit from 0.19.6 to 0.19.7 by @dependabot in #192
- Bump semver from 1.0.16 to 1.0.17 by @dependabot in #193
- Bump anyhow from 1.0.69 to 1.0.70 by @dependabot in #195
- Update Cairo to
1.0.0-alpha.6
by @mkaput in #196 - Bump serde from 1.0.156 to 1.0.158 by @dependabot in #198
- Stabilize metadata format and fix all problems found by @mkaput in #189
Full Changelog: v0.1.0-rc.0...v0.1.0-rc.2
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