Stream: general

Topic: test compile errors?


view this post on Zulip Benjamin Bouvier (Apr 01 2020 at 15:15):

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?

view this post on Zulip Till Schneidereit (Apr 01 2020 at 15:19):

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

Standalone JIT-style runtime for WebAssembly, using Cranelift - bytecodealliance/wasmtime

view this post on Zulip Till Schneidereit (Apr 01 2020 at 15:20):

and https://github.com/bytecodealliance/wasmtime/blob/master/.github/workflows/main.yml#L243-L244

Standalone JIT-style runtime for WebAssembly, using Cranelift - bytecodealliance/wasmtime

view this post on Zulip Benjamin Bouvier (Apr 01 2020 at 15:21):

Ok, thanks! Indeed it compiles at least with cargo +nightly test --all

view this post on Zulip Alex Crichton (Apr 01 2020 at 15:33):

@Benjamin Bouvier you can also do cargo test --all --exclude lightbeam

view this post on Zulip Alex Crichton (Apr 01 2020 at 15:34):

it's a bummer you have to do that though :(

view this post on Zulip Benjamin Bouvier (Apr 01 2020 at 16:24):

@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)

view this post on Zulip Alex Crichton (Apr 01 2020 at 16:46):

@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)

view this post on Zulip Benjamin Bouvier (Apr 02 2020 at 14:59):

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.

Is there a plan to make the crate work on stable Rust at some point, i.e. using procedural macros (either via https://github.com/dtolnay/proc-macro-hack or using proper expression macros when they ...

view this post on Zulip Benjamin Bouvier (Apr 02 2020 at 15:00):

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.

view this post on Zulip Benjamin Bouvier (Apr 02 2020 at 15:01):

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

view this post on Zulip Benjamin Bouvier (Apr 02 2020 at 15:06):

Oh i see the line Till linked to also contains something to not run these tests.

view this post on Zulip Yury Delendik (Apr 02 2020 at 15:06):

You probably want to exclude "wasmtime-c-api " too -- it requires --test-threads 1

view this post on Zulip Benjamin Bouvier (Apr 02 2020 at 15:10):

Yep, thanks!

view this post on Zulip fitzgen (he/him) (Apr 02 2020 at 15:29):

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.

view this post on Zulip Yury Delendik (Apr 02 2020 at 15:31):

it calls make which call cargo to build wasmtime for c-api -- lots of cargo locks

view this post on Zulip fitzgen (he/him) (Apr 02 2020 at 15:32):

but that should Just Work, right? cargo's build locks shouldn't get broken if you don't pass --test-threads 1, right?

view this post on Zulip Yury Delendik (Apr 02 2020 at 15:33):

they are not

view this post on Zulip fitzgen (he/him) (Apr 02 2020 at 15:34):

ok, then it shouldn't require --test-threads 1 (at least for that reason) right?

view this post on Zulip Yury Delendik (Apr 02 2020 at 15:35):

not sure, it might due to multiple make (which do not have a lock)

view this post on Zulip Yury Delendik (Apr 02 2020 at 15:37):

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

view this post on Zulip fitzgen (he/him) (Apr 02 2020 at 15:44):

They seem to have two problems:

  1. be using the wrong examples dir: crates/c-api/examples rather than examples/ which is where the source files are, and

  2. invoking make when there doesn't appear to be a makefile anywhere

view this post on Zulip fitzgen (he/him) (Apr 02 2020 at 15:45):

(1) is an easy fix, but I don't know where the makefile is supposed to be...

view this post on Zulip fitzgen (he/him) (Apr 02 2020 at 15:47):

going to switch them to use cc I suppose...

view this post on Zulip Yury Delendik (Apr 02 2020 at 16:01):

There was Makefile in c-api/examples at one point :shrug:

view this post on Zulip Yury Delendik (Apr 02 2020 at 16:07):

It was removed at https://github.com/bytecodealliance/wasmtime/commit/3c51d3adb8646fd271771b6a7bfa0253f8af0477#diff-6462c44c9f4a73be62c7d161adb35442

* Move all examples to a top-level directory This commit moves all API examples (Rust and C) to a top-level `examples` directory. This is intended to make it more discoverable and conventional...

view this post on Zulip Yury Delendik (Apr 02 2020 at 16:13):

@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

Attempt to add some testing and its CI automation to C API crate.

view this post on Zulip fitzgen (he/him) (Apr 02 2020 at 17:05):

I've fixed the tests and enabled them in CI here: https://github.com/bytecodealliance/wasmtime/pull/1463

@Yury Delendik PTAL

GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.

view this post on Zulip Benjamin Bouvier (Apr 23 2020 at 11:56):

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?

view this post on Zulip Benjamin Bouvier (Apr 23 2020 at 12:00):

Oh well, cargo clean and a rerun made those pass. :shrug:


Last updated: Dec 23 2024 at 12:05 UTC