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

only build the required files when running a few tests #588

Open
moodysalem opened this issue Aug 20, 2023 · 8 comments
Open

only build the required files when running a few tests #588

moodysalem opened this issue Aug 20, 2023 · 8 comments

Comments

@moodysalem
Copy link

Problem

when i run a single test via scarb test -f ... it takes 5-10 seconds just to run

i suspect it's re-building all the code just to run a single test

my repo is quite large and splitting it up is impractical, so i'd like it if scarb only built the required files

Proposed Solution

only build the required files, so it runs faster

Notes

n/a

@moodysalem
Copy link
Author

or ideally add a watch mode that only runs the changed tests and i can just fix my tests in real time

@mkaput
Copy link
Member

mkaput commented Aug 22, 2023

Hmm, this suggestion sounds neat, but I can't see how we can implement this without having incremental compilation in Cairo compiler itself. That's because the compiler is indeed fully rebuilding everything because it is not capable of saving a part of work and reusing it later, it just takes a hash map of package name → source path as sole input.

The only much more coarse thing we can do with Scarb only is that with #380 being done, we could only recompile one of tests/* files whenever it's changed, instead of recompiling everything. But this won't help a lot I think

@moodysalem
Copy link
Author

it takes 45 seconds just to compile so i can run a single test in the ekubo contracts repo right now. i'm used to it but this feels very high priority for codebases with significant amount of complexity. is there any other solution?

@mkaput
Copy link
Member

mkaput commented Oct 7, 2023

We have identified a regression in Scarb 2.3.0-rc0, which we will fix in 2.3.0-rc1, to be released in couple of days. This should help with your 45s build time situation.

Other than that, we can only push Cairo team to prioritise this work.

@fvelazquez-X
Copy link

Hello dear @mkaput , I just followed this thread and I am facing the same situation as @moodysalem. When performing tests on large codebases its impractical to wait for a considerably long compilation time. Idk in which stage of improving this you are now as I saw your last comment was to push Cairo team for it.

Thanks a lot in advance!,

@mkaput
Copy link
Member

mkaput commented Apr 8, 2024

Hey @fvelazquez-X! This is still a low-priority thing upstream. We've been discussing this recently and there are no updates on this front.

We are not saying this is not important. We agree it is! But the Cairo team identifies more critical features to implement now.

@mkaput
Copy link
Member

mkaput commented Apr 18, 2024

Update: As for now, incremental compilation is not planned to be worked on.

@mkaput
Copy link
Member

mkaput commented Jan 13, 2025

good news: starkware-libs/cairo#7053

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

No branches or pull requests

3 participants