diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index eeeec5fd..71453aab 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -77,7 +77,6 @@ jobs: pyenv install --skip-existing "$(cat .python-version)" - name: Set up LLVM for `wasmer_compiler_llvm` - if: matrix.target.id != 'windows-amd64' # This is disabled in the `just` file, skip it to save data. shell: bash run: | curl --proto '=https' --tlsv1.2 -sSfL ${{ matrix.target.llvm-archive-url }} -o llvm.tar.gz diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 69a64bb9..681ee949 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -83,7 +83,6 @@ jobs: pyenv install --skip-existing "$(cat .python-version)" - name: Set up LLVM for `wasmer_compiler_llvm` - if: matrix.target.id != 'windows-amd64' # This is disabled in the `just` file, skip it to save data. shell: bash run: | curl --proto '=https' --tlsv1.2 -sSfL ${{ matrix.target.llvm-archive-url }} -o llvm.tar.gz diff --git a/packages/api/src/memory/buffer.rs b/packages/api/src/memory/buffer.rs index 30517e65..91d3e84e 100644 --- a/packages/api/src/memory/buffer.rs +++ b/packages/api/src/memory/buffer.rs @@ -25,7 +25,7 @@ use std::{ /// [buffer-protocol]: https://docs.python.org/3/c-api/buffer.html /// [bytes]: https://docs.python.org/3/library/stdtypes.html#bytes /// [bytearray]: https://docs.python.org/3/library/stdtypes.html#bytearray -/// [memoryview]: https://docs.python.org/3/library/stdtypes.html?#memoryview +/// [memoryview]: https://docs.python.org/3/library/stdtypes.html#memoryview /// /// ## Example /// diff --git a/tests/test_store.py b/tests/test_store.py index 0dfbfd5f..4124e2b6 100644 --- a/tests/test_store.py +++ b/tests/test_store.py @@ -1,4 +1,4 @@ -from wasmer import engine, Store, Module, Instance +from wasmer import engine, target, Store, Module, Instance import itertools import os import platform @@ -13,39 +13,60 @@ def test_store_defaults(): assert store.engine_name == 'jit' assert store.compiler_name == 'cranelift' -#@pytest.mark.skipif(platform.system() == 'Windows', reason='Wasmer (`master`) has some troubles with JIT on Windows for the moment.') -#def test_store_with_various_engines_and_compilers(): -# import wasmer_compiler_llvm -# -# engines = [ -# engine.JIT, -# engine.Native -# ] -# compilers = [ -# None, -# wasmer_compiler_cranelift.Compiler, -# wasmer_compiler_llvm.Compiler, -# wasmer_compiler_singlepass.Compiler -# ] -# results = [ -# ('jit', None), -# ('jit', 'cranelift'), -# ('jit', 'llvm'), -# ('jit', 'singlepass'), -# ('native', None), -# ('native', 'cranelift'), -# ('native', 'llvm'), -# ('native', 'singlepass'), -# ] -# -# for ((engine_, compiler), expected) in itertools.zip_longest(itertools.product(engines, compilers), results): -# store = Store(engine_(compiler)) -# -# assert store.engine_name == expected[0] -# assert store.compiler_name == expected[1] -# -# if compiler != None: -# module = Module(store, TEST_BYTES) -# instance = Instance(module) -# -# assert instance.exports.sum(1, 2) +@pytest.mark.skipif(platform.system() == 'Windows', reason = 'temp') +def test_store_with_various_engines_and_compilers(): + host_triple = target.Triple.host() + is_aarch64 = host_triple.architecture == 'aarch64' + exclude_native = is_aarch64 + + compilers = [None] + engines = [ + engine.JIT, + engine.Native + ] + results = [ + (None, 'jit'), + (None, 'native'), + ] + + try: + import wasmer_compiler_cranelift + + compilers.append(wasmer_compiler_cranelift.Compiler) + results.append(('cranelift', 'jit')) + results.append(('cranelift', 'native')) + except ImportError: + pass + + try: + import wasmer_compiler_llvm + + compilers.append(wasmer_compiler_llvm.Compiler) + results.append(('llvm', 'jit')) + results.append(('llvm', 'native')) + except ImportError: + pass + + try: + import wasmer_compiler_singlepass + + compilers.append(wasmer_compiler_singlepass.Compiler) + results.append(('singlepass', 'jit')) + results.append(('singlepass', 'native')) + except ImportError: + pass + + for ((compiler, engine_), expected) in itertools.zip_longest(itertools.product(compilers, engines), results): + if exclude_native and engine_ == engine.Native: + continue + + store = Store(engine_(compiler)) + + assert store.compiler_name == expected[0] + assert store.engine_name == expected[1] + + if compiler != None: + module = Module(store, TEST_BYTES) + instance = Instance(module) + + assert instance.exports.sum(1, 2) diff --git a/tests/test_target.py b/tests/test_target.py index e8fd94bf..855d79d6 100644 --- a/tests/test_target.py +++ b/tests/test_target.py @@ -43,7 +43,7 @@ def test_target_with_default_cpu_features(): triple = target.Triple.host() target_ = target.Target(triple) -@pytest.mark.skip(reason = 'CI does not have `gcc` or `clang` installed for the moment. It will be resolved once LLVM is installed.') +@pytest.mark.skipif(platform.system() == 'Windows', reason = '`clang` is not found on the CI for the moment') def test_cross_compilation_roundtrip(): triple = target.Triple('x86_64-linux-musl') cpu_features = target.CpuFeatures()