From a42cd96da808fe38027e3fa9cc47480cf5362c07 Mon Sep 17 00:00:00 2001 From: ptitSeb Date: Fri, 24 Mar 2023 10:31:32 +0100 Subject: [PATCH 01/42] [CI] Add RISCV in test and build --- .github/cross-linux-riscv64/Dockerfile | 11 ++++ .github/workflows/build.yml | 76 +++++++++++++++++++++++++- .github/workflows/test.yaml | 69 ++++++++++++++++++++++- Makefile | 2 +- 4 files changed, 154 insertions(+), 4 deletions(-) create mode 100644 .github/cross-linux-riscv64/Dockerfile diff --git a/.github/cross-linux-riscv64/Dockerfile b/.github/cross-linux-riscv64/Dockerfile new file mode 100644 index 00000000000..303d1bc2844 --- /dev/null +++ b/.github/cross-linux-riscv64/Dockerfile @@ -0,0 +1,11 @@ +FROM rust:1 +#FROM ghcr.io/cross-rs/riscv64-unknown-linux-gnu:edge + +# set CROSS_DOCKER_IN_DOCKER to inform `cross` that it is executed from within a container +ENV CROSS_DOCKER_IN_DOCKER=true + +RUN cargo install cross +RUN dpkg --add-architecture riscv64 && \ + apt-get update && \ + apt-get install -qy curl && \ + curl -sSL https://get.docker.com/ | sh \ No newline at end of file diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 493d748364c..a70b805ae19 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -405,8 +405,73 @@ jobs: if-no-files-found: error retention-days: 2 + linux_riscv64: + name: Linux riscv64 + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: dtolnay/rust-toolchain@stable + with: + target: riscv64gc-unknown-linux-gnu + - name: Build cross image + run: | + docker build -t wasmer/riscv64 ${GITHUB_WORKSPACE}/.github/cross-linux-riscv64/ + env: + CROSS_DOCKER_IN_DOCKER: true + - name: Build Wasmer binary + run: | + make build-wasmer + env: + CARGO_BINARY: docker run -v /var/run/docker.sock:/var/run/docker.sock -v ${GITHUB_WORKSPACE}:/project -w /project wasmer/riscv64 cross + CROSS_DOCKER_IN_DOCKER: true + CARGO_TARGET: riscv64gc-unknown-linux-gnu + PKG_CONFIG_PATH: /usr/lib/riscv64-linux-gnu/pkgconfig + PKG_CONFIG_ALLOW_CROSS: true + ENABLE_LLVM: 0 + - name: Build C API headless + shell: bash + run: | + make package-capi-headless + env: + CARGO_BINARY: docker run -v /var/run/docker.sock:/var/run/docker.sock -v ${GITHUB_WORKSPACE}:/project -w /project wasmer/riscv64 cross + CROSS_DOCKER_IN_DOCKER: true + CARGO_TARGET: riscv64gc-unknown-linux-gnu + PKG_CONFIG_PATH: /usr/lib/riscv64-linux-gnu/pkgconfig + PKG_CONFIG_ALLOW_CROSS: true + ENABLE_LLVM: 0 + TARGET: riscv64gc-unknown-linux-gnu + TARGET_DIR: target/riscv64gc-unknown-linux-gnu/release + - name: Build C API + run: | + make build-capi + env: + CARGO_BINARY: docker run -v /var/run/docker.sock:/var/run/docker.sock -v ${GITHUB_WORKSPACE}:/project -w /project wasmer/riscv64 cross + CROSS_DOCKER_IN_DOCKER: true + CARGO_TARGET: riscv64gc-unknown-linux-gnu + PKG_CONFIG_PATH: /usr/lib/riscv64-linux-gnu/pkgconfig + PKG_CONFIG_ALLOW_CROSS: true + ENABLE_LLVM: 0 + - name: Dist + run: | + make distribution + env: + CARGO_BINARY: docker run -v /var/run/docker.sock:/var/run/docker.sock -v ${GITHUB_WORKSPACE}:/project -w /project wasmer/riscv64 cross + CROSS_DOCKER_IN_DOCKER: true + CARGO_TARGET: riscv64gc-unknown-linux-gnu + PKG_CONFIG_PATH: /usr/lib/riscv64-linux-gnu/pkgconfig + PKG_CONFIG_ALLOW_CROSS: true + TARGET: riscv64gc-unknown-linux-gnu + TARGET_DIR: target/riscv64gc-unknown-linux-gnu/release + - name: Upload Artifacts + uses: actions/upload-artifact@v3 + with: + name: wasmer-linux-riscv64 + path: dist + if-no-files-found: error + retention-days: 2 + release: - needs: [setup, build, linux_aarch64, windows_gnu] + needs: [setup, build, linux_aarch64, windows_gnu, linux_riscv64] runs-on: ubuntu-latest if: needs.setup.outputs.DOING_RELEASE == '1' || github.event.inputs.release != '' steps: @@ -460,6 +525,15 @@ jobs: asset_path: artifacts/wasmer-linux-aarch64/wasmer.tar.gz asset_name: wasmer-linux-aarch64.tar.gz asset_content_type: application/gzip + - name: Upload Release Asset Linux riscv64 + uses: actions/upload-release-asset@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + upload_url: ${{ steps.create_release.outputs.upload_url }} + asset_path: artifacts/wasmer-linux-riscv64/wasmer.tar.gz + asset_name: wasmer-linux-riscv64.tar.gz + asset_content_type: application/gzip - name: Upload Release Asset Windows gnu64 uses: actions/upload-release-asset@v1 env: diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index f56071356b8..43485018a44 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -144,7 +144,7 @@ jobs: - uses: actions/checkout@v3 - uses: dtolnay/rust-toolchain@stable with: - toolchain: 1.61 + toolchain: 1.65 target: aarch64-unknown-linux-gnu - name: Build cross image run: | @@ -182,6 +182,66 @@ jobs: if-no-files-found: error retention-days: 2 + build_linux_rv64: + name: ${{ matrix.build-what.name }} on linux-riscv64 + runs-on: ubuntu-22.04 + strategy: + fail-fast: false + matrix: + build-what: [ + { + key: capi, + build-cmd: 'make build-capi && make package-capi', + name: 'Build C-API' + }, + { + key: wasmer, + build-cmd: 'make build-wasmer && make package-wasmer && make tar-wasmer', + name: 'Build wasmer-cli' + } + ] + steps: + - uses: actions/checkout@v3 + - uses: dtolnay/rust-toolchain@stable + with: + toolchain: 1.65 + target: riscv64gc-unknown-linux-gnu + - name: Build cross image + run: | + docker build -t wasmer/riscv64 ${GITHUB_WORKSPACE}/.github/cross-linux-riscv64/ + env: + CROSS_DOCKER_IN_DOCKER: true + - name: Build ${{ matrix.build-what.key }} + run: | + ${{ matrix.build-what.build-cmd }} + env: + CARGO_BINARY: docker run -v /var/run/docker.sock:/var/run/docker.sock -v ${GITHUB_WORKSPACE}:/project -w /project wasmer/riscv64 cross + CROSS_DOCKER_IN_DOCKER: true + CARGO_TARGET: riscv64gc-unknown-linux-gnu + PKG_CONFIG_PATH: /usr/lib/riscv64-linux-gnu/pkgconfig + PKG_CONFIG_ALLOW_CROSS: true + ENABLE_LLVM: 0 + - name: Dist + if: ${{ matrix.build-what.key == 'capi' }} + run: | + make distribution + env: + CARGO_BINARY: docker run -v /var/run/docker.sock:/var/run/docker.sock -v ${GITHUB_WORKSPACE}:/project -w /project wasmer/riscv64 cross + CROSS_DOCKER_IN_DOCKER: true + CARGO_TARGET: riscv64gc-unknown-linux-gnu + PKG_CONFIG_PATH: /usr/lib/riscv64-linux-gnu/pkgconfig + PKG_CONFIG_ALLOW_CROSS: true + TARGET: riscv64gc-unknown-linux-gnu + TARGET_DIR: target/riscv64gc-unknown-linux-gnu/release + - name: Upload Artifacts + if: ${{ matrix.build-what.key == 'capi' }} + uses: actions/upload-artifact@v3 + with: + name: capi-linux-riscv64 + path: dist + if-no-files-found: error + retention-days: 2 + build: name: ${{ matrix.build-what.name }} on ${{ matrix.metadata.build }} runs-on: ${{ matrix.metadata.os }} @@ -538,7 +598,7 @@ jobs: test_integration_cli: name: CLI integration tests on ${{ matrix.build }} runs-on: ${{ matrix.os }} - needs: [build, build_linux_aarch64] + needs: [build, build_linux_aarch64, build_linux_riscv64] strategy: fail-fast: false matrix: @@ -628,6 +688,10 @@ jobs: with: name: capi-linux-x64 path: package/cache/wasmercache5 + - uses: actions/download-artifact@v3 + with: + name: capi-linux-riscv64 + path: package/cache/wasmercache6 - name: Copy .tar.gz files to proper location shell: bash run: | @@ -641,6 +705,7 @@ jobs: cp package/cache/wasmercache3/build-capi.tar.gz package/cache/wasmer-darwin-arm64.tar.gz cp package/cache/wasmercache4/build-capi.tar.gz package/cache/wasmer-darwin-amd64.tar.gz cp package/cache/wasmercache5/build-capi.tar.gz package/cache/wasmer-linux-amd64.tar.gz + cp package/cache/wasmercache6/wasmer.tar.gz package/cache/wasmer-linux-riscv64.tar.gz - uses: actions/download-artifact@v3 if: ${{ matrix.build == 'windows-x64' }} with: diff --git a/Makefile b/Makefile index e6f820d3519..bd4db333abd 100644 --- a/Makefile +++ b/Makefile @@ -85,7 +85,7 @@ else # We use spaces instead of tabs to indent `$(error)` # otherwise it's considered as a command outside a # target and it will fail. - $(error Unrecognized architecture, expect `x86_64`, `aarch64` or `arm64`) + $(error Unrecognized architecture, expect `x86_64`, `aarch64`, `arm64`, 'riscv64') endif # Libc From a1db1ec0762ca92b7d44c1bd135db75db2203b0b Mon Sep 17 00:00:00 2001 From: ptitSeb Date: Fri, 24 Mar 2023 10:36:05 +0100 Subject: [PATCH 02/42] Fixed a typo --- .github/workflows/test.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 43485018a44..008aefdf635 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -182,7 +182,7 @@ jobs: if-no-files-found: error retention-days: 2 - build_linux_rv64: + build_linux_riscv64: name: ${{ matrix.build-what.name }} on linux-riscv64 runs-on: ubuntu-22.04 strategy: From 1306a941aaab760f72d5e2ffb51ac4c53abc06bc Mon Sep 17 00:00:00 2001 From: ptitSeb Date: Fri, 24 Mar 2023 10:54:39 +0100 Subject: [PATCH 03/42] update Cargo lock to fix cargo deny step --- Cargo.lock | 44 ++++++++++++++++++++++---------------------- 1 file changed, 22 insertions(+), 22 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 754f61cc32a..93e560684d0 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -143,7 +143,7 @@ checksum = "86ea188f25f0255d8f92797797c97ebf5631fa88178beb1a46fdf5622c9a00e4" dependencies = [ "proc-macro2", "quote", - "syn 2.0.5", + "syn 2.0.8", ] [[package]] @@ -926,7 +926,7 @@ dependencies = [ "proc-macro2", "quote", "scratch", - "syn 2.0.5", + "syn 2.0.8", ] [[package]] @@ -943,7 +943,7 @@ checksum = "631569015d0d8d54e6c241733f944042623ab6df7bc3be7466874b05fcdb1c5f" dependencies = [ "proc-macro2", "quote", - "syn 2.0.5", + "syn 2.0.8", ] [[package]] @@ -1258,9 +1258,9 @@ dependencies = [ [[package]] name = "fern" -version = "0.6.1" +version = "0.6.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3bdd7b0849075e79ee9a1836df22c717d1eba30451796fdc631b04565dd11e2a" +checksum = "d9f0c14694cbd524c8720dd69b0e3179344f04ebb5f90f2e4a440c6ea3b2f1ee" dependencies = [ "colored 1.9.3", "log", @@ -1487,7 +1487,7 @@ checksum = "e77ac7b51b8e6313251737fcef4b1c01a2ea102bde68415b62c0ee9268fec357" dependencies = [ "proc-macro2", "quote", - "syn 2.0.5", + "syn 2.0.8", ] [[package]] @@ -1976,9 +1976,9 @@ dependencies = [ [[package]] name = "insta" -version = "1.28.0" +version = "1.29.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fea5b3894afe466b4bcf0388630fc15e11938a6074af0cd637c825ba2ec8a099" +checksum = "9a28d25139df397cbca21408bb742cf6837e04cdbebf1b07b760caf971d6a972" dependencies = [ "console", "lazy_static", @@ -2601,9 +2601,9 @@ checksum = "0ab1bc2a289d34bd04a330323ac98a1b4bc82c9d9fcb1e66b63caa84da26b575" [[package]] name = "openssl" -version = "0.10.47" +version = "0.10.48" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d8b277f87dacc05a6b709965d1cbafac4649d6ce9f3ce9ceb88508b5666dfec9" +checksum = "518915b97df115dd36109bfa429a48b8f737bd05508cf9588977b599648926d2" dependencies = [ "bitflags", "cfg-if 1.0.0", @@ -2633,9 +2633,9 @@ checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf" [[package]] name = "openssl-sys" -version = "0.9.82" +version = "0.9.83" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a95792af3c4e0153c3914df2261bedd30a98476f94dc892b67dfe1d89d433a04" +checksum = "666416d899cf077260dac8698d60a60b435a46d57e82acb1be3d0dad87284e5b" dependencies = [ "autocfg", "cc", @@ -3397,9 +3397,9 @@ dependencies = [ [[package]] name = "rustc-demangle" -version = "0.1.21" +version = "0.1.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ef03e0a2b150c7a90d01faf6254c9c48a41e95fb2a8c2ac1c6f0d2b9aefc342" +checksum = "d4a36c42d1873f9a77c53bde094f9664d9891bc604a45b4798fd2c389ed12e5b" [[package]] name = "rustc_version" @@ -3719,7 +3719,7 @@ checksum = "e801c1712f48475582b7696ac71e0ca34ebb30e09338425384269d9717c62cad" dependencies = [ "proc-macro2", "quote", - "syn 2.0.5", + "syn 2.0.8", ] [[package]] @@ -4038,9 +4038,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.5" +version = "2.0.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "89c2d1c76a26822187a1fbb5964e3fff108bc208f02e820ab9dac1234f6b388a" +checksum = "bcc02725fd69ab9f26eab07fad303e2497fad6fb9eba4f96c4d1687bdf704ad9" dependencies = [ "proc-macro2", "quote", @@ -4202,7 +4202,7 @@ checksum = "f9456a42c5b0d803c8cd86e73dd7cc9edd429499f37a3550d286d5e86720569f" dependencies = [ "proc-macro2", "quote", - "syn 2.0.5", + "syn 2.0.8", ] [[package]] @@ -4401,9 +4401,9 @@ checksum = "3ab8ed2edee10b50132aed5f331333428b011c99402b5a534154ed15746f9622" [[package]] name = "toml_edit" -version = "0.19.7" +version = "0.19.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dc18466501acd8ac6a3f615dd29a3438f8ca6bb3b19537138b3106e575621274" +checksum = "239410c8609e8125456927e6707163a3b1fdb40561e4b803bc041f466ccfdc13" dependencies = [ "indexmap", "toml_datetime", @@ -6389,9 +6389,9 @@ checksum = "9aec5da331524158c6d1a4ac0ab1541149c0b9505fde06423b02f5ef0106b9f0" [[package]] name = "winnow" -version = "0.3.6" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "23d020b441f92996c80d94ae9166e8501e59c7bb56121189dc9eab3bd8216966" +checksum = "deac0939bd6e4f24ab5919fbf751c97a8cfc8543bb083a305ed5c0c10bb241d1" dependencies = [ "memchr", ] From 8a1fa492ed3ce45393da8f60096f83f844346389 Mon Sep 17 00:00:00 2001 From: ptitSeb Date: Fri, 24 Mar 2023 13:42:09 +0100 Subject: [PATCH 04/42] Some updates to avoid riscv incompatibilities --- Cargo.lock | 186 +++++---------------------- lib/cli/Cargo.toml | 11 +- lib/cli/src/commands/run_unstable.rs | 8 +- lib/wasi/src/runners/container.rs | 2 +- lib/wasi/src/runners/emscripten.rs | 2 +- lib/wasi/src/runners/wasi.rs | 2 +- lib/wasi/src/runners/wcgi/runner.rs | 4 +- 7 files changed, 47 insertions(+), 168 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 93e560684d0..71051384046 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1343,12 +1343,6 @@ version = "1.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "42703706b716c37f96a77aea830392ad231f44c9e9a67872fa5548707e11b11c" -[[package]] -name = "fuchsia-cprng" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a06f77d526c1a601b7c4cdd98f54b5eaabffc14d5f2f0296febdc7f357c6d3ba" - [[package]] name = "futures" version = "0.3.27" @@ -3066,19 +3060,6 @@ dependencies = [ "proc-macro2", ] -[[package]] -name = "rand" -version = "0.4.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "552840b97013b1a26992c11eac34bdd778e464601a4c2054b5f0bff7c6761293" -dependencies = [ - "fuchsia-cprng", - "libc", - "rand_core 0.3.1", - "rdrand", - "winapi", -] - [[package]] name = "rand" version = "0.8.5" @@ -3087,7 +3068,7 @@ checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" dependencies = [ "libc", "rand_chacha", - "rand_core 0.6.4", + "rand_core", ] [[package]] @@ -3097,24 +3078,9 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" dependencies = [ "ppv-lite86", - "rand_core 0.6.4", + "rand_core", ] -[[package]] -name = "rand_core" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a6fdeb83b075e8266dcc8762c22776f6877a63111121f5f8c7411e5be7eed4b" -dependencies = [ - "rand_core 0.4.2", -] - -[[package]] -name = "rand_core" -version = "0.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c33a3c44ca05fa6f1807d8e6743f3824e8509beca625669633be0acbdf509dc" - [[package]] name = "rand_core" version = "0.6.4" @@ -3165,15 +3131,6 @@ dependencies = [ "num_cpus", ] -[[package]] -name = "rdrand" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "678054eb77286b51581ba43620cc911abf02758c91f93f479767aed0f90458b2" -dependencies = [ - "rand_core 0.3.1", -] - [[package]] name = "redox_syscall" version = "0.1.57" @@ -3256,15 +3213,6 @@ dependencies = [ "winapi", ] -[[package]] -name = "remove_dir_all" -version = "0.5.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3acd125665422973a33ac9d3dd2df85edad0f4ae9b00dafb1a05e43a9f5ef8e7" -dependencies = [ - "winapi", -] - [[package]] name = "rend" version = "0.4.0" @@ -4070,16 +4018,6 @@ version = "0.12.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8ae9980cab1db3fceee2f6c6f643d5d8de2997c58ee8d25fb0cc8a9e9e7348e5" -[[package]] -name = "tempdir" -version = "0.3.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "15f2b5fb00ccdf689e0149d1b1b3c03fead81c2b37735d812fa8bddbbf41b6d8" -dependencies = [ - "rand 0.4.6", - "remove_dir_all", -] - [[package]] name = "tempfile" version = "3.4.0" @@ -4775,7 +4713,7 @@ dependencies = [ "tokio", "tracing", "typetag", - "webc 5.0.0-rc.5", + "webc", ] [[package]] @@ -4937,45 +4875,29 @@ dependencies = [ [[package]] name = "wapm-targz-to-pirita" -version = "0.1.7" +version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "39980ef50ab15c47dbd9b26678f06ece2341178d82e25e21e4ac68310d1f2e63" +checksum = "1f2daf9fc40607c4a14a89220afe36e62dbb111627cb428b764d322e7c9d4493" dependencies = [ "anyhow", - "base64 0.13.1", + "base64 0.21.0", "flate2", + "indexmap", "json5", "nuke-dir", - "rand 0.8.5", + "rand", "serde", "serde_cbor", - "serde_derive", "serde_json", "sha2", "tar", "toml", "tracing", + "url", "validator", - "wapm-toml 0.4.0", - "wasmer-registry 3.1.1", - "webc 4.1.1", -] - -[[package]] -name = "wapm-toml" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a61b6d3b6a2fc171198e6378b3a9b38650e114298775a9e63401613abb6a10b3" -dependencies = [ - "anyhow", - "semver 1.0.17", - "serde", - "serde_cbor", - "serde_derive", - "serde_json", - "serde_yaml 0.8.26", - "thiserror", - "toml", + "wapm-toml", + "wasmer-registry 4.1.0 (registry+https://github.com/rust-lang/crates.io-index)", + "webc", ] [[package]] @@ -5288,7 +5210,7 @@ dependencies = [ "wasmer-middlewares", "wasmer-types", "wasmer-wasix", - "webc 5.0.0-rc.5", + "webc", ] [[package]] @@ -5308,7 +5230,7 @@ dependencies = [ "blake3", "criterion", "hex", - "rand 0.8.5", + "rand", "tempfile", "thiserror", "wasmer", @@ -5394,8 +5316,7 @@ dependencies = [ "wasmer-wasm-interface", "wasmer-wast", "wasmparser 0.51.4", - "webc 4.1.1", - "webc 5.0.0-rc.5", + "webc", ] [[package]] @@ -5574,7 +5495,7 @@ dependencies = [ "object 0.30.3", "predicates 2.1.5", "pretty_assertions", - "rand 0.8.5", + "rand", "reqwest", "serde", "tar", @@ -5607,11 +5528,10 @@ dependencies = [ [[package]] name = "wasmer-registry" -version = "3.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "982286807bf43d2522a9f6139f9c2570df45d5a32148460226ccbc7edfb3ee13" +version = "4.1.0" dependencies = [ "anyhow", + "console", "dirs", "filetime", "flate2", @@ -5619,28 +5539,33 @@ dependencies = [ "futures-util", "graphql_client", "hex", + "indicatif", + "lazy_static", "log", "lzma-rs", + "rand", "regex", "reqwest", "semver 1.0.17", "serde", "serde_json", "tar", - "tempdir", + "tempfile", "thiserror", "tldextract", "tokio", "toml", "url", - "wapm-toml 0.2.2", - "webc 3.0.1", + "wasmer-toml", + "webc", "whoami", ] [[package]] name = "wasmer-registry" version = "4.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "20cdae8472f28a3bd4f15f7a838278db9262e9cdb5d38684e9a9a2765c0c29da" dependencies = [ "anyhow", "console", @@ -5655,7 +5580,6 @@ dependencies = [ "lazy_static", "log", "lzma-rs", - "rand 0.8.5", "regex", "reqwest", "semver 1.0.17", @@ -5669,7 +5593,7 @@ dependencies = [ "toml", "url", "wasmer-toml", - "webc 5.0.0-rc.5", + "webc", "whoami", ] @@ -5768,7 +5692,7 @@ dependencies = [ "linked_hash_set", "once_cell", "pin-project", - "rand 0.8.5", + "rand", "reqwest", "serde", "serde_cbor", @@ -5803,7 +5727,7 @@ dependencies = [ "wasmer-wasix-types", "wcgi", "wcgi-host", - "webc 5.0.0-rc.5", + "webc", "weezl", "winapi", ] @@ -6099,55 +6023,9 @@ dependencies = [ [[package]] name = "webc" -version = "3.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ef87e7b955d5d1feaa8697ae129f1a9ce8859e151574ad3baceae9413b48d2f0" -dependencies = [ - "anyhow", - "base64 0.13.1", - "indexmap", - "leb128", - "lexical-sort", - "memchr", - "memmap2", - "path-clean", - "rand 0.8.5", - "serde", - "serde_cbor", - "serde_json", - "sha2", - "url", - "walkdir", -] - -[[package]] -name = "webc" -version = "4.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e4af0f2f0b6bf2e4366375c3cd6635aef1a2eb66cd02454d79525aa7eecf0751" -dependencies = [ - "anyhow", - "base64 0.13.1", - "byteorder", - "indexmap", - "leb128", - "lexical-sort", - "memchr", - "path-clean", - "rand 0.8.5", - "serde", - "serde_cbor", - "serde_json", - "sha2", - "url", - "walkdir", -] - -[[package]] -name = "webc" -version = "5.0.0-rc.5" +version = "5.0.0-rc.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "418bfd8fc298ce60295203a6960d53af48c8e10c5a021a5e7db8bc06c4830148" +checksum = "aa158c77bd41040f4b9a4b91be63446885ce9b04bc9a5bb457fa586e7a8c9815" dependencies = [ "anyhow", "base64 0.21.0", @@ -6159,7 +6037,7 @@ dependencies = [ "memmap2", "once_cell", "path-clean", - "rand 0.8.5", + "rand", "serde", "serde_cbor", "serde_json", diff --git a/lib/cli/Cargo.toml b/lib/cli/Cargo.toml index 250a9416a99..7d6de9eada6 100644 --- a/lib/cli/Cargo.toml +++ b/lib/cli/Cargo.toml @@ -66,10 +66,7 @@ regex = "1.6.0" toml = "0.5.9" url = "2.3.1" libc = { version = "^0.2", default-features = false } -webc = { version = "5.0.0-rc.5" } -# HACK(Michael-F-Bryan): Remove this once a new version of wapm-targz-to-pirita -# is published that doesn't have a public dependency on webc -webc_v4 = { version = "4", package = "webc" } +webc = { version = "5.0.0-rc.6" } isatty = "0.1.9" dialoguer = "0.10.2" tldextract = "0.6.0" @@ -91,7 +88,7 @@ wasm-coredump-builder = { version = "0.1.11" } tracing = { version = "0.1" } tracing-subscriber = { version = "0.3", features = [ "env-filter", "fmt" ] } clap-verbosity-flag = "1" -wapm-targz-to-pirita = "0.1.7" +wapm-targz-to-pirita = "0.2.0" [target.'cfg(not(target_arch = "riscv64"))'.dependencies] http_req = { version="^0.8", default-features = false, features = ["rust-tls"] } @@ -205,6 +202,10 @@ bin-dir = "bin/{ bin }" pkg-url = "{ repo }/releases/download/v{ version }/wasmer-linux-aarch64.{ archive-format }" bin-dir = "bin/{ bin }" +[package.metadata.binstall.overrides.riscv64gc-unknown-linux-gnu] +pkg-url = "{ repo }/releases/download/v{ version }/wasmer-linux-riscv64gc.{ archive-format }" +bin-dir = "bin/{ bin }" + [package.metadata.binstall.overrides.x86_64-unknown-linux-gnu] pkg-url = "{ repo }/releases/download/v{ version }/wasmer-linux-amd64.{ archive-format }" bin-dir = "bin/{ bin }" diff --git a/lib/cli/src/commands/run_unstable.rs b/lib/cli/src/commands/run_unstable.rs index 8ef2b98b813..ee5142351d5 100644 --- a/lib/cli/src/commands/run_unstable.rs +++ b/lib/cli/src/commands/run_unstable.rs @@ -27,7 +27,7 @@ use wasmer_compiler::ArtifactBuild; use wasmer_registry::Package; use wasmer_wasix::runners::{MappedDirectory, Runner, WapmContainer}; use webc::metadata::Manifest; -use webc_v4::DirOrFile; +use webc::v1::DirOrFile; use crate::{ store::StoreOptions, @@ -291,7 +291,7 @@ fn compile_directory_to_webc(dir: &Path) -> Result, Error> { let mut files = BTreeMap::new(); load_files_from_disk(&mut files, dir, dir)?; - let wasmer_toml = webc_v4::DirOrFile::File("wasmer.toml".into()); + let wasmer_toml = DirOrFile::File("wasmer.toml".into()); if let Some(toml_data) = files.remove(&wasmer_toml) { // HACK(Michael-F-Bryan): The version of wapm-targz-to-pirita we are // using doesn't know we renamed "wapm.toml" to "wasmer.toml", so we @@ -317,11 +317,11 @@ fn load_files_from_disk(files: &mut FileMap, dir: &Path, base: &Path) -> Result< if path.is_dir() { load_files_from_disk(files, &path, base)?; - files.insert(webc_v4::DirOrFile::Dir(relative_path), Vec::new()); + files.insert(DirOrFile::Dir(relative_path), Vec::new()); } else if path.is_file() { let data = std::fs::read(&path) .with_context(|| format!("Unable to read \"{}\"", path.display()))?; - files.insert(webc_v4::DirOrFile::File(relative_path), data); + files.insert(DirOrFile::File(relative_path), data); } } Ok(()) diff --git a/lib/wasi/src/runners/container.rs b/lib/wasi/src/runners/container.rs index 810f5b6c0ca..bd1e7dda782 100644 --- a/lib/wasi/src/runners/container.rs +++ b/lib/wasi/src/runners/container.rs @@ -28,7 +28,7 @@ impl WapmContainer { pub fn from_bytes(bytes: Bytes) -> std::result::Result { match webc::detect(bytes.as_ref())? { Version::V1 => { - let webc = WebCOwned::parse(bytes.into(), &ParseOptions::default())?; + let webc = WebCOwned::parse(bytes, &ParseOptions::default())?; Ok(WapmContainer { repr: Repr::V1Owned(Arc::new(webc)), }) diff --git a/lib/wasi/src/runners/emscripten.rs b/lib/wasi/src/runners/emscripten.rs index f0b9cb4ee8e..81b66a7714e 100644 --- a/lib/wasi/src/runners/emscripten.rs +++ b/lib/wasi/src/runners/emscripten.rs @@ -63,7 +63,7 @@ impl crate::runners::Runner for EmscriptenRunner { atom: atom_name, main_args, .. - } = command.get_annotation("emscripten")?.unwrap_or_default(); + } = command.annotation("emscripten")?.unwrap_or_default(); let atom_name = atom_name.context("The atom name is required")?; let atom_bytes = container .get_atom(&atom_name) diff --git a/lib/wasi/src/runners/wasi.rs b/lib/wasi/src/runners/wasi.rs index d17b72382ac..a63a0f44f51 100644 --- a/lib/wasi/src/runners/wasi.rs +++ b/lib/wasi/src/runners/wasi.rs @@ -169,7 +169,7 @@ impl crate::runners::Runner for WasiRunner { command: &Command, container: &WapmContainer, ) -> Result { - let atom_name = match command.get_annotation("wasi")? { + let atom_name = match command.annotation("wasi")? { Some(Wasi { atom, .. }) => atom, None => command_name.to_string(), }; diff --git a/lib/wasi/src/runners/wcgi/runner.rs b/lib/wasi/src/runners/wcgi/runner.rs index ed6dd3bfde8..b7356d24b0b 100644 --- a/lib/wasi/src/runners/wcgi/runner.rs +++ b/lib/wasi/src/runners/wcgi/runner.rs @@ -41,7 +41,7 @@ impl WcgiRunner { fn run(&mut self, command_name: &str, ctx: &RunnerContext<'_>) -> Result<(), Error> { let wasi: Wasi = ctx .command() - .get_annotation("wasi") + .annotation("wasi") .context("Unable to retrieve the WASI metadata")? .unwrap_or_else(|| Wasi::new(command_name)); @@ -129,7 +129,7 @@ impl WcgiRunner { let env = construct_env(wasi, self.config.forward_host_env, &self.config.env); let args = construct_args(wasi, &self.config.args); - let Wcgi { dialect, .. } = ctx.command().get_annotation("wcgi")?.unwrap_or_default(); + let Wcgi { dialect, .. } = ctx.command().annotation("wcgi")?.unwrap_or_default(); let dialect = match dialect { Some(d) => d.parse().context("Unable to parse the CGI dialect")?, From 05b2d2fb52ca32f9e7fab840b213e61302596565 Mon Sep 17 00:00:00 2001 From: ptitSeb Date: Fri, 24 Mar 2023 13:52:27 +0100 Subject: [PATCH 05/42] [CI] Added libssl-dev to RISCV Doker image --- .github/cross-linux-riscv64/Dockerfile | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/cross-linux-riscv64/Dockerfile b/.github/cross-linux-riscv64/Dockerfile index 303d1bc2844..f7850cb311a 100644 --- a/.github/cross-linux-riscv64/Dockerfile +++ b/.github/cross-linux-riscv64/Dockerfile @@ -8,4 +8,5 @@ RUN cargo install cross RUN dpkg --add-architecture riscv64 && \ apt-get update && \ apt-get install -qy curl && \ + apt-get install -qy libssl-dev && \ curl -sSL https://get.docker.com/ | sh \ No newline at end of file From 57a75137100de6b8f2238fa6d10a1f2ba21f10a9 Mon Sep 17 00:00:00 2001 From: ptitSeb Date: Fri, 24 Mar 2023 14:03:27 +0100 Subject: [PATCH 06/42] [CI] It's libssl-dev:riscv64 that is needed for RISCV Doker image --- .github/cross-linux-riscv64/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/cross-linux-riscv64/Dockerfile b/.github/cross-linux-riscv64/Dockerfile index f7850cb311a..eff63428d20 100644 --- a/.github/cross-linux-riscv64/Dockerfile +++ b/.github/cross-linux-riscv64/Dockerfile @@ -8,5 +8,5 @@ RUN cargo install cross RUN dpkg --add-architecture riscv64 && \ apt-get update && \ apt-get install -qy curl && \ - apt-get install -qy libssl-dev && \ + apt-get install -qy libssl-dev:riscv64 && \ curl -sSL https://get.docker.com/ | sh \ No newline at end of file From 10afcb2e0ad137ccca07e3c17e71bb4bb699d2a2 Mon Sep 17 00:00:00 2001 From: ptitSeb Date: Fri, 24 Mar 2023 14:32:10 +0100 Subject: [PATCH 07/42] [CI] More work to get riscv to be cross compiled --- .github/cross-linux-riscv64/Dockerfile | 13 +++-- .github/cross-linux-riscv64/install_deb.sh | 56 ++++++++++++++++++++++ 2 files changed, 64 insertions(+), 5 deletions(-) create mode 100755 .github/cross-linux-riscv64/install_deb.sh diff --git a/.github/cross-linux-riscv64/Dockerfile b/.github/cross-linux-riscv64/Dockerfile index eff63428d20..b8cd73c7003 100644 --- a/.github/cross-linux-riscv64/Dockerfile +++ b/.github/cross-linux-riscv64/Dockerfile @@ -1,12 +1,15 @@ FROM rust:1 -#FROM ghcr.io/cross-rs/riscv64-unknown-linux-gnu:edge +#FROM ghcr.io/cross-rs/riscv64gc-unknown-linux-gnu:edge + +# Prepare script to grab Debian port package +COPY install_deb.sh / # set CROSS_DOCKER_IN_DOCKER to inform `cross` that it is executed from within a container ENV CROSS_DOCKER_IN_DOCKER=true RUN cargo install cross -RUN dpkg --add-architecture riscv64 && \ - apt-get update && \ +RUN apt-get update && \ apt-get install -qy curl && \ - apt-get install -qy libssl-dev:riscv64 && \ - curl -sSL https://get.docker.com/ | sh \ No newline at end of file + curl -sSL https://get.docker.com/ | sh +# Needed for openssl-sys crate +RUN /install_deb.sh riscv64 libssl-dev \ No newline at end of file diff --git a/.github/cross-linux-riscv64/install_deb.sh b/.github/cross-linux-riscv64/install_deb.sh new file mode 100755 index 00000000000..917b9ca1218 --- /dev/null +++ b/.github/cross-linux-riscv64/install_deb.sh @@ -0,0 +1,56 @@ +#!/bin/bash +set -x +set -euo pipefail + +arch="${1}" +shift + +# need to install certain local dependencies +export DEBIAN_FRONTEND=noninteractive +apt-get update +apt-get install --assume-yes --no-install-recommends \ + ca-certificates \ + curl \ + cpio \ + sharutils \ + gnupg + +# get our debian sources +debsource="deb http://http.debian.net/debian/ buster main" +debsource="${debsource}\ndeb http://security.debian.org/ buster/updates main" + +# temporarily use debian sources rather than ubuntu. +mv /etc/apt/sources.list /etc/apt/sources.list.bak +echo -e "${debsource}" > /etc/apt/sources.list + +dpkg --add-architecture "${arch}" || echo "foreign-architecture ${arch}" \ + > /etc/dpkg/dpkg.cfg.d/multiarch + +# Add Debian keys. +curl --retry 3 -sSfL 'https://ftp-master.debian.org/keys/archive-key-{7.0,8,9,10}.asc' -O +curl --retry 3 -sSfL 'https://ftp-master.debian.org/keys/archive-key-{8,9,10}-security.asc' -O +curl --retry 3 -sSfL 'https://ftp-master.debian.org/keys/release-{7,8,9,10}.asc' -O +curl --retry 3 -sSfL 'https://www.ports.debian.org/archive_{2020,2021,2022}.key' -O + +for key in *.asc *.key; do + apt-key add "${key}" + rm "${key}" +done + +# allow apt-get to retry downloads +echo 'APT::Acquire::Retries "3";' > /etc/apt/apt.conf.d/80-retries + +apt-get update +for dep in $@; do + apt-get install "${dep}:${arch}" --assume-yes +done + +# restore our old sources list +mv -f /etc/apt/sources.list.bak /etc/apt/sources.list +if [ -f /etc/dpkg/dpkg.cfg.d/multiarch.bak ]; then + mv /etc/dpkg/dpkg.cfg.d/multiarch.bak /etc/dpkg/dpkg.cfg.d/multiarch +fi + +# can fail if arch is used (amd64 and/or i386) +dpkg --remove-architecture "${arch}" || true +apt-get update \ No newline at end of file From daf963d401b5e7be020f491829a3ecf24c320839 Mon Sep 17 00:00:00 2001 From: ptitSeb Date: Fri, 24 Mar 2023 14:58:26 +0100 Subject: [PATCH 08/42] [CI] Added debian-port sid or riscv Docker image --- .github/cross-linux-riscv64/install_deb.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/cross-linux-riscv64/install_deb.sh b/.github/cross-linux-riscv64/install_deb.sh index 917b9ca1218..a82341872e6 100755 --- a/.github/cross-linux-riscv64/install_deb.sh +++ b/.github/cross-linux-riscv64/install_deb.sh @@ -18,6 +18,8 @@ apt-get install --assume-yes --no-install-recommends \ # get our debian sources debsource="deb http://http.debian.net/debian/ buster main" debsource="${debsource}\ndeb http://security.debian.org/ buster/updates main" +# Add port from sid to get some riscv packages +debsource="${debsource}\ndeb http://deb.debian.org/debian-ports sid main" # temporarily use debian sources rather than ubuntu. mv /etc/apt/sources.list /etc/apt/sources.list.bak From 7b4250f498b6787381ff373689c7c75116786672 Mon Sep 17 00:00:00 2001 From: ptitSeb Date: Fri, 24 Mar 2023 15:19:51 +0100 Subject: [PATCH 09/42] [CI] Added archive_2023 key for debian port --- .github/cross-linux-riscv64/install_deb.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/cross-linux-riscv64/install_deb.sh b/.github/cross-linux-riscv64/install_deb.sh index a82341872e6..73932e836f2 100755 --- a/.github/cross-linux-riscv64/install_deb.sh +++ b/.github/cross-linux-riscv64/install_deb.sh @@ -32,7 +32,7 @@ dpkg --add-architecture "${arch}" || echo "foreign-architecture ${arch}" \ curl --retry 3 -sSfL 'https://ftp-master.debian.org/keys/archive-key-{7.0,8,9,10}.asc' -O curl --retry 3 -sSfL 'https://ftp-master.debian.org/keys/archive-key-{8,9,10}-security.asc' -O curl --retry 3 -sSfL 'https://ftp-master.debian.org/keys/release-{7,8,9,10}.asc' -O -curl --retry 3 -sSfL 'https://www.ports.debian.org/archive_{2020,2021,2022}.key' -O +curl --retry 3 -sSfL 'https://www.ports.debian.org/archive_{2020,2021,2022,2023}.key' -O for key in *.asc *.key; do apt-key add "${key}" From 9bd113af3f30aecc3082e67d7dbf959c3d4396d2 Mon Sep 17 00:00:00 2001 From: ptitSeb Date: Fri, 24 Mar 2023 15:58:10 +0100 Subject: [PATCH 10/42] [CI] Try to used vendored openssl for riscv --- .github/cross-linux-riscv64/Dockerfile | 4 ++-- .github/cross-linux-riscv64/install_deb.sh | 2 +- Cargo.lock | 11 +++++++++++ lib/cli/Cargo.toml | 1 + 4 files changed, 15 insertions(+), 3 deletions(-) diff --git a/.github/cross-linux-riscv64/Dockerfile b/.github/cross-linux-riscv64/Dockerfile index b8cd73c7003..51fdccfbf0c 100644 --- a/.github/cross-linux-riscv64/Dockerfile +++ b/.github/cross-linux-riscv64/Dockerfile @@ -2,7 +2,7 @@ FROM rust:1 #FROM ghcr.io/cross-rs/riscv64gc-unknown-linux-gnu:edge # Prepare script to grab Debian port package -COPY install_deb.sh / +#COPY install_deb.sh / # set CROSS_DOCKER_IN_DOCKER to inform `cross` that it is executed from within a container ENV CROSS_DOCKER_IN_DOCKER=true @@ -12,4 +12,4 @@ RUN apt-get update && \ apt-get install -qy curl && \ curl -sSL https://get.docker.com/ | sh # Needed for openssl-sys crate -RUN /install_deb.sh riscv64 libssl-dev \ No newline at end of file +#RUN /install_deb.sh riscv64 libssl-dev \ No newline at end of file diff --git a/.github/cross-linux-riscv64/install_deb.sh b/.github/cross-linux-riscv64/install_deb.sh index 73932e836f2..ce4268a5f0e 100755 --- a/.github/cross-linux-riscv64/install_deb.sh +++ b/.github/cross-linux-riscv64/install_deb.sh @@ -19,7 +19,7 @@ apt-get install --assume-yes --no-install-recommends \ debsource="deb http://http.debian.net/debian/ buster main" debsource="${debsource}\ndeb http://security.debian.org/ buster/updates main" # Add port from sid to get some riscv packages -debsource="${debsource}\ndeb http://deb.debian.org/debian-ports sid main" +#debsource="${debsource}\ndeb http://deb.debian.org/debian-ports buster main" # temporarily use debian sources rather than ubuntu. mv /etc/apt/sources.list /etc/apt/sources.list.bak diff --git a/Cargo.lock b/Cargo.lock index 71051384046..0b7ad698009 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2625,6 +2625,15 @@ version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf" +[[package]] +name = "openssl-src" +version = "111.25.2+1.1.1t" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "320708a054ad9b3bf314688b5db87cf4d6683d64cfc835e2337924ae62bf4431" +dependencies = [ + "cc", +] + [[package]] name = "openssl-sys" version = "0.9.83" @@ -2634,6 +2643,7 @@ dependencies = [ "autocfg", "cc", "libc", + "openssl-src", "pkg-config", "vcpkg", ] @@ -5272,6 +5282,7 @@ dependencies = [ "log", "minisign", "object 0.30.3", + "openssl", "pathdiff", "prettytable-rs", "regex", diff --git a/lib/cli/Cargo.toml b/lib/cli/Cargo.toml index 7d6de9eada6..ec45e96f249 100644 --- a/lib/cli/Cargo.toml +++ b/lib/cli/Cargo.toml @@ -95,6 +95,7 @@ http_req = { version="^0.8", default-features = false, features = ["rust-tls"] reqwest = { version = "^0.11", default-features = false, features = ["rustls-tls", "json", "multipart"] } [target.'cfg(target_arch = "riscv64")'.dependencies] +openssl = { version = "0.10", features = ["vendored"] } http_req = { version="^0.8", default-features = false, features = ["native-tls"] } reqwest = { version = "^0.11", default-features = false, features = ["native-tls", "json", "multipart"] } From 0222f09be29cae3a9ed8969c242749ee4eeff83e Mon Sep 17 00:00:00 2001 From: ptitSeb Date: Fri, 24 Mar 2023 16:38:38 +0100 Subject: [PATCH 11/42] [CI] Try to cross-build a localy OpenSSL for riscv --- .github/cross-linux-riscv64/Dockerfile | 16 +++++++++++++++- Cargo.lock | 11 ----------- lib/cli/Cargo.toml | 1 - 3 files changed, 15 insertions(+), 13 deletions(-) diff --git a/.github/cross-linux-riscv64/Dockerfile b/.github/cross-linux-riscv64/Dockerfile index 51fdccfbf0c..a30ca9ae610 100644 --- a/.github/cross-linux-riscv64/Dockerfile +++ b/.github/cross-linux-riscv64/Dockerfile @@ -12,4 +12,18 @@ RUN apt-get update && \ apt-get install -qy curl && \ curl -sSL https://get.docker.com/ | sh # Needed for openssl-sys crate -#RUN /install_deb.sh riscv64 libssl-dev \ No newline at end of file +#RUN /install_deb.sh riscv64 libssl-dev + +ENV OPENSSL_VERSION="3.1.0" + +RUN set -x \ + ### BUILD OpenSSL + && wget --no-check-certificate -O /tmp/openssl-${OPENSSL_VERSION}.tar.gz "https://www.openssl.org/source/openssl-${OPENSSL_VERSION}.tar.gz" \ + && tar -xvf /tmp/openssl-${OPENSSL_VERSION}.tar.gz -C /tmp/ \ + && rm -rf /tmp/openssl-${OPENSSL_VERSION}.tar.gz \ + && cd /tmp/openssl-${OPENSSL_VERSION} \ + && ./Configure linux64-riscv64 --cross-compile-prefix=riscv64-linux-gnu- shared\ + && make \ + && make install \ + && cd .. \ + && rm -rf openssl-${OPENSSL_VERSION} \ No newline at end of file diff --git a/Cargo.lock b/Cargo.lock index 0b7ad698009..71051384046 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2625,15 +2625,6 @@ version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf" -[[package]] -name = "openssl-src" -version = "111.25.2+1.1.1t" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "320708a054ad9b3bf314688b5db87cf4d6683d64cfc835e2337924ae62bf4431" -dependencies = [ - "cc", -] - [[package]] name = "openssl-sys" version = "0.9.83" @@ -2643,7 +2634,6 @@ dependencies = [ "autocfg", "cc", "libc", - "openssl-src", "pkg-config", "vcpkg", ] @@ -5282,7 +5272,6 @@ dependencies = [ "log", "minisign", "object 0.30.3", - "openssl", "pathdiff", "prettytable-rs", "regex", diff --git a/lib/cli/Cargo.toml b/lib/cli/Cargo.toml index ec45e96f249..7d6de9eada6 100644 --- a/lib/cli/Cargo.toml +++ b/lib/cli/Cargo.toml @@ -95,7 +95,6 @@ http_req = { version="^0.8", default-features = false, features = ["rust-tls"] reqwest = { version = "^0.11", default-features = false, features = ["rustls-tls", "json", "multipart"] } [target.'cfg(target_arch = "riscv64")'.dependencies] -openssl = { version = "0.10", features = ["vendored"] } http_req = { version="^0.8", default-features = false, features = ["native-tls"] } reqwest = { version = "^0.11", default-features = false, features = ["native-tls", "json", "multipart"] } From b916166a4ba087c5e3e01ef056afbb0229aba8d6 Mon Sep 17 00:00:00 2001 From: ptitSeb Date: Fri, 24 Mar 2023 16:53:58 +0100 Subject: [PATCH 12/42] [CI] gcc-riscv64-linux-gnu is not installed it seems, only g++ is --- .github/cross-linux-riscv64/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/cross-linux-riscv64/Dockerfile b/.github/cross-linux-riscv64/Dockerfile index a30ca9ae610..4540d42c744 100644 --- a/.github/cross-linux-riscv64/Dockerfile +++ b/.github/cross-linux-riscv64/Dockerfile @@ -9,7 +9,7 @@ ENV CROSS_DOCKER_IN_DOCKER=true RUN cargo install cross RUN apt-get update && \ - apt-get install -qy curl && \ + apt-get install -qy curl gcc-riscv64-linux-gnu && \ curl -sSL https://get.docker.com/ | sh # Needed for openssl-sys crate #RUN /install_deb.sh riscv64 libssl-dev From 5b8dedc9ee9e34c5056948858b9e1b6989ade746 Mon Sep 17 00:00:00 2001 From: ptitSeb Date: Fri, 24 Mar 2023 17:14:57 +0100 Subject: [PATCH 13/42] Fixed linter --- lib/wasi/src/runners/wasi.rs | 1 - lib/wasi/src/runners/wcgi/runner.rs | 1 - 2 files changed, 2 deletions(-) diff --git a/lib/wasi/src/runners/wasi.rs b/lib/wasi/src/runners/wasi.rs index fe23f1f1d69..479ae00a12a 100644 --- a/lib/wasi/src/runners/wasi.rs +++ b/lib/wasi/src/runners/wasi.rs @@ -150,7 +150,6 @@ impl crate::runners::Runner for WasiRunner { command: &Command, container: &WapmContainer, ) -> Result { - let wasi = command .annotation("wasi")? .unwrap_or_else(|| Wasi::new(command_name)); diff --git a/lib/wasi/src/runners/wcgi/runner.rs b/lib/wasi/src/runners/wcgi/runner.rs index 3043b8e8c4c..bf91c75d4bb 100644 --- a/lib/wasi/src/runners/wcgi/runner.rs +++ b/lib/wasi/src/runners/wcgi/runner.rs @@ -128,7 +128,6 @@ impl WcgiRunner { wasi: &Wasi, ctx: &RunnerContext<'_>, ) -> Result { - let Wcgi { dialect, .. } = ctx.command().annotation("wcgi")?.unwrap_or_default(); let dialect = match dialect { From 863d33bf6553e8504a57d16992bb3164f82f2dc1 Mon Sep 17 00:00:00 2001 From: ptitSeb Date: Fri, 24 Mar 2023 17:28:58 +0100 Subject: [PATCH 14/42] [CI] Fined tune OpenSSL installation on RISCV Docker image --- .github/cross-linux-riscv64/Dockerfile | 2 +- .github/workflows/build.yml | 8 ++++---- .github/workflows/test.yaml | 4 ++-- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/cross-linux-riscv64/Dockerfile b/.github/cross-linux-riscv64/Dockerfile index 4540d42c744..3e67bec7883 100644 --- a/.github/cross-linux-riscv64/Dockerfile +++ b/.github/cross-linux-riscv64/Dockerfile @@ -22,7 +22,7 @@ RUN set -x \ && tar -xvf /tmp/openssl-${OPENSSL_VERSION}.tar.gz -C /tmp/ \ && rm -rf /tmp/openssl-${OPENSSL_VERSION}.tar.gz \ && cd /tmp/openssl-${OPENSSL_VERSION} \ - && ./Configure linux64-riscv64 --cross-compile-prefix=riscv64-linux-gnu- shared\ + && ./Configure linux64-riscv64 --cross-compile-prefix=riscv64-linux-gnu- --prefix=/opt/riscv64 shared\ && make \ && make install \ && cd .. \ diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index a70b805ae19..667cc5cbe10 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -425,7 +425,7 @@ jobs: CARGO_BINARY: docker run -v /var/run/docker.sock:/var/run/docker.sock -v ${GITHUB_WORKSPACE}:/project -w /project wasmer/riscv64 cross CROSS_DOCKER_IN_DOCKER: true CARGO_TARGET: riscv64gc-unknown-linux-gnu - PKG_CONFIG_PATH: /usr/lib/riscv64-linux-gnu/pkgconfig + PKG_CONFIG_PATH: /opt/riscv64/lib/pkgconfig PKG_CONFIG_ALLOW_CROSS: true ENABLE_LLVM: 0 - name: Build C API headless @@ -436,7 +436,7 @@ jobs: CARGO_BINARY: docker run -v /var/run/docker.sock:/var/run/docker.sock -v ${GITHUB_WORKSPACE}:/project -w /project wasmer/riscv64 cross CROSS_DOCKER_IN_DOCKER: true CARGO_TARGET: riscv64gc-unknown-linux-gnu - PKG_CONFIG_PATH: /usr/lib/riscv64-linux-gnu/pkgconfig + PKG_CONFIG_PATH: /opt/riscv64/lib/pkgconfig PKG_CONFIG_ALLOW_CROSS: true ENABLE_LLVM: 0 TARGET: riscv64gc-unknown-linux-gnu @@ -448,7 +448,7 @@ jobs: CARGO_BINARY: docker run -v /var/run/docker.sock:/var/run/docker.sock -v ${GITHUB_WORKSPACE}:/project -w /project wasmer/riscv64 cross CROSS_DOCKER_IN_DOCKER: true CARGO_TARGET: riscv64gc-unknown-linux-gnu - PKG_CONFIG_PATH: /usr/lib/riscv64-linux-gnu/pkgconfig + PKG_CONFIG_PATH: /opt/riscv64/lib/pkgconfig PKG_CONFIG_ALLOW_CROSS: true ENABLE_LLVM: 0 - name: Dist @@ -458,7 +458,7 @@ jobs: CARGO_BINARY: docker run -v /var/run/docker.sock:/var/run/docker.sock -v ${GITHUB_WORKSPACE}:/project -w /project wasmer/riscv64 cross CROSS_DOCKER_IN_DOCKER: true CARGO_TARGET: riscv64gc-unknown-linux-gnu - PKG_CONFIG_PATH: /usr/lib/riscv64-linux-gnu/pkgconfig + PKG_CONFIG_PATH: /opt/riscv64/lib/pkgconfig PKG_CONFIG_ALLOW_CROSS: true TARGET: riscv64gc-unknown-linux-gnu TARGET_DIR: target/riscv64gc-unknown-linux-gnu/release diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 008aefdf635..74b6d73932e 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -218,7 +218,7 @@ jobs: CARGO_BINARY: docker run -v /var/run/docker.sock:/var/run/docker.sock -v ${GITHUB_WORKSPACE}:/project -w /project wasmer/riscv64 cross CROSS_DOCKER_IN_DOCKER: true CARGO_TARGET: riscv64gc-unknown-linux-gnu - PKG_CONFIG_PATH: /usr/lib/riscv64-linux-gnu/pkgconfig + PKG_CONFIG_PATH: /opt/riscv64/lib/pkgconfig PKG_CONFIG_ALLOW_CROSS: true ENABLE_LLVM: 0 - name: Dist @@ -229,7 +229,7 @@ jobs: CARGO_BINARY: docker run -v /var/run/docker.sock:/var/run/docker.sock -v ${GITHUB_WORKSPACE}:/project -w /project wasmer/riscv64 cross CROSS_DOCKER_IN_DOCKER: true CARGO_TARGET: riscv64gc-unknown-linux-gnu - PKG_CONFIG_PATH: /usr/lib/riscv64-linux-gnu/pkgconfig + PKG_CONFIG_PATH: /opt/riscv64/lib/pkgconfig PKG_CONFIG_ALLOW_CROSS: true TARGET: riscv64gc-unknown-linux-gnu TARGET_DIR: target/riscv64gc-unknown-linux-gnu/release From 50d0cab0213b8c6445efd6843cc07fea70110fdc Mon Sep 17 00:00:00 2001 From: ptitSeb Date: Fri, 24 Mar 2023 17:53:41 +0100 Subject: [PATCH 15/42] Fixed linter --- lib/cli/src/commands/run_unstable.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/cli/src/commands/run_unstable.rs b/lib/cli/src/commands/run_unstable.rs index ee5142351d5..7b24f7aa200 100644 --- a/lib/cli/src/commands/run_unstable.rs +++ b/lib/cli/src/commands/run_unstable.rs @@ -303,7 +303,7 @@ fn compile_directory_to_webc(dir: &Path) -> Result, Error> { } let functions = wapm_targz_to_pirita::TransformManifestFunctions::default(); - wapm_targz_to_pirita::generate_webc_file(files, &dir.to_path_buf(), None, &functions) + wapm_targz_to_pirita::generate_webc_file(files, dir, None, &functions) } fn load_files_from_disk(files: &mut FileMap, dir: &Path, base: &Path) -> Result<(), Error> { From bc37e32bbf4c4a8679701dd3de70b7db813c242b Mon Sep 17 00:00:00 2001 From: ptitSeb Date: Fri, 24 Mar 2023 17:53:51 +0100 Subject: [PATCH 16/42] [CI] Try to force RISCV64GC_UNKNOWN_LINUX_GNU_OPENSSL_DIR env. var. --- .github/workflows/build.yml | 4 ++++ .github/workflows/test.yaml | 2 ++ 2 files changed, 6 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 667cc5cbe10..738489bc97f 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -426,6 +426,7 @@ jobs: CROSS_DOCKER_IN_DOCKER: true CARGO_TARGET: riscv64gc-unknown-linux-gnu PKG_CONFIG_PATH: /opt/riscv64/lib/pkgconfig + RISCV64GC_UNKNOWN_LINUX_GNU_OPENSSL_DIR: /opt/riscv64 PKG_CONFIG_ALLOW_CROSS: true ENABLE_LLVM: 0 - name: Build C API headless @@ -437,6 +438,7 @@ jobs: CROSS_DOCKER_IN_DOCKER: true CARGO_TARGET: riscv64gc-unknown-linux-gnu PKG_CONFIG_PATH: /opt/riscv64/lib/pkgconfig + RISCV64GC_UNKNOWN_LINUX_GNU_OPENSSL_DIR: /opt/riscv64 PKG_CONFIG_ALLOW_CROSS: true ENABLE_LLVM: 0 TARGET: riscv64gc-unknown-linux-gnu @@ -449,6 +451,7 @@ jobs: CROSS_DOCKER_IN_DOCKER: true CARGO_TARGET: riscv64gc-unknown-linux-gnu PKG_CONFIG_PATH: /opt/riscv64/lib/pkgconfig + RISCV64GC_UNKNOWN_LINUX_GNU_OPENSSL_DIR: /opt/riscv64 PKG_CONFIG_ALLOW_CROSS: true ENABLE_LLVM: 0 - name: Dist @@ -459,6 +462,7 @@ jobs: CROSS_DOCKER_IN_DOCKER: true CARGO_TARGET: riscv64gc-unknown-linux-gnu PKG_CONFIG_PATH: /opt/riscv64/lib/pkgconfig + RISCV64GC_UNKNOWN_LINUX_GNU_OPENSSL_DIR: /opt/riscv64 PKG_CONFIG_ALLOW_CROSS: true TARGET: riscv64gc-unknown-linux-gnu TARGET_DIR: target/riscv64gc-unknown-linux-gnu/release diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 74b6d73932e..f78f4ab8057 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -219,6 +219,7 @@ jobs: CROSS_DOCKER_IN_DOCKER: true CARGO_TARGET: riscv64gc-unknown-linux-gnu PKG_CONFIG_PATH: /opt/riscv64/lib/pkgconfig + RISCV64GC_UNKNOWN_LINUX_GNU_OPENSSL_DIR: /opt/riscv64 PKG_CONFIG_ALLOW_CROSS: true ENABLE_LLVM: 0 - name: Dist @@ -230,6 +231,7 @@ jobs: CROSS_DOCKER_IN_DOCKER: true CARGO_TARGET: riscv64gc-unknown-linux-gnu PKG_CONFIG_PATH: /opt/riscv64/lib/pkgconfig + RISCV64GC_UNKNOWN_LINUX_GNU_OPENSSL_DIR: /opt/riscv64 PKG_CONFIG_ALLOW_CROSS: true TARGET: riscv64gc-unknown-linux-gnu TARGET_DIR: target/riscv64gc-unknown-linux-gnu/release From af592e3298cfa341cbc52bce4697b0615e99a2a1 Mon Sep 17 00:00:00 2001 From: ptitSeb Date: Fri, 24 Mar 2023 18:37:46 +0100 Subject: [PATCH 17/42] [CI] Use the cross-rs docker image instead of creating one from scratch --- .github/cross-linux-riscv64/Dockerfile | 32 +++++++++++++------------- .github/workflows/build.yml | 12 ++++------ .github/workflows/test.yaml | 6 ++--- 3 files changed, 22 insertions(+), 28 deletions(-) diff --git a/.github/cross-linux-riscv64/Dockerfile b/.github/cross-linux-riscv64/Dockerfile index 3e67bec7883..cd40eae7186 100644 --- a/.github/cross-linux-riscv64/Dockerfile +++ b/.github/cross-linux-riscv64/Dockerfile @@ -1,5 +1,5 @@ -FROM rust:1 -#FROM ghcr.io/cross-rs/riscv64gc-unknown-linux-gnu:edge +#FROM rust:1 +FROM ghcr.io/cross-rs/riscv64gc-unknown-linux-gnu:edge # Prepare script to grab Debian port package #COPY install_deb.sh / @@ -7,23 +7,23 @@ FROM rust:1 # set CROSS_DOCKER_IN_DOCKER to inform `cross` that it is executed from within a container ENV CROSS_DOCKER_IN_DOCKER=true -RUN cargo install cross +#RUN cargo install cross RUN apt-get update && \ - apt-get install -qy curl gcc-riscv64-linux-gnu && \ + apt-get install -qy curl gcc-riscv64-linux-gnu libssl-dev:riscv64 && \ curl -sSL https://get.docker.com/ | sh # Needed for openssl-sys crate #RUN /install_deb.sh riscv64 libssl-dev -ENV OPENSSL_VERSION="3.1.0" +#ENV OPENSSL_VERSION="3.1.0" -RUN set -x \ - ### BUILD OpenSSL - && wget --no-check-certificate -O /tmp/openssl-${OPENSSL_VERSION}.tar.gz "https://www.openssl.org/source/openssl-${OPENSSL_VERSION}.tar.gz" \ - && tar -xvf /tmp/openssl-${OPENSSL_VERSION}.tar.gz -C /tmp/ \ - && rm -rf /tmp/openssl-${OPENSSL_VERSION}.tar.gz \ - && cd /tmp/openssl-${OPENSSL_VERSION} \ - && ./Configure linux64-riscv64 --cross-compile-prefix=riscv64-linux-gnu- --prefix=/opt/riscv64 shared\ - && make \ - && make install \ - && cd .. \ - && rm -rf openssl-${OPENSSL_VERSION} \ No newline at end of file +#RUN set -x \ +# ### BUILD OpenSSL +# && wget --no-check-certificate -O /tmp/openssl-${OPENSSL_VERSION}.tar.gz "https://www.openssl.org/source/openssl-${OPENSSL_VERSION}.tar.gz" \ +# && tar -xvf /tmp/openssl-${OPENSSL_VERSION}.tar.gz -C /tmp/ \ +# && rm -rf /tmp/openssl-${OPENSSL_VERSION}.tar.gz \ +# && cd /tmp/openssl-${OPENSSL_VERSION} \ +# && ./Configure linux64-riscv64 --cross-compile-prefix=riscv64-linux-gnu- --prefix=/opt/riscv64 shared\ +# && make \ +# && make install \ +# && cd .. \ +# && rm -rf openssl-${OPENSSL_VERSION} \ No newline at end of file diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 738489bc97f..a70b805ae19 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -425,8 +425,7 @@ jobs: CARGO_BINARY: docker run -v /var/run/docker.sock:/var/run/docker.sock -v ${GITHUB_WORKSPACE}:/project -w /project wasmer/riscv64 cross CROSS_DOCKER_IN_DOCKER: true CARGO_TARGET: riscv64gc-unknown-linux-gnu - PKG_CONFIG_PATH: /opt/riscv64/lib/pkgconfig - RISCV64GC_UNKNOWN_LINUX_GNU_OPENSSL_DIR: /opt/riscv64 + PKG_CONFIG_PATH: /usr/lib/riscv64-linux-gnu/pkgconfig PKG_CONFIG_ALLOW_CROSS: true ENABLE_LLVM: 0 - name: Build C API headless @@ -437,8 +436,7 @@ jobs: CARGO_BINARY: docker run -v /var/run/docker.sock:/var/run/docker.sock -v ${GITHUB_WORKSPACE}:/project -w /project wasmer/riscv64 cross CROSS_DOCKER_IN_DOCKER: true CARGO_TARGET: riscv64gc-unknown-linux-gnu - PKG_CONFIG_PATH: /opt/riscv64/lib/pkgconfig - RISCV64GC_UNKNOWN_LINUX_GNU_OPENSSL_DIR: /opt/riscv64 + PKG_CONFIG_PATH: /usr/lib/riscv64-linux-gnu/pkgconfig PKG_CONFIG_ALLOW_CROSS: true ENABLE_LLVM: 0 TARGET: riscv64gc-unknown-linux-gnu @@ -450,8 +448,7 @@ jobs: CARGO_BINARY: docker run -v /var/run/docker.sock:/var/run/docker.sock -v ${GITHUB_WORKSPACE}:/project -w /project wasmer/riscv64 cross CROSS_DOCKER_IN_DOCKER: true CARGO_TARGET: riscv64gc-unknown-linux-gnu - PKG_CONFIG_PATH: /opt/riscv64/lib/pkgconfig - RISCV64GC_UNKNOWN_LINUX_GNU_OPENSSL_DIR: /opt/riscv64 + PKG_CONFIG_PATH: /usr/lib/riscv64-linux-gnu/pkgconfig PKG_CONFIG_ALLOW_CROSS: true ENABLE_LLVM: 0 - name: Dist @@ -461,8 +458,7 @@ jobs: CARGO_BINARY: docker run -v /var/run/docker.sock:/var/run/docker.sock -v ${GITHUB_WORKSPACE}:/project -w /project wasmer/riscv64 cross CROSS_DOCKER_IN_DOCKER: true CARGO_TARGET: riscv64gc-unknown-linux-gnu - PKG_CONFIG_PATH: /opt/riscv64/lib/pkgconfig - RISCV64GC_UNKNOWN_LINUX_GNU_OPENSSL_DIR: /opt/riscv64 + PKG_CONFIG_PATH: /usr/lib/riscv64-linux-gnu/pkgconfig PKG_CONFIG_ALLOW_CROSS: true TARGET: riscv64gc-unknown-linux-gnu TARGET_DIR: target/riscv64gc-unknown-linux-gnu/release diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index f78f4ab8057..008aefdf635 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -218,8 +218,7 @@ jobs: CARGO_BINARY: docker run -v /var/run/docker.sock:/var/run/docker.sock -v ${GITHUB_WORKSPACE}:/project -w /project wasmer/riscv64 cross CROSS_DOCKER_IN_DOCKER: true CARGO_TARGET: riscv64gc-unknown-linux-gnu - PKG_CONFIG_PATH: /opt/riscv64/lib/pkgconfig - RISCV64GC_UNKNOWN_LINUX_GNU_OPENSSL_DIR: /opt/riscv64 + PKG_CONFIG_PATH: /usr/lib/riscv64-linux-gnu/pkgconfig PKG_CONFIG_ALLOW_CROSS: true ENABLE_LLVM: 0 - name: Dist @@ -230,8 +229,7 @@ jobs: CARGO_BINARY: docker run -v /var/run/docker.sock:/var/run/docker.sock -v ${GITHUB_WORKSPACE}:/project -w /project wasmer/riscv64 cross CROSS_DOCKER_IN_DOCKER: true CARGO_TARGET: riscv64gc-unknown-linux-gnu - PKG_CONFIG_PATH: /opt/riscv64/lib/pkgconfig - RISCV64GC_UNKNOWN_LINUX_GNU_OPENSSL_DIR: /opt/riscv64 + PKG_CONFIG_PATH: /usr/lib/riscv64-linux-gnu/pkgconfig PKG_CONFIG_ALLOW_CROSS: true TARGET: riscv64gc-unknown-linux-gnu TARGET_DIR: target/riscv64gc-unknown-linux-gnu/release From 3b19bcf51aea01ba88e067fbeb12de0bbd633a86 Mon Sep 17 00:00:00 2001 From: ptitSeb Date: Fri, 24 Mar 2023 18:42:07 +0100 Subject: [PATCH 18/42] [CI] Use the katest cross-rs docker image for RISCV --- .github/cross-linux-riscv64/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/cross-linux-riscv64/Dockerfile b/.github/cross-linux-riscv64/Dockerfile index cd40eae7186..2255cc70405 100644 --- a/.github/cross-linux-riscv64/Dockerfile +++ b/.github/cross-linux-riscv64/Dockerfile @@ -1,5 +1,5 @@ #FROM rust:1 -FROM ghcr.io/cross-rs/riscv64gc-unknown-linux-gnu:edge +FROM ghcr.io/cross-rs/riscv64gc-unknown-linux-gnu:latest # Prepare script to grab Debian port package #COPY install_deb.sh / From 5f31ade27e004fb99ac17d056bcf61bccc518a20 Mon Sep 17 00:00:00 2001 From: ptitSeb Date: Fri, 24 Mar 2023 18:45:16 +0100 Subject: [PATCH 19/42] [CI] more attempt to get opensll for RISCV --- .github/cross-linux-riscv64/Dockerfile | 4 ++-- .github/cross-linux-riscv64/install_deb.sh | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/cross-linux-riscv64/Dockerfile b/.github/cross-linux-riscv64/Dockerfile index 2255cc70405..f504e9c4601 100644 --- a/.github/cross-linux-riscv64/Dockerfile +++ b/.github/cross-linux-riscv64/Dockerfile @@ -9,10 +9,10 @@ ENV CROSS_DOCKER_IN_DOCKER=true #RUN cargo install cross RUN apt-get update && \ - apt-get install -qy curl gcc-riscv64-linux-gnu libssl-dev:riscv64 && \ + apt-get install -qy curl gcc-riscv64-linux-gnu && \ curl -sSL https://get.docker.com/ | sh # Needed for openssl-sys crate -#RUN /install_deb.sh riscv64 libssl-dev +RUN /install_deb.sh riscv64 libssl-dev #ENV OPENSSL_VERSION="3.1.0" diff --git a/.github/cross-linux-riscv64/install_deb.sh b/.github/cross-linux-riscv64/install_deb.sh index ce4268a5f0e..81eeb3fefe6 100755 --- a/.github/cross-linux-riscv64/install_deb.sh +++ b/.github/cross-linux-riscv64/install_deb.sh @@ -19,7 +19,7 @@ apt-get install --assume-yes --no-install-recommends \ debsource="deb http://http.debian.net/debian/ buster main" debsource="${debsource}\ndeb http://security.debian.org/ buster/updates main" # Add port from sid to get some riscv packages -#debsource="${debsource}\ndeb http://deb.debian.org/debian-ports buster main" +debsource="${debsource}\ndeb http://deb.debian.org/debian-ports buster main" # temporarily use debian sources rather than ubuntu. mv /etc/apt/sources.list /etc/apt/sources.list.bak From 1478eb4c905cef08bfa2f626e4b2526c3fc35d63 Mon Sep 17 00:00:00 2001 From: ptitSeb Date: Fri, 24 Mar 2023 18:47:44 +0100 Subject: [PATCH 20/42] [CI] nother attempt to get opensll for RISCV --- .github/cross-linux-riscv64/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/cross-linux-riscv64/Dockerfile b/.github/cross-linux-riscv64/Dockerfile index f504e9c4601..14fdf03fa9d 100644 --- a/.github/cross-linux-riscv64/Dockerfile +++ b/.github/cross-linux-riscv64/Dockerfile @@ -2,7 +2,7 @@ FROM ghcr.io/cross-rs/riscv64gc-unknown-linux-gnu:latest # Prepare script to grab Debian port package -#COPY install_deb.sh / +COPY install_deb.sh / # set CROSS_DOCKER_IN_DOCKER to inform `cross` that it is executed from within a container ENV CROSS_DOCKER_IN_DOCKER=true From 3b8fd5c318ca4cb16246ce5a20141801a6bc0648 Mon Sep 17 00:00:00 2001 From: ptitSeb Date: Mon, 27 Mar 2023 13:09:27 +0200 Subject: [PATCH 21/42] [CI] New Docker image for riscv64 cross build --- .github/cross-linux-riscv64/Dockerfile | 74 +++++++++++++------ .github/cross-linux-riscv64/install_deb.sh | 6 +- .github/cross-linux-riscv64/install_docker.sh | 11 +++ 3 files changed, 64 insertions(+), 27 deletions(-) create mode 100755 .github/cross-linux-riscv64/install_docker.sh diff --git a/.github/cross-linux-riscv64/Dockerfile b/.github/cross-linux-riscv64/Dockerfile index 14fdf03fa9d..606b1fbf796 100644 --- a/.github/cross-linux-riscv64/Dockerfile +++ b/.github/cross-linux-riscv64/Dockerfile @@ -1,29 +1,57 @@ -#FROM rust:1 -FROM ghcr.io/cross-rs/riscv64gc-unknown-linux-gnu:latest - -# Prepare script to grab Debian port package -COPY install_deb.sh / +FROM debian:sid +#FROM ghcr.io/cross-rs/aarch64-unknown-linux-gnu:edge # set CROSS_DOCKER_IN_DOCKER to inform `cross` that it is executed from within a container ENV CROSS_DOCKER_IN_DOCKER=true -#RUN cargo install cross -RUN apt-get update && \ - apt-get install -qy curl gcc-riscv64-linux-gnu && \ - curl -sSL https://get.docker.com/ | sh -# Needed for openssl-sys crate +RUN apt-get update && \ + apt-get install --assume-yes --no-install-recommends \ + ca-certificates \ + curl \ + cpio \ + sharutils \ + gnupg \ + build-essential \ + libc6-dev + +RUN curl --proto "=https" --tlsv1.2 --retry 3 -sSfL https://sh.rustup.rs | sh -s -- -y + +ENV PATH="/root/.cargo/bin:${PATH}" + +RUN cargo install cross + +COPY install_deb.sh / + +#install libssl-dev for riscv64! RUN /install_deb.sh riscv64 libssl-dev +ENV RISCV64GC_UNKNOWN_LINUX_GNU_OPENSSL_INCLUDE_DIR=/usr/include/openssl +ENV RISCV64GC_UNKNOWN_LINUX_GNU_OPENSSL_LIB_DIR=/usr/lib/riscv64-linux-gnu + +# add docker the manual way +COPY install_docker.sh / +RUN /install_docker.sh + +RUN apt-get update && \ + apt-get install --assume-yes --no-install-recommends \ + docker-ce \ + docker-ce-cli \ + containerd.io \ + docker-buildx-plugin \ + docker-compose-plugin + +RUN apt-get update && apt-get install -y --no-install-recommends \ + gcc-riscv64-linux-gnu \ + g++-riscv64-linux-gnu \ + qemu-user-static \ + pkg-config \ + libc6-dev-riscv64-cross -#ENV OPENSSL_VERSION="3.1.0" - -#RUN set -x \ -# ### BUILD OpenSSL -# && wget --no-check-certificate -O /tmp/openssl-${OPENSSL_VERSION}.tar.gz "https://www.openssl.org/source/openssl-${OPENSSL_VERSION}.tar.gz" \ -# && tar -xvf /tmp/openssl-${OPENSSL_VERSION}.tar.gz -C /tmp/ \ -# && rm -rf /tmp/openssl-${OPENSSL_VERSION}.tar.gz \ -# && cd /tmp/openssl-${OPENSSL_VERSION} \ -# && ./Configure linux64-riscv64 --cross-compile-prefix=riscv64-linux-gnu- --prefix=/opt/riscv64 shared\ -# && make \ -# && make install \ -# && cd .. \ -# && rm -rf openssl-${OPENSSL_VERSION} \ No newline at end of file +ENV CROSS_TOOLCHAIN_PREFIX=riscv64-linux-gnu- +ENV CROSS_SYSROOT=/usr/riscv64-linux-gnu +ENV AR_riscv64gc_unknown_linux_gnu="$CROSS_TOOLCHAIN_PREFIX"ar \ + CC_riscv64gc_unknown_linux_gnu="$CROSS_TOOLCHAIN_PREFIX"gcc \ + CXX_riscv64gc_unknown_linux_gnu="$CROSS_TOOLCHAIN_PREFIX"g++ \ + BINDGEN_EXTRA_CLANG_ARGS_riscv64gc_unknown_linux_gnu="--sysroot=$CROSS_SYSROOT" \ + QEMU_LD_PREFIX="$CROSS_SYSROOT" \ + RUST_TEST_THREADS=1 \ + PKG_CONFIG_PATH="/usr/lib/riscv64-linux-gnu/pkgconfig/:${PKG_CONFIG_PATH}" diff --git a/.github/cross-linux-riscv64/install_deb.sh b/.github/cross-linux-riscv64/install_deb.sh index 81eeb3fefe6..a38715c2762 100755 --- a/.github/cross-linux-riscv64/install_deb.sh +++ b/.github/cross-linux-riscv64/install_deb.sh @@ -15,13 +15,11 @@ apt-get install --assume-yes --no-install-recommends \ sharutils \ gnupg -# get our debian sources -debsource="deb http://http.debian.net/debian/ buster main" -debsource="${debsource}\ndeb http://security.debian.org/ buster/updates main" # Add port from sid to get some riscv packages -debsource="${debsource}\ndeb http://deb.debian.org/debian-ports buster main" +debsource="deb http://deb.debian.org/debian-ports sid main" # temporarily use debian sources rather than ubuntu. +touch /etc/apt/sources.list mv /etc/apt/sources.list /etc/apt/sources.list.bak echo -e "${debsource}" > /etc/apt/sources.list diff --git a/.github/cross-linux-riscv64/install_docker.sh b/.github/cross-linux-riscv64/install_docker.sh new file mode 100755 index 00000000000..ea7e7aef2fe --- /dev/null +++ b/.github/cross-linux-riscv64/install_docker.sh @@ -0,0 +1,11 @@ +#!/bin/bash +set -x +set -euo pipefail + +mkdir -m 0755 -p /etc/apt/keyrings +curl -fsSL https://download.docker.com/linux/debian/gpg | gpg --dearmor -o /etc/apt/keyrings/docker.gpg + +echo \ + "deb [arch="$(dpkg --print-architecture)" signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/debian \ + "$(. /etc/os-release && echo "$VERSION_CODENAME")" stable" | \ + tee /etc/apt/sources.list.d/docker.list > /dev/null From a1b336e42602f0ceb19ee008820131d1ac98c08b Mon Sep 17 00:00:00 2001 From: ptitSeb Date: Mon, 27 Mar 2023 13:34:28 +0200 Subject: [PATCH 22/42] [CI] Can you please find those openssl libs now --- .github/cross-linux-riscv64/Dockerfile | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/cross-linux-riscv64/Dockerfile b/.github/cross-linux-riscv64/Dockerfile index 606b1fbf796..ad3a0e133cc 100644 --- a/.github/cross-linux-riscv64/Dockerfile +++ b/.github/cross-linux-riscv64/Dockerfile @@ -55,3 +55,6 @@ ENV AR_riscv64gc_unknown_linux_gnu="$CROSS_TOOLCHAIN_PREFIX"ar \ QEMU_LD_PREFIX="$CROSS_SYSROOT" \ RUST_TEST_THREADS=1 \ PKG_CONFIG_PATH="/usr/lib/riscv64-linux-gnu/pkgconfig/:${PKG_CONFIG_PATH}" + +ENV RISCV64GC_UNKNOWN_LINUX_GNU_OPENSSL_LIB_DIR=/usr/lib/riscv64-linux-gnu +ENV RISCV64GC_UNKNOWN_LINUX_GNU_OPENSSL_INCLUDE_DIR=/usr/include/openssl \ No newline at end of file From 1e8dd09aaee4e35c15fbe4752908e5f48fb1326f Mon Sep 17 00:00:00 2001 From: ptitSeb Date: Mon, 27 Mar 2023 13:45:44 +0200 Subject: [PATCH 23/42] [CI] Try not to use pkg-config maybe --- .github/cross-linux-riscv64/Dockerfile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/cross-linux-riscv64/Dockerfile b/.github/cross-linux-riscv64/Dockerfile index ad3a0e133cc..a797f878e53 100644 --- a/.github/cross-linux-riscv64/Dockerfile +++ b/.github/cross-linux-riscv64/Dockerfile @@ -57,4 +57,5 @@ ENV AR_riscv64gc_unknown_linux_gnu="$CROSS_TOOLCHAIN_PREFIX"ar \ PKG_CONFIG_PATH="/usr/lib/riscv64-linux-gnu/pkgconfig/:${PKG_CONFIG_PATH}" ENV RISCV64GC_UNKNOWN_LINUX_GNU_OPENSSL_LIB_DIR=/usr/lib/riscv64-linux-gnu -ENV RISCV64GC_UNKNOWN_LINUX_GNU_OPENSSL_INCLUDE_DIR=/usr/include/openssl \ No newline at end of file +ENV RISCV64GC_UNKNOWN_LINUX_GNU_OPENSSL_INCLUDE_DIR=/usr/include/openssl +ENV OPENSSL_NO_PKG_CONFIG=1 \ No newline at end of file From f684e0cb708538bf5c37c7251e20540d3b2b8640 Mon Sep 17 00:00:00 2001 From: ptitSeb Date: Mon, 27 Mar 2023 14:02:15 +0200 Subject: [PATCH 24/42] [CI] one more try --- .github/workflows/test.yaml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 008aefdf635..e15e767fcf0 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -218,9 +218,7 @@ jobs: CARGO_BINARY: docker run -v /var/run/docker.sock:/var/run/docker.sock -v ${GITHUB_WORKSPACE}:/project -w /project wasmer/riscv64 cross CROSS_DOCKER_IN_DOCKER: true CARGO_TARGET: riscv64gc-unknown-linux-gnu - PKG_CONFIG_PATH: /usr/lib/riscv64-linux-gnu/pkgconfig - PKG_CONFIG_ALLOW_CROSS: true - ENABLE_LLVM: 0 + ENABLE_LLVM: 1 - name: Dist if: ${{ matrix.build-what.key == 'capi' }} run: | From b9cb23e790a8e1e06aea7de32eef0dfb5994ce6e Mon Sep 17 00:00:00 2001 From: ptitSeb Date: Mon, 27 Mar 2023 14:48:14 +0200 Subject: [PATCH 25/42] [CI] more openssl try --- .github/cross-linux-riscv64/Dockerfile | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/cross-linux-riscv64/Dockerfile b/.github/cross-linux-riscv64/Dockerfile index a797f878e53..4b739f6d7ba 100644 --- a/.github/cross-linux-riscv64/Dockerfile +++ b/.github/cross-linux-riscv64/Dockerfile @@ -43,6 +43,7 @@ RUN apt-get update && apt-get install -y --no-install-recommends \ gcc-riscv64-linux-gnu \ g++-riscv64-linux-gnu \ qemu-user-static \ + libssl-dev \ pkg-config \ libc6-dev-riscv64-cross @@ -57,5 +58,5 @@ ENV AR_riscv64gc_unknown_linux_gnu="$CROSS_TOOLCHAIN_PREFIX"ar \ PKG_CONFIG_PATH="/usr/lib/riscv64-linux-gnu/pkgconfig/:${PKG_CONFIG_PATH}" ENV RISCV64GC_UNKNOWN_LINUX_GNU_OPENSSL_LIB_DIR=/usr/lib/riscv64-linux-gnu -ENV RISCV64GC_UNKNOWN_LINUX_GNU_OPENSSL_INCLUDE_DIR=/usr/include/openssl -ENV OPENSSL_NO_PKG_CONFIG=1 \ No newline at end of file +ENV RISCV64GC_UNKNOWN_LINUX_GNU_OPENSSL_INCLUDE_DIR=/usr/include +ENV OPENSSL_NO_PKG_CONFIG=1 From cce19631d290265691b4af992bb66730dbb08a27 Mon Sep 17 00:00:00 2001 From: ptitSeb Date: Mon, 27 Mar 2023 15:33:48 +0200 Subject: [PATCH 26/42] [CI] again, more openssl try --- .github/cross-linux-riscv64/Dockerfile | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/cross-linux-riscv64/Dockerfile b/.github/cross-linux-riscv64/Dockerfile index 4b739f6d7ba..f169fa6b126 100644 --- a/.github/cross-linux-riscv64/Dockerfile +++ b/.github/cross-linux-riscv64/Dockerfile @@ -24,8 +24,9 @@ COPY install_deb.sh / #install libssl-dev for riscv64! RUN /install_deb.sh riscv64 libssl-dev -ENV RISCV64GC_UNKNOWN_LINUX_GNU_OPENSSL_INCLUDE_DIR=/usr/include/openssl -ENV RISCV64GC_UNKNOWN_LINUX_GNU_OPENSSL_LIB_DIR=/usr/lib/riscv64-linux-gnu +RUN cp /usr/lib/riscv64-linux-gnu/libssl* /usr/riscv64-linux-gnu/lib/ +#ENV RISCV64GC_UNKNOWN_LINUX_GNU_OPENSSL_INCLUDE_DIR=/usr/include/openssl +#ENV RISCV64GC_UNKNOWN_LINUX_GNU_OPENSSL_LIB_DIR=/usr/lib/riscv64-linux-gnu # add docker the manual way COPY install_docker.sh / @@ -59,4 +60,4 @@ ENV AR_riscv64gc_unknown_linux_gnu="$CROSS_TOOLCHAIN_PREFIX"ar \ ENV RISCV64GC_UNKNOWN_LINUX_GNU_OPENSSL_LIB_DIR=/usr/lib/riscv64-linux-gnu ENV RISCV64GC_UNKNOWN_LINUX_GNU_OPENSSL_INCLUDE_DIR=/usr/include -ENV OPENSSL_NO_PKG_CONFIG=1 +#ENV OPENSSL_NO_PKG_CONFIG=1 From 57309eeb15ceb2e1076ab350190fc0768cfc5470 Mon Sep 17 00:00:00 2001 From: ptitSeb Date: Mon, 27 Mar 2023 15:54:48 +0200 Subject: [PATCH 27/42] [CI] again, one more openssl try --- .github/cross-linux-riscv64/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/cross-linux-riscv64/Dockerfile b/.github/cross-linux-riscv64/Dockerfile index f169fa6b126..f419bf4c076 100644 --- a/.github/cross-linux-riscv64/Dockerfile +++ b/.github/cross-linux-riscv64/Dockerfile @@ -24,7 +24,6 @@ COPY install_deb.sh / #install libssl-dev for riscv64! RUN /install_deb.sh riscv64 libssl-dev -RUN cp /usr/lib/riscv64-linux-gnu/libssl* /usr/riscv64-linux-gnu/lib/ #ENV RISCV64GC_UNKNOWN_LINUX_GNU_OPENSSL_INCLUDE_DIR=/usr/include/openssl #ENV RISCV64GC_UNKNOWN_LINUX_GNU_OPENSSL_LIB_DIR=/usr/lib/riscv64-linux-gnu @@ -61,3 +60,4 @@ ENV AR_riscv64gc_unknown_linux_gnu="$CROSS_TOOLCHAIN_PREFIX"ar \ ENV RISCV64GC_UNKNOWN_LINUX_GNU_OPENSSL_LIB_DIR=/usr/lib/riscv64-linux-gnu ENV RISCV64GC_UNKNOWN_LINUX_GNU_OPENSSL_INCLUDE_DIR=/usr/include #ENV OPENSSL_NO_PKG_CONFIG=1 +RUN cp /usr/lib/riscv64-linux-gnu/libssl* /usr/riscv64-linux-gnu/lib/ From 5788909fae1aadfee66a2a9af1637e1416efb96d Mon Sep 17 00:00:00 2001 From: ptitSeb Date: Mon, 27 Mar 2023 16:06:37 +0200 Subject: [PATCH 28/42] [CI] again and again, one more openssl try --- .github/cross-linux-riscv64/Dockerfile | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/cross-linux-riscv64/Dockerfile b/.github/cross-linux-riscv64/Dockerfile index f419bf4c076..87472ec5126 100644 --- a/.github/cross-linux-riscv64/Dockerfile +++ b/.github/cross-linux-riscv64/Dockerfile @@ -61,3 +61,4 @@ ENV RISCV64GC_UNKNOWN_LINUX_GNU_OPENSSL_LIB_DIR=/usr/lib/riscv64-linux-gnu ENV RISCV64GC_UNKNOWN_LINUX_GNU_OPENSSL_INCLUDE_DIR=/usr/include #ENV OPENSSL_NO_PKG_CONFIG=1 RUN cp /usr/lib/riscv64-linux-gnu/libssl* /usr/riscv64-linux-gnu/lib/ +RUN cp /usr/lib/include/openssl /usr/riscv64-linux-gnu/include/ -r From 156b0175151920ee6f4792963a4a06346453c4c8 Mon Sep 17 00:00:00 2001 From: ptitSeb Date: Mon, 27 Mar 2023 16:24:45 +0200 Subject: [PATCH 29/42] [CI] a newer openssl try --- .github/cross-linux-riscv64/Dockerfile | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/.github/cross-linux-riscv64/Dockerfile b/.github/cross-linux-riscv64/Dockerfile index 87472ec5126..c7ad398256c 100644 --- a/.github/cross-linux-riscv64/Dockerfile +++ b/.github/cross-linux-riscv64/Dockerfile @@ -24,8 +24,8 @@ COPY install_deb.sh / #install libssl-dev for riscv64! RUN /install_deb.sh riscv64 libssl-dev -#ENV RISCV64GC_UNKNOWN_LINUX_GNU_OPENSSL_INCLUDE_DIR=/usr/include/openssl -#ENV RISCV64GC_UNKNOWN_LINUX_GNU_OPENSSL_LIB_DIR=/usr/lib/riscv64-linux-gnu +ENV RISCV64GC_UNKNOWN_LINUX_GNU_OPENSSL_INCLUDE_DIR=/usr/include +ENV RISCV64GC_UNKNOWN_LINUX_GNU_OPENSSL_LIB_DIR=/usr/lib/riscv64-linux-gnu # add docker the manual way COPY install_docker.sh / @@ -57,8 +57,12 @@ ENV AR_riscv64gc_unknown_linux_gnu="$CROSS_TOOLCHAIN_PREFIX"ar \ RUST_TEST_THREADS=1 \ PKG_CONFIG_PATH="/usr/lib/riscv64-linux-gnu/pkgconfig/:${PKG_CONFIG_PATH}" -ENV RISCV64GC_UNKNOWN_LINUX_GNU_OPENSSL_LIB_DIR=/usr/lib/riscv64-linux-gnu -ENV RISCV64GC_UNKNOWN_LINUX_GNU_OPENSSL_INCLUDE_DIR=/usr/include #ENV OPENSSL_NO_PKG_CONFIG=1 RUN cp /usr/lib/riscv64-linux-gnu/libssl* /usr/riscv64-linux-gnu/lib/ -RUN cp /usr/lib/include/openssl /usr/riscv64-linux-gnu/include/ -r +RUN cp /usr/lib/riscv64-linux-gnu/libcrypto* /usr/riscv64-linux-gnu/lib/ +RUN mkdir -p /opt/local +RUN mkdir -p /opt/local/lib +RUN mkdir -p /opt/local/include +RUN cp /usr/lib/riscv64-linux-gnu/libssl* /opt/local/lib/ +RUN cp /usr/lib/riscv64-linux-gnu/libcrypto* /opt/local/lib/ +RUN cp /usr/include/openssl /opt/local/include/ -r From f30d4c4d4e63d1bffda27a3dda2434d97fdeaa2b Mon Sep 17 00:00:00 2001 From: ptitSeb Date: Mon, 27 Mar 2023 16:40:52 +0200 Subject: [PATCH 30/42] [CI] and another openssl try --- .github/cross-linux-riscv64/Cross.toml | 2 ++ .github/workflows/test.yaml | 1 + 2 files changed, 3 insertions(+) create mode 100644 .github/cross-linux-riscv64/Cross.toml diff --git a/.github/cross-linux-riscv64/Cross.toml b/.github/cross-linux-riscv64/Cross.toml new file mode 100644 index 00000000000..a63b1b72a21 --- /dev/null +++ b/.github/cross-linux-riscv64/Cross.toml @@ -0,0 +1,2 @@ +[target.risc64gc-unknown-linux-gnu] +image = "wasmer/riscv64" diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index e15e767fcf0..5f40b781f6c 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -211,6 +211,7 @@ jobs: docker build -t wasmer/riscv64 ${GITHUB_WORKSPACE}/.github/cross-linux-riscv64/ env: CROSS_DOCKER_IN_DOCKER: true + CROSS_CONFIG: ${GITHUB_WORKSPACE}/.github/cross-linux-riscv64/Cross.toml - name: Build ${{ matrix.build-what.key }} run: | ${{ matrix.build-what.build-cmd }} From 56c9087d4be1bd566d7102a6bf6211efd33990df Mon Sep 17 00:00:00 2001 From: ptitSeb Date: Mon, 27 Mar 2023 16:54:52 +0200 Subject: [PATCH 31/42] [CI] yet another openssl try --- .github/workflows/test.yaml | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 5f40b781f6c..7d59d81304c 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -211,21 +211,20 @@ jobs: docker build -t wasmer/riscv64 ${GITHUB_WORKSPACE}/.github/cross-linux-riscv64/ env: CROSS_DOCKER_IN_DOCKER: true - CROSS_CONFIG: ${GITHUB_WORKSPACE}/.github/cross-linux-riscv64/Cross.toml - name: Build ${{ matrix.build-what.key }} run: | ${{ matrix.build-what.build-cmd }} env: - CARGO_BINARY: docker run -v /var/run/docker.sock:/var/run/docker.sock -v ${GITHUB_WORKSPACE}:/project -w /project wasmer/riscv64 cross + CARGO_BINARY: docker run -v /var/run/docker.sock:/var/run/docker.sock -v ${GITHUB_WORKSPACE}:/project -w /project wasmer/riscv64 cargo CROSS_DOCKER_IN_DOCKER: true CARGO_TARGET: riscv64gc-unknown-linux-gnu - ENABLE_LLVM: 1 + ENABLE_LLVM: 0 - name: Dist if: ${{ matrix.build-what.key == 'capi' }} run: | make distribution env: - CARGO_BINARY: docker run -v /var/run/docker.sock:/var/run/docker.sock -v ${GITHUB_WORKSPACE}:/project -w /project wasmer/riscv64 cross + CARGO_BINARY: docker run -v /var/run/docker.sock:/var/run/docker.sock -v ${GITHUB_WORKSPACE}:/project -w /project wasmer/riscv64 cargo CROSS_DOCKER_IN_DOCKER: true CARGO_TARGET: riscv64gc-unknown-linux-gnu PKG_CONFIG_PATH: /usr/lib/riscv64-linux-gnu/pkgconfig From 54dcaa9e5f93a7773f0494f1224bc7dc29738e07 Mon Sep 17 00:00:00 2001 From: ptitSeb Date: Mon, 27 Mar 2023 17:08:05 +0200 Subject: [PATCH 32/42] [CI] adding riscv64gc manualy, not using cross --- .github/cross-linux-riscv64/Dockerfile | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/.github/cross-linux-riscv64/Dockerfile b/.github/cross-linux-riscv64/Dockerfile index c7ad398256c..29ac0241e63 100644 --- a/.github/cross-linux-riscv64/Dockerfile +++ b/.github/cross-linux-riscv64/Dockerfile @@ -18,7 +18,7 @@ RUN curl --proto "=https" --tlsv1.2 --retry 3 -sSfL https://sh.rustup.rs | sh -s ENV PATH="/root/.cargo/bin:${PATH}" -RUN cargo install cross +#RUN cargo install cross COPY install_deb.sh / @@ -57,12 +57,14 @@ ENV AR_riscv64gc_unknown_linux_gnu="$CROSS_TOOLCHAIN_PREFIX"ar \ RUST_TEST_THREADS=1 \ PKG_CONFIG_PATH="/usr/lib/riscv64-linux-gnu/pkgconfig/:${PKG_CONFIG_PATH}" +RUN rustup target install riscv64gc-unknown-linux-gnu + #ENV OPENSSL_NO_PKG_CONFIG=1 -RUN cp /usr/lib/riscv64-linux-gnu/libssl* /usr/riscv64-linux-gnu/lib/ -RUN cp /usr/lib/riscv64-linux-gnu/libcrypto* /usr/riscv64-linux-gnu/lib/ -RUN mkdir -p /opt/local -RUN mkdir -p /opt/local/lib -RUN mkdir -p /opt/local/include -RUN cp /usr/lib/riscv64-linux-gnu/libssl* /opt/local/lib/ -RUN cp /usr/lib/riscv64-linux-gnu/libcrypto* /opt/local/lib/ -RUN cp /usr/include/openssl /opt/local/include/ -r +#RUN cp /usr/lib/riscv64-linux-gnu/libssl* /usr/riscv64-linux-gnu/lib/ +#RUN cp /usr/lib/riscv64-linux-gnu/libcrypto* /usr/riscv64-linux-gnu/lib/ +#RUN mkdir -p /opt/local +#RUN mkdir -p /opt/local/lib +#RUN mkdir -p /opt/local/include +#RUN cp /usr/lib/riscv64-linux-gnu/libssl* /opt/local/lib/ +#RUN cp /usr/lib/riscv64-linux-gnu/libcrypto* /opt/local/lib/ +#RUN cp /usr/include/openssl /opt/local/include/ -r From a28caf7b07d72478f6aa986377f40597d5ae0518 Mon Sep 17 00:00:00 2001 From: ptitSeb Date: Mon, 27 Mar 2023 17:14:39 +0200 Subject: [PATCH 33/42] [CI] again,adding riscv64gc manualy, not using cross --- .github/cross-linux-riscv64/Dockerfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/cross-linux-riscv64/Dockerfile b/.github/cross-linux-riscv64/Dockerfile index 29ac0241e63..ca07a0515ba 100644 --- a/.github/cross-linux-riscv64/Dockerfile +++ b/.github/cross-linux-riscv64/Dockerfile @@ -23,7 +23,7 @@ ENV PATH="/root/.cargo/bin:${PATH}" COPY install_deb.sh / #install libssl-dev for riscv64! -RUN /install_deb.sh riscv64 libssl-dev +RUN /install_deb.sh riscv64 libssl-dev llvm-14-dev ENV RISCV64GC_UNKNOWN_LINUX_GNU_OPENSSL_INCLUDE_DIR=/usr/include ENV RISCV64GC_UNKNOWN_LINUX_GNU_OPENSSL_LIB_DIR=/usr/lib/riscv64-linux-gnu @@ -57,7 +57,7 @@ ENV AR_riscv64gc_unknown_linux_gnu="$CROSS_TOOLCHAIN_PREFIX"ar \ RUST_TEST_THREADS=1 \ PKG_CONFIG_PATH="/usr/lib/riscv64-linux-gnu/pkgconfig/:${PKG_CONFIG_PATH}" -RUN rustup target install riscv64gc-unknown-linux-gnu +RUN rustup target add riscv64gc-unknown-linux-gnu #ENV OPENSSL_NO_PKG_CONFIG=1 #RUN cp /usr/lib/riscv64-linux-gnu/libssl* /usr/riscv64-linux-gnu/lib/ From b7e71e3f7b21aa9ef9e0da4734828e03a7f30165 Mon Sep 17 00:00:00 2001 From: ptitSeb Date: Mon, 27 Mar 2023 17:18:39 +0200 Subject: [PATCH 34/42] [CI] don't mess with llvm-14 for now --- .github/cross-linux-riscv64/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/cross-linux-riscv64/Dockerfile b/.github/cross-linux-riscv64/Dockerfile index ca07a0515ba..1c72cfa9f0f 100644 --- a/.github/cross-linux-riscv64/Dockerfile +++ b/.github/cross-linux-riscv64/Dockerfile @@ -23,7 +23,7 @@ ENV PATH="/root/.cargo/bin:${PATH}" COPY install_deb.sh / #install libssl-dev for riscv64! -RUN /install_deb.sh riscv64 libssl-dev llvm-14-dev +RUN /install_deb.sh riscv64 libssl-dev ENV RISCV64GC_UNKNOWN_LINUX_GNU_OPENSSL_INCLUDE_DIR=/usr/include ENV RISCV64GC_UNKNOWN_LINUX_GNU_OPENSSL_LIB_DIR=/usr/lib/riscv64-linux-gnu From d43393aa1c75a7b65eeb81759b3d60d08759623e Mon Sep 17 00:00:00 2001 From: ptitSeb Date: Mon, 27 Mar 2023 17:38:50 +0200 Subject: [PATCH 35/42] [CI] and another try --- .github/cross-linux-riscv64/Dockerfile | 4 ++-- .github/workflows/test.yaml | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/cross-linux-riscv64/Dockerfile b/.github/cross-linux-riscv64/Dockerfile index 1c72cfa9f0f..7e9e2e53850 100644 --- a/.github/cross-linux-riscv64/Dockerfile +++ b/.github/cross-linux-riscv64/Dockerfile @@ -17,6 +17,8 @@ RUN apt-get update && \ RUN curl --proto "=https" --tlsv1.2 --retry 3 -sSfL https://sh.rustup.rs | sh -s -- -y ENV PATH="/root/.cargo/bin:${PATH}" +RUN rustup toolchain install 1.65 +RUN rustup target add riscv64gc-unknown-linux-gnu #RUN cargo install cross @@ -57,8 +59,6 @@ ENV AR_riscv64gc_unknown_linux_gnu="$CROSS_TOOLCHAIN_PREFIX"ar \ RUST_TEST_THREADS=1 \ PKG_CONFIG_PATH="/usr/lib/riscv64-linux-gnu/pkgconfig/:${PKG_CONFIG_PATH}" -RUN rustup target add riscv64gc-unknown-linux-gnu - #ENV OPENSSL_NO_PKG_CONFIG=1 #RUN cp /usr/lib/riscv64-linux-gnu/libssl* /usr/riscv64-linux-gnu/lib/ #RUN cp /usr/lib/riscv64-linux-gnu/libcrypto* /usr/riscv64-linux-gnu/lib/ diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 7d59d81304c..7aa45f307fd 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -202,10 +202,10 @@ jobs: ] steps: - uses: actions/checkout@v3 - - uses: dtolnay/rust-toolchain@stable - with: - toolchain: 1.65 - target: riscv64gc-unknown-linux-gnu + #- uses: dtolnay/rust-toolchain@stable + # with: + # toolchain: 1.65 + # target: riscv64gc-unknown-linux-gnu - name: Build cross image run: | docker build -t wasmer/riscv64 ${GITHUB_WORKSPACE}/.github/cross-linux-riscv64/ From 05ec30b41f8a09a5b31694c264f63b4a18eb3c16 Mon Sep 17 00:00:00 2001 From: ptitSeb Date: Tue, 28 Mar 2023 17:50:23 +0200 Subject: [PATCH 36/42] [CI] New try, it works localy, so there is hope --- .github/cross-linux-riscv64/Dockerfile | 29 +++++++++----------------- .github/workflows/build.yml | 8 +++---- 2 files changed, 14 insertions(+), 23 deletions(-) diff --git a/.github/cross-linux-riscv64/Dockerfile b/.github/cross-linux-riscv64/Dockerfile index 7e9e2e53850..6f942ad5671 100644 --- a/.github/cross-linux-riscv64/Dockerfile +++ b/.github/cross-linux-riscv64/Dockerfile @@ -1,4 +1,4 @@ -FROM debian:sid +FROM debian:sid AS openssl_riscv64 #FROM ghcr.io/cross-rs/aarch64-unknown-linux-gnu:edge # set CROSS_DOCKER_IN_DOCKER to inform `cross` that it is executed from within a container @@ -14,14 +14,6 @@ RUN apt-get update && \ build-essential \ libc6-dev -RUN curl --proto "=https" --tlsv1.2 --retry 3 -sSfL https://sh.rustup.rs | sh -s -- -y - -ENV PATH="/root/.cargo/bin:${PATH}" -RUN rustup toolchain install 1.65 -RUN rustup target add riscv64gc-unknown-linux-gnu - -#RUN cargo install cross - COPY install_deb.sh / #install libssl-dev for riscv64! @@ -29,6 +21,11 @@ RUN /install_deb.sh riscv64 libssl-dev ENV RISCV64GC_UNKNOWN_LINUX_GNU_OPENSSL_INCLUDE_DIR=/usr/include ENV RISCV64GC_UNKNOWN_LINUX_GNU_OPENSSL_LIB_DIR=/usr/lib/riscv64-linux-gnu + +# install rust tools +RUN curl --proto "=https" --tlsv1.2 --retry 3 -sSfL https://sh.rustup.rs | sh -s -- -y +ENV PATH="/root/.cargo/bin:${PATH}" +RUN rustup -v toolchain install 1.65 # add docker the manual way COPY install_docker.sh / RUN /install_docker.sh @@ -51,20 +48,14 @@ RUN apt-get update && apt-get install -y --no-install-recommends \ ENV CROSS_TOOLCHAIN_PREFIX=riscv64-linux-gnu- ENV CROSS_SYSROOT=/usr/riscv64-linux-gnu -ENV AR_riscv64gc_unknown_linux_gnu="$CROSS_TOOLCHAIN_PREFIX"ar \ +ENV CARGO_TARGET_RISCV64GC_UNKNOWN_LINUX_GNU_LINKER="$CROSS_TOOLCHAIN_PREFIX"gcc \ + AR_riscv64gc_unknown_linux_gnu="$CROSS_TOOLCHAIN_PREFIX"ar \ CC_riscv64gc_unknown_linux_gnu="$CROSS_TOOLCHAIN_PREFIX"gcc \ CXX_riscv64gc_unknown_linux_gnu="$CROSS_TOOLCHAIN_PREFIX"g++ \ + CFLAGS_riscv64gc_unknown_linux_gnu="-march=rv64gc -mabi=lp64d" \ BINDGEN_EXTRA_CLANG_ARGS_riscv64gc_unknown_linux_gnu="--sysroot=$CROSS_SYSROOT" \ QEMU_LD_PREFIX="$CROSS_SYSROOT" \ RUST_TEST_THREADS=1 \ PKG_CONFIG_PATH="/usr/lib/riscv64-linux-gnu/pkgconfig/:${PKG_CONFIG_PATH}" -#ENV OPENSSL_NO_PKG_CONFIG=1 -#RUN cp /usr/lib/riscv64-linux-gnu/libssl* /usr/riscv64-linux-gnu/lib/ -#RUN cp /usr/lib/riscv64-linux-gnu/libcrypto* /usr/riscv64-linux-gnu/lib/ -#RUN mkdir -p /opt/local -#RUN mkdir -p /opt/local/lib -#RUN mkdir -p /opt/local/include -#RUN cp /usr/lib/riscv64-linux-gnu/libssl* /opt/local/lib/ -#RUN cp /usr/lib/riscv64-linux-gnu/libcrypto* /opt/local/lib/ -#RUN cp /usr/include/openssl /opt/local/include/ -r +RUN rustup target add riscv64gc-unknown-linux-gnu --toolchain 1.65-x86_64-unknown-linux-gnu diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index a70b805ae19..fbd4ea64d40 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -422,7 +422,7 @@ jobs: run: | make build-wasmer env: - CARGO_BINARY: docker run -v /var/run/docker.sock:/var/run/docker.sock -v ${GITHUB_WORKSPACE}:/project -w /project wasmer/riscv64 cross + CARGO_BINARY: docker run -v /var/run/docker.sock:/var/run/docker.sock -v ${GITHUB_WORKSPACE}:/project -w /project wasmer/riscv64:latest cargo CROSS_DOCKER_IN_DOCKER: true CARGO_TARGET: riscv64gc-unknown-linux-gnu PKG_CONFIG_PATH: /usr/lib/riscv64-linux-gnu/pkgconfig @@ -433,7 +433,7 @@ jobs: run: | make package-capi-headless env: - CARGO_BINARY: docker run -v /var/run/docker.sock:/var/run/docker.sock -v ${GITHUB_WORKSPACE}:/project -w /project wasmer/riscv64 cross + CARGO_BINARY: docker run -v /var/run/docker.sock:/var/run/docker.sock -v ${GITHUB_WORKSPACE}:/project -w /project wasmer/riscv64:latest cargo CROSS_DOCKER_IN_DOCKER: true CARGO_TARGET: riscv64gc-unknown-linux-gnu PKG_CONFIG_PATH: /usr/lib/riscv64-linux-gnu/pkgconfig @@ -445,7 +445,7 @@ jobs: run: | make build-capi env: - CARGO_BINARY: docker run -v /var/run/docker.sock:/var/run/docker.sock -v ${GITHUB_WORKSPACE}:/project -w /project wasmer/riscv64 cross + CARGO_BINARY: docker run -v /var/run/docker.sock:/var/run/docker.sock -v ${GITHUB_WORKSPACE}:/project -w /project wasmer/riscv64:latest cargo CROSS_DOCKER_IN_DOCKER: true CARGO_TARGET: riscv64gc-unknown-linux-gnu PKG_CONFIG_PATH: /usr/lib/riscv64-linux-gnu/pkgconfig @@ -455,7 +455,7 @@ jobs: run: | make distribution env: - CARGO_BINARY: docker run -v /var/run/docker.sock:/var/run/docker.sock -v ${GITHUB_WORKSPACE}:/project -w /project wasmer/riscv64 cross + CARGO_BINARY: docker run -v /var/run/docker.sock:/var/run/docker.sock -v ${GITHUB_WORKSPACE}:/project -w /project wasmer/riscv64:latest cargo CROSS_DOCKER_IN_DOCKER: true CARGO_TARGET: riscv64gc-unknown-linux-gnu PKG_CONFIG_PATH: /usr/lib/riscv64-linux-gnu/pkgconfig From d484f349a506349abc97064a21f854a912c583fd Mon Sep 17 00:00:00 2001 From: ptitSeb Date: Tue, 28 Mar 2023 18:19:47 +0200 Subject: [PATCH 37/42] Fixed build after merge --- lib/wasi/src/runners/wasi.rs | 2 +- lib/wasi/src/runners/wcgi/runner.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/wasi/src/runners/wasi.rs b/lib/wasi/src/runners/wasi.rs index c4f1339cd06..6099393a27d 100644 --- a/lib/wasi/src/runners/wasi.rs +++ b/lib/wasi/src/runners/wasi.rs @@ -152,7 +152,7 @@ impl crate::runners::Runner for WasiRunner { container: &WapmContainer, ) -> Result { let Annotations { wasi } = command - .get_annotation(webc::metadata::annotations::WASI_RUNNER_URI)? + .annotation(webc::metadata::annotations::WASI_RUNNER_URI)? .unwrap_or_default(); let wasi = wasi.unwrap_or_else(|| Wasi::new(command_name)); let atom_name = &wasi.atom; diff --git a/lib/wasi/src/runners/wcgi/runner.rs b/lib/wasi/src/runners/wcgi/runner.rs index 892a53b63dc..f1b31837bb7 100644 --- a/lib/wasi/src/runners/wcgi/runner.rs +++ b/lib/wasi/src/runners/wcgi/runner.rs @@ -44,7 +44,7 @@ impl WcgiRunner { let key = webc::metadata::annotations::WCGI_RUNNER_URI; let Annotations { wasi, wcgi } = ctx .command() - .get_annotation(key) + .annotation(key) .with_context(|| format!("Unable to deserialize the \"{key}\" annotations"))? .unwrap_or_default(); From 4b9aa42e971684f667709c4b15f16f0d7d77d423 Mon Sep 17 00:00:00 2001 From: ptitSeb Date: Tue, 28 Mar 2023 18:52:11 +0200 Subject: [PATCH 38/42] Another build fix --- lib/vfs/src/overlay_fs.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/vfs/src/overlay_fs.rs b/lib/vfs/src/overlay_fs.rs index 3c304bc8de8..ac3057fb5ce 100644 --- a/lib/vfs/src/overlay_fs.rs +++ b/lib/vfs/src/overlay_fs.rs @@ -734,7 +734,7 @@ mod tests { fn load_webc(bytes: &'static [u8]) -> WebcFileSystem { let options = ParseOptions::default(); - let webc = WebCOwned::parse(bytes.into(), &options).unwrap(); + let webc = WebCOwned::parse(bytes, &options).unwrap(); WebcFileSystem::init_all(Arc::new(webc)) } From 6a4bbf876bb36c037dbdc9f646196efabcacd41a Mon Sep 17 00:00:00 2001 From: ptitSeb Date: Tue, 28 Mar 2023 18:53:05 +0200 Subject: [PATCH 39/42] [CI] Removed unused file --- .github/cross-linux-riscv64/Cross.toml | 2 -- 1 file changed, 2 deletions(-) delete mode 100644 .github/cross-linux-riscv64/Cross.toml diff --git a/.github/cross-linux-riscv64/Cross.toml b/.github/cross-linux-riscv64/Cross.toml deleted file mode 100644 index a63b1b72a21..00000000000 --- a/.github/cross-linux-riscv64/Cross.toml +++ /dev/null @@ -1,2 +0,0 @@ -[target.risc64gc-unknown-linux-gnu] -image = "wasmer/riscv64" From b86d182e4133fa45dbda437e067184dc66429bb8 Mon Sep 17 00:00:00 2001 From: ptitSeb Date: Wed, 29 Mar 2023 17:24:53 +0200 Subject: [PATCH 40/42] Use the correct webc version for cli --- lib/cli/Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/cli/Cargo.toml b/lib/cli/Cargo.toml index 80d8bc0441d..f0ae6921e22 100644 --- a/lib/cli/Cargo.toml +++ b/lib/cli/Cargo.toml @@ -64,7 +64,7 @@ regex = "1.6.0" toml = "0.5.9" url = "2.3.1" libc = { version = "^0.2", default-features = false } -webc = { version = "5.0.0-rc.6" } +webc = { version = "5.0.0-rc.5" } isatty = "0.1.9" dialoguer = "0.10.2" tldextract = "0.6.0" From 1cb0300c6dbdb7e841d4a428ebf3384aacec3584 Mon Sep 17 00:00:00 2001 From: ptitSeb Date: Wed, 5 Apr 2023 12:14:57 +0000 Subject: [PATCH 41/42] Fix build after merge --- lib/wasi/src/runners/wasi.rs | 7 +++---- lib/wasi/src/runners/wcgi/runner.rs | 10 ++++------ 2 files changed, 7 insertions(+), 10 deletions(-) diff --git a/lib/wasi/src/runners/wasi.rs b/lib/wasi/src/runners/wasi.rs index 2996273c49e..361863ea49b 100644 --- a/lib/wasi/src/runners/wasi.rs +++ b/lib/wasi/src/runners/wasi.rs @@ -163,10 +163,9 @@ impl crate::runners::Runner for WasiRunner { command: &Command, container: &WapmContainer, ) -> Result { - let Annotations { wasi } = command - .annotation(webc::metadata::annotations::WASI_RUNNER_URI)? - .unwrap_or_default(); - let wasi = wasi.unwrap_or_else(|| Wasi::new(command_name)); + let wasi = command + .annotation("wasi")? + .unwrap_or_else(|| Wasi::new(command_name)); let atom_name = &wasi.atom; let atom = container .get_atom(atom_name) diff --git a/lib/wasi/src/runners/wcgi/runner.rs b/lib/wasi/src/runners/wcgi/runner.rs index 2d263fc3d65..2e2bfbab087 100644 --- a/lib/wasi/src/runners/wcgi/runner.rs +++ b/lib/wasi/src/runners/wcgi/runner.rs @@ -44,11 +44,9 @@ impl WcgiRunner { fn run(&mut self, command_name: &str, ctx: &RunnerContext<'_>) -> Result<(), Error> { let wasi: Wasi = ctx .command() - .annotation(key) - .with_context(|| format!("Unable to deserialize the \"{key}\" annotations"))? - .unwrap_or_default(); - - let wasi = wasi.unwrap_or_else(|| Wasi::new(command_name)); + .annotation("wasi") + .context("Unable to retreive the WASI metadata")? + .unwrap_or_else(|| Wasi::new(command_name)); let module = self .load_module(&wasi, ctx) @@ -149,7 +147,7 @@ impl WcgiRunner { wasi: &Wasi, ctx: &RunnerContext<'_>, ) -> Result { - let Wcgi { dialect, .. } = ctx.command().get_annotation("wcgi")?.unwrap_or_default(); + let Wcgi { dialect, .. } = ctx.command().annotation("wcgi")?.unwrap_or_default(); let dialect = match dialect { Some(d) => d.parse().context("Unable to parse the CGI dialect")?, From 59c09337feee02c9e50d663021991d01431cffec Mon Sep 17 00:00:00 2001 From: ptitSeb Date: Thu, 6 Apr 2023 10:55:24 +0000 Subject: [PATCH 42/42] Use webc 5.0.0.0-rc.7 --- Cargo.lock | 38 ++++++++++++++++++++------------------ lib/c-api/Cargo.toml | 2 +- lib/cli/Cargo.toml | 2 +- lib/registry/Cargo.toml | 2 +- lib/vfs/Cargo.toml | 2 +- lib/wasi/Cargo.toml | 2 +- 6 files changed, 25 insertions(+), 23 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index becbecb0773..08999962354 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1278,14 +1278,14 @@ dependencies = [ [[package]] name = "filetime" -version = "0.2.20" +version = "0.2.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a3de6e8d11b22ff9edc6d916f890800597d60f8b2da1caf2955c274638d6412" +checksum = "5cbc844cecaee9d4443931972e1289c8ff485cb4cc2767cb03ca139ed6885153" dependencies = [ "cfg-if 1.0.0", "libc", "redox_syscall 0.2.16", - "windows-sys 0.45.0", + "windows-sys 0.48.0", ] [[package]] @@ -3715,9 +3715,9 @@ dependencies = [ [[package]] name = "serde_yaml" -version = "0.9.19" +version = "0.9.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f82e6c8c047aa50a7328632d067bcae6ef38772a79e28daf32f735e0e4f3dd10" +checksum = "d9d684e3ec7de3bf5466b32bd75303ac16f0736426e5a4e0d6e489559ce1249c" dependencies = [ "indexmap", "itoa", @@ -4631,9 +4631,9 @@ dependencies = [ [[package]] name = "unsafe-libyaml" -version = "0.2.7" +version = "0.2.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ad2024452afd3874bf539695e04af6732ba06517424dbf958fdb16a01f3bef6c" +checksum = "1865806a559042e51ab5414598446a5871b561d21b6764f2eabb0dd481d880a6" [[package]] name = "untrusted" @@ -4903,7 +4903,7 @@ dependencies = [ "url", "validator", "wapm-toml", - "wasmer-registry 4.2.0 (registry+https://github.com/rust-lang/crates.io-index)", + "wasmer-registry 4.2.0", "webc", ] @@ -4918,7 +4918,7 @@ dependencies = [ "serde", "serde_cbor", "serde_json", - "serde_yaml 0.9.19", + "serde_yaml 0.9.21", "thiserror", "toml", ] @@ -5530,6 +5530,8 @@ dependencies = [ [[package]] name = "wasmer-registry" version = "4.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7a2466288c71defce98142c435a11a346222ce863ff7dcd3606da295205bbb55" dependencies = [ "anyhow", "console", @@ -5540,31 +5542,23 @@ dependencies = [ "futures-util", "graphql_client", "hex", - "indexmap", "indicatif", "lazy_static", "log", "lzma-rs", - "minisign", - "rand", "regex", "reqwest", - "rpassword", - "rusqlite", "semver 1.0.17", "serde", "serde_json", "tar", "tempfile", "thiserror", - "time 0.3.20", "tldextract", "tokio", "toml", "url", "wasmer-toml", - "wasmer-wasm-interface", - "wasmparser 0.51.4", "webc", "whoami", ] @@ -5582,23 +5576,31 @@ dependencies = [ "futures-util", "graphql_client", "hex", + "indexmap", "indicatif", "lazy_static", "log", "lzma-rs", + "minisign", + "rand", "regex", "reqwest", + "rpassword", + "rusqlite", "semver 1.0.17", "serde", "serde_json", "tar", "tempfile", "thiserror", + "time 0.3.20", "tldextract", "tokio", "toml", "url", "wasmer-toml", + "wasmer-wasm-interface", + "wasmparser 0.51.4", "webc", "whoami", ] @@ -5629,7 +5631,7 @@ dependencies = [ "serde", "serde_cbor", "serde_json", - "serde_yaml 0.9.19", + "serde_yaml 0.9.21", "thiserror", "toml", ] diff --git a/lib/c-api/Cargo.toml b/lib/c-api/Cargo.toml index 85be4077e78..15648c9fd31 100644 --- a/lib/c-api/Cargo.toml +++ b/lib/c-api/Cargo.toml @@ -32,7 +32,7 @@ wasmer-middlewares = { version = "=3.2.0-beta.2", path = "../middlewares", optio wasmer-wasix = { version = "0.2.0", path = "../wasi", features = ["host-fs", "host-vnet"], optional = true } wasmer-types = { version = "=3.2.0-beta.2", path = "../types" } virtual-fs = { version = "0.1.1", path = "../vfs", optional = true, default-features = false, features = ["static-fs"] } -webc = { version = "=5.0.0-rc.5", optional = true } +webc = { version = "=5.0.0-rc.7", optional = true } enumset = "1.0.2" cfg-if = "1.0" lazy_static = "1.4" diff --git a/lib/cli/Cargo.toml b/lib/cli/Cargo.toml index 746545c615a..ab5882fda30 100644 --- a/lib/cli/Cargo.toml +++ b/lib/cli/Cargo.toml @@ -64,7 +64,7 @@ regex = "1.6.0" toml = "0.5.9" url = "2.3.1" libc = { version = "^0.2", default-features = false } -webc = { version = "=5.0.0-rc.5" } +webc = { version = "=5.0.0-rc.7" } isatty = "0.1.9" dialoguer = "0.10.2" tldextract = "0.6.0" diff --git a/lib/registry/Cargo.toml b/lib/registry/Cargo.toml index 6abbfbdd7d7..87305d0e697 100644 --- a/lib/registry/Cargo.toml +++ b/lib/registry/Cargo.toml @@ -27,7 +27,7 @@ tar = "0.4.38" flate2 = "1.0.24" semver = "1.0.14" lzma-rs = "0.2.0" -webc = { version = "=5.0.0-rc.5", features = ["mmap"] } +webc = { version = "=5.0.0-rc.7", features = ["mmap"] } hex = "0.4.3" tokio = "1.24.0" log = "0.4.17" diff --git a/lib/vfs/Cargo.toml b/lib/vfs/Cargo.toml index 8be9140a428..0eb6db13a1d 100644 --- a/lib/vfs/Cargo.toml +++ b/lib/vfs/Cargo.toml @@ -11,7 +11,7 @@ libc = { version = "^0.2", default-features = false, optional = true } thiserror = "1" tracing = { version = "0.1" } typetag = { version = "0.1", optional = true } -webc = { version = "=5.0.0-rc.5", optional = true } +webc = { version = "=5.0.0-rc.7", optional = true } slab = { version = "0.4" } derivative = "2.2.0" anyhow = { version = "1.0.66", optional = true } diff --git a/lib/wasi/Cargo.toml b/lib/wasi/Cargo.toml index 22507610194..b58b528578e 100644 --- a/lib/wasi/Cargo.toml +++ b/lib/wasi/Cargo.toml @@ -27,7 +27,7 @@ bincode = { version = "1.3" } chrono = { version = "^0.4", default-features = false, features = [ "wasmbind", "std", "clock" ], optional = true } derivative = { version = "^2" } bytes = "1" -webc = { version = "=5.0.0-rc.5", default-features = false } +webc = { version = "=5.0.0-rc.7", default-features = false } serde_cbor = { version = "0.11.2", optional = true } anyhow = { version = "1.0.66" } lazy_static = "1.4"