foundry-rs / foundry-rs/foundry

[feature] foundry.toml settings conditional on OS type

Open
#6,373 5 comments 3 reactions 0 assignees View on GitHub
A-compiler A-config C-forge P-low T-feature
Dominant language
Rust
Stars
10.6k
Forks
2.6k
Avg merge
18h 20m
Merged PRs (30d)
510

Description

### Component

Forge

### Describe the feature you would like

It would be nice to be able to set some settings in `foundry.toml` depending on the current OS.

My specific use case is that Uniswap/v4-core uses a custom solc binary, which has a [different target](https://github.com/Uniswap/v4-core/tree/main/bin) for different OSes. We currently set the target using $OSTYPE in a sourced .env file, but this is annoying

One API would be something like
```
[os.linux]
solc = ./bin/static-linux-solc

[os.mac]
solc = ./bin/mac-solc

[os.default]
solc = ./bin/solc
```

But even better would be allowing some light variable definitions and callable functions in foundry.toml, similar to `[just](https://github.com/casey/just/blob/master/examples/cross-platform.just)`

### Additional context

_No response_

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.