paritytech / paritytech/revive

Split the `Dockerfile` to allow passing a prebuilt LLVM

Open
#541 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Rust
Stars
102
Forks
26
Avg merge
1d 13h
Merged PRs (30d)
6

Description

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

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with Dockerfile, Makefile.toml, and .github/workflows/reusable-build.yml, then review the referenced get-llvm action and the Build (MUSL) step. Define the Docker build flow for a reusable prebuilt LLVM and add the requested .dockerignore and top-level workflow. Done means the new target builds and sanity-checks the full image, while CI uses Dockerfile.resolc for the MUSL build.

Written by the indexing model from the issue text.

Assessment

Tech stack
docker, github-actions, rust
Domain
build-system, ci-cd, compilers, devops
Issue type
Refactor
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.