Skip to content

Implement auto compile #210

Open
Open

Description

@montyly

We are having a lot of issues in Slither due to bugs in the underlying compilation platforms that lead to broken ASTs.

We could overcome these issues by running solc directly. The main pitfalls to use solc is to select what files are needed in the compilation units, and the configuration (solc version, optimization, etc). However, the underlying compilation platform might be able to give us the correct list of files, even if the ASTs are incorrect, or at least give us most of the files and the configuration.

As a result, we could have an "auto recompile" mode that we could trigger automatically in case of failure that would do:

  • Collect the filenames from the underlying platform
  • Allow the users to specify missing files (if there are some)
  • Call solc with the input standard json, with all the files and the configuration

An alternative would be to implement the same heuristics as the compilation platforms to recover the set of files and their associated compilation units. But this will require more efforts, to support all the different format (contracts, interfaces, dependencies in nodejs/python-based frameworks, ...)

We can probably rely on the compilation unit in the short term, and move toward the full heuristic in the long term

Additionally, this mode would allow to significantly reduce the compilation time in case of re-runs.

(tagging @Xenomega for visibility)

Activity

  1. added a commit that references this issue on Jul 18, 2022
  2. montyly commented on Jul 19, 2023

    @montyly
    ContributorAuthor

    Bumping this. We need to make it a priority + add an easy way to configure the set of files & remapping

    Nowadays codebase can take a lot of time to compile, so we need to allows the user to configure what files they want to compile without having to compile everything

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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