Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade wasmer #458

Closed
wants to merge 8 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 12 additions & 12 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ jobs:
# All checks on the codebase that can run in parallel to build_shared_library
libwasmvm_sanity:
docker:
- image: cimg/rust:1.67.0
- image: cimg/rust:1.70.0
steps:
- checkout
- run:
Expand All @@ -18,8 +18,8 @@ jobs:
command: rustup component add clippy rustfmt
- restore_cache:
keys:
- cargocache-v3-libwasmvm_sanity-rust:1.67.0-{{ checksum "libwasmvm/Cargo.lock" }}
- cargocache-v3-libwasmvm_sanity-rust:1.67.0-
- cargocache-v3-libwasmvm_sanity-rust:1.70.0-{{ checksum "libwasmvm/Cargo.lock" }}
- cargocache-v3-libwasmvm_sanity-rust:1.70.0-
- run:
name: Ensure libwasmvm/bindings.h is up-to-date
working_directory: libwasmvm
Expand Down Expand Up @@ -66,7 +66,7 @@ jobs:
- libwasmvm/target/release/.fingerprint
- libwasmvm/target/release/build
- libwasmvm/target/release/deps
key: cargocache-v3-libwasmvm_sanity-rust:1.67.0-{{ checksum "libwasmvm/Cargo.lock" }}
key: cargocache-v3-libwasmvm_sanity-rust:1.70.0-{{ checksum "libwasmvm/Cargo.lock" }}

# This performs all the Rust debug builds on Windows. Similar to libwasmvm_sanity
# but avoids duplicating things that are not platform dependent.
Expand All @@ -84,15 +84,15 @@ jobs:
command: |
set -o errexit
curl -sS --output rustup-init.exe https://static.rust-lang.org/rustup/dist/x86_64-pc-windows-msvc/rustup-init.exe
./rustup-init.exe --no-modify-path --profile minimal --default-toolchain 1.67.0 -y
./rustup-init.exe --no-modify-path --profile minimal --default-toolchain 1.70.0 -y
echo 'export PATH="$PATH;$USERPROFILE/.cargo/bin"' >> "$BASH_ENV"
- run:
name: Show Rust version information
command: rustc --version; cargo --version; rustup --version
- restore_cache:
keys:
- cachev4-libwasmvm_sanity_windows-rust:1.67.0-{{ checksum "libwasmvm/Cargo.lock" }}
- cachev4-libwasmvm_sanity_windows-rust:1.67.0-
- cachev4-libwasmvm_sanity_windows-rust:1.70.0-{{ checksum "libwasmvm/Cargo.lock" }}
- cachev4-libwasmvm_sanity_windows-rust:1.70.0-
- run:
name: Run unit tests
working_directory: libwasmvm
Expand All @@ -104,7 +104,7 @@ jobs:
- libwasmvm/target/debug/.fingerprint
- libwasmvm/target/debug/build
- libwasmvm/target/debug/deps
key: cachev4-libwasmvm_sanity_windows-rust:1.67.0-{{ checksum "libwasmvm/Cargo.lock" }}
key: cachev4-libwasmvm_sanity_windows-rust:1.70.0-{{ checksum "libwasmvm/Cargo.lock" }}

libwasmvm_audit:
docker:
Expand Down Expand Up @@ -219,16 +219,16 @@ jobs:

build_shared_library:
docker:
- image: cimg/rust:1.67.0
- image: cimg/rust:1.70.0
steps:
- checkout
- run:
name: Show version information
command: rustc --version; cargo --version; rustup --version
- restore_cache:
keys:
- cargocache-v3-build_shared_library-rust:1.67.0-{{ checksum "libwasmvm/Cargo.lock" }}
- cargocache-v3-build_shared_library-rust:1.67.0-
- cargocache-v3-build_shared_library-rust:1.70.0-{{ checksum "libwasmvm/Cargo.lock" }}
- cargocache-v3-build_shared_library-rust:1.70.0-
- run:
name: Create release build of libwasmvm
command: make build-rust
Expand All @@ -245,7 +245,7 @@ jobs:
- libwasmvm/target/release/.fingerprint
- libwasmvm/target/release/build
- libwasmvm/target/release/deps
key: cargocache-v3-build_shared_library-rust:1.67.0-{{ checksum "libwasmvm/Cargo.lock" }}
key: cargocache-v3-build_shared_library-rust:1.70.0-{{ checksum "libwasmvm/Cargo.lock" }}

# Test the Go project
wasmvm_test:
Expand Down
8 changes: 8 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,14 @@ release-build-macos-static:
cp libwasmvm/artifacts/libwasmvmstatic_darwin.a internal/api/libwasmvmstatic_darwin.a
make update-bindings

# Creates a release build in a native MacOS build environment, of the shared library for macOS (.dylib)
release-build-macos-native:
rm -rf libwasmvm/target/x86_64-apple-darwin/release
rm -rf libwasmvm/target/aarch64-apple-darwin/release
(cd libwasmvm && ../builders/guest/build_macos_native.sh)
cp libwasmvm/artifacts/libwasmvm.dylib internal/api
make update-bindings

# Creates a release build in a containerized build environment of the shared library for Windows (.dll)
release-build-windows:
# Builders should not write their target folder into the host file system (https://github.com/CosmWasm/wasmvm/issues/437)
Expand Down
2 changes: 1 addition & 1 deletion builders/Dockerfile.alpine
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ RUN set -eux \

RUN wget "https://static.rust-lang.org/rustup/dist/x86_64-unknown-linux-musl/rustup-init" \
&& chmod +x rustup-init \
&& ./rustup-init -y --no-modify-path --profile minimal --default-toolchain 1.69.0 \
&& ./rustup-init -y --no-modify-path --profile minimal --default-toolchain 1.70.0 \
&& rm rustup-init \
&& chmod -R a+w $RUSTUP_HOME $CARGO_HOME

Expand Down
2 changes: 1 addition & 1 deletion builders/Dockerfile.centos7
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ ENV RUSTUP_HOME=/usr/local/rustup \

RUN wget "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.69.0 \
&& ./rustup-init -y --no-modify-path --profile minimal --default-toolchain 1.70.0 \
&& rm rustup-init \
&& chmod -R a+w $RUSTUP_HOME $CARGO_HOME \
&& rustup --version \
Expand Down
2 changes: 1 addition & 1 deletion builders/Dockerfile.cross
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM rust:1.69.0-bullseye
FROM rust:1.70.0-bullseye

# Install build dependencies
RUN apt-get update \
Expand Down
2 changes: 1 addition & 1 deletion builders/Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Versioned by a simple counter that is not bound to a specific CosmWasm version
# See builders/README.md
BUILDERS_PREFIX := cosmwasm/go-ext-builder:0016
BUILDERS_PREFIX := cosmwasm/go-ext-builder:0017

.PHONY: docker-image-centos7
docker-image-centos7:
Expand Down
4 changes: 4 additions & 0 deletions builders/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@ any machine that can run Docker can do the cross-compilation.

## Changelog

**Version 0017:**

- Update Rust to 1.70.0.

**Version 0016:**

- Update Rust to 1.69.0.
Expand Down
24 changes: 24 additions & 0 deletions builders/guest/build_macos_native.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
#!/bin/bash
set -o errexit -o nounset -o pipefail

# ref: https://wapl.es/rust/2019/02/17/rust-cross-compile-linux-to-macos.html
#export PATH="/opt/osxcross/target/bin:$PATH"
export LIBZ_SYS_STATIC=1

# See https://github.com/CosmWasm/wasmvm/issues/222#issuecomment-880616953 for two approaches to
# enable stripping through cargo (if that is desired).

echo "Starting aarch64-apple-darwin build"
export CC=aarch64-apple-darwin20.4-clang
export CXX=aarch64-apple-darwin20.4-clang++
cargo build --release --target aarch64-apple-darwin

echo "Starting x86_64-apple-darwin build"
export CC=o64-clang
export CXX=o64-clang++
cargo build --release --target x86_64-apple-darwin

# Create a universal library with both archs
lipo -output artifacts/libwasmvm.dylib -create \
target/x86_64-apple-darwin/release/deps/libwasmvm.dylib \
target/aarch64-apple-darwin/release/deps/libwasmvm.dylib
6 changes: 3 additions & 3 deletions docs/COMPILER_VERSIONS.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,6 @@ We currently use the following version:

| Type | Rust version | Note |
| ------------------------ | ------------ | --------------------------------- |
| Production Rust compiler | 1.69.0 | Builders version 0016 |
| Min Rust compiler | 1.67.0 | Supports builder versions >= 0015 |
| Tooling Rust compiler | 1.69.0 | |
| Production Rust compiler | 1.70.0 | Builders version 0017 |
| Min Rust compiler | 1.70.0 | Supports builder versions >= 0017 |
| Tooling Rust compiler | 1.70.0 | |
Loading