Skip to content
This repository was archived by the owner on Feb 26, 2024. It is now read-only.
This repository was archived by the owner on Feb 26, 2024. It is now read-only.

Setting a custom path for the native solc binary #4490

Open
@cameel

Description

@cameel

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:

TRUFFLE_NATIVE_SOLC_PATH="/tmp/solc-linux-amd64-v0.8.10+commit.fc410830" truffle compile

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions