mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-19 10:22:23 +00:00
feat: compile ccc (#741)
* update Makefile * update * fix github action
This commit is contained in:
parent
40f30fd7be
commit
2d335724b0
3 changed files with 42 additions and 7 deletions
24
.github/workflows/ci.yml
vendored
24
.github/workflows/ci.yml
vendored
|
|
@ -14,7 +14,7 @@ on:
|
|||
- ready_for_review
|
||||
name: CI
|
||||
jobs:
|
||||
build:
|
||||
build-mock-ccc-geth: # build geth with mock circuit capacity checker
|
||||
if: github.event.pull_request.draft == false
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
|
|
@ -26,6 +26,28 @@ jobs:
|
|||
uses: actions/checkout@v2
|
||||
- name: Build
|
||||
run: |
|
||||
make nccc_geth
|
||||
build-geth: # build geth with circuit capacity checker
|
||||
if: github.event_name == 'push' # will only be triggered when pushing to main & staging & develop & alpha
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Install Go
|
||||
uses: actions/setup-go@v2
|
||||
with:
|
||||
go-version: 1.20.x
|
||||
- name: Install rust
|
||||
uses: actions-rs/toolchain@v1
|
||||
with:
|
||||
toolchain: nightly-2022-12-10
|
||||
override: true
|
||||
components: rustfmt, clippy
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v2
|
||||
- name: Build
|
||||
run: |
|
||||
make libzkp
|
||||
sudo cp ./rollup/circuitcapacitychecker/libzkp/libzkp.so /usr/local/lib/
|
||||
sudo cp ./rollup/circuitcapacitychecker/libzkp/libzktrie.so /usr/local/lib/
|
||||
make geth
|
||||
# check:
|
||||
# if: github.event.pull_request.draft == false
|
||||
|
|
|
|||
12
Makefile
12
Makefile
|
|
@ -2,17 +2,25 @@
|
|||
# with Go source code. If you know what GOPATH is then you probably
|
||||
# don't need to bother with make.
|
||||
|
||||
.PHONY: geth android ios evm all test clean
|
||||
.PHONY: geth android ios evm all test clean libzkp
|
||||
|
||||
GOBIN = ./build/bin
|
||||
GO ?= latest
|
||||
GORUN = go run
|
||||
|
||||
geth:
|
||||
libzkp:
|
||||
cd $(PWD)/rollup/circuitcapacitychecker/libzkp && make libzkp
|
||||
|
||||
nccc_geth: ## geth without circuit capacity checker
|
||||
$(GORUN) build/ci.go install ./cmd/geth
|
||||
@echo "Done building."
|
||||
@echo "Run \"$(GOBIN)/geth\" to launch geth."
|
||||
|
||||
geth: libzkp ## geth with circuit capacity checker
|
||||
$(GORUN) build/ci.go install -tags circuit_capacity_checker ./cmd/geth
|
||||
@echo "Done building."
|
||||
@echo "Run \"$(GOBIN)/geth\" to launch geth."
|
||||
|
||||
all:
|
||||
$(GORUN) build/ci.go install
|
||||
|
||||
|
|
|
|||
13
build/ci.go
13
build/ci.go
|
|
@ -186,10 +186,11 @@ func main() {
|
|||
|
||||
func doInstall(cmdline []string) {
|
||||
var (
|
||||
dlgo = flag.Bool("dlgo", false, "Download Go and build with it")
|
||||
arch = flag.String("arch", "", "Architecture to cross build for")
|
||||
cc = flag.String("cc", "", "C compiler to cross build with")
|
||||
staticlink = flag.Bool("static", false, "Create statically-linked executable")
|
||||
dlgo = flag.Bool("dlgo", false, "Download Go and build with it")
|
||||
arch = flag.String("arch", "", "Architecture to cross build for")
|
||||
cc = flag.String("cc", "", "C compiler to cross build with")
|
||||
staticlink = flag.Bool("static", false, "Create statically-linked executable")
|
||||
gobuildtags = flag.String("tags", "", "Tags for go build")
|
||||
)
|
||||
flag.CommandLine.Parse(cmdline)
|
||||
env := build.Env()
|
||||
|
|
@ -208,6 +209,10 @@ func doInstall(cmdline []string) {
|
|||
buildTags = append(buildTags, "ckzg")
|
||||
}
|
||||
|
||||
if len(*gobuildtags) > 0 {
|
||||
buildTags = append(buildTags, strings.Split(*gobuildtags, ",")...)
|
||||
}
|
||||
|
||||
// Configure the build.
|
||||
gobuild := tc.Go("build", buildFlags(env, *staticlink, buildTags)...)
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue