Skip to content

Commit

Permalink
fix: builders (#159)
Browse files Browse the repository at this point in the history
* fix cosmos messages

* fix debian build

* rollback shared libraries

* remove redundant line
  • Loading branch information
beer-1 authored Oct 31, 2024
1 parent 6ebb22a commit e959648
Show file tree
Hide file tree
Showing 5 changed files with 73 additions and 98 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ release-build-linux:
rm -rf target/release
docker run --rm -u $(USER_ID):$(USER_GROUP) \
-v $(shell pwd):/code/ \
$(BUILDERS_PREFIX)-centos7
$(BUILDERS_PREFIX)-debian
cp artifacts/libmovevm.x86_64.so api
cp artifacts/libmovevm.aarch64.so api
cp artifacts/libcompiler.x86_64.so api
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ Requires **Rust 1.80+ and Go 1.22+.**

The Rust implementation of the VM is compiled to a library called libmovevm. This is then linked to the Go code when the final binary is built. For that reason not all systems supported by Go are supported by this project.

Linux (tested on CentOS7 and Alpine) and macOS are supported.
Linux (tested on Ubuntu, Debian, and Alpine) and macOS are supported.

### Builds of libmovevm

Expand Down
91 changes: 0 additions & 91 deletions builders/Dockerfile.centos7

This file was deleted.

66 changes: 66 additions & 0 deletions builders/Dockerfile.debian
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
# Use a debian version that is old enough to lead to a low
# glibc requirement of builds.
# Debian 11 "Bullseye" has long-term support until August 31st, 2026
FROM --platform=linux/amd64 debian:11-slim

RUN apt update -y \
&& apt install -y gcc make gcc-aarch64-linux-gnu binutils-aarch64-linux-gnu wget perl

# GET FROM https://github.com/rust-lang/docker-rust-nightly
ENV RUSTUP_HOME=/usr/local/rustup \
CARGO_HOME=/usr/local/cargo \
PATH=/usr/local/cargo/bin:$PATH

RUN wget --no-verbose "https://static.rust-lang.org/rustup/dist/x86_64-unknown-linux-gnu/rustup-init" \
&& chmod +x rustup-init \
&& ./rustup-init -y --no-modify-path --profile minimal --default-toolchain 1.80.1 \
&& rm rustup-init \
&& chmod -R a+w $RUSTUP_HOME $CARGO_HOME \
&& rustup --version \
&& cargo --version \
&& rustc --version \
&& chmod -R 777 /usr/local/cargo \
&& rustup target add aarch64-unknown-linux-gnu

## COPY BUILD SCRIPTS

WORKDIR /code

COPY guest/*.sh /opt/
RUN chmod +x /opt/*.sh

RUN mkdir /.cargo
RUN chmod +rx /.cargo
COPY guest/cargo-config /.cargo/config

#############
## OPENSSL ##
#############

RUN wget "https://www.openssl.org/source/openssl-1.1.1k.tar.gz"

# Install openssl for x86_64. This is required by Move
RUN tar -zxvf ./openssl-1.1.1k.tar.gz \
&& cd openssl-1.1.1k \
&& INSTALL_DIR="/opt/x86_64-openssl" \
&& ./Configure linux-x86_64 --prefix="$INSTALL_DIR" threads no-shared \
&& make -j$(nproc) \
&& make install_sw \
&& cd .. \
&& rm -rf ./openssl-1.1.1k

# Install openssl for cross-compilation. This is required by Move
RUN tar -zxvf ./openssl-1.1.1k.tar.gz \
&& cd openssl-1.1.1k \
&& INSTALL_DIR="/opt/aarch64-openssl" \
&& ./Configure linux-aarch64 --cross-compile-prefix=aarch64-linux-gnu- --prefix="$INSTALL_DIR" threads no-shared \
&& make -j$(nproc) \
&& make install_sw \
&& cd .. \
&& rm -rf ./openssl-1.1.1k

RUN rm ./openssl-1.1.1k.tar.gz

WORKDIR /code

CMD ["/opt/build_linux.sh"]
10 changes: 5 additions & 5 deletions builders/Makefile
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
BUILDERS_PREFIX := initia/go-ext-builder:0001

.PHONY: docker-image-centos7
docker-image-centos7:
docker build --pull . -t $(BUILDERS_PREFIX)-centos7 -f ./Dockerfile.centos7
.PHONY: docker-image-debian
docker-image-debian:
docker build --pull . -t $(BUILDERS_PREFIX)-debian -f ./Dockerfile.debian

.PHONY: docker-image-cross
docker-image-cross:
Expand All @@ -13,10 +13,10 @@ docker-image-alpine:
docker build --pull . -t $(BUILDERS_PREFIX)-alpine -f ./Dockerfile.alpine

.PHONY: docker-images
docker-images: docker-image-centos7 docker-image-cross docker-image-alpine
docker-images: docker-image-debian docker-image-cross docker-image-alpine

.PHONY: docker-publish
docker-publish: docker-images
docker push $(BUILDERS_PREFIX)-cross
docker push $(BUILDERS_PREFIX)-centos7
docker push $(BUILDERS_PREFIX)-debian
docker push $(BUILDERS_PREFIX)-alpine

0 comments on commit e959648

Please sign in to comment.