spinframework / spinframework/spin
Make sure debug assertions work in tests
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 6.5k
- Forks
- 310
- Avg merge
- 1d 20h
- Merged PRs (30d)
- 24
Description
We currently run a lot of tests with --release for performance reasons (wasmtime cranelift compile times): https://github.com/spinframework/spin/blob/291316ddd376e14ae0850967e83d8a94962f93c5/Makefile#L57-L76
One major downside of this is that it disables debug assertions, which we definitely would rather have enabled for testing.
@alexcrichton has suggested that we can probably mitigate the performance issues by selectively enabling optimizations just for cranelift, e.g.:
[profile.test.package.cranelift-codegen]
opt-level = 3
I would probably do the same for [profile.dev] as well, for the same reasons.
Another option would be to continue testing with --release and selectively enable debug-assertions when testing, but there are other reasons to avoid --release such as - ironically - making compilation of the tests themselves faster.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reading the test commands in Makefile lines 57-76 and the Cargo profile settings described in the issue. Compare selectively optimizing Cranelift in test and development profiles with enabling debug assertions under release testing. Done means tests retain debug assertions while avoiding the reported Cranelift compilation cost.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- build-system, testing
- Issue type
- Refactor
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 68/100