Sitelet https://github.com/ethereum-optimism/optimism/commit/d0c4e370618c7ed4a3ab7ce6f699f0df62ddd8b9
Skip to content

Commit d0c4e37

Browse files
authored
op components migration to just (#13185)
* build(op-supervisor): migrate build to just * build(op-service): migrate build to just * build(op-conductor): migrate build to just * build(op-wheel): migrate build to just * build(op-challenger): cleanup visualize target The referenced visualize.sh script doesn't exist. It was moved around and finally deleted in #12286 * build(op-challenger): migrate build to just * build(op-chain-ops): migrate build to just * build(op-dispute-mon): migrate build to just * build(op-alt-da): migrate build to just
1 parent 67dd693 commit d0c4e37

16 files changed

Lines changed: 203 additions & 214 deletions

File tree

‎op-alt-da/Makefile‎

Lines changed: 2 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,3 @@
1-
GITCOMMIT ?= $(shell git rev-parse HEAD)
2-
GITDATE ?= $(shell git show -s --format='%ct')
3-
VERSION ?= v0.0.0
1+
DEPRECATED_TARGETS := da-server clean test
42

5-
LDFLAGSSTRING +=-X main.GitCommit=$(GITCOMMIT)
6-
LDFLAGSSTRING +=-X main.GitDate=$(GITDATE)
7-
LDFLAGSSTRING +=-X main.Version=$(VERSION)
8-
LDFLAGS := -ldflags "$(LDFLAGSSTRING)"
9-
10-
da-server:
11-
env GO111MODULE=on GOOS=$(TARGETOS) GOARCH=$(TARGETARCH) CGO_ENABLED=0 go build -v $(LDFLAGS) -o ./bin/da-server ./cmd/daserver
12-
13-
clean:
14-
rm bin/da-server
15-
16-
test:
17-
go test -v ./...
18-
19-
.PHONY: \
20-
op-batcher \
21-
clean \
22-
test
3+
include ../just/deprecated.mk

‎op-alt-da/justfile‎

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
import '../just/go.just'
2+
3+
# Build ldflags string
4+
_LDFLAGSSTRING := "'" + trim(
5+
"-X main.GitCommit=" + GITCOMMIT + " " + \
6+
"-X main.GitDate=" + GITDATE + " " + \
7+
"-X main.Version=" + VERSION + " " + \
8+
"") + "'"
9+
10+
BINARY := "./bin/da-server"
11+
12+
# Build the da-server binary
13+
da-server: (go_build BINARY "./cmd/daserver" "-ldflags" _LDFLAGSSTRING)
14+
15+
# Remove build artifacts
16+
clean:
17+
rm -f {{BINARY}}
18+
19+
# Run tests
20+
test: (go_test "./...")

‎op-chain-ops/Makefile‎

Lines changed: 2 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -1,54 +1,3 @@
1-
GITCOMMIT ?= $(shell git rev-parse HEAD)
2-
GITDATE ?= $(shell git show -s --format='%ct')
1+
DEPRECATED_TARGETS := ecotone-scalar receipt-reference-builder test op-deployer fuzz sync-standard-version
32

4-
# Find the github tag that points to this commit. If none are found, set the version string to "untagged"
5-
# Prioritizes release tag, if one exists, over tags suffixed with "-rc"
6-
VERSION ?= $(shell tags=$$(git tag --points-at $(GITCOMMIT) | grep '^op-deployer/' | sed 's/op-deployer\///' | sort -V); \
7-
preferred_tag=$$(echo "$$tags" | grep -v -- '-rc' | tail -n 1); \
8-
if [ -z "$$preferred_tag" ]; then \
9-
if [ -z "$$tags" ]; then \
10-
echo "untagged"; \
11-
else \
12-
echo "$$tags" | tail -n 1; \
13-
fi \
14-
else \
15-
echo $$preferred_tag; \
16-
fi)
17-
18-
LDFLAGSSTRING +=-X main.GitCommit=$(GITCOMMIT)
19-
LDFLAGSSTRING +=-X main.GitDate=$(GITDATE)
20-
LDFLAGSSTRING +=-X github.com/ethereum-optimism/optimism/op-chain-ops/deployer/version.Version=$(VERSION)
21-
LDFLAGSSTRING +=-X github.com/ethereum-optimism/optimism/op-chain-ops/deployer/version.Meta=$(VERSION_META)
22-
LDFLAGS := -ldflags "$(LDFLAGSSTRING)"
23-
24-
# Use the old Apple linker to workaround broken xcode - https://github.com/golang/go/issues/65169
25-
ifeq ($(shell uname),Darwin)
26-
FUZZLDFLAGS := -ldflags=-extldflags=-Wl,-ld_classic
27-
endif
28-
29-
ecotone-scalar:
30-
go build -o ./bin/ecotone-scalar ./cmd/ecotone-scalar/main.go
31-
32-
receipt-reference-builder:
33-
go build -o ./bin/receipt-reference-builder ./cmd/receipt-reference-builder/*.go
34-
35-
test:
36-
go test ./...
37-
38-
op-deployer:
39-
GOOS=$(TARGETOS) GOARCH=$(TARGETARCH) CGO_ENABLED=0 go build -v $(LDFLAGS) -o ./bin/op-deployer ../op-deployer/cmd/op-deployer/main.go
40-
41-
fuzz:
42-
printf "%s\n" \
43-
"go test $(FUZZLDFLAGS) -run NOTAREALTEST -v -fuzztime 10s -fuzz=FuzzEncodeDecodeWithdrawal ./crossdomain" \
44-
"go test $(FUZZLDFLAGS) -run NOTAREALTEST -v -fuzztime 10s -fuzz=FuzzEncodeDecodeLegacyWithdrawal ./crossdomain" \
45-
"go test $(FUZZLDFLAGS) -run NOTAREALTEST -v -fuzztime 10s -fuzz=FuzzAliasing ./crossdomain" \
46-
"go test $(FUZZLDFLAGS) -run NOTAREALTEST -v -fuzztime 10s -fuzz=FuzzVersionedNonce ./crossdomain" \
47-
| parallel -j 8 {}
48-
49-
50-
sync-standard-version:
51-
curl -Lo ./deployer/opcm/standard-versions-mainnet.toml https://raw.githubusercontent.com/ethereum-optimism/superchain-registry/refs/heads/main/validation/standard/standard-versions-mainnet.toml
52-
curl -Lo ./deployer/opcm/standard-versions-sepolia.toml https://raw.githubusercontent.com/ethereum-optimism/superchain-registry/refs/heads/main/validation/standard/standard-versions-sepolia.toml
53-
54-
.PHONY: test fuzz op-deployer sync-standard-version
3+
include ../just/deprecated.mk

‎op-chain-ops/justfile‎

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
import '../just/go.just'
2+
3+
# Build ldflags string
4+
_VERSION_META_STR := if VERSION_META != "" { "+" + VERSION_META } else { "" }
5+
_LDFLAGSSTRING := "'" + trim(
6+
"-X main.GitCommit=" + GITCOMMIT + " " + \
7+
"-X main.GitDate=" + GITDATE + " " + \
8+
"-X github.com/ethereum-optimism/optimism/op-chain-ops/deployer/version.Version=" + VERSION + " " + \
9+
"-X github.com/ethereum-optimism/optimism/op-chain-ops/deployer/version.Meta=" + _VERSION_META_STR + " " + \
10+
"") + "'"
11+
12+
# Build ecotone-scalar binary
13+
ecotone-scalar: (go_build "./bin/ecotone-scalar" "./cmd/ecotone-scalar" "-ldflags" _LDFLAGSSTRING)
14+
15+
# Build receipt-reference-builder binary
16+
receipt-reference-builder: (go_build "./bin/receipt-reference-builder" "./cmd/receipt-reference-builder" "-ldflags" _LDFLAGSSTRING)
17+
18+
# Run tests
19+
test: (go_test "./...")
20+
21+
# Build op-deployer binary
22+
op-deployer:
23+
just ../op-deployer/build
24+
mkdir -p ./bin && ln -f ../op-deployer/bin/op-deployer ./bin/op-deployer
25+
26+
# Run fuzzing tests
27+
[private]
28+
fuzz_task FUZZ TIME='10s': (go_fuzz FUZZ TIME "./crossdomain")
29+
30+
fuzz:
31+
printf "%s\n" \
32+
"FuzzEncodeDecodeWithdrawal" \
33+
"FuzzEncodeDecodeLegacyWithdrawal" \
34+
"FuzzAliasing" \
35+
"FuzzVersionedNonce" \
36+
| parallel -j {{PARALLEL_JOBS}} {{just_executable()}} fuzz_task {}
37+
38+
# Sync standard versions
39+
sync-standard-version:
40+
curl -Lo ./deployer/opcm/standard-versions-mainnet.toml https://raw.githubusercontent.com/ethereum-optimism/superchain-registry/refs/heads/main/validation/standard/standard-versions-mainnet.toml
41+
curl -Lo ./deployer/opcm/standard-versions-sepolia.toml https://raw.githubusercontent.com/ethereum-optimism/superchain-registry/refs/heads/main/validation/standard/standard-versions-sepolia.toml

‎op-challenger/Makefile‎

Lines changed: 2 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,3 @@
1-
GITCOMMIT ?= $(shell git rev-parse HEAD)
2-
GITDATE ?= $(shell git show -s --format='%ct')
3-
VERSION ?= v0.0.0
1+
DEPRECATED_TARGETS := op-challenger clean test fuzz visualize
42

5-
LDFLAGSSTRING +=-X main.GitCommit=$(GITCOMMIT)
6-
LDFLAGSSTRING +=-X main.GitDate=$(GITDATE)
7-
LDFLAGSSTRING +=-X github.com/ethereum-optimism/optimism/op-challenger/version.Version=$(VERSION)
8-
LDFLAGSSTRING +=-X github.com/ethereum-optimism/optimism/op-challenger/version.Meta=$(VERSION_META)
9-
LDFLAGS := -ldflags "$(LDFLAGSSTRING)"
10-
11-
# Use the old Apple linker to workaround broken xcode - https://github.com/golang/go/issues/65169
12-
ifeq ($(shell uname),Darwin)
13-
FUZZLDFLAGS := -ldflags=-extldflags=-Wl,-ld_classic
14-
endif
15-
16-
op-challenger:
17-
env GO111MODULE=on GOOS=$(TARGETOS) GOARCH=$(TARGETARCH) CGO_ENABLED=0 go build -v $(LDFLAGS) -o ./bin/op-challenger ./cmd
18-
19-
fuzz:
20-
go test $(FUZZLDFLAGS) -run NOTAREALTEST -v -fuzztime 10s -fuzz FuzzKeccak ./game/keccak/matrix
21-
22-
clean:
23-
rm bin/op-challenger
24-
25-
test:
26-
go test -v ./...
27-
28-
visualize:
29-
./scripts/visualize.sh
30-
31-
.PHONY: \
32-
op-challenger \
33-
clean \
34-
test \
35-
visualize
3+
include ../just/deprecated.mk

‎op-challenger/justfile‎

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
import '../just/go.just'
2+
3+
# Build ldflags string
4+
_VERSION_META_STR := if VERSION_META != "" { "+" + VERSION_META } else { "" }
5+
_LDFLAGSSTRING := "'" + trim(
6+
"-X main.GitCommit=" + GITCOMMIT + " " + \
7+
"-X main.GitDate=" + GITDATE + " " + \
8+
"-X github.com/ethereum-optimism/optimism/op-challenger/version.Version=" + VERSION + " " + \
9+
"-X github.com/ethereum-optimism/optimism/op-challenger/version.Meta=" + _VERSION_META_STR + " " + \
10+
"") + "'"
11+
12+
BINARY := "./bin/op-challenger"
13+
14+
# Build op-challenger binary
15+
op-challenger: (go_build BINARY "./cmd" "-ldflags" _LDFLAGSSTRING)
16+
17+
# Run fuzzing tests
18+
fuzz: (go_fuzz "FuzzKeccak" "10s" "./game/keccak/matrix")
19+
20+
# Clean build artifacts
21+
clean:
22+
rm -f {{BINARY}}
23+
24+
# Run tests
25+
test: (go_test "./...")

‎op-conductor/Makefile‎

Lines changed: 2 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,3 @@
1-
GITCOMMIT ?= $(shell git rev-parse HEAD)
2-
GITDATE ?= $(shell git show -s --format='%ct')
3-
VERSION ?= v0.0.0
1+
DEPRECATED_TARGETS := op-conductor clean test generate-mocks
42

5-
LDFLAGSSTRING +=-X main.GitCommit=$(GITCOMMIT)
6-
LDFLAGSSTRING +=-X main.GitDate=$(GITDATE)
7-
LDFLAGSSTRING +=-X main.Version=$(VERSION)
8-
LDFLAGS := -ldflags "$(LDFLAGSSTRING)"
9-
10-
op-conductor:
11-
env GO111MODULE=on GOOS=$(TARGETOS) GOARCH=$(TARGETARCH) CGO_ENABLED=0 go build -v $(LDFLAGS) -o ./bin/op-conductor ./cmd
12-
13-
clean:
14-
rm bin/op-conductor
15-
16-
test:
17-
go test -v ./...
18-
19-
generate-mocks:
20-
go generate ./...
21-
22-
.PHONY: \
23-
op-conductor \
24-
clean \
25-
test \
26-
generate-mocks
3+
include ../just/deprecated.mk

‎op-conductor/justfile‎

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
import '../just/go.just'
2+
3+
# Build ldflags string
4+
_LDFLAGSSTRING := "'" + trim(
5+
"-X main.GitCommit=" + GITCOMMIT + " " + \
6+
"-X main.GitDate=" + GITDATE + " " + \
7+
"-X main.Version=" + VERSION + " " + \
8+
"") + "'"
9+
10+
BINARY := "./bin/op-conductor"
11+
12+
# Build op-conductor binary
13+
op-conductor: (go_build BINARY "./cmd" "-ldflags" _LDFLAGSSTRING)
14+
15+
# Clean build artifacts
16+
clean:
17+
rm -f {{BINARY}}
18+
19+
# Run tests
20+
test: (go_test "./...")
21+
22+
# Generate mocks
23+
generate-mocks: (go_generate "./...")

‎op-dispute-mon/Makefile‎

Lines changed: 2 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,3 @@
1-
GITCOMMIT ?= $(shell git rev-parse HEAD)
2-
GITDATE ?= $(shell git show -s --format='%ct')
3-
VERSION ?= v0.0.0
1+
DEPRECATED_TARGETS := op-dispute-mon clean test
42

5-
LDFLAGSSTRING +=-X main.GitCommit=$(GITCOMMIT)
6-
LDFLAGSSTRING +=-X main.GitDate=$(GITDATE)
7-
LDFLAGSSTRING +=-X github.com/ethereum-optimism/optimism/op-dispute-mon/version.Version=$(VERSION)
8-
LDFLAGSSTRING +=-X github.com/ethereum-optimism/optimism/op-dispute-mon/version.Meta=$(VERSION_META)
9-
LDFLAGS := -ldflags "$(LDFLAGSSTRING)"
10-
11-
op-dispute-mon:
12-
env GO111MODULE=on GOOS=$(TARGETOS) GOARCH=$(TARGETARCH) CGO_ENABLED=0 go build -v $(LDFLAGS) -o ./bin/op-dispute-mon ./cmd
13-
.PHONY: op-dispute-mon
14-
15-
clean:
16-
rm bin/op-dispute-mon
17-
.PHONY: clean
18-
19-
test:
20-
go test -v ./...
21-
.PHONY: test
3+
include ../just/deprecated.mk

‎op-dispute-mon/justfile‎

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
import '../just/go.just'
2+
3+
# Build ldflags string
4+
_LDFLAGSSTRING := "'" + trim(
5+
"-X main.GitCommit=" + GITCOMMIT + " " + \
6+
"-X main.GitDate=" + GITDATE + " " + \
7+
"-X github.com/ethereum-optimism/optimism/op-dispute-mon/version.Version=" + VERSION + " " + \
8+
"-X github.com/ethereum-optimism/optimism/op-dispute-mon/version.Meta=" + VERSION_META + " " + \
9+
"") + "'"
10+
11+
BINARY := "./bin/op-dispute-mon"
12+
13+
# Build op-dispute-mon binary
14+
op-dispute-mon: (go_build BINARY "./cmd" "-ldflags" _LDFLAGSSTRING)
15+
16+
# Clean build artifacts
17+
clean:
18+
rm -f {{BINARY}}
19+
20+
# Run tests
21+
test: (go_test "./...")

0 commit comments

Comments
 (0)