-
Notifications
You must be signed in to change notification settings - Fork 85
Open
Description
Summary
In a workspace containing both executable targets and starknet-contract targets, it's impossible to compile executables because the [cairo] enable-gas setting cannot be configured per-package.
Current Behavior
When a workspace contains:
- A package with executable targets (requires
enable-gas = false) - A package with starknet-contract targets (requires
enable-gas = true)
Running scarb execute on the executable fails with:
error: executable target cannot be compiled with enabled gas calculation
The warning message confirms the limitation:
warn: in context of a workspace, only the `cairo` set in the workspace manifest is applied,
but the `falcon` package also defines `cairo` in the manifest
Reproduction
Workspace Scarb.toml:
[workspace]
members = ["packages/*"]Package A (packages/falcon/Scarb.toml) with executable:
[package]
name = "falcon"
version = "0.1.0"
edition = "2024_07"
[cairo]
enable-gas = false
[[target.executable]]
name = "bench_ntt_bounded_int"
function = "falcon::programs::bench_ntt_bounded_int::main"
sierra = truePackage B (packages/test-contract/Scarb.toml) with contract:
[package]
name = "test_contract"
version = "0.1.0"
edition = "2024_07"
[[target.starknet-contract]]
sierra = true
casm = true
[dependencies]
falcon = { path = "../falcon" }Running:
scarb execute --executable-name bench_ntt_bounded_int --package falconFails because the package-level enable-gas = false is ignored.
Expected Behavior
One of:
- Per-package
[cairo]settings should be respected in workspaces - Or
enable-gascould be configurable per-target type (executables vs contracts) - Or at minimum,
--packageflag should use that package's[cairo]settings
Environment
- scarb version: 2.15.1
- OS: Linux
Workaround
Currently the only workaround is to move the executable package outside the workspace, which breaks the dependency relationship.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels
Type
Projects
Status
Triage