1143: Set backend_id to static str r=MarkMcCaskey a=syrusakbary
<!--
Prior to submitting a PR, review the CONTRIBUTING.md document for recommendations on how to test:
https://github.com/wasmerio/wasmer/blob/master/CONTRIBUTING.md#pull-requests
-->
# Description
As per feedback in #1099, set backend_id to static str.
<!--
Provide details regarding the change including motivation,
links to related issues, and the context of the PR.
-->
# Review
- [ ] Add a short description of the the change to the CHANGELOG.md file
Co-authored-by: Syrus <me@syrusakbary.com>
Co-authored-by: Mark McCaskey <mark@wasmer.io>
1149: fix(bin) Remove a warning for unreachable code. r=MarkMcCaskey a=Hywan
The `panic!` statement is indeed unreachable for regular usages, but
not for wrong feature configurations. Allowing `unreachable_code` to
avoid a warning.
Co-authored-by: Ivan Enderlin <ivan.enderlin@hoa-project.net>
The `panic!` statement is indeed unreachable for regular usages, but
not for wrong feature configurations. Allowing `unreachable_code` to
avoid a warning.
760: Add Publish_Docs stage, make it push to a fake gh-pages branch for testing whenever master is updated. r=syrusakbary a=nlewycky
bors r-
Co-authored-by: Nick Lewycky <nick@wasmer.io>
Co-authored-by: Syrus <me@syrusakbary.com>
Co-authored-by: Azure Pipelines <azuredevops@microsoft.com>
1133: feat(runtime-c-api) Implement `wasmer_trap` r=Hywan a=Hywan
Idea is to provide an API to get fallible host function by calling `wasmer_trap` to run the Wasmer trapping API.
This is probably the easiest solution to not break the existing API, and not add a lot of complexity in the code.
Co-authored-by: Ivan Enderlin <ivan.enderlin@hoa-project.net>
1147: Update logging to use `log`, add command line flag to toggle it r=MarkMcCaskey a=MarkMcCaskey
This PR:
- ports our logging to the [`log`](https://crates.io/crates/log) crate which is the de-facto standard way to do logging in Rust (it defines a trait which logging backends can implement (we can also implement our own at a later date using these traits)). Another benefit of using the standard logging utilities is that we can now allow users of our libraries to filter and display log messages from Wasmer in a more natural way.
- adds a command line flag to enable/disable logging
- updates the `debug` and `trace` features to pass the correct static toggles to the `log` crate; judging by the `log` documentation these features need to only be set once
- copies and slightly modifies our `fern` configuration from wapm
- updates the makefile so that `make release` compiles out all log statements
- TODO: update CI to not print with color (may not be necessary actually)
# Review
- [x] Add a short description of the the change to the CHANGELOG.md file
Here's some example output:
```
[1579035881.809 DEBUG wasmer_wasi::state] wasi::fs::inodes
[1579035881.809 DEBUG wasmer_wasi::state] wasi::fs::preopen_dirs
[1579035881.809 DEBUG wasmer_wasi::state] wasi::fs::mapped_dirs
[1579035881.809 DEBUG wasmer_wasi::state] wasi::fs::end
[1579035881.810 DEBUG wasmer_wasi::syscalls] wasi::fd_prestat_get: fd=3
[1579035881.810 DEBUG wasmer_wasi::state] in prestat_fd Fd { rights: 536870911, rights_inheriting: 536870911, flags: 0, offset: 0, open_flags: 1, inode: Index { index: 3, generation: 0 } }
[1579035881.810 DEBUG wasmer_wasi::syscalls] wasi::fd_prestat_dir_name: fd=3, path_len=2
[1579035881.810 DEBUG wasmer_wasi::syscalls] => result: "/"
[1579035881.810 DEBUG wasmer_wasi::syscalls] wasi::fd_fdstat_get: fd=3, buf_ptr=1048536
[1579035881.810 DEBUG wasmer_wasi::state] fdstat: Fd { rights: 536870911, rights_inheriting: 536870911, flags: 0, offset: 0, open_flags: 1, inode: Index { index: 3, generation: 0 } }
[1579035881.810 DEBUG wasmer_wasi::syscalls] wasi::fd_prestat_get: fd=4
[1579035881.810 DEBUG wasmer_wasi::syscalls] wasi::environ_sizes_get
[1579035881.810 DEBUG wasmer_wasi::syscalls] env_var_count: 0, env_buf_size: 0
[1579035881.810 DEBUG wasmer_wasi::syscalls] wasi::args_sizes_get
[1579035881.810 DEBUG wasmer_wasi::syscalls] => argc=3, argv_buf_size=92
[1579035881.810 DEBUG wasmer_wasi::syscalls] wasi::args_get
[1579035881.810 DEBUG wasmer_wasi::syscalls] => args:
0: /Users/mark/.wasmer/globals/wapm_packages/mark/rust-example@0.1.11/wasi-example.wasm
1: -e
2: HQ+
[1579035881.810 DEBUG wasmer_wasi::syscalls] wasi::args_sizes_get
[1579035881.811 DEBUG wasmer_wasi::syscalls] => argc=3, argv_buf_size=92
[1579035881.811 DEBUG wasmer_wasi::syscalls] wasi::args_get
[1579035881.811 DEBUG wasmer_wasi::syscalls] => args:
0: /Users/mark/.wasmer/globals/wapm_packages/mark/rust-example@0.1.11/wasi-example.wasm
1: -e
2: HQ+
[1579035881.811 DEBUG wasmer_wasi::syscalls] wasi::random_get buf_len: 16
[1579035881.811 DEBUG wasmer_wasi::syscalls] wasi::fd_write: fd=1
Hello, world!
[1579035881.811 DEBUG wasmer_wasi::syscalls] wasi::fd_write: fd=1
HQ+
```
Co-authored-by: Mark McCaskey <mark@wasmer.io>