foundry icon indicating copy to clipboard operation
foundry copied to clipboard

feat(`compilation`): allow selective compilation of sources with `--via-ir`, running tests and scripts without

Open zerosnacks opened this issue 4 months ago • 1 comments

Component

Forge

Describe the feature you would like

In a basic scenario I was able to selectively compile with --via-ir as follows using the --skip flag:

$ forge build --via-ir --skip tests scripts

or this should work in foundry.toml:

[profile.via-ir]
via-ir = true
skip = ["test/*", "script/*"]

[profile.test]
skip = ["src/*"]

and then:

$ FOUNDRY_PROFILE=via-ir forge build
$ FOUNDRY_PROFILE=test forge test

This appears to work in a basic Counter example but appears to not work in all cases e.g. https://github.com/uniswap/v4-core

cc @klkvr is there a better way to do this?

Additional context

Related: https://x.com/0xKaden/status/1846606449977532748 + https://x.com/emo_eth/status/1846645499358859469

zerosnacks avatar Oct 16 '24 21:10 zerosnacks