Problem
The coverage job runs forge coverage which disables via_ir for accurate instrumentation. However, projects that use IR-only features (e.g., calldata[] calldata to storage copying) fail to compile without the IR pipeline:
Error (1834): Copying of type struct IExecutor.Call calldata[] calldata to storage
is not supported in legacy (only supported by the IR pipeline).
This results in an empty coverage report (0/0 for all metrics).
Proposed Solution
Add an optional coverage-ir-minimum boolean input (default false). When enabled, pass --ir-minimum to forge coverage, which enables viaIR with minimal optimization — enough for IR-dependent code while still producing accurate coverage.
coverage-ir-minimum:
description: 'Pass --ir-minimum to forge coverage for projects requiring the IR pipeline'
type: boolean
default: false
Then in the coverage step:
if [[ "${{ inputs.coverage-ir-minimum }}" == "true" ]]; then
forge coverage --ir-minimum 2>&1 | tee coverage-raw.txt
else
forge coverage 2>&1 | tee coverage-raw.txt
fi
Context
Encountered in POP when enabling run-coverage: true. The forge coverage warning itself suggests this flag:
If you encounter "stack too deep" errors, consider using --ir-minimum which enables viaIR with minimum optimization resolving most of the errors
Problem
The coverage job runs
forge coveragewhich disablesvia_irfor accurate instrumentation. However, projects that use IR-only features (e.g.,calldata[] calldatato storage copying) fail to compile without the IR pipeline:This results in an empty coverage report (0/0 for all metrics).
Proposed Solution
Add an optional
coverage-ir-minimumboolean input (defaultfalse). When enabled, pass--ir-minimumtoforge coverage, which enablesviaIRwith minimal optimization — enough for IR-dependent code while still producing accurate coverage.Then in the coverage step:
Context
Encountered in POP when enabling
run-coverage: true. Theforge coveragewarning itself suggests this flag: