Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Workspace dev-dependencies #1523

Open
milancermak opened this issue Aug 14, 2024 · 0 comments
Open

Workspace dev-dependencies #1523

milancermak opened this issue Aug 14, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@milancermak
Copy link

Problem

This might be a bug or a feature request 😁 It seems Scarb does not take workspace dev-dependencies into account.

In Alexandria, we have a setup where cario_test is supposed to be inherited from the workspace, as a dev-dependency, but there's no clean way how to do it. Currently, running tests emits a warning. When creating a [workspace.dev-dependencies] section in the main Scarb.toml, it emits an error.

Steps

  1. Clone the latest version of Alexandria - it has just been updated to 2.7.0
  2. cd alexandria/packages/linalg
  3. scarb test

You should see this warning in the console:

scarb test
     Running cairo-test alexandria_linalg
warn: `cairo_test` plugin not found
please add the following snippet to your Scarb.toml manifest:
\```
[dev-dependencies]
cairo_test = "2.7.0"
\```

Notice that linalg/Scarb.toml has

[dev-dependencies]
cairo_test.workspace = true

but the main workspace Scarb.toml has cairo_test only in [workspace.dependencies]. This setup works, but results in the warning mentioned above.

  1. Next, edit the main Scarb.toml - remove cairo_test from [workspace.dependencies] and put it into [workspace.dev-dependencies], so that it can be inherited in the linalg package (at least that's how I think it ought to work):
[workspace.dependencies]
starknet = "2.7.0"
# cairo_test = "2.7.0"

[workspace.dev-dependencies]
cairo_test = "2.7.0"
  1. Now, running scarb test results in this error:
error: failed to parse manifest at: /Users/m/projects/tmp/alexandria/Scarb.toml

Caused by:
    0: error inheriting `cairo_test` from workspace root manifest's `workspace.dependencies.cairo_test`
    1: dependency `cairo_test` not found in workspace

Possible Solution(s)

No response

Notes

No response

Version

scarb 2.7.0 (e9a2b8716 2024-08-01)
cairo: 2.7.0 (https://crates.io/crates/cairo-lang-compiler/2.7.0)
sierra: 1.6.0
@milancermak milancermak added the bug Something isn't working label Aug 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Status: Triage
Development

No branches or pull requests

1 participant