Skip to content
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

Display the supported compiler versions for packages #97

Open
0xJem opened this issue Jul 15, 2024 · 4 comments
Open

Display the supported compiler versions for packages #97

0xJem opened this issue Jul 15, 2024 · 4 comments
Labels
enhancement New feature or request

Comments

@0xJem
Copy link

0xJem commented Jul 15, 2024

Many packages (e.g. uniswap-v3-core) are highly opinionated wrt the compiler version used. It would be useful if each soldeer package version listed the supported compiler versions. (It could use the same format as the pragma statement.)

@mario-eth mario-eth added enhancement New feature or request good first issue Good for newcomers labels Jul 31, 2024
@beeb
Copy link
Collaborator

beeb commented Nov 13, 2024

Could you expand a little bit on this? Would you like that the soldeer.xyz website displays a range of acceptable solidity versions on each package page?

This might be a bit tricky, as each version of the package could potentially require different solidity versions, and there are not only version specifiers in the files (pragma statements) but also in the foundry.toml config. Then, pragma statements could even be different for each file, as well as non-source files like tests and helpers.

If you could describe in a bit more detail what you would like to see, it would help to define what is required.

@beeb beeb added question Further information is requested and removed good first issue Good for newcomers labels Nov 13, 2024
@0xJem
Copy link
Author

0xJem commented Nov 25, 2024

Yes, it is a little complicated!

Would you like that the soldeer.xyz website displays a range of acceptable solidity versions on each package page?

Pretty much, yes. But for a particular version of the package (since it could change from version to version).

An example:

  • Interfaces tend to be very loose with the pragma statements (e.g. >= 0.8.0) to make integration easier
  • Implementation files (at least how we practice it) would be specific (e.g. 0.8.15)
  • The test files (for foundry, assume /test) and script files (/script), the pragma statements could be ignored

Thinking about this further, it's probably quite difficult to do. Perhaps using the solc_version in foundry.toml (if present) is the way to go? It's a specific version, but it would at least give an indication of which version is being used, and you would know if it's likely to be incompatible.

@beeb
Copy link
Collaborator

beeb commented Nov 25, 2024

Thanks for the clarifications. Yes indeed it's not a trivial task. Using the foundry setting is maybe not the best idea as it could artificially restrain the version when in fact the files would be OK with lower version.
Using all the pragmas would be best, but it's hard to know which files to consider. In the ideal case where it's a foundry project and all the file extensions are correct we could ignore .t.sol and .s.sol files, or even ignore the test and script directories (unless they have been customized). And then it would be a matter of resolving the lowest acceptable version considering all pragmas. But what if there is no version that suits all files because the authors put ranges that do not overlap in different files?

@beeb
Copy link
Collaborator

beeb commented Nov 25, 2024

Additionally, at the moment I think the backend has no feature that would introspect the content of packages. This would require a large refactor on the backend side.

@beeb beeb removed the question Further information is requested label Nov 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants