foundry-rs / compilers

Utilities for working with native solc and compiling projects.
Apache License 2.0
70 stars 41 forks source link

feat: allow multiple languages for compilers #128

Closed klkvr closed 4 months ago

klkvr commented 4 months ago

This changes Compiler trait to also have associated Language type which is supposed to be an enum with languages supported by the compiler. Also CompilerVersionManager trait is removed and compiler now should contain full logic for version resolution.

For version management we have to keep track of all different languages and versions to compile them with, thus I've rewritten some of the graph logic to use HashMap<C::Language, HashMap<Version, Sources>> during compilation.

Now, instead of representing a binary wrapper, Compiler is more like binary manager which resolves and installs binaries dynamically depending on requested language and version.

It's mostly ready, I just need to add logic for compilation with locked compiler version.