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

Improve validation for Scarb Version and Scarb.toml Configuration for Forge Backtrace #2710

Open
ksew1 opened this issue Nov 25, 2024 · 4 comments · May be fixed by #2900
Open

Improve validation for Scarb Version and Scarb.toml Configuration for Forge Backtrace #2710

ksew1 opened this issue Nov 25, 2024 · 4 comments · May be fixed by #2900
Assignees

Comments

@ksew1
Copy link
Collaborator

ksew1 commented Nov 25, 2024

Which component is your feature related to?

Forge

Feature Request

Currently, when annotations are missing, we return the following error:

"perhaps the contract was compiled without the following entry in Scarb.toml under [profile.dev.cairo]:

We should display a more descriptive message that clearly explains what is wrong. The message should be similar in approach to what the coverage functionality displays:

pub fn can_coverage_be_generated(scarb_metadata: &Metadata) -> Result<()> {

To achieve this, two new functions should be added to the backtrace file:

pub fn can_be_generated(scarb_metadata: &Metadata) -> Result<()>  
pub fn is_enabled() -> bool

These functions should then be invoked in the following function:

pub async fn run_for_workspace(args: TestArgs) -> Result<ExitStatus> {

if backtrace::is_enabled() {
    backtrace::can_be_generated(&scarb_metadata)?;
}

Definition of Done:

  • Running with BACKTRACE_ENV=1 will validate the Scarb version and Scarb.toml configuration.
  • e2e tests should be included to ensure that the changes are functioning as expected.
@khayss
Copy link
Contributor

khayss commented Jan 22, 2025

Can I take care of this issue?

@PoulavBhowmick03
Copy link

May I take this issue on?
Can I take care of this issue?
i am an active contributor in the starknet and ethereum ecosystem (my OD profile - https://app.onlydust.com/u/PoulavBhowmick03)
I have a robust experience working on Rust, having contributed to Dojo and other projects and built smart contracts in Rust.
ETA- 2 days

@cptartur
Copy link
Member

Hey @PoulavBhowmick03, what's the status of this? Do you have any draft you can publish? We are not that far from ODBoost conclusion.

@PoulavBhowmick03
Copy link

Hey @PoulavBhowmick03, what's the status of this? Do you have any draft you can publish? We are not that far from ODBoost conclusion.

Gm, yes! I spoke to you on Tg. My laptop crashed so had to take it to the store. will make a PR by tomorrw

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Backlog
Development

Successfully merging a pull request may close this issue.

5 participants