You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Feb 26, 2024. It is now read-only.
Currently Truffle is hard-coded to use the globally installed solc binary called solc when configured with compilers.solc.version = 'native'. This makes switching between versions of the compiler cumbersome. It would be more convenient if it allowed setting a custom path. Currently this is only possible with the emscripten binaries via solc-js.
In my case the primary motivation is to easily run tests of external projects with custom builds of the compiler but I could also imagine users wanting to use the much faster native binaries with multiple projects using different compiler versions.
If simply accepting the path to a native binary in the compilers.solc.version setting is problematic (would need some kind of detection to recognize it as a native binary?), my suggestion would be to read the compiler path from an environment variable if the variable exists. Using a custom compiler would then be as simple as:
Hi @cameel we like this idea, but it will require scoping as far as how to specify this properly in the user config and properly handle the info inside Truffle. We'll put it on our backlog to investigate further, but PRs are always welcome if you have an implementation in mind!
Great! I might try submitting a PR for this eventually, because it's blocking switching the Colony-based tests to the native compiler in the Solidity repo. Unfortunately not at the moment though because it's just a small part of a bigger task (benchmarking compilation/optimization using the new IR-based code generator) and it's not that critical, just nice to have to be able to get rid of brittle workarounds.
As for specifying this - would you prefer the solution with putting the compiler path in the setting or using an env variable? In case of a setting would you rely on autodetection or add another property to indicate what type of executable this is?
Currently Truffle is hard-coded to use the globally installed solc binary called
solc
when configured withcompilers.solc.version = 'native'
. This makes switching between versions of the compiler cumbersome. It would be more convenient if it allowed setting a custom path. Currently this is only possible with the emscripten binaries via solc-js.In my case the primary motivation is to easily run tests of external projects with custom builds of the compiler but I could also imagine users wanting to use the much faster native binaries with multiple projects using different compiler versions.
If simply accepting the path to a native binary in the
compilers.solc.version
setting is problematic (would need some kind of detection to recognize it as a native binary?), my suggestion would be to read the compiler path from an environment variable if the variable exists. Using a custom compiler would then be as simple as:TRUFFLE_NATIVE_SOLC_PATH="/tmp/solc-linux-amd64-v0.8.10+commit.fc410830" truffle compile
The text was updated successfully, but these errors were encountered: