Skip to content

Commit

Permalink
portable blst build in docker image (flashbots#258)
Browse files Browse the repository at this point in the history
  • Loading branch information
metachris authored Aug 24, 2022
1 parent 5d18505 commit 407f692
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 0 deletions.
10 changes: 10 additions & 0 deletions .github/workflows/releaser.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,16 @@ jobs:
tags: flashbots/mev-boost:latest,flashbots/mev-boost:${{ steps.vars.outputs.tag }}
platforms: linux/amd64,linux/arm64

- name: Build and push portable
uses: docker/build-push-action@v3
env:
VERSION: ${{ steps.vars.outputs.tag }}
CGO_CFLAGS: "O -D__BLST_PORTABLE__"
with:
context: .
push: true
tags: flashbots/mev-boost:latest-portable,flashbots/mev-boost:${{ steps.vars.outputs.tag }}-portable
platforms: linux/amd64,linux/arm64

github-release:
runs-on: ubuntu-latest
Expand Down
8 changes: 8 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@ v:
build:
go build -ldflags "-X 'github.com/flashbots/mev-boost/config.Version=${VERSION}' -X 'github.com/flashbots/mev-boost/config.BuildTime=$(shell date)'" -v -o mev-boost .

.PHONY: build-portable
build-portable:
CGO_CFLAGS=-"O -D__BLST_PORTABLE__" go build -ldflags "-X 'github.com/flashbots/mev-boost/config.Version=${VERSION}' -X 'github.com/flashbots/mev-boost/config.BuildTime=$(shell date)'" -v -o mev-boost .

.PHONY: build-testcli
build-testcli:
go build -ldflags "-X 'github.com/flashbots/mev-boost/config.Version=${VERSION}' -X 'github.com/flashbots/mev-boost/config.BuildTime=$(shell date)'" -v -o test-cli ./cmd/test-cli
Expand Down Expand Up @@ -55,6 +59,10 @@ run-mergemock-integration: build
build-for-docker:
GOOS=linux go build -ldflags "-X 'github.com/flashbots/mev-boost/config.Version=${VERSION}' -X 'github.com/flashbots/mev-boost/config.BuildTime=$(shell date)'" -v -o mev-boost .

.PHONY: build-for-docker-portable
build-for-docker-portable:
CGO_CFLAGS=-"O -D__BLST_PORTABLE__" GOOS=linux go build -ldflags "-X 'github.com/flashbots/mev-boost/config.Version=${VERSION}' -X 'github.com/flashbots/mev-boost/config.BuildTime=$(shell date)'" -v -o mev-boost .

.PHONY: docker-image
docker-image:
DOCKER_BUILDKIT=1 docker build . -t mev-boost
Expand Down
9 changes: 9 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,15 @@ make build
./mev-boost -help
```

If mev-boost crashes with [`"SIGILL: illegal instruction"`](https://github.com/flashbots/mev-boost/issues/256) then you need to create a portable build:

```bash
CGO_CFLAGS=-"O -D__BLST_PORTABLE__" go install github.com/flashbots/mev-boost@latest

# or
make build-portable
```

## From Docker image

We maintain a mev-boost Docker image at https://hub.docker.com/r/flashbots/mev-boost
Expand Down

0 comments on commit 407f692

Please sign in to comment.