With a fresh clone of wasmtime, it seems i hit compile errors when running cargo test --all
:
error[E0554]: `#![feature]` may not be used on the stable release channel --> /home/ben/.cargo/registry/src/github.com-1ecc6299db9ec823/dynasm-0.5.2/src/lib.rs:1:1 | 1 | #![feature(proc_macro_diagnostic)] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error[E0554]: `#![feature]` may not be used on the stable release channel --> /home/ben/.cargo/registry/src/github.com-1ecc6299db9ec823/dynasm-0.5.2/src/lib.rs:2:1 | 2 | #![feature(proc_macro_span)] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Is it expected?
That's from Lightbeam, which currently only works on Nightly, which is why we only run these tests on Nightly: https://github.com/bytecodealliance/wasmtime/blob/master/.github/workflows/main.yml#L227
and https://github.com/bytecodealliance/wasmtime/blob/master/.github/workflows/main.yml#L243-L244
Ok, thanks! Indeed it compiles at least with cargo +nightly test --all
@Benjamin Bouvier you can also do cargo test --all --exclude lightbeam
it's a bummer you have to do that though :(
@Alex Crichton Ah nice, thanks! Would it make sense to have a tiny bash utility at the top-level, with a "test" command, to do this? (and we could put other utility commands, for other cases like this)
@Benjamin Bouvier perhaps yeah, but I'd ideally prefer to put effort towards getting cargo test --all
working or something like that (e.g. by disabling tests in lightbeam
or moving them behind a feature)
One piece of information: dynasm requires a nightly Rust to build: https://github.com/CensoredUsername/dynasm-rs/issues/31, and lightbeam uses dynasm. Recently one of the nightly requirements has been removed, but there's still one that can't be easily removed, it seems.
I don't understand much about proc macros and all, but if anybody wanted to take a look, then we could make it work on Rust too in general, and that would benefit the whole ecosystem, etc.
Another thing: now when i run cargo test --all --exclude lightbeam
, the C-API tests fail because it seems the files don't exist??
---- test_run_trap_example stdout ---- thread 'test_run_trap_example' panicked at 'success: Os { code: 2, kind: NotFound, message: "No such file or directory" }', crates/c-api/tests/wasm-c-examples.rs:10:18 failures: test_run_callback_example test_run_global_example test_run_hello_example test_run_memory_example test_run_reflect_example test_run_start_example test_run_trap_example
Oh i see the line Till linked to also contains something to not run these tests.
You probably want to exclude "wasmtime-c-api " too -- it requires --test-threads 1
Yep, thanks!
Yury Delendik said:
You probably want to exclude "wasmtime-c-api " too -- it requires
--test-threads 1
Out of curiosity, why does it require --test-threads 1
? I glanced at the tests but the answer didn't immediately jump out at me. Would it work to have a global lock to sequentialize each test thread? That way, even though they would still run sequentially, one wouldn't have to supply --test-threads 1
.
it calls make
which call cargo
to build wasmtime for c-api -- lots of cargo locks
but that should Just Work, right? cargo's build locks shouldn't get broken if you don't pass --test-threads 1
, right?
they are not
ok, then it shouldn't require --test-threads 1
(at least for that reason) right?
not sure, it might due to multiple make
(which do not have a lock)
To be clear, I was just meant that for efficient wasmtime-c-api run, it will make sense to use "test-threads 1". it might not to related to failures
They seem to have two problems:
be using the wrong examples dir: crates/c-api/examples
rather than examples/
which is where the source files are, and
invoking make
when there doesn't appear to be a makefile anywhere
(1) is an easy fix, but I don't know where the makefile is supposed to be...
going to switch them to use cc
I suppose...
There was Makefile in c-api/examples at one point :shrug:
It was removed at https://github.com/bytecodealliance/wasmtime/commit/3c51d3adb8646fd271771b6a7bfa0253f8af0477#diff-6462c44c9f4a73be62c7d161adb35442
@fitzgen (he/him) I guess this line prevented us from noticing any errors on CI https://github.com/bytecodealliance/wasmtime/pull/904/files#diff-90829e76e906f1c73140c7ded7e1b268R203
I've fixed the tests and enabled them in CI here: https://github.com/bytecodealliance/wasmtime/pull/1463
@Yury Delendik PTAL
I get new compile errors when trying to use cargo test --all --exclude lightbeam
from the top level directory:
failures: src/externals.rs - externals::Memory::grow (line 811) src/externals.rs - externals::Memory::new (line 671) src/func.rs - func::Func (line 101) src/func.rs - func::Func (line 35) src/func.rs - func::Func (line 65) src/func.rs - func::Func::wrap (line 335) src/func.rs - func::Func::wrap (line 361) src/func.rs - func::Func::wrap (line 392) src/func.rs - func::Func::wrap (line 425) src/linker.rs - linker::Linker::allow_shadowing (line 97) src/linker.rs - linker::Linker::define (line 135) src/linker.rs - linker::Linker::func (line 186) src/linker.rs - linker::Linker::instance (line 234) src/linker.rs - linker::Linker::new (line 71) src/module.rs - module::Module::exports (line 429) src/module.rs - module::Module::from_binary (line 223) src/module.rs - module::Module::imports (line 371) src/module.rs - module::Module::imports (line 383) src/module.rs - module::Module::new (line 151) src/runtime.rs - runtime::Store::interrupt_handle (line 643) src/trap.rs - trap::Trap::new (line 28)
A detailed failure shows a cc
failure, with ld
returning 1 exit status. How can I run these tests properly on my machine?
Oh well, cargo clean and a rerun made those pass. :shrug:
Last updated: Dec 23 2024 at 12:05 UTC