Skip to content

Commit 1671c87

Browse files
author
Alessio Treglia
authored
Remove reproducible builder image (#7484)
The image has been moved to gh/tendemrint/images.
1 parent c39dd9e commit 1671c87

File tree

5 files changed

+26
-123
lines changed

5 files changed

+26
-123
lines changed

Makefile

+4-4
Original file line numberDiff line numberDiff line change
@@ -110,10 +110,10 @@ $(BUILDDIR)/:
110110
mkdir -p $(BUILDDIR)/
111111

112112
build-simd-all: go.sum
113-
$(if $(shell docker inspect -f '{{ .Id }}' cosmossdk/rbuilder 2>/dev/null),$(info found image cosmossdk/rbuilder),docker pull cosmossdk/rbuilder:latest)
113+
docker pull cosmossdk/rbuilder:latest
114114
docker rm latest-build || true
115115
docker run --volume=$(CURDIR):/sources:ro \
116-
--env TARGET_OS='darwin linux windows' \
116+
--env TARGET_PLATFORMS='linux/amd64 darwin/amd64 linux/arm64 windows/amd64' \
117117
--env APP=simd \
118118
--env VERSION=$(VERSION) \
119119
--env COMMIT=$(COMMIT) \
@@ -122,10 +122,10 @@ build-simd-all: go.sum
122122
docker cp -a latest-build:/home/builder/artifacts/ $(CURDIR)/
123123

124124
build-simd-linux: go.sum $(BUILDDIR)/
125-
$(if $(shell docker inspect -f '{{ .Id }}' cosmossdk/rbuilder 2>/dev/null),$(info found image cosmossdk/rbuilder),docker pull cosmossdk/rbuilder:latest)
125+
docker pull cosmossdk/rbuilder:latest
126126
docker rm latest-build || true
127127
docker run --volume=$(CURDIR):/sources:ro \
128-
--env TARGET_OS='linux' \
128+
--env TARGET_PLATFORMS='linux/amd64' \
129129
--env APP=simd \
130130
--env VERSION=$(VERSION) \
131131
--env COMMIT=$(COMMIT) \

build.sh

+21-16
Original file line numberDiff line numberDiff line change
@@ -18,22 +18,27 @@ set -ue
1818
# - OUTDIR
1919

2020
# Build for each os-architecture pair
21-
for os in ${TARGET_OS} ; do
22-
archs="`f_build_archs ${os}`"
23-
exe_file_extension="`f_binary_file_ext ${os}`"
24-
for arch in ${archs} ; do
25-
make clean
26-
GOOS="${os}" GOARCH="${arch}" GOROOT_FINAL="$(go env GOROOT)" \
27-
make build \
28-
LDFLAGS=-buildid=${VERSION} \
29-
VERSION=${VERSION} \
30-
COMMIT=${COMMIT} \
31-
LEDGER_ENABLED=${LEDGER_ENABLED}
32-
mv ./build/${APP}${exe_file_extension} ${OUTDIR}/${APP}-${VERSION}-${os}-${arch}${exe_file_extension}
33-
done
34-
unset exe_file_extension
21+
for platform in ${TARGET_PLATFORMS} ; do
22+
# This function sets GOOS, GOARCH, and OS_FILE_EXT environment variables
23+
# according to the build target platform. OS_FILE_EXT is empty in all
24+
# cases except when the target platform is 'windows'.
25+
setup_build_env_for_platform "${platform}"
26+
27+
make clean
28+
echo Building for $(go env GOOS)/$(go env GOARCH) >&2
29+
GOROOT_FINAL="$(go env GOROOT)" \
30+
make build \
31+
LDFLAGS=-buildid=${VERSION} \
32+
VERSION=${VERSION} \
33+
COMMIT=${COMMIT} \
34+
LEDGER_ENABLED=${LEDGER_ENABLED}
35+
mv ./build/${APP}${OS_FILE_EXT} ${OUTDIR}/${APP}-${VERSION}-$(go env GOOS)-$(go env GOARCH)${OS_FILE_EXT}
36+
37+
# This function restore the build environment variables to their
38+
# original state.
39+
restore_build_env
3540
done
3641

37-
# Generate and display build report
38-
f_generate_build_report ${OUTDIR}
42+
# Generate and display build report.
43+
generate_build_report
3944
cat ${OUTDIR}/build_report

contrib/images/Makefile

+1-4
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,4 @@ all: simd-env
33
simd-env:
44
docker build --build-arg UID=$(shell id -u) --build-arg GID=$(shell id -g) --tag cosmossdk/simd-env simd-env
55

6-
rbuilder:
7-
docker build --tag cosmossdk/rbuilder rbuilder
8-
9-
.PHONY: all simd-env rbuilder
6+
.PHONY: all simd-env

contrib/images/rbuilder/Dockerfile

-19
This file was deleted.

contrib/images/rbuilder/buildlib.sh

-80
This file was deleted.

0 commit comments

Comments
 (0)