Skip to content

Commit

Permalink
Remove reproducible builder image (#7484)
Browse files Browse the repository at this point in the history
The image has been moved to gh/tendemrint/images.
  • Loading branch information
Alessio Treglia authored Oct 8, 2020
1 parent c39dd9e commit 1671c87
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 123 deletions.
8 changes: 4 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -110,10 +110,10 @@ $(BUILDDIR)/:
mkdir -p $(BUILDDIR)/

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

build-simd-linux: go.sum $(BUILDDIR)/
$(if $(shell docker inspect -f '{{ .Id }}' cosmossdk/rbuilder 2>/dev/null),$(info found image cosmossdk/rbuilder),docker pull cosmossdk/rbuilder:latest)
docker pull cosmossdk/rbuilder:latest
docker rm latest-build || true
docker run --volume=$(CURDIR):/sources:ro \
--env TARGET_OS='linux' \
--env TARGET_PLATFORMS='linux/amd64' \
--env APP=simd \
--env VERSION=$(VERSION) \
--env COMMIT=$(COMMIT) \
Expand Down
37 changes: 21 additions & 16 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,22 +18,27 @@ set -ue
# - OUTDIR

# Build for each os-architecture pair
for os in ${TARGET_OS} ; do
archs="`f_build_archs ${os}`"
exe_file_extension="`f_binary_file_ext ${os}`"
for arch in ${archs} ; do
make clean
GOOS="${os}" GOARCH="${arch}" GOROOT_FINAL="$(go env GOROOT)" \
make build \
LDFLAGS=-buildid=${VERSION} \
VERSION=${VERSION} \
COMMIT=${COMMIT} \
LEDGER_ENABLED=${LEDGER_ENABLED}
mv ./build/${APP}${exe_file_extension} ${OUTDIR}/${APP}-${VERSION}-${os}-${arch}${exe_file_extension}
done
unset exe_file_extension
for platform in ${TARGET_PLATFORMS} ; do
# This function sets GOOS, GOARCH, and OS_FILE_EXT environment variables
# according to the build target platform. OS_FILE_EXT is empty in all
# cases except when the target platform is 'windows'.
setup_build_env_for_platform "${platform}"

make clean
echo Building for $(go env GOOS)/$(go env GOARCH) >&2
GOROOT_FINAL="$(go env GOROOT)" \
make build \
LDFLAGS=-buildid=${VERSION} \
VERSION=${VERSION} \
COMMIT=${COMMIT} \
LEDGER_ENABLED=${LEDGER_ENABLED}
mv ./build/${APP}${OS_FILE_EXT} ${OUTDIR}/${APP}-${VERSION}-$(go env GOOS)-$(go env GOARCH)${OS_FILE_EXT}

# This function restore the build environment variables to their
# original state.
restore_build_env
done

# Generate and display build report
f_generate_build_report ${OUTDIR}
# Generate and display build report.
generate_build_report
cat ${OUTDIR}/build_report
5 changes: 1 addition & 4 deletions contrib/images/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,4 @@ all: simd-env
simd-env:
docker build --build-arg UID=$(shell id -u) --build-arg GID=$(shell id -g) --tag cosmossdk/simd-env simd-env

rbuilder:
docker build --tag cosmossdk/rbuilder rbuilder

.PHONY: all simd-env rbuilder
.PHONY: all simd-env
19 changes: 0 additions & 19 deletions contrib/images/rbuilder/Dockerfile

This file was deleted.

80 changes: 0 additions & 80 deletions contrib/images/rbuilder/buildlib.sh

This file was deleted.

0 comments on commit 1671c87

Please sign in to comment.