Skip to content

Split the Dockerfile to allow passing a prebuilt LLVM #541

Description

@elle-j

Description

Refactor the current Dockerfile so CI can reuse it to build the resolc musl binary without the overhead of building LLVM from source. Instead, the LLVM binary that we already get from the get-llvm action can be used.

This also makes sure building of the musl build is aligned in CI (the distributed binary) and for users of the plain Dockerfile(s).

Changes

  • Split the Dockerfile
    • Dockerfile.resolc (or Dockerfile)
      • Builds resolc + Alpine image with solc
      • Pulls LLVM from separate image or a binded prebuilt
    • Dockerfile.llvm
      • Builds LLVM
  • Add Makefile.toml target
    • Add a phony target chaining the docker build -fs
  • Update CI MUSL build step
    • Replace the run command in the Build (MUSL) step (will be moved to the new build-resolc action in PR #536) to build the Dockerfile.resolc
  • Add .dockerignore
    • To skip transferring irrelevant files during docker build, we could add a .dockerignore (more useful if building locally)
    • Contains e.g. .git/, target/, llvm-*, node_modules/, book/, docs/, etc.
  • Add a new workflow running the full build
    • Add a top-level workflow running the new task from Makefile.toml
    • Once built, include a sanity check step
    • Since this will also build LLVM:
      • Should trigger on pushes to main (not PRs, we already build LLVM in PRs if our llvm builder changes)
      • Should use runner parity-large

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions