diff --git a/.circleci/config.yml b/.circleci/config.yml index 594179f21..01e297072 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -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: @@ -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 @@ -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. @@ -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 @@ -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: @@ -219,7 +219,7 @@ jobs: build_shared_library: docker: - - image: cimg/rust:1.67.0 + - image: cimg/rust:1.70.0 steps: - checkout - run: @@ -227,8 +227,8 @@ jobs: 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 @@ -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: diff --git a/Makefile b/Makefile index 8c4b23ee8..fefe0a454 100644 --- a/Makefile +++ b/Makefile @@ -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) diff --git a/builders/Dockerfile.alpine b/builders/Dockerfile.alpine index 8ba3cbb8b..f06f4bfb2 100644 --- a/builders/Dockerfile.alpine +++ b/builders/Dockerfile.alpine @@ -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 diff --git a/builders/Dockerfile.centos7 b/builders/Dockerfile.centos7 index c95318092..f6ba4250b 100644 --- a/builders/Dockerfile.centos7 +++ b/builders/Dockerfile.centos7 @@ -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 \ diff --git a/builders/Dockerfile.cross b/builders/Dockerfile.cross index bcabb747a..72b094e78 100644 --- a/builders/Dockerfile.cross +++ b/builders/Dockerfile.cross @@ -1,4 +1,4 @@ -FROM rust:1.69.0-bullseye +FROM rust:1.70.0-bullseye # Install build dependencies RUN apt-get update \ diff --git a/builders/Makefile b/builders/Makefile index 3d18e0d31..6e6e25ef1 100644 --- a/builders/Makefile +++ b/builders/Makefile @@ -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: diff --git a/builders/README.md b/builders/README.md index 4a568eef6..ae0452232 100644 --- a/builders/README.md +++ b/builders/README.md @@ -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. diff --git a/builders/guest/build_macos_native.sh b/builders/guest/build_macos_native.sh new file mode 100755 index 000000000..67c003369 --- /dev/null +++ b/builders/guest/build_macos_native.sh @@ -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 diff --git a/docs/COMPILER_VERSIONS.md b/docs/COMPILER_VERSIONS.md index 785053066..9be7e28d5 100644 --- a/docs/COMPILER_VERSIONS.md +++ b/docs/COMPILER_VERSIONS.md @@ -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 | | diff --git a/libwasmvm/Cargo.lock b/libwasmvm/Cargo.lock index c6a40e34b..682a5cf0c 100644 --- a/libwasmvm/Cargo.lock +++ b/libwasmvm/Cargo.lock @@ -223,9 +223,9 @@ dependencies = [ [[package]] name = "clru" -version = "0.4.0" +version = "0.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "591ff76ca0691bd91c1b0b5b987e5cf93b21ec810ad96665c5a569c60846dd93" +checksum = "b8191fa7302e03607ff0e237d4246cc043ff5b3cb9409d995172ba3bea16b807" [[package]] name = "const-oid" @@ -249,9 +249,10 @@ dependencies = [ [[package]] name = "cosmwasm-crypto" version = "1.4.0" -source = "git+https://github.com/CosmWasm/cosmwasm.git?rev=v1.4.0#f11b456d46073d0324d9e39ed617f7fcfdbe1b06" +source = "git+https://github.com/CosmWasm/cosmwasm.git?branch=upgrade-wasmer#592ce72652d784c840596f92aaadeebc6770e0c6" dependencies = [ "digest 0.10.7", + "ecdsa", "ed25519-zebra", "k256", "rand_core 0.6.4", @@ -261,7 +262,7 @@ dependencies = [ [[package]] name = "cosmwasm-derive" version = "1.4.0" -source = "git+https://github.com/CosmWasm/cosmwasm.git?rev=v1.4.0#f11b456d46073d0324d9e39ed617f7fcfdbe1b06" +source = "git+https://github.com/CosmWasm/cosmwasm.git?branch=upgrade-wasmer#592ce72652d784c840596f92aaadeebc6770e0c6" dependencies = [ "syn 1.0.109", ] @@ -269,7 +270,7 @@ dependencies = [ [[package]] name = "cosmwasm-std" version = "1.4.0" -source = "git+https://github.com/CosmWasm/cosmwasm.git?rev=v1.4.0#f11b456d46073d0324d9e39ed617f7fcfdbe1b06" +source = "git+https://github.com/CosmWasm/cosmwasm.git?branch=upgrade-wasmer#592ce72652d784c840596f92aaadeebc6770e0c6" dependencies = [ "base64", "bnum", @@ -282,13 +283,14 @@ dependencies = [ "serde", "serde-json-wasm", "sha2 0.10.7", + "static_assertions", "thiserror", ] [[package]] name = "cosmwasm-vm" version = "1.4.0" -source = "git+https://github.com/CosmWasm/cosmwasm.git?rev=v1.4.0#f11b456d46073d0324d9e39ed617f7fcfdbe1b06" +source = "git+https://github.com/CosmWasm/cosmwasm.git?branch=upgrade-wasmer#592ce72652d784c840596f92aaadeebc6770e0c6" dependencies = [ "bitflags", "bytecheck", @@ -444,6 +446,16 @@ dependencies = [ "scopeguard", ] +[[package]] +name = "crossbeam-queue" +version = "0.3.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d1cfb3ea8a53f37c40dea2c7bedcbd88bdfae54f5e2175d6ecaff1c988353add" +dependencies = [ + "cfg-if", + "crossbeam-utils", +] + [[package]] name = "crossbeam-utils" version = "0.8.16" @@ -612,7 +624,7 @@ checksum = "64fba5a42bd76a17cad4bfa00de168ee1cbfa06a5e8ce992ae880218c05641a9" dependencies = [ "byteorder", "dynasm", - "memmap2", + "memmap2 0.5.10", ] [[package]] @@ -1052,6 +1064,15 @@ dependencies = [ "libc", ] +[[package]] +name = "memmap2" +version = "0.6.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6d28bba84adfe6646737845bc5ebbfa2c08424eb1c37e94a1fd2a82adb56a872" +dependencies = [ + "libc", +] + [[package]] name = "memoffset" version = "0.8.0" @@ -1419,6 +1440,12 @@ dependencies = [ "zeroize", ] +[[package]] +name = "self_cell" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4c309e515543e67811222dbc9e3dd7e1056279b782e1dacffe4242b718734fb6" + [[package]] name = "serde" version = "1.0.188" @@ -1505,6 +1532,16 @@ dependencies = [ "digest 0.10.7", ] +[[package]] +name = "shared-buffer" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2cf61602ee61e2f83dd016b3e6387245291cf728ea071c378b35088125b4d995" +dependencies = [ + "bytes", + "memmap2 0.6.2", +] + [[package]] name = "signature" version = "2.1.0" @@ -1549,6 +1586,12 @@ version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a8f112729512f8e442d81f95a8a7ddf2b7c6b8a1a6f509a95864142b30cab2d3" +[[package]] +name = "static_assertions" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f" + [[package]] name = "strsim" version = "0.10.0" @@ -1863,9 +1906,9 @@ checksum = "ca6ad05a4870b2bf5fe995117d3728437bd27d7cd5f06f13c17443ef369775a1" [[package]] name = "wasmer" -version = "4.1.2" +version = "4.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fc7142dbb91ede83cc0aef2301fa75fcc7e0c9e5a7d5358e3c4f3a7249fe9ce8" +checksum = "0e626f958755a90a6552b9528f59b58a62ae288e6c17fcf40e99495bc33c60f0" dependencies = [ "bytes", "cfg-if", @@ -1876,6 +1919,7 @@ dependencies = [ "rustc-demangle", "serde", "serde-wasm-bindgen", + "shared-buffer", "target-lexicon", "thiserror", "wasm-bindgen", @@ -1891,19 +1935,23 @@ dependencies = [ [[package]] name = "wasmer-compiler" -version = "4.1.2" +version = "4.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e5b99c70711ec7631b602a9fc95577c40df21e8f3916159c9d80c3fb4f77abdc" +checksum = "848e1922694cf97f4df680a0534c9d72c836378b5eb2313c1708fe1a75b40044" dependencies = [ "backtrace", + "bytes", "cfg-if", "enum-iterator", "enumset", "lazy_static", "leb128", - "memmap2", + "memmap2 0.5.10", "more-asserts", "region", + "rkyv", + "self_cell", + "shared-buffer", "smallvec", "thiserror", "wasmer-types", @@ -1914,9 +1962,9 @@ dependencies = [ [[package]] name = "wasmer-compiler-cranelift" -version = "4.1.2" +version = "4.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "52aef2ef35513a04fed54de9a7dc9c469d4742a5c2e378a5f7e2a79b1327e3bd" +checksum = "3d96bce6fad15a954edcfc2749b59e47ea7de524b6ef3df392035636491a40b4" dependencies = [ "cranelift-codegen", "cranelift-entity", @@ -1933,9 +1981,9 @@ dependencies = [ [[package]] name = "wasmer-compiler-singlepass" -version = "4.1.2" +version = "4.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ebfd019aa98b19fea0fb1d8db9b539145c9416d183ce4cda4e8e024b2c890aac" +checksum = "ebaa865b40ffb3351b03dab9fe9930a5248c25daebd55b464b79b862d9b55ccd" dependencies = [ "byteorder", "dynasm", @@ -1952,9 +2000,9 @@ dependencies = [ [[package]] name = "wasmer-derive" -version = "4.1.2" +version = "4.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "25bb1425c9e4dc3e2d3aacd6e82e22e27a3127379e0d09bcbdf25ff376229162" +checksum = "7f08f80d166a9279671b7af7a09409c28ede2e0b4e3acabbf0e3cb22c8038ba7" dependencies = [ "proc-macro-error", "proc-macro2", @@ -1964,9 +2012,9 @@ dependencies = [ [[package]] name = "wasmer-middlewares" -version = "4.1.2" +version = "4.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "acfc08fb8e2e1511f1d69302d7406ace6c0ec0c90e103f8c0a5aa81ecb9fe81f" +checksum = "eeb4b87c0ea9f8636c81a8ab8f52bad01c8623c9fcbb3db5f367d5f157fada30" dependencies = [ "wasmer", "wasmer-types", @@ -1975,9 +2023,9 @@ dependencies = [ [[package]] name = "wasmer-types" -version = "4.1.2" +version = "4.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d7e32ed799fa8c0d96ca9615d9ea8006857a0f0c18e7c2ed8082bd5c63a9ea70" +checksum = "ae2c892882f0b416783fb4310e5697f5c30587f6f9555f9d4f2be85ab39d5d3d" dependencies = [ "bytecheck", "enum-iterator", @@ -1991,14 +2039,15 @@ dependencies = [ [[package]] name = "wasmer-vm" -version = "4.1.2" +version = "4.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0847513cb176b5d62a6f65d6ae474594935e726a10e9e3387177d9cbf8b8cda0" +checksum = "7c0a9a57b627fb39e5a491058d4365f099bc9b140031c000fded24a3306d9480" dependencies = [ "backtrace", "cc", "cfg-if", "corosensei", + "crossbeam-queue", "dashmap", "derivative", "enum-iterator", diff --git a/libwasmvm/Cargo.toml b/libwasmvm/Cargo.toml index f3dab36ba..6635bfb75 100644 --- a/libwasmvm/Cargo.toml +++ b/libwasmvm/Cargo.toml @@ -26,8 +26,8 @@ default = [] backtraces = [] [dependencies] -cosmwasm-std = { git = "https://github.com/CosmWasm/cosmwasm.git", rev = "v1.4.0", features = ["staking", "stargate", "iterator"] } -cosmwasm-vm = { git = "https://github.com/CosmWasm/cosmwasm.git", rev = "v1.4.0", features = ["staking", "stargate", "iterator"] } +cosmwasm-std = { git = "https://github.com/CosmWasm/cosmwasm.git", branch = "upgrade-wasmer", features = ["staking", "stargate", "iterator"] } +cosmwasm-vm = { git = "https://github.com/CosmWasm/cosmwasm.git", branch = "upgrade-wasmer", features = ["staking", "stargate", "iterator"] } errno = "0.2" serde_json = "1.0.91" thiserror = "1.0.38"