-
Notifications
You must be signed in to change notification settings - Fork 1.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Non-deterministic behavior with auto_detect_solc
#5050
Comments
since this happens in CI I assume you have already compatible versions installed locally ref: https://github.com/gakonst/ethers-rs/blob/master/ethers-solc/src/resolver/mod.rs#L17 |
Ah, yes. That's where this feature requests would then come in imho: #5049 That wouldn't solve all edge cases but probably most of them (e.g. if there are still multiple possible versions within the configured range it wouldn't solve it but that's probably less likely). |
I guess this is a reasonable request and could be solved by changed it to a set of solc versions. supportive |
Would you implement it by a) turning or b) add a new option Happy to work on this and submit a PR. My preference would be a) if that can be implemented without causing any breaking changes. |
there's a distinction between a pinned version and a range, pinning a version makes finding a compatible version obsolete. I'm not entirely sure how to implement this, the relevant code is here: |
Gotcha. So I guess we'd want a third |
yeah, which provides a HashSet of allowed versions, I think that should work |
this can be now achieved using newly introduced compilation restrictions (#8668), that is pin files to specific version. please use it and report if any issue with, thank you! |
Component
Forge
Have you ensured that all of these are up to date?
What version of Foundry are you on?
forge 0.2.0 (33f3fee 2023-05-26T00:03:48.457406188Z)
What command(s) is the bug in?
forge build
Operating System
Linux
Describe the bug
NOTE: I also opened a feature request related to this: #5049
I'm currently debugging an issue where auto_detect_solc behaves somewhat non-deterministically and chooses different solc versions between CI and local runs. Locally, it uses 0.8.17 and in CI it uses 0.8.20 for some files.
The underlying issue seems to be that if it finds a file that has a version range that is supported by any installed solc version it will use that pre-installed solc version instead of downloading the highest available version. So depending on the environment it is run in, if there's already solc 0.8.17 available (which is the case locally), it will use that. But if that's not available (e.g. in CI where it installs those on every run), it will download the highest match (0.8.20) and then use that.
EDIT: This also seems to be affected by caches.
Given the non-deterministic / environment-dependent behavior of this I'd categorize that as a bug.
The text was updated successfully, but these errors were encountered: