foundry-rs / foundry-rs/foundry

bug(`forge coverage`): stack too deep when using `--ir-minimum` and coverage report is not accurate

Open
#3,357 32 comments 24 reactions 1 assignee Assigned to @grandizzy View on GitHub
C-forge Cmd-forge-coverage T-bug T-post-V1
Dominant language
Rust
Stars
10.6k
Forks
2.6k
Avg merge
18h 20m
Merged PRs (30d)
510

Description

### Component

Forge

### Have you ensured that all of these are up to date?

- [X] Foundry
- [X] Foundryup

### What version of Foundry are you on?

forge 0.2.0 (ddaf100 2022-09-24T00:05:44.382307Z)

### What command(s) is the bug in?

forge coverage

### Operating System

macOS (Apple Silicon)

### Describe the bug

on executing `forge coverage` i am getting the below error
```
Error:
Compiler run failed
CompilerError: Stack too deep when compiling inline assembly: Variable headStart is 1 slot(s) too deep inside the stack.
```
but `forge test` and `forge build` are working fine.

NOTE: I noticed also that `forge build` and `forge test` are considering the cache but `forge coverage` is trying to re-compile even though I have a cached successful build

EDIT: See https://getfoundry.sh/guides/best-practices/stack-too-deep/ for techniques to work around "Stack too deep"

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.