diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index c49b0a26a..71f536c60 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -1,25 +1,24 @@ -# -src/ @syrusakbary @MarkMcCaskey - -# Backends -lib/compiler-singlepass @losfair @nlewycky -lib/compiler-cranelift @syrusakbary @nlewycky -lib/compiler-llvm @nlewycky @losfair - -# Runtime -lib/runtime @syrusakbary @Hywan -lib/c-api @Hywan - -# Frontend integrations - -## Emscripten -lib/emscripten @MarkMcCaskey @syrusakbary - -## WASI -lib/wasi @MarkMcCaskey - -# Examples -examples @syrusakbary - -# Examples -tests @syrusakbary @MarkMcCaskey +benches @syrusakbary +examples @Hywan @jubianchi +fuzz @syrusakbary +lib/api @syrusakbary @Hywan @MarkMcCaskey +lib/c-api @Hywan @MarkMcCaskey @jubianchi +lib/cache @syrusakbary @Hywan +lib/cli @syrusakbary @MarkMcCaskey +lib/compiler @syrusakbary @nlewycky @losfair @Hywan @MarkMcCaskey +lib/compiler-cranelift @nlewycky @syrusakbary +lib/compiler-llvm @nlewycky @losfair +lib/compiler-singlepass @losfair @nlewycky +lib/deprecated @Hywan @MarkMcCaskey +lib/emscripten @MarkMcCaskey +lib/engine @syrusakbary @MarkMcCaskey @Hywan +lib/engine-jit @syrusakbary @MarkMcCaskey @Hywan +lib/engine-native @syrusakbary @MarkMcCaskey @Hywan +lib/engine-object-file @syrusakbary @MarkMcCaskey @Hywan +lib/object @syrusakbary @nlewycky +lib/vm @syrusakbary @nlewycky @MarkMcCaskey +lib/wasi @MarkMcCaskey +lib/wasi-experimental-io-devices @MarkMcCaskey +lib/wasmer-types @syrusakbary @Hywan +scripts @syrusakbary +tests @MarkMcCaskey \ No newline at end of file diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index 04e99e589..cdd9e2af7 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -143,8 +143,8 @@ jobs: - run: make test - name: Build and Test C API run: | - make build-capi make test-capi + make build-capi if: matrix.os != 'windows-latest' - name: Build C API on Windows run: make build-capi diff --git a/CHANGELOG.md b/CHANGELOG.md index 64b844d6b..8b0db1ecd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,9 +7,21 @@ ## **[Unreleased]** -- [#1710](https://github.com/wasmerio/wasmer/pull/1710) Memory for function call trampolines is now owned by the Artifact. ### Added +- [#1649](https://github.com/wasmerio/wasmer/pull/1649) Add outline of migration to 1.0.0 docs. + +### Changed + +### Fixed + +- [#1764](https://github.com/wasmerio/wasmer/pull/1764) Fix bug in WASI `path_rename` allowing renamed files to be 1 directory below a preopened directory. + +## 1.0.0-alpha5 - 2020-11-06 + +### Added + +- [#1761](https://github.com/wasmerio/wasmer/pull/1761) Implement the `wasm_trap_t**` argument of `wasm_instance_new` in the Wasm C API. - [#1687](https://github.com/wasmerio/wasmer/pull/1687) Add basic table example; fix ownership of local memory and local table metadata in the VM. - [#1751](https://github.com/wasmerio/wasmer/pull/1751) Implement `wasm_trap_t` inside a function declared with `wasm_func_new_with_env` in the Wasm C API. - [#1741](https://github.com/wasmerio/wasmer/pull/1741) Implement `wasm_memory_type` in the Wasm C API. @@ -20,15 +32,26 @@ - [#1715](https://github.com/wasmerio/wasmer/pull/1715) Register errors from `wasm_module_serialize` in the Wasm C API. - [#1709](https://github.com/wasmerio/wasmer/pull/1709) Implement `wasm_module_name` and `wasm_module_set_name` in the Wasm(er) C API. - [#1700](https://github.com/wasmerio/wasmer/pull/1700) Implement `wasm_externtype_copy` in the Wasm C API. +- [#1785](https://github.com/wasmerio/wasmer/pull/1785) Add more examples on the Rust API. +- [#1783](https://github.com/wasmerio/wasmer/pull/1783) Handle initialized but empty results in `wasm_func_call` in the Wasm C API. +- [#1780](https://github.com/wasmerio/wasmer/pull/1780) Implement new SIMD zero-extend loads in compiler-llvm. +- [#1754](https://github.com/wasmerio/wasmer/pull/1754) Implement aarch64 ABI for compiler-llvm. +- [#1693](https://github.com/wasmerio/wasmer/pull/1693) Add `wasmer create-exe` subcommand. ### Changed - [#1772](https://github.com/wasmerio/wasmer/pull/1772) Remove lifetime parameter from `NativeFunc`. - [#1762](https://github.com/wasmerio/wasmer/pull/1762) Allow the `=` sign in a WASI environment variable value. +- [#1710](https://github.com/wasmerio/wasmer/pull/1710) Memory for function call trampolines is now owned by the Artifact. +- [#1781](https://github.com/wasmerio/wasmer/pull/1781) Cranelift upgrade to 0.67. +- [#1777](https://github.com/wasmerio/wasmer/pull/1777) Wasmparser update to 0.65. +- [#1775](https://github.com/wasmerio/wasmer/pull/1775) Improve LimitingTunables implementation. +- [#1720](https://github.com/wasmerio/wasmer/pull/1720) Autodetect llvm regardless of architecture. ### Fixed - [#1718](https://github.com/wasmerio/wasmer/pull/1718) Fix panic in the API in some situations when the memory's min bound was greater than the memory's max bound. +- [#1731](https://github.com/wasmerio/wasmer/pull/1731) In compiler-llvm always load before store, to trigger any traps before any bytes are written. ## 1.0.0-alpha4 - 2020-10-08 @@ -41,6 +64,7 @@ - [#1690](https://github.com/wasmerio/wasmer/pull/1690) Fix `wasm_memorytype_limits` where `min` and `max` represents pages, not bytes. Additionally, fixes the max limit sentinel value. - [#1671](https://github.com/wasmerio/wasmer/pull/1671) Fix probestack firing inappropriately, and sometimes over/under allocating stack. - [#1660](https://github.com/wasmerio/wasmer/pull/1660) Fix issue preventing map-dir aliases starting with `/` from working properly. +- [#1624](https://github.com/wasmerio/wasmer/pull/1624) Add Value::I32/Value::I64 converters from unsigned ints. ### Changed - [#1682](https://github.com/wasmerio/wasmer/pull/1682) Improve error reporting when making a memory with invalid settings. diff --git a/Cargo.lock b/Cargo.lock index fdd942ca8..a224f657a 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -8,11 +8,11 @@ checksum = "955f37ac58af2416bac687c8ab66a4ccba282229bd7422a28d2281a5e66a6116" [[package]] name = "addr2line" -version = "0.13.0" +version = "0.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1b6a2d3371669ab3ca9797670853d61402b03d0b4b9ebf33d677dfa720203072" +checksum = "7c0929d69e78dd9bf5408269919fcbcaeb2e35e5d43e5815517cdc6a8e11a423" dependencies = [ - "gimli 0.22.0", + "gimli 0.23.0", ] [[package]] @@ -28,10 +28,16 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e8fd72866655d1904d6b0997d0b07ba561047d070fbe29de039031c641b61217" [[package]] -name = "aho-corasick" -version = "0.7.13" +name = "ahash" +version = "0.4.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "043164d8ba5c4c3035fec9bbee8647c0261d788f3474306f93bb65901cae0e86" +checksum = "f6789e291be47ace86a60303502173d84af8327e3627ecf334356ee0f87a164c" + +[[package]] +name = "aho-corasick" +version = "0.7.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7404febffaa47dac81aa44dba71523c9d069b1bdc50a77db41195149e17f68e5" dependencies = [ "memchr", ] @@ -47,9 +53,9 @@ dependencies = [ [[package]] name = "anyhow" -version = "1.0.32" +version = "1.0.34" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6b602bfe940d21c130f3895acd65221e8a61270debe89d628b9cb4e3ccb8569b" +checksum = "bf8dcb5b4bbaa28653b647d8c77bd4ed40183b48882e130c1f1ffb73de069fd7" [[package]] name = "arrayref" @@ -59,9 +65,22 @@ checksum = "a4c527152e37cf757a3f78aae5a06fbeefdb07ccc535c980a3208ee3060dd544" [[package]] name = "arrayvec" -version = "0.5.1" +version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cff77d8686867eceff3105329d4698d96c2391c176d5d03adc90c7389162b5b8" +checksum = "23b62fc65de8e4e7f52534fb52b0f3ed04746ae267519eef2a83941e8085068b" + +[[package]] +name = "assert_cmd" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c88b9ca26f9c16ec830350d309397e74ee9abdfd8eb1f71cb6ecc71a3fc818da" +dependencies = [ + "doc-comment", + "predicates", + "predicates-core", + "predicates-tree", + "wait-timeout", +] [[package]] name = "atty" @@ -88,15 +107,15 @@ checksum = "cdb031dd78e28731d87d56cc8ffef4a8f36ca26c38fe2de700543e627f8a464a" [[package]] name = "backtrace" -version = "0.3.50" +version = "0.3.54" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "46254cf2fdcdf1badb5934448c1bcbe046a56537b3987d96c51a7afc5d03f293" +checksum = "2baad346b2d4e94a24347adeee9c7a93f412ee94b9cc26e5b59dea23848e9f28" dependencies = [ "addr2line", - "cfg-if", + "cfg-if 1.0.0", "libc", "miniz_oxide", - "object 0.20.0", + "object 0.22.0", "rustc-demangle", ] @@ -124,7 +143,7 @@ checksum = "f1c85344eb535a31b62f0af37be84441ba9e7f0f4111eb0530f43d15e513fe57" dependencies = [ "bitflags", "cexpr", - "cfg-if", + "cfg-if 0.1.10", "clang-sys", "clap", "env_logger", @@ -159,14 +178,14 @@ dependencies = [ [[package]] name = "blake3" -version = "0.3.6" +version = "0.3.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ce4f9586c9a3151c4b49b19e82ba163dd073614dd057e53c969e1a4db5b52720" +checksum = "e9ff35b701f3914bdb8fad3368d822c766ef2858b2583198e41639b936f09d3f" dependencies = [ "arrayref", "arrayvec", "cc", - "cfg-if", + "cfg-if 0.1.10", "constant_time_eq", "crypto-mac", "digest", @@ -174,9 +193,9 @@ dependencies = [ [[package]] name = "bstr" -version = "0.2.13" +version = "0.2.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "31accafdb70df7871592c058eca3985b71104e15ac32f64706022c58867da931" +checksum = "473fc6b38233f9af7baa94fb5852dca389e3d95b8e21c8e3719301462c5d9faf" dependencies = [ "lazy_static", "memchr", @@ -217,7 +236,7 @@ version = "0.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4b9434b9a5aa1450faa3f9cb14ea0e8c53bb5d2b3c1bfd1ab4fc03e9f33fbfb0" dependencies = [ - "rustc_version", + "rustc_version 0.2.3", ] [[package]] @@ -241,9 +260,9 @@ dependencies = [ [[package]] name = "cc" -version = "1.0.60" +version = "1.0.62" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ef611cc68ff783f18535d77ddd080185275713d852c4f5cbb6122c462a7a825c" +checksum = "f1770ced377336a88a67c473594ccc14eca6f4559217c34f64aac8f83d641b40" [[package]] name = "cexpr" @@ -251,7 +270,7 @@ version = "0.3.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fce5b5fb86b0c57c20c834c1b412fd09c77c8a59b9473f86272709e78874cd1d" dependencies = [ - "nom", + "nom 4.2.3", ] [[package]] @@ -260,6 +279,12 @@ version = "0.1.10" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4785bdd1c96b2a846b2bd7cc02e86b6b3dbf14e7e53446c4f54c92a361040822" +[[package]] +name = "cfg-if" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" + [[package]] name = "clang-sys" version = "0.28.1" @@ -347,6 +372,13 @@ dependencies = [ "winapi", ] +[[package]] +name = "const_fn" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c478836e029dcef17fb47c89023448c64f781a046e0300e257ad8225ae59afab" + + [[package]] name = "constant_time_eq" version = "0.1.5" @@ -355,18 +387,18 @@ checksum = "245097e9a4535ee1e3e3931fcfcd55a796a44c643e8596ff6566d68f09b87bbc" [[package]] name = "cranelift-bforest" -version = "0.65.0" +version = "0.67.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d9413a2c6bdb01ab8acc867421bd7343ddea491d015453f4e56f4f60c816d120" +checksum = "0f065f6889758f817f61a230220d1811ba99a9762af2fb69ae23048314f75ff2" dependencies = [ "cranelift-entity", ] [[package]] name = "cranelift-codegen" -version = "0.65.0" +version = "0.67.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f28d389588c2375bb95292e0bc6cbf010e7f30fb4e9734738b576521b737826a" +checksum = "510aa2ab4307644100682b94e449940a0ea15c5887f1d4b9678b8dd5ef31e736" dependencies = [ "byteorder", "cranelift-bforest", @@ -385,9 +417,9 @@ dependencies = [ [[package]] name = "cranelift-codegen-meta" -version = "0.65.0" +version = "0.67.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "74dd3cf6f107c1df4c2b8aab91ec4181aee7ff17289673fcbec63325e7e40a83" +checksum = "b4cb0c7e87c60d63b35f9670c15479ee4a5e557dd127efab88b2f9b2ca83c9a0" dependencies = [ "cranelift-codegen-shared", "cranelift-entity", @@ -395,24 +427,24 @@ dependencies = [ [[package]] name = "cranelift-codegen-shared" -version = "0.65.0" +version = "0.67.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "efaf050fab2dbf324544489443ff3cc8c67c9420c8902ec6628bd906bd7393e9" +checksum = "60636227098693e06de8d6d88beea2a7d32ecf8a8030dacdb57c68e06f381826" [[package]] name = "cranelift-entity" -version = "0.65.0" +version = "0.67.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f07eb8aa0a5da94b56339e4e3052c496a3df4354357cd5da8c7b02c6e8f1dc1d" +checksum = "6156db73e0c9f65f80c512988d63ec736be0dee3dd66bf951e3e28aed9dc02d3" dependencies = [ "serde", ] [[package]] name = "cranelift-frontend" -version = "0.65.0" +version = "0.67.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0f6fe1d3e968576f4b60d23f40ee90281f8de2cdf23d2110f3b0296ff420555e" +checksum = "e09cd158c9a820a4cc14a34076811da225cce1d31dc6d03c5ef85b91aef560b9" dependencies = [ "cranelift-codegen", "hashbrown 0.7.2", @@ -423,11 +455,11 @@ dependencies = [ [[package]] name = "crc32fast" -version = "1.2.0" +version = "1.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ba125de2af0df55319f41944744ad91c71113bf74a4646efff39afe1f6842db1" +checksum = "81156fece84ab6a9f2afdb109ce3ae577e42b1228441eded99bd77f627953b1a" dependencies = [ - "cfg-if", + "cfg-if 1.0.0", ] [[package]] @@ -468,48 +500,48 @@ dependencies = [ [[package]] name = "crossbeam-channel" -version = "0.4.4" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b153fe7cbef478c567df0f972e02e6d736db11affe43dfc9c56a9374d1adfb87" +checksum = "dca26ee1f8d361640700bde38b2c37d8c22b3ce2d360e1fc1c74ea4b0aa7d775" dependencies = [ + "cfg-if 1.0.0", "crossbeam-utils", - "maybe-uninit", ] [[package]] name = "crossbeam-deque" -version = "0.7.3" +version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9f02af974daeee82218205558e51ec8768b48cf524bd01d550abe5573a608285" +checksum = "94af6efb46fef72616855b036a624cf27ba656ffc9be1b9a3c931cfc7749a9a9" dependencies = [ + "cfg-if 1.0.0", "crossbeam-epoch", "crossbeam-utils", - "maybe-uninit", ] [[package]] name = "crossbeam-epoch" -version = "0.8.2" +version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "058ed274caafc1f60c4997b5fc07bf7dc7cca454af7c6e81edffe5f33f70dace" +checksum = "ec0f606a85340376eef0d6d8fec399e6d4a544d648386c6645eb6d0653b27d9f" dependencies = [ - "autocfg 1.0.1", - "cfg-if", + "cfg-if 1.0.0", + "const_fn", "crossbeam-utils", "lazy_static", - "maybe-uninit", "memoffset", "scopeguard", ] [[package]] name = "crossbeam-utils" -version = "0.7.2" +version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c3c7c73a2d1e9fc0886a08b93e98eb643461230d5f1925e4036204d5f2e261a8" +checksum = "ec91540d98355f690a86367e566ecad2e9e579f230230eb7c21398372be73ea5" dependencies = [ "autocfg 1.0.1", - "cfg-if", + "cfg-if 1.0.0", + "const_fn", "lazy_static", ] @@ -525,9 +557,9 @@ dependencies = [ [[package]] name = "csv" -version = "1.1.3" +version = "1.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "00affe7f6ab566df61b4be3ce8cf16bc2576bca0963ceb0955e45d514bf9a279" +checksum = "fc4666154fd004af3fd6f1da2e81a96fd5a81927fe8ddb6ecc79e2aa6e138b54" dependencies = [ "bstr", "csv-core", @@ -596,6 +628,12 @@ version = "0.1.12" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0e25ea47919b1560c4e3b7fe0aaab9becf5b84a10325ddf7db0f0ba5e1026499" +[[package]] +name = "difference" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "524cbf6897b527295dff137cec09ecf3a05f4fddffd7dfcd1585403449e74198" + [[package]] name = "digest" version = "0.9.0" @@ -633,13 +671,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6d9d8664cf849d7d0f3114a3a387d2f5e4303176d746d5a951aaddc66dfe9240" [[package]] -name = "dlib" -version = "0.4.2" +name = "doc-comment" +version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b11f15d1e3268f140f68d390637d5e76d849782d971ae7063e0da69fe9709a76" -dependencies = [ - "libloading 0.6.3", -] +checksum = "fea41bba32d969b513997752735605054bc0dfa92b4c56bf1189f2e174be7a10" [[package]] name = "downcast-rs" @@ -749,6 +784,14 @@ dependencies = [ "libc", "redox_syscall", "winapi", + +[[package]] +name = "float-cmp" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e1267f4ac4f343772758f7b1bdcbe767c218bbab93bb432acbf5162bbf85a6c4" +dependencies = [ + "num-traits", ] [[package]] @@ -769,7 +812,7 @@ version = "0.2.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8e1d3b771574f62d0548cee0ad9057857e9fc25d7a3335f140c84f6acd0bf601" dependencies = [ - "cfg-if", + "cfg-if 0.1.10", "serde", ] @@ -798,7 +841,18 @@ version = "0.1.15" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fc587bc0ec293155d5bfa6b9891ec18a1e330c234f896ea47fbada4cadbe47e6" dependencies = [ - "cfg-if", + "cfg-if 0.1.10", + "libc", + "wasi 0.9.0+wasi-snapshot-preview1", +] + +[[package]] +name = "getrandom" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ee8025cf36f917e6a52cce185b7c7177689b838b7ec138364e50cc2277a56cf4" +dependencies = [ + "cfg-if 0.1.10", "libc", "wasi 0.9.0+wasi-snapshot-preview1", ] @@ -827,9 +881,9 @@ dependencies = [ [[package]] name = "gimli" -version = "0.22.0" +version = "0.23.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aaf91faf136cb47367fa430cd46e37a788775e7fa104f8b4bcb3861dc389b724" +checksum = "f6503fe142514ca4799d4c26297c4248239fe8838d827db6bd6065c6ed29a6ce" [[package]] name = "glob" @@ -860,26 +914,19 @@ version = "0.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "96282e96bfcd3da0d3aa9938bedf1e50df3269b6db08b4876d2da0bb1a0841cf" dependencies = [ - "ahash", + "ahash 0.3.8", "autocfg 1.0.1", ] [[package]] name = "hashbrown" -version = "0.8.2" +version = "0.9.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e91b62f79061a0bc2e046024cb7ba44b08419ed238ecbd9adbd787434b9e8c25" +checksum = "d7afe4a420e3fe79967a00898cc1f4db7c8a49a9333a29f8a4bd76a253d5cd04" dependencies = [ - "ahash", - "autocfg 1.0.1", + "ahash 0.4.6", ] -[[package]] -name = "hashbrown" -version = "0.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "00d63df3d41950fb462ed38308eea019113ad1508da725bbedcd0fa5a85ef5f7" - [[package]] name = "heck" version = "0.3.1" @@ -891,9 +938,9 @@ dependencies = [ [[package]] name = "hermit-abi" -version = "0.1.16" +version = "0.1.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4c30f6d0bc6b00693347368a67d41b58f2fb851215ff1da49e90fe2c5c667151" +checksum = "5aca5565f760fb5b220e499d72710ed156fdb74e631659e99377d9ebfbd13ae8" dependencies = [ "libc", ] @@ -926,7 +973,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "55e2e4c765aa53a0424761bf9f41aa7a6ac1efa87238f59560640e27fca028f2" dependencies = [ "autocfg 1.0.1", - "hashbrown 0.9.0", + "hashbrown 0.9.1", "serde", ] @@ -957,12 +1004,38 @@ dependencies = [ ] [[package]] -name = "instant" -version = "0.1.7" +name = "inline-c" +version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "63312a18f7ea8760cdd0a7c5aac1a619752a246b833545e3e36d1f81f7cd9e66" +checksum = "6acf1564e52050c9f7102e87951265c4c8012873181998be24640cb6b5e3f77c" dependencies = [ - "cfg-if", + "assert_cmd", + "cc", + "inline-c-macro", + "lazy_static", + "predicates", + "regex", + "target-lexicon", + "tempfile", +] + +[[package]] +name = "inline-c-macro" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "18417ebfdcd2ffc446b55558a66ce4e1d3a7127af7889a1014288aabc8dcbf2d" +dependencies = [ + "proc-macro2", + "quote", +] + +[[package]] +name = "instant" +version = "0.1.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cb1fc4429a33e1f80d41dc9fea4d108a88bec1de8053878898ae448a0b52f613" +dependencies = [ + "cfg-if 1.0.0", ] [[package]] @@ -1031,9 +1104,9 @@ checksum = "3576a87f2ba00f6f106fdfcd16db1d698d648a26ad8e0573cad8537c3c362d2a" [[package]] name = "libc" -version = "0.2.77" +version = "0.2.80" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f2f96b10ec2560088a8e76961b00d47107b3a625fecb76dedb29ee7ccbf98235" +checksum = "4d58d1b70b004888f764dfbf6a26a3b0342a1632d33968e4a179d8011c760614" [[package]] name = "libffi" @@ -1070,11 +1143,11 @@ dependencies = [ [[package]] name = "libloading" -version = "0.6.3" +version = "0.6.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2443d8f0478b16759158b2f66d525991a05491138bc05814ef52a250148ef4f9" +checksum = "1090080fe06ec2648d0da3881d9453d97e71a45f00eb179af7fdd7e3f686fdb0" dependencies = [ - "cfg-if", + "cfg-if 1.0.0", "winapi", ] @@ -1088,7 +1161,7 @@ dependencies = [ "lazy_static", "libc", "regex", - "semver", + "semver 0.9.0", ] [[package]] @@ -1106,7 +1179,7 @@ version = "0.4.11" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4fabed175da42fed1fa0746b0ea71f412aa9d35e76e95e59b192c64b9dc2bf8b" dependencies = [ - "cfg-if", + "cfg-if 0.1.10", ] [[package]] @@ -1132,9 +1205,9 @@ checksum = "60302e4db3a61da70c0cb7991976248362f30319e88850c487b9b95bbf059e00" [[package]] name = "memchr" -version = "2.3.3" +version = "2.3.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3728d817d99e5ac407411fa471ff9800a778d88a24685968b36824eaf4bee400" +checksum = "0ee1c47aaa256ecabcaea351eae4a9b01ef39ed810004e298d2511ed284b1525" [[package]] name = "memmap" @@ -1157,16 +1230,14 @@ dependencies = [ [[package]] name = "minifb" -version = "0.16.0" +version = "0.19.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b18d2987dac6afdd7f6d81101a3b422b7da3e6799d7f11863ad006d8ccd562b2" +checksum = "2eb411a297b8f714800f085846cbda55fbd2ae17ecd381f1b4652af0e5bebe63" dependencies = [ - "cast", "cc", "orbclient", "raw-window-handle", "tempfile", - "time", "wayland-client", "wayland-cursor", "wayland-protocols", @@ -1178,9 +1249,9 @@ dependencies = [ [[package]] name = "miniz_oxide" -version = "0.4.2" +version = "0.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c60c0dfe32c10b43a144bad8fc83538c52f58302c92300ea7ec7bf7b38d5a7b9" +checksum = "0f2d26ec3309788e423cfbf68ad1800f061638098d76a83681af979dc4eda19d" dependencies = [ "adler", "autocfg 1.0.1", @@ -1210,7 +1281,7 @@ checksum = "50e4785f2c3b7589a0d0c1dd60285e1188adac4006e8abd6dd578e1567027363" dependencies = [ "bitflags", "cc", - "cfg-if", + "cfg-if 0.1.10", "libc", "void", ] @@ -1225,6 +1296,22 @@ dependencies = [ "version_check 0.1.5", ] +[[package]] +name = "nom" +version = "5.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ffb4262d26ed83a1c0a33a38fe2bb15797329c85770da05e6b828ddb782627af" +dependencies = [ + "memchr", + "version_check 0.9.2", +] + +[[package]] +name = "normalize-line-endings" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "61807f77802ff30975e01f4f071c8ba10c022052f98b3294119f3e615d13e5be" + [[package]] name = "num" version = "0.1.42" @@ -1238,9 +1325,9 @@ dependencies = [ [[package]] name = "num-integer" -version = "0.1.43" +version = "0.1.44" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8d59457e662d541ba17869cf51cf177c0b5f0cbf476c66bdc90bf1edac4f875b" +checksum = "d2cc698a63b549a70bc047073d2949cce27cd1c7b0a4a862d08a8031bc2801db" dependencies = [ "autocfg 1.0.1", "num-traits", @@ -1248,9 +1335,9 @@ dependencies = [ [[package]] name = "num-iter" -version = "0.1.41" +version = "0.1.42" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a6e6b7c748f995c4c29c5f5ae0248536e04a5739927c74ec0fa564805094b9f" +checksum = "b2021c8337a54d21aca0d59a92577a029af9431cb59b909b03252b9c164fad59" dependencies = [ "autocfg 1.0.1", "num-integer", @@ -1259,9 +1346,9 @@ dependencies = [ [[package]] name = "num-traits" -version = "0.2.12" +version = "0.2.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac267bcc07f48ee5f8935ab0d24f316fb722d7a1292e2913f0cc196b29ffd611" +checksum = "9a64b1ec5cda2586e284722486d802acf1f7dbdc623e2bfc57e65ca1cd099290" dependencies = [ "autocfg 1.0.1", ] @@ -1278,9 +1365,9 @@ dependencies = [ [[package]] name = "object" -version = "0.19.0" +version = "0.21.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9cbca9424c482ee628fa549d9c812e2cd22f1180b9222c9200fdfa6eb31aecb2" +checksum = "37fd5004feb2ce328a52b0b3d01dbf4ffff72583493900ed15f22d4111c51693" dependencies = [ "crc32fast", "indexmap", @@ -1288,15 +1375,15 @@ dependencies = [ [[package]] name = "object" -version = "0.20.0" +version = "0.22.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1ab52be62400ca80aa00285d25253d7f7c437b7375c4de678f5405d3afe82ca5" +checksum = "8d3b63360ec3cb337817c2dbd47ab4a0f170d285d8e5a2064600f3def1402397" [[package]] name = "once_cell" -version = "1.4.1" +version = "1.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "260e51e7efe62b592207e9e13a68e43692a7a279171d6ba57abd208bf23645ad" +checksum = "13bd41f508810a131401606d54ac32a467c97172d74ba7662562ebba5ad07fa0" [[package]] name = "oorandom" @@ -1331,7 +1418,7 @@ version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c361aa727dd08437f2f1447be8b59a33b0edd15e0fcee698f935613d9efbca9b" dependencies = [ - "cfg-if", + "cfg-if 0.1.10", "cloudabi 0.1.0", "instant", "libc", @@ -1366,10 +1453,25 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "19b17cddbe7ec3f8bc800887bab5e717348c95ea2ca0b1bf0837fb964dc67099" [[package]] -name = "pkg-config" -version = "0.3.18" +name = "pest" +version = "2.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d36492546b6af1463394d46f0c834346f31548646f6ba10849802c9c9a27ac33" +checksum = "10f4872ae94d7b90ae48754df22fd42ad52ce740b8f370b03da4835417403e53" +dependencies = [ + "ucd-trie", +] + +[[package]] +name = "pin-project-lite" +version = "0.1.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c917123afa01924fc84bb20c4c03f004d9c38e5127e3c039bbf7f4b9c76a2f6b" + +[[package]] +name = "pkg-config" +version = "0.3.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3831453b3449ceb48b6d9c7ad7c96d5ea673e9b470a1dc578c2ce6521230884c" [[package]] name = "plain" @@ -1391,9 +1493,38 @@ dependencies = [ [[package]] name = "ppv-lite86" -version = "0.2.9" +version = "0.2.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c36fa947111f5c62a733b652544dd0016a43ce89619538a8ef92724a6f501a20" +checksum = "ac74c624d6b2d21f425f752262f42188365d7b8ff1aff74c82e45136510a4857" + +[[package]] +name = "predicates" +version = "1.0.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "96bfead12e90dccead362d62bb2c90a5f6fc4584963645bc7f71a735e0b0735a" +dependencies = [ + "difference", + "float-cmp", + "normalize-line-endings", + "predicates-core", + "regex", +] + +[[package]] +name = "predicates-core" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "06075c3a3e92559ff8929e7a280684489ea27fe44805174c3ebd9328dcb37178" + +[[package]] +name = "predicates-tree" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e63c4859013b38a76eca2414c64911fba30def9e3202ac461a2d22831220124" +dependencies = [ + "predicates-core", + "treeline", +] [[package]] name = "proc-macro-error" @@ -1421,15 +1552,15 @@ dependencies = [ [[package]] name = "proc-macro-hack" -version = "0.5.18" +version = "0.5.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "99c605b9a0adc77b7211c6b1f722dcb613d68d66859a44f3d485a6da332b0598" +checksum = "dbf0c48bc1d91375ae5c3cd81e3722dff1abcf81a30960240640d223f59fe0e5" [[package]] name = "proc-macro2" -version = "1.0.21" +version = "1.0.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "36e28516df94f3dd551a587da5357459d9b36d945a7c37c3557928c1c2ff2a2c" +checksum = "1e0704ee1a7e00d7bb417d0770ea303c1bccbabf0ef1667dae92b5967f5f8a71" dependencies = [ "unicode-xid", ] @@ -1474,7 +1605,7 @@ version = "0.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6a6b1679d49b24bbfe0c803429aa1874472f50d9b363131f0e89fc356b544d03" dependencies = [ - "getrandom", + "getrandom 0.1.15", "libc", "rand_chacha 0.2.2", "rand_core 0.5.1", @@ -1522,7 +1653,7 @@ version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "90bde5296fc891b0cef12a6d03ddccc162ce7b2aff54160af9338f8d40df6d19" dependencies = [ - "getrandom", + "getrandom 0.1.15", ] [[package]] @@ -1604,7 +1735,7 @@ checksum = "b4a349ca83373cfa5d6dbb66fd76e58b2cca08da71a5f6400de0a0a6a9bceeaf" dependencies = [ "bitflags", "cc", - "rustc_version", + "rustc_version 0.2.3", ] [[package]] @@ -1618,9 +1749,9 @@ dependencies = [ [[package]] name = "rayon" -version = "1.4.0" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cfd016f0c045ad38b5251be2c9c0ab806917f82da4d36b2a327e5166adad9270" +checksum = "8b0d8e0819fadc20c74ea8373106ead0600e3a67ef1fe8da56e39b9ae7275674" dependencies = [ "autocfg 1.0.1", "crossbeam-deque", @@ -1630,9 +1761,9 @@ dependencies = [ [[package]] name = "rayon-core" -version = "1.8.1" +version = "1.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e8c4fec834fb6e6d2dd5eece3c7b432a52f0ba887cf40e595190c4107edc08bf" +checksum = "9ab346ac5921dc62ffa9f89b7a773907511cdfa5490c572ae9be1be33e8afa4a" dependencies = [ "crossbeam-channel", "crossbeam-deque", @@ -1675,9 +1806,9 @@ checksum = "d813022b2e00774a48eaf43caaa3c20b45f040ba8cbf398e2e8911a06668dbe6" [[package]] name = "regalloc" -version = "0.0.26" +version = "0.0.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7c03092d79e0fd610932d89ed53895a38c0dd3bcd317a0046e69940de32f1d95" +checksum = "2041c2d34f6ff346d6f428974f03d8bf12679b0c816bb640dc5eb1d48848d8d1" dependencies = [ "log", "rustc-hash", @@ -1686,9 +1817,9 @@ dependencies = [ [[package]] name = "regex" -version = "1.3.9" +version = "1.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c3780fcf44b193bc4d09f36d2a3c87b251da4a046c87795a0d35f4f927ad8e6" +checksum = "38cf2c13ed4745de91a5eb834e11c00bcc3709e773173b2ce4c56c9fbde04b9c" dependencies = [ "aho-corasick", "memchr", @@ -1707,9 +1838,9 @@ dependencies = [ [[package]] name = "regex-syntax" -version = "0.6.18" +version = "0.6.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26412eb97c6b088a6997e05f69403a802a92d520de2f8e63c2b65f9e0f47c4e8" +checksum = "3b181ba2dcf07aaccad5448e8ead58db5b742cf85dfe035e2227f137a539a189" [[package]] name = "region" @@ -1746,9 +1877,9 @@ dependencies = [ [[package]] name = "rustc-demangle" -version = "0.1.16" +version = "0.1.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4c691c0e608126e00913e33f0ccf3727d5fc84573623b8d65b2df340b5201783" +checksum = "6e3bad0ee36814ca07d7968269dd4b7ec89ec2da10c4bb613928d3077083c232" [[package]] name = "rustc-hash" @@ -1762,7 +1893,16 @@ version = "0.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "138e3e0acb6c9fb258b19b67cb8abd63c00679d2851805ea151465464fe9030a" dependencies = [ - "semver", + "semver 0.9.0", +] + +[[package]] +name = "rustc_version" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "65c94201b44764d6d1f7e37c15a8289ed55e546c1762c7f1d57f616966e0c181" +dependencies = [ + "semver 0.11.0", ] [[package]] @@ -1792,12 +1932,6 @@ dependencies = [ "winapi-util", ] -[[package]] -name = "scoped-tls" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ea6a9290e3c9cf0f18145ef7ffa62d68ee0bf5fcd651017e586dc7fd5da448c2" - [[package]] name = "scopeguard" version = "1.1.0" @@ -1806,18 +1940,18 @@ checksum = "d29ab0c6d3fc0ee92fe66e2d99f700eab17a8d57d1c1d3b748380fb20baa78cd" [[package]] name = "scroll" -version = "0.10.1" +version = "0.10.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "abb2332cb595d33f7edd5700f4cbf94892e680c7f0ae56adab58a35190b66cb1" +checksum = "fda28d4b4830b807a8b43f7b0e6b5df875311b3e7621d84577188c175b6ec1ec" dependencies = [ "scroll_derive", ] [[package]] name = "scroll_derive" -version = "0.10.2" +version = "0.10.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e367622f934864ffa1c704ba2b82280aab856e3d8213c84c5720257eb34b15b9" +checksum = "b12bd20b94c7cdfda8c7ba9b92ad0d9a56e3fa018c25fca83b51aa664c9b4c0d" dependencies = [ "proc-macro2", "quote", @@ -1844,7 +1978,7 @@ version = "0.32.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "34e71125077d297d57e4c1acfe8981b5bdfbf5a20e7b589abfdcb33bf1127f86" dependencies = [ - "cfg-if", + "cfg-if 0.1.10", "libc", ] @@ -1854,7 +1988,16 @@ version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1d7eb9ef2c18661902cc47e535f9bc51b78acd254da71d375c2f6720d9a40403" dependencies = [ - "semver-parser", + "semver-parser 0.7.0", +] + +[[package]] +name = "semver" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f301af10236f6df4160f7c3f04eec6dbc70ace82d23326abad5edee88801c6b6" +dependencies = [ + "semver-parser 0.10.1", ] [[package]] @@ -1864,10 +2007,19 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "388a1df253eca08550bef6c72392cfe7c30914bf41df5269b68cbd6ff8f570a3" [[package]] -name = "serde" -version = "1.0.116" +name = "semver-parser" +version = "0.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "96fe57af81d28386a513cbc6858332abc6117cfdb5999647c6444b8f43a370a5" +checksum = "42ef146c2ad5e5f4b037cd6ce2ebb775401729b19a82040c1beac9d36c7d1428" +dependencies = [ + "pest", +] + +[[package]] +name = "serde" +version = "1.0.117" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b88fa983de7720629c9387e9f517353ed404164b1e482c970a90c1a4aaf7dc1a" dependencies = [ "serde_derive", ] @@ -1893,9 +2045,9 @@ dependencies = [ [[package]] name = "serde_derive" -version = "1.0.116" +version = "1.0.117" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f630a6370fd8e457873b4bd2ffdae75408bc291ba72be773772a4c2a065d9ae8" +checksum = "cbd1ae72adb44aab48f325a02444a5fc079349a8d804c1fc922aed3f7454c74e" dependencies = [ "proc-macro2", "quote", @@ -1904,9 +2056,9 @@ dependencies = [ [[package]] name = "serde_json" -version = "1.0.57" +version = "1.0.59" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "164eacbdb13512ec2745fb09d51fd5b22b0d65ed294a1dcf7285a360c80a675c" +checksum = "dcac07dbffa1c65e7f816ab9eba78eb142c6d44410f4eeba1e26e4f5dfa56b95" dependencies = [ "itoa", "ryu", @@ -1957,9 +2109,9 @@ checksum = "6446ced80d6c486436db5c078dde11a9f73d42b57fb273121e160b84f63d894c" [[package]] name = "structopt" -version = "0.3.17" +version = "0.3.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6cc388d94ffabf39b5ed5fadddc40147cb21e605f53db6f8f36a625d27489ac5" +checksum = "126d630294ec449fae0b16f964e35bf3c74f940da9dca17ee9b905f7b3112eb8" dependencies = [ "clap", "lazy_static", @@ -1968,9 +2120,9 @@ dependencies = [ [[package]] name = "structopt-derive" -version = "0.4.10" +version = "0.4.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5e2513111825077552a6751dfad9e11ce0fba07d7276a3943a037d7e93e64c5f" +checksum = "65e51c492f9e23a220534971ff5afc14037289de430e3c83f9daf6a1b6ae91e8" dependencies = [ "heck", "proc-macro-error", @@ -1987,9 +2139,9 @@ checksum = "343f3f510c2915908f155e94f17220b19ccfacf2a64a2a5d8004f2c3e311e7fd" [[package]] name = "syn" -version = "1.0.41" +version = "1.0.48" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6690e3e9f692504b941dc6c3b188fd28df054f7fb8469ab40680df52fdcc842b" +checksum = "cc371affeffc477f42a221a1e4297aedcea33d47d19b61455588bd9d8f6b19ac" dependencies = [ "proc-macro2", "quote", @@ -1998,9 +2150,9 @@ dependencies = [ [[package]] name = "target-lexicon" -version = "0.10.0" +version = "0.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ab0e7238dcc7b40a7be719a25365910f6807bd864f4cce6b2e6b873658e2b19d" +checksum = "4ee5a98e506fb7231a304c3a1bd7c132a55016cf65001e0282480665870dfcb9" [[package]] name = "tempfile" @@ -2008,7 +2160,7 @@ version = "3.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7a6e24d9338a0a5be79593e2fa15a648add6138caa803e2d5bc782c371732ca9" dependencies = [ - "cfg-if", + "cfg-if 0.1.10", "libc", "rand 0.7.3", "redox_syscall", @@ -2065,18 +2217,18 @@ dependencies = [ [[package]] name = "thiserror" -version = "1.0.20" +version = "1.0.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7dfdd070ccd8ccb78f4ad66bf1982dc37f620ef696c6b5028fe2ed83dd3d0d08" +checksum = "0e9ae34b84616eedaaf1e9dd6026dbe00dcafa92aa0c8077cb69df1fcfe5e53e" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.20" +version = "1.0.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bd80fc12f73063ac132ac92aceea36734f04a1d93c1240c6944e23a3b8841793" +checksum = "9ba20f23e85b10754cd195504aebf6a27e2e6cbe28c17778a0c930724628dd56" dependencies = [ "proc-macro2", "quote", @@ -2115,21 +2267,22 @@ dependencies = [ [[package]] name = "toml" -version = "0.5.6" +version = "0.5.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ffc92d160b1eef40665be3a05630d003936a3bc7da7421277846c2613e92c71a" +checksum = "75cf45bb0bef80604d001caaec0d09da99611b3c0fd39d3080468875cdb65645" dependencies = [ "serde", ] [[package]] name = "tracing" -version = "0.1.19" +version = "0.1.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6d79ca061b032d6ce30c660fded31189ca0b9922bf483cd70759f13a2d86786c" +checksum = "b0987850db3733619253fe60e17cb59b82d37c7e6c0236bb81e4d6b87c879f27" dependencies = [ - "cfg-if", + "cfg-if 0.1.10", "log", + "pin-project-lite", "tracing-attributes", "tracing-core", ] @@ -2147,13 +2300,19 @@ dependencies = [ [[package]] name = "tracing-core" -version = "0.1.16" +version = "0.1.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5bcf46c1f1f06aeea2d6b81f3c863d0930a596c86ad1920d4e5bad6dd1d7119a" +checksum = "f50de3927f93d202783f4513cda820ab47ef17f624b03c096e86ef00c67e6b5f" dependencies = [ "lazy_static", ] +[[package]] +name = "treeline" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a7f741b240f1a48843f9b8e0444fb55fb2a4ff67293b50a9179dfd5ea67f8d41" + [[package]] name = "typenum" version = "1.12.0" @@ -2185,10 +2344,16 @@ dependencies = [ ] [[package]] -name = "unicode-segmentation" -version = "1.6.0" +name = "ucd-trie" +version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e83e153d1053cbb5a118eeff7fd5be06ed99153f00dbcd8ae310c5fb2b22edc0" +checksum = "56dee185309b50d1f11bfedef0fe6d036842e3fb77413abef29f8f8d1c5d4c1c" + +[[package]] +name = "unicode-segmentation" +version = "1.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "db8716a166f290ff49dabc18b44aa407cb7c6dbe1aa0971b44b8a24b0ca35aae" [[package]] name = "unicode-width" @@ -2226,6 +2391,15 @@ version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6a02e4885ed3bc0f2de90ea6dd45ebcbb66dacffe03547fadbb0eeae2770887d" +[[package]] +name = "wait-timeout" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9f200f5b12eb75f8c1ed65abd4b2db8a6e1b138a20de009dacee265a2498f3f6" +dependencies = [ + "libc", +] + [[package]] name = "walkdir" version = "2.3.1" @@ -2255,7 +2429,7 @@ version = "0.2.68" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1ac64ead5ea5f05873d7c12b545865ca2b8d28adfc50a49b84770a3a97265d42" dependencies = [ - "cfg-if", + "cfg-if 0.1.10", "wasm-bindgen-macro", ] @@ -2305,10 +2479,10 @@ checksum = "1d649a3145108d7d3fbcde896a468d1bd636791823c9921135218ad89be08307" [[package]] name = "wasmer" -version = "1.0.0-alpha4" +version = "1.0.0-alpha5" dependencies = [ "anyhow", - "cfg-if", + "cfg-if 0.1.10", "indexmap", "libc", "more-asserts", @@ -2331,10 +2505,11 @@ dependencies = [ [[package]] name = "wasmer-c-api" -version = "1.0.0-alpha4" +version = "1.0.0-alpha5" dependencies = [ "cbindgen", - "cfg-if", + "cfg-if 1.0.0", + "inline-c", "lazy_static", "libc", "libffi", @@ -2358,7 +2533,7 @@ dependencies = [ [[package]] name = "wasmer-cache" -version = "1.0.0-alpha4" +version = "1.0.0-alpha5" dependencies = [ "blake3", "hex", @@ -2369,12 +2544,12 @@ dependencies = [ [[package]] name = "wasmer-cli" -version = "1.0.0-alpha4" +version = "1.0.0-alpha5" dependencies = [ "anyhow", "atty", "bytesize", - "cfg-if", + "cfg-if 1.0.0", "colored 2.0.0", "distance", "fern", @@ -2401,10 +2576,10 @@ dependencies = [ [[package]] name = "wasmer-compiler" -version = "1.0.0-alpha4" +version = "1.0.0-alpha5" dependencies = [ "enumset", - "hashbrown 0.8.2", + "hashbrown 0.9.1", "raw-cpuid", "serde", "serde_bytes", @@ -2418,16 +2593,17 @@ dependencies = [ [[package]] name = "wasmer-compiler-cranelift" -version = "1.0.0-alpha4" +version = "1.0.0-alpha5" dependencies = [ "cranelift-codegen", "cranelift-frontend", "gimli 0.21.0", - "hashbrown 0.8.2", + "hashbrown 0.9.1", "lazy_static", "more-asserts", "rayon", "serde", + "smallvec", "target-lexicon", "tracing", "wasmer-compiler", @@ -2437,7 +2613,7 @@ dependencies = [ [[package]] name = "wasmer-compiler-llvm" -version = "1.0.0-alpha4" +version = "1.0.0-alpha5" dependencies = [ "byteorder", "cc", @@ -2448,8 +2624,8 @@ dependencies = [ "libc", "rayon", "regex", - "rustc_version", - "semver", + "rustc_version 0.2.3", + "semver 0.9.0", "smallvec", "target-lexicon", "wasmer-compiler", @@ -2459,12 +2635,12 @@ dependencies = [ [[package]] name = "wasmer-compiler-singlepass" -version = "1.0.0-alpha4" +version = "1.0.0-alpha5" dependencies = [ "byteorder", "dynasm", "dynasmrt", - "hashbrown 0.8.2", + "hashbrown 0.9.1", "lazy_static", "more-asserts", "rayon", @@ -2489,10 +2665,10 @@ dependencies = [ [[package]] name = "wasmer-emscripten" -version = "1.0.0-alpha4" +version = "1.0.0-alpha5" dependencies = [ "byteorder", - "getrandom", + "getrandom 0.2.0", "lazy_static", "libc", "log", @@ -2502,7 +2678,7 @@ dependencies = [ [[package]] name = "wasmer-engine" -version = "1.0.0-alpha4" +version = "1.0.0-alpha5" dependencies = [ "backtrace", "bincode", @@ -2520,7 +2696,7 @@ dependencies = [ [[package]] name = "wasmer-engine-dummy" -version = "1.0.0-alpha4" +version = "1.0.0-alpha5" dependencies = [ "bincode", "serde", @@ -2533,10 +2709,10 @@ dependencies = [ [[package]] name = "wasmer-engine-jit" -version = "1.0.0-alpha4" +version = "1.0.0-alpha5" dependencies = [ "bincode", - "cfg-if", + "cfg-if 0.1.10", "region", "serde", "serde_bytes", @@ -2549,12 +2725,12 @@ dependencies = [ [[package]] name = "wasmer-engine-native" -version = "1.0.0-alpha4" +version = "1.0.0-alpha5" dependencies = [ "bincode", - "cfg-if", + "cfg-if 0.1.10", "leb128", - "libloading 0.6.3", + "libloading 0.6.5", "serde", "tempfile", "tracing", @@ -2568,12 +2744,12 @@ dependencies = [ [[package]] name = "wasmer-engine-object-file" -version = "1.0.0-alpha4" +version = "1.0.0-alpha5" dependencies = [ "bincode", - "cfg-if", + "cfg-if 0.1.10", "leb128", - "libloading 0.6.3", + "libloading 0.6.5", "serde", "tempfile", "tracing", @@ -2586,7 +2762,7 @@ dependencies = [ [[package]] name = "wasmer-integration-tests-cli" -version = "1.0.0-alpha4" +version = "1.0.0-alpha5" dependencies = [ "anyhow", "tempfile", @@ -2594,9 +2770,9 @@ dependencies = [ [[package]] name = "wasmer-object" -version = "1.0.0-alpha4" +version = "1.0.0-alpha5" dependencies = [ - "object 0.19.0", + "object 0.21.1", "thiserror", "wasmer-compiler", "wasmer-types", @@ -2604,7 +2780,7 @@ dependencies = [ [[package]] name = "wasmer-types" -version = "1.0.0-alpha4" +version = "1.0.0-alpha5" dependencies = [ "cranelift-entity", "serde", @@ -2612,11 +2788,11 @@ dependencies = [ [[package]] name = "wasmer-vm" -version = "1.0.0-alpha4" +version = "1.0.0-alpha5" dependencies = [ "backtrace", "cc", - "cfg-if", + "cfg-if 0.1.10", "indexmap", "libc", "memoffset", @@ -2630,12 +2806,12 @@ dependencies = [ [[package]] name = "wasmer-wasi" -version = "1.0.0-alpha4" +version = "1.0.0-alpha5" dependencies = [ "bincode", "byteorder", "generational-arena", - "getrandom", + "getrandom 0.2.0", "libc", "serde", "thiserror", @@ -2648,7 +2824,7 @@ dependencies = [ [[package]] name = "wasmer-wasi-experimental-io-devices" -version = "1.0.0-alpha4" +version = "1.0.0-alpha5" dependencies = [ "minifb", "ref_thread_local", @@ -2660,7 +2836,7 @@ dependencies = [ [[package]] name = "wasmer-wast" -version = "1.0.0-alpha4" +version = "1.0.0-alpha5" dependencies = [ "anyhow", "serde", @@ -2674,16 +2850,16 @@ dependencies = [ [[package]] name = "wasmer-workspace" -version = "1.0.0-alpha4" +version = "1.0.0-alpha5" dependencies = [ "anyhow", "blake3", "build-deps", - "cfg-if", + "cfg-if 1.0.0", "criterion", "glob", "lazy_static", - "rustc_version", + "rustc_version 0.3.0", "tempfile", "test-generator", "wasmer", @@ -2704,9 +2880,9 @@ dependencies = [ [[package]] name = "wasmparser" -version = "0.57.0" +version = "0.65.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "32fddd575d477c6e9702484139cf9f23dcd554b06d185ed0f56c857dd3a47aa6" +checksum = "87cc2fe6350834b4e528ba0901e7aa405d78b89dc1fa3145359eb4de0e323fcf" [[package]] name = "wast" @@ -2719,33 +2895,32 @@ dependencies = [ [[package]] name = "wast" -version = "24.0.0" +version = "27.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6ff1e3bd3ad0b2ee7784add89c30dc96b89a54b43e5d6d95d774eda1863b3500" +checksum = "c2c3ef5f6a72dffa44c24d5811123f704e18a1dbc83637d347b1852b41d3835c" dependencies = [ "leb128", ] [[package]] name = "wat" -version = "1.0.25" +version = "1.0.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c7c0bb2872ae453f98cec6ff1bf1a71cde1da6041fce8b0ac39d51eb033e9ec0" +checksum = "835cf59c907f67e2bbc20f50157e08f35006fe2a8444d8ec9f5683e22f937045" dependencies = [ - "wast 24.0.0", + "wast 27.0.0", ] [[package]] name = "wayland-client" -version = "0.25.0" +version = "0.27.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a42cb608953ec8e132c7f53fde722cca9bfbf8b2071d685dbbb8df2b567fee8b" +checksum = "ab702fefbcd6d6f67fb5816e3a89a3b5a42a94290abbc015311c9a30d1068ae4" dependencies = [ "bitflags", "downcast-rs", "libc", "nix", - "scoped-tls", "wayland-commons", "wayland-scanner", "wayland-sys", @@ -2753,9 +2928,9 @@ dependencies = [ [[package]] name = "wayland-commons" -version = "0.25.0" +version = "0.27.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8caa2f106138cf71358c6a9e84468e4406069cec93cbd6dbfce92225fc175932" +checksum = "e972e9336ad5a9dd861b4e21ff35ad71d3e5c6b4803d65c39913612f851b95f1" dependencies = [ "nix", "once_cell", @@ -2765,19 +2940,20 @@ dependencies = [ [[package]] name = "wayland-cursor" -version = "0.25.0" +version = "0.27.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3d774f69a6a4a9eac6d1a29cea45a4750ee7f997520421b2068f099a11b4cbba" +checksum = "539f346e1a3f706f38c8ccbe1196001e2fb1c9b3e6b605c27d665db2f5b60d41" dependencies = [ + "nix", "wayland-client", - "wayland-sys", + "xcursor", ] [[package]] name = "wayland-protocols" -version = "0.25.0" +version = "0.27.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f784a990d5fa6d846fa93eb8d3bb744ff1e6ec60c7f785b0a0ee2f1a1f20bee9" +checksum = "f3d6fc54b17b98b5083bc21ae3a30e6d75cb4b01647360e4c3a04648bcf8781d" dependencies = [ "bitflags", "wayland-client", @@ -2787,9 +2963,9 @@ dependencies = [ [[package]] name = "wayland-scanner" -version = "0.25.0" +version = "0.27.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f45ddc08a8078f3efa96b5f413268cc9c53b30712891de081fbc1d5846fbc736" +checksum = "030f56009d932bd9400bb472764fea8109be1b0fc482d9cd75496c943ac30328" dependencies = [ "proc-macro2", "quote", @@ -2798,11 +2974,11 @@ dependencies = [ [[package]] name = "wayland-sys" -version = "0.25.0" +version = "0.27.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "80f9fc64f9045ad5ff491886a9460437655353e8be73c1b3f29f569342553319" +checksum = "8bdeffbbb474477dfa2acb45ac7479e5fe8f741c64ab032c5d11b94d07edc269" dependencies = [ - "dlib", + "pkg-config", ] [[package]] @@ -2877,6 +3053,15 @@ dependencies = [ "pkg-config", ] +[[package]] +name = "xcursor" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d3a481cfdefd35e1c50073ae33a8000d695c98039544659f5dc5dd71311b0d01" +dependencies = [ + "nom 5.1.2", +] + [[package]] name = "xkb" version = "0.2.1" diff --git a/Cargo.toml b/Cargo.toml index e49f41249..ea6780cec 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "wasmer-workspace" -version = "1.0.0-alpha4" +version = "1.0.0-alpha5" description = "Wasmer workspace" authors = ["Wasmer Engineering Team "] repository = "https://github.com/wasmerio/wasmer" @@ -10,20 +10,20 @@ publish = false autoexamples = false [dependencies] -wasmer = { version = "1.0.0-alpha4", path = "lib/api", default-features = false } -wasmer-compiler = { version = "1.0.0-alpha4", path = "lib/compiler" } -wasmer-compiler-cranelift = { version = "1.0.0-alpha4", path = "lib/compiler-cranelift", optional = true } -wasmer-compiler-singlepass = { version = "1.0.0-alpha4", path = "lib/compiler-singlepass", optional = true } -wasmer-compiler-llvm = { version = "1.0.0-alpha4", path = "lib/compiler-llvm", optional = true } -wasmer-engine = { version = "1.0.0-alpha4", path = "lib/engine" } -wasmer-engine-jit = { version = "1.0.0-alpha4", path = "lib/engine-jit", optional = true } -wasmer-engine-native = { version = "1.0.0-alpha4", path = "lib/engine-native", optional = true } -wasmer-engine-object-file = { version = "1.0.0-alpha4", path = "lib/engine-object-file", optional = true } -wasmer-wasi = { version = "1.0.0-alpha4", path = "lib/wasi", optional = true } -wasmer-wast = { version = "1.0.0-alpha4", path = "tests/lib/wast", optional = true } -wasmer-cache = { version = "1.0.0-alpha4", path = "lib/cache", optional = true } -wasmer-types = { version = "1.0.0-alpha4", path = "lib/wasmer-types" } -cfg-if = "0.1" +wasmer = { version = "1.0.0-alpha5", path = "lib/api", default-features = false } +wasmer-compiler = { version = "1.0.0-alpha5", path = "lib/compiler" } +wasmer-compiler-cranelift = { version = "1.0.0-alpha5", path = "lib/compiler-cranelift", optional = true } +wasmer-compiler-singlepass = { version = "1.0.0-alpha5", path = "lib/compiler-singlepass", optional = true } +wasmer-compiler-llvm = { version = "1.0.0-alpha5", path = "lib/compiler-llvm", optional = true } +wasmer-engine = { version = "1.0.0-alpha5", path = "lib/engine" } +wasmer-engine-jit = { version = "1.0.0-alpha5", path = "lib/engine-jit", optional = true } +wasmer-engine-native = { version = "1.0.0-alpha5", path = "lib/engine-native", optional = true } +wasmer-engine-object-file = { version = "1.0.0-alpha5", path = "lib/engine-object-file", optional = true } +wasmer-wasi = { version = "1.0.0-alpha5", path = "lib/wasi", optional = true } +wasmer-wast = { version = "1.0.0-alpha5", path = "tests/lib/wast", optional = true } +wasmer-cache = { version = "1.0.0-alpha5", path = "lib/cache", optional = true } +wasmer-types = { version = "1.0.0-alpha5", path = "lib/wasmer-types" } +cfg-if = "1.0" [workspace] members = [ @@ -58,7 +58,7 @@ test-generator = { path = "tests/lib/test-generator" } build-deps = "0.1.4" anyhow = "1.0" glob = "0.3" -rustc_version = "0.2" +rustc_version = "0.3" [dev-dependencies] anyhow = "1.0" @@ -212,6 +212,11 @@ name = "imported-global" path = "examples/imports_global.rs" required-features = ["cranelift"] +[[example]] +name = "tunables-limit-memory" +path = "examples/tunables_limit_memory.rs" +required-features = ["cranelift"] + [[example]] name = "wasi" path = "examples/wasi.rs" @@ -226,3 +231,18 @@ required-features = ["cranelift"] name = "memory" path = "examples/memory.rs" required-features = ["cranelift"] + +[[example]] +name = "instance" +path = "examples/instance.rs" +required-features = ["cranelift"] + +[[example]] +name = "errors" +path = "examples/errors.rs" +required-features = ["cranelift"] + +[[example]] +name = "imported-function-env" +path = "examples/imports_function_env.rs" +required-features = ["cranelift"] diff --git a/Makefile b/Makefile index f6bd2eca4..d9ac0ac69 100644 --- a/Makefile +++ b/Makefile @@ -61,11 +61,13 @@ ifneq ($(OS), Windows_NT) endif -$(info Available compilers: $(bold)$(green)${compilers}$(reset)) - compiler_features_spaced := $(foreach compiler,$(compilers),$(compiler)) compiler_features := --features "$(compiler_features_spaced)" +$(info Available compilers: $(bold)$(green)${compilers}$(reset)) +$(info Compilers features: $(bold)$(green)${compiler_features}$(reset)) +$(info Available compilers + engines for test: $(bold)$(green)${test_compilers_engines}$(reset)) + ############ # Building # @@ -89,20 +91,41 @@ build-docs: cargo doc --release $(compiler_features) --document-private-items --no-deps --workspace build-docs-capi: - cd lib/c-api/ && doxygen doxyfile + cd lib/c-api/doc/deprecated/ && doxygen doxyfile + cargo doc --manifest-path lib/c-api/Cargo.toml --no-deps --features wat,jit,object-file,native,cranelift,wasi # We use cranelift as the default backend for the capi for now -build-capi: build-capi-cranelift-jit +build-capi: build-capi-cranelift + +build-capi-singlepass: + cargo build --manifest-path lib/c-api/Cargo.toml --release \ + --no-default-features --features wat,jit,native,object-file,singlepass,wasi build-capi-singlepass-jit: cargo build --manifest-path lib/c-api/Cargo.toml --release \ - --no-default-features --features wat,jit,object-file,singlepass,wasi + --no-default-features --features wat,jit,singlepass,wasi + +build-capi-singlepass-native: + cargo build --manifest-path lib/c-api/Cargo.toml --release \ + --no-default-features --features wat,native,singlepass,wasi + +build-capi-singlepass-object-file: + cargo build --manifest-path lib/c-api/Cargo.toml --release \ + --no-default-features --features wat,object-file,singlepass,wasi + +build-capi-cranelift: + cargo build --manifest-path lib/c-api/Cargo.toml --release \ + --no-default-features --features wat,jit,native,object-file,cranelift,wasi build-capi-cranelift-jit: cargo build --manifest-path lib/c-api/Cargo.toml --release \ - --no-default-features --features wat,jit,object-file,cranelift,wasi + --no-default-features --features wat,jit,cranelift,wasi build-capi-cranelift-native: + cargo build --manifest-path lib/c-api/Cargo.toml --release \ + --no-default-features --features wat,native,cranelift,wasi + +build-capi-cranelift-object-file: cargo build --manifest-path lib/c-api/Cargo.toml --release \ --no-default-features --features wat,native,object-file,cranelift,wasi @@ -110,13 +133,21 @@ build-capi-cranelift-system-libffi: cargo build --manifest-path lib/c-api/Cargo.toml --release \ --no-default-features --features wat,jit,native,object-file,cranelift,wasi,system-libffi +build-capi-llvm: + cargo build --manifest-path lib/c-api/Cargo.toml --release \ + --no-default-features --features wat,jit,native,object-file,llvm,wasi + build-capi-llvm-jit: cargo build --manifest-path lib/c-api/Cargo.toml --release \ - --no-default-features --features wat,jit,object-file,llvm,wasi + --no-default-features --features wat,jit,llvm,wasi build-capi-llvm-native: cargo build --manifest-path lib/c-api/Cargo.toml --release \ - --no-default-features --features wat,native,object-file,llvm,wasi + --no-default-features --features wat,native,llvm,wasi + +build-capi-llvm-object-file: + cargo build --manifest-path lib/c-api/Cargo.toml --release \ + --no-default-features --features wat,object-file,llvm,wasi ########### # Testing # @@ -163,6 +194,8 @@ test-packages: # link the tests against. cargo test doesn't know that the tests will be running # cmake + make to build programs whose dependencies cargo isn't aware of. +test-capi: $(foreach compiler_engine,$(test_compilers_engines),test-capi-$(compiler_engine)) #$(if $(findstring cranelift-jit,$(test_compilers_engines)),test-capi-cranelift-jit-system-libffi) + test-capi-singlepass-jit: build-capi-singlepass-jit cargo test --manifest-path lib/c-api/Cargo.toml --release \ --no-default-features --features wat,jit,singlepass,wasi -- --nocapture @@ -187,8 +220,6 @@ test-capi-llvm-native: cargo test --manifest-path lib/c-api/Cargo.toml --release \ --no-default-features --features wat,native,llvm,wasi -- --nocapture -test-capi: $(foreach compiler_engine,$(test_compilers_engines),test-capi-$(compiler_engine)) $(if $(findstring cranelift-jit,$(test_compilers_engines)),test-capi-cranelift-jit-system-libffi) - test-wasi-unit: cargo test --manifest-path lib/wasi/Cargo.toml --release diff --git a/README.md b/README.md index bddeba897..c8224f729 100644 --- a/README.md +++ b/README.md @@ -134,7 +134,7 @@ qjs > [js logo]: ./assets/languages/js.svg [js integration]: https://github.com/wasmerio/wasmer-js [`@wasmerio` npm packages]: https://www.npmjs.com/org/wasmer -[js docs]: https://docs.wasmer.io/wasmer-js/wasmer-js +[js docs]: https://docs.wasmer.io/integrations/js/reference-api [ruby logo]: ./assets/languages/ruby.svg [ruby integration]: https://github.com/wasmerio/wasmer-ruby diff --git a/docs/deps_dedup.dot b/docs/deps_dedup.dot new file mode 100644 index 000000000..d4ae34a77 --- /dev/null +++ b/docs/deps_dedup.dot @@ -0,0 +1,74 @@ +digraph dependencies { + newrank=true; + + n0 [label="wasmer", color=orange]; + n1 [label="wasmer-compiler", color=orange]; + n5 [label="wasmer-engine", color=orange]; + n6 [label="wasmer-engine-jit", color=orange]; + n7 [label="wasmer-engine-native", color=orange]; + n8 [label="wasmer-types", color=orange]; + n9 [label="wasmer-vm", color=orange]; + n10 [label="wasmer-c-api", color=orange]; + n11 [label="wasmer-emscripten", color=orange]; + n12 [label="wasmer-wasi", color=orange]; + n13 [label="wasmer-cache", color=orange]; + n14 [label="wasmer-cli", color=orange]; + + + subgraph cluster_compiler { + label="Compilers"; + color=brown; + + n2 [label="wasmer-compiler-cranelift", color=orange]; + n3 [label="wasmer-compiler-llvm", color=orange]; + n4 [label="wasmer-compiler-singlepass", color=orange]; + } + + subgraph cluster_engine { + label="Engines"; + color=brown; + + n6 [label="wasmer-engine-jit", color=orange]; + n7 [label="wasmer-engine-native", color=orange]; + } + + { + rank=same; + n2; + n3; + n4; + n6; + n7; + } + + + subgraph cluster_abi { + label="Provided ABIs"; + color=brown; + + n12 [label="wasmer-wasi", color=orange]; + n11 [label="wasmer-emscripten", color=orange]; + } + + n14 -> n13 [color=orange, style=dashed]; + n14 -> n12 [color=orange, style=dashed]; + n14 -> n11 [color=orange, style=dashed]; + n13 -> n0 [color=orange, style=dashed]; + n10 -> n11 [color=orange, style=dashed]; + n10 -> n12 [color=orange, style=dashed]; + n11 -> n0 [color=orange, style=dashed]; + n12 -> n0 [color=orange, style=dashed]; + n0 -> n2 [color=orange, style=dashed]; + n0 -> n3 [color=orange, style=dashed]; + n0 -> n4 [color=orange, style=dashed]; + n0 -> n6 [color=orange, style=dashed]; + n0 -> n7 [color=orange, style=dashed]; + n2 -> n1 [color=orange, style=dashed]; + n3 -> n1 [color=orange, style=dashed]; + n4 -> n1 [color=orange, style=dashed]; + n6 -> n5 [color=orange, style=dashed]; + n7 -> n5 [color=orange, style=dashed]; + n5 -> n1 [color=orange, style=dashed]; + n1 -> n9 [color=orange, style=dashed]; + n9 -> n8 [color=orange, style=dashed]; +} diff --git a/docs/deps_dedup.svg b/docs/deps_dedup.svg new file mode 100644 index 000000000..384e010a4 --- /dev/null +++ b/docs/deps_dedup.svg @@ -0,0 +1,244 @@ + + + + + + +dependencies + + +cluster_compiler + +Compilers + + +cluster_engine + +Engines + + +cluster_abi + +Provided ABIs + + + +n0 + +wasmer + + + +n6 + +wasmer-engine-jit + + + +n0->n6 + + + + + +n7 + +wasmer-engine-native + + + +n0->n7 + + + + + +n2 + +wasmer-compiler-cranelift + + + +n0->n2 + + + + + +n3 + +wasmer-compiler-llvm + + + +n0->n3 + + + + + +n4 + +wasmer-compiler-singlepass + + + +n0->n4 + + + + + +n1 + +wasmer-compiler + + + +n9 + +wasmer-vm + + + +n1->n9 + + + + + +n5 + +wasmer-engine + + + +n5->n1 + + + + + +n6->n5 + + + + + +n7->n5 + + + + + +n8 + +wasmer-types + + + +n9->n8 + + + + + +n10 + +wasmer-c-api + + + +n11 + +wasmer-emscripten + + + +n10->n11 + + + + + +n12 + +wasmer-wasi + + + +n10->n12 + + + + + +n11->n0 + + + + + +n12->n0 + + + + + +n13 + +wasmer-cache + + + +n13->n0 + + + + + +n14 + +wasmer-cli + + + +n14->n11 + + + + + +n14->n12 + + + + + +n14->n13 + + + + + +n2->n1 + + + + + +n3->n1 + + + + + +n4->n1 + + + + + diff --git a/docs/migration_to_1.0.0.md b/docs/migration_to_1.0.0.md new file mode 100644 index 000000000..ba59eae49 --- /dev/null +++ b/docs/migration_to_1.0.0.md @@ -0,0 +1,346 @@ +# Migrating from Wasmer 0.x to Wasmer 1.0.0 + +Wasmer 1.0.0 is currently in alpha and is our primary focus. This document will +describe the differences between Wasmer 0.x and Wasmer 1.0.0 and provide examples +to make migrating to the new API as simple as possible. + +Some features are still under development during the alpha of Wasmer 1.0.0. This document +will aim to make clear what these features are. + +## Table of Contents + +- [Rationale for changes in 1.0.0](#rationale-for-changes-in-100) +- [How to use Wasmer 1.0.0](#how-to-use-wasmer-100) + - [Installing Wasmer CLI](#installing-wamser-cli) + - [Using Wasmer 1.0.0](#using-wamser-100) +- [Project structure](#project-structure) +- [Differences](#differences) + - [Instantiating modules](#instantiating-modules) + - [Passing host functions](#passing-host-functions) + - [Accessing the environment as a host function](#accessing-the-environment-as-a-host-function) + - [Error handling](#error-handling) + - [Caching modules](#caching-modules) + +## Rationale for changes in 1.0.0 + +Wasmer 0.x was great but as the WASM community and standards evolve we felt the need to make Wasmer also follow these +changes. + +Wasmer 1.x is what we think a necessary rewrite of a big part of the project to make it more future-proof. + +This version introduces many new features and makes using Wasmer more natural. We did a hard work making it as close +to the standard API as possible while always providing good performances, flexibility and stability. + +The rewrite of the Wasmer Runtime also comes with a rewrite of the languages integrations to achieve the same goals: +providing a clearer API and improving the feature set. + +In this document you will discover the major changes between Wasmer 0.x and Wasmer 1.x by highlighting how to use the +new Rust API. + +## How to use Wasmer 1.0.0 + +### Installing Wasmer CLI + +See [wasmer.io] for installation instructions. + +If you already have wasmer installed, run `wasmer self-update`. + +Install the latest versions of Wasmer with [wasmer-nightly] or by following the steps described in the +documentation: [Getting Started][getting-started]. + +### Using Wasmer 1.0.0 + +The CLI interface for Wasmer 1.0.0 is mostly the same as it was in Wasmer 0.x. + +One difference is that rather than specifying the compiler with `--backend=cranelift`, +in Wasmer 1.0.0 we prefer using the name of the backend as a flag directly, +for example: `--cranelift`. + +The top-level crates that users will usually interface with are: + +- [wasmer] - Wasmer's core runtime API +- [wasmer-wasi] - Wasmer's WASI implementation +- [wasmer-emscripten] - Wasmer's Emscripten implementation +- TODO: + +See the [examples] to find out how to do specific things in Wasmer 1.0.0. + +## Project Structure + +![Wasmer dependencies graph](./deps_dedup.svg) + +The figure above shows the core Wasmer crates and their dependencies with transitive dependencies deduplicated. + +Wasmer 1.0.0 has two core architectural abstractions: engines and compilers. + +An engine is a system that processes WASM with a compiler and prepares it to be executed. + +A compiler is a system that translates WASM into a format that can be understood +more directly by a real computer: machine code. + +For example, in the [examples] you'll see that we are using the JIT engine and the Cranelift compiler. The JIT engine +will generate machine code at runtime, using Cranelift, and then execute it. + +For most uses, users will primarily use the [wasmer] crate directly, perhaps with one of our +provided ABIs such as [wasmer-wasi]. However, for users that need finer grained control over +the behavior of wasmer, other crates such as [wasmer-compiler] and [wasmer-engine] may be used +to implement custom compilers and engines respectively. + +## Differences + +### Instantiating modules + +With Wasmer 0.x, instantiating a module was a matter of calling `wasmer::compiler::compile` and then calling +`instanciate` on the compiled module. + +While simple, this did not give you full-control over Wasmer's configuration. For example, choosing another compiler +was not straightforward. + +With Wasmer 1.x, we changed this part and made the API look more like how Wasmer works internally to give you more +control: + +```diff +- let module = compile(&wasm_bytes[..])?; ++ let engine = JIT::new(&Cranelift::default()).engine(); ++ let store = Store::new(&engine); ++ let module = Module::new(&store, wasm_bytes)?; +- let instance = module.instantiate(&imports)?; ++ let instance = Instance::new(&module, &import_object)?; +``` + +Note that we did not cover how to create the import object here. This is because this part works the same as it used to +with Wasmer 0.x. + +To get more information on how instantiation now works, have a look at the [dedicated example][instance-example] + +### Passing host functions + +With Wasmer 0.x passing host functions to the guest was primarily done using the `func!` macro or by directly using +`Func::new` or `DynamicFunc::new`. + +Given we have a function like: + +```rust +fn sum(a: i32, b: i32) -> i32 { + a + b +} +``` + +We want to import this function in the guest module, let's have a look at how it differs between Wasmer 0.x and +Wasmer 1.x: + +```diff +let import_object = imports! { + "env" => { +- "sum" => func!(sum), ++ "sum" => Function::new_native(&store, sum), + } +} +``` + +The above example illustrates how to import what we call "native functions". There were already available in Wasmer +0.x through the `func!` macro or with `Func::new`. + +There is a second flavor for imported functions: dynamic functions. With Wasmer 0;x you would have created such a +function using `DynamicFunc::new`, here is how it's done with Wasmer 1.x: + +```rust +let sum_signature = FunctionType::new(vec![Type::I32, Type::I32], vec![Type::I32]); +let sum = Function::new(&store, &sum_signature, |args| { + let result = args[0].unwrap_I32() + args[1].unwrap_i32(); + + Ok(vec![Value::I32(result)]) +}); +``` + +Both examples address different needs and have their own pros and cons. We encourage you to have a look at the +dedicated example: [Exposing host functions][host-functions-example]. + +Note that having this API for functions now looks more like the other entities APIs: globals, memories, tables. Here is +a quick example introducing each of them: [Imports & Exports][imports-exports-example] + +### Accessing the environment as a host function + +With Wasmer 0.x each function had its own `vm::Ctx`. This was your entrypoint to the module internals and allowed +access to the context of the currently running instance. + +With Wasmer 1.0.0 this was changed to provide a simpler yet powerful API. + +Let's see an example where we want to have access to the module memory. Here is how we would have done that with Wasmer +0.x: + +```diff +- let get_at = |ctx: &mut vm::Ctx, idx: i32, len: i32| { +- let mem_desc = ctx.memory(0); +- let mem = mem_desc.deref(); +- +- println!("Memory: {:?}", mem); +- +- let view: MemoryView = mem.view(); +- let bytes = view[idx as usize..len as usize].iter().map(Cell::get).collect(); +- +- println!("string: {}", String::from_utf8(bytes).unwrap()); +- }; + +- let import_object = imports! { +- "env" => { +- "get_at" => func!(get_at), +- } +- }; ++ let import_object = imports! {}; + +- let instance = instantiate(wasm_bytes, &import_object)?; ++ let instance = Instance::new(&wasm_bytes, &import_object)?; + ++ let memory = instance.exports.get_memory("mem")?; ++ let get = instance ++ .exports ++ .get_native_function::<(), (WasmPtr, i32)>("get")?; ++ let (ptr, length) = get.call()?; ++ let str = ptr.get_utf8_string(memory, length as u32)?; +``` + +Here we have a module which provides one exported function: `get`. Each time we call this function it will in turn +call our imported function `get_at`. + +The `get_at` function is responsible for reading the guest module-s memory through the `vm::Ctx`. + +With Wasmer 1.0.0 (where the `vm::Ctx` does not exist anymore) we can achieve the same result with something more +natural: we only use imports and exports to read from the memory and write to it. + +Take a look at the following examples to get more details: +* [Interacting with memory][memory] +* [Using memory pointers][memory-pointers] + +The other thing where `vm::Ctx` was useful was to pass data from and to host functions. This has also been made simpler +with Wasmer 1.x: + +```rust +let shared_counter: Arc> = Arc::new(RefCell::new(0)); + +struct Env { + counter: Arc>, +} + +fn get_counter(env: &mut Env) -> i32 { + *env.counter.borrow() +} + +let get_counter_func = Function::new_native_with_env( + &store, + Env { counter: shared_counter.clone() }, + get_counter +); +``` + +A dedicated example describes how to use this feature: [Exposing host functions][host-functions]. + +### Error handling + +Handling errors with Wasmer 0.x was a bit hard, especially, the `wasmer_runtime::error::RuntimeError`. It was rather +complex: it had many variants that you had to handle when pattern matching results. This has been made way simpler with +Wasmer 1.0.0: + +```diff +// Retrieve the `get` function from module's exports and then call it +let result = get.call(0, 13); + +match result { +- Err(RuntimeError::InvokeError(InvokeError::TrapCode { .. })) => { +- // ... +- } +- Err(RuntimeError::InvokeError(InvokeError::FailedWithNoError)) => { +- // ... +- } +- Err(RuntimeError::InvokeError(InvokeError::UnknownTrap { .. })) => { +- // ... +- } +- Err(RuntimeError::InvokeError(InvokeError::UnknownTrapCode { .. })) => { +- // ... +- } +- Err(RuntimeError::InvokeError(InvokeError::EarlyTrap(_))) => { +- // ... +- } +- Err(RuntimeError::InvokeError(InvokeError::Breakpoint(_))) => { +- // ... +- } +- Err(RuntimeError::Metering(_)) => { +- // ... +- } +- Err(RuntimeError::InstanceImage(_)) => { +- // ... +- } +- Err(RuntimeError::User(_)) => { +- // ... +- } ++ Error(e) => { ++ println!("Error caught from `div_by_zero`: {}", e.message()); ++ ++ let frames = e.trace(); ++ let frames_len = frames.len(); ++ ++ // ... ++ } + Ok(_) => { + // ... + }, +} +``` + +As you can see here, handling errors is really easy now! You may find the following examples useful to get more familiar +with this topic: +* [Handling Errors][errors] +* [Interrupting Execution][exit-early] + +Note than with Wasmer 1.0.0, each function that is part of the API has its own kind of error. For example: +* Instantiating a module may return `InstantiationError`s; +* Getting exports from the guest module may return `ExportError`s; +* Calling a exported function may return `RuntimeError`s; +* ... + +### Caching modules + +You may be aware Wasmer, since 0.x, allows you to cache compiled module so that further executions of your program +will be faster. + +Because caching may bring a significant boost when running Wasm modules we wanted to make it easier to use with +Wasmer 1.0.0. + +With Wasmer 0.x you had to handle the whole caching process inside your program's code. With Wasmer 1.0.0 +you'll be able to delegate most of the work to Wasmer: + +```diff +- let artifact = module.cache().unwrap(); +- let bytes = artifact.serialize().unwrap(); +- +- let path = "module_cached.so"; +- fs::write(path, bytes).unwrap(); ++ module.serialize_to_file(path)?; + +- let mut file = File::open(path).unwrap(); +- let cached_bytes = &mut vec![]; +- file.read_to_end(cached_bytes); +- drop(file); +- +- let cached_artifact = Artifact::deserialize(&cached_bytes).unwrap(); +- let cached_module = unsafe { load_cache_with(cached_artifact, &default_compiler()) }.unwrap(); ++ let cached_module = unsafe { Module::deserialize_from_file(&store, path) }?; +``` + +[examples]: https://docs.wasmer.io/integrations/examples +[wasmer]: https://crates.io/crates/wasmer/1.0.0-alpha3 +[wasmer-wasi]: https://crates.io/crates/wasmer-wasi/1.0.0-alpha3 +[wasmer-emscripten]: https://crates.io/crates/wasmer-emscripten/1.0.0-alpha3 +[wasmer-engine]: https://crates.io/crates/wasmer-engine/1.0.0-alpha3 +[wasmer-compiler]: https://crates.io/crates/wasmer-compiler/1.0.0-alpha3 +[wasmer.io]: https://wasmer.io +[wasmer-nightly]: https://github.com/wasmerio/wasmer-nightly/ +[getting-started]: https://docs.wasmer.io/ecosystem/wasmer/getting-started +[instance-example]: https://docs.wasmer.io/integrations/examples/instance +[imports-exports-example]: https://docs.wasmer.io/integrations/examples/imports-and-exports +[host-functions-example]: https://docs.wasmer.io/integrations/examples/host-functions +[memory]: https://docs.wasmer.io/integrations/examples/memory +[memory-pointers]: https://docs.wasmer.io/integrations/examples/memory-pointers +[host-functions]: https://docs.wasmer.io/integrations/examples/host-functions +[errors]: https://docs.wasmer.io/integrations/examples/errors +[exit-early]: https://docs.wasmer.io/integrations/examples/exit-early \ No newline at end of file diff --git a/examples/README.md b/examples/README.md index 1f57e3bcd..ab5df2842 100644 --- a/examples/README.md +++ b/examples/README.md @@ -37,6 +37,173 @@ The examples are written in a difficulty/discovery order. Concepts that are explained in an example is not necessarily re-explained in a next example. +### Basics + +1. [**Instantiating a module**][instance], explains the basics of using Wasmer + and how to create an instance out of a Wasm module. + + _Keywords_: instance, module. + +
+ Execute the example + + ```shell + $ cargo run --example instance --release --features "cranelift" + ``` + +
+ +2. [**Handling errors**][errors], explains the basics of interacting with + Wasm module memory. + + _Keywords_: memory, module. + +
+ Execute the example + + ```shell + $ cargo run --example memory --release --features "cranelift" + ``` + +
+ +3. [**Interacting with memory**][memory], explains the basics of interacting with + Wasm module memory. + + _Keywords_: memory, module. + +
+ Execute the example + + ```shell + $ cargo run --example memory --release --features "cranelift" + ``` + +
+ +### Exports + +1. [**Exported global**][exported-global], explains how to work with + exported globals: get/set their value, have information about their + type. + + _Keywords_: export, global. + +
+ Execute the example + + ```shell + $ cargo run --example exported-globals --release --features "cranelift" + ``` + +
+ +2. [**Exported function**][exported-function], explains how to get and + how to call an exported function. They come in 2 flavors: dynamic, + and “static”/native. The pros and cons are discussed briefly. + + _Keywords_: export, function, dynamic, static, native. + +
+ Execute the example + + ```shell + $ cargo run --example exported-function --release --features "cranelift" + ``` + +
+ + +3. [**Exported memory**][exported-memory], explains how to read from + and write to exported memory. + + _Keywords_: export, memory. + +
+ Execute the example + + ```shell + $ cargo run --example exported-memory --release --features "cranelift" + ``` + +
+ +### Imports + +1. [**Imported global**][imported-global], explains how to work with + imported globals: create globals, import them, get/set their value. + + _Keywords_: import, global. + +
+ Execute the example + + ```shell + $ cargo run --example imported-globals --release --features "cranelift" + ``` + +
+ +2. [**Imported function**][imported-function], explains how to define + an imported function. They come in 2 flavors: dynamic, + and “static”/native. + + _Keywords_: import, function, dynamic, static, native. + +
+ Execute the example + + ```shell + $ cargo run --example imported-function --release --features "cranelift" + ``` + +
+ +### Externs + +1. [**Table**][table], explains how to use Wasm Tables from the Wasmer API. + + _Keywords_: basic, table, call_indirect + +
+ Execute the example + + ```shell + $ cargo run --example table --release --features "cranelift" + ``` + +
+ +2. [**Memory**][memory], explains how to use Wasm Memories from + the Wasmer API. Memory example is a work in progress. + + _Keywords_: basic, memory + +
+ Execute the example + + ```shell + $ cargo run --example memory --release --features "cranelift" + ``` + +
+ +### Tunables + +1. **Limit memory**, explains how to use Tunables to limit the + size of an exported Wasm memory + + _Keywords_: basic, tunables, memory + +
+ Execute the example + + ```shell + $ cargo run --example tunables-limit-memory --release --features "cranelift" + ``` + +
+ ### Engines 1. [**JIT engine**][engine-jit], explains what an engine is, what the @@ -107,7 +274,7 @@ example. ### Compilers -5. [**Singlepass compiler**][compiler-singlepass], explains how to use +1. [**Singlepass compiler**][compiler-singlepass], explains how to use the [`wasmer-compiler-singlepass`] compiler. _Keywords_: compiler, singlepass. @@ -121,7 +288,7 @@ example. -6. [**Cranelift compiler**][compiler-cranelift], explains how to use +2. [**Cranelift compiler**][compiler-cranelift], explains how to use the [`wasmer-compiler-cranelift`] compiler. _Keywords_: compiler, cranelift. @@ -135,7 +302,7 @@ example. -7. [**LLVM compiler**][compiler-llvm], explains how to use the +3. [**LLVM compiler**][compiler-llvm], explains how to use the [`wasmer-compiler-llvm`] compiler. _Keywords_: compiler, llvm. @@ -149,116 +316,9 @@ example. -### Exports - -8. [**Exported global**][exported-global], explains how to work with - exported globals: get/set their value, have information about their - type. - - _Keywords_: export, global. - -
- Execute the example - - ```shell - $ cargo run --example exported-globals --release --features "cranelift" - ``` - -
- -9. [**Exported function**][exported-function], explains how to get and - how to call an exported function. They come in 2 flavors: dynamic, - and “static”/native. The pros and cons are discussed briefly. - - _Keywords_: export, function, dynamic, static, native. - -
- Execute the example - - ```shell - $ cargo run --example exported-function --release --features "cranelift" - ``` - -
- - -10. [**Exported memory**][exported-memory], explains how to read from - and write to exported memory. - - _Keywords_: export, memory. - -
- Execute the example - - ```shell - $ cargo run --example exported-memory --release --features "cranelift" - ``` - -
- -### Imports - -11. [**Imported global**][imported-global], explains how to work with - imported globals: create globals, import them, get/set their value. - - _Keywords_: import, global. - -
- Execute the example - - ```shell - $ cargo run --example imported-globals --release --features "cranelift" - ``` - -
- -12. [**Imported function**][imported-function], explains how to define - an imported function. They come in 2 flavors: dynamic, - and “static”/native. - - _Keywords_: import, function, dynamic, static, native. - -
- Execute the example - - ```shell - $ cargo run --example imported-function --release --features "cranelift" - ``` - -
- -### Externs - -13. [**Table**][table], explains how to use Wasm Tables from the Wasmer API. - - _Keywords_: basic, table, call_indirect - -
- Execute the example - - ```shell - $ cargo run --example table --release --features "cranelift" - ``` - -
- -14. [**Memory**][memory], explains how to use Wasm Memories from - the Wasmer API. Memory example is a work in progress. - - _Keywords_: basic, memory - -
- Execute the example - - ```shell - $ cargo run --example memory --release --features "cranelift" - ``` - -
- ### Integrations -15. [**WASI**][wasi], explains how to use the [WebAssembly System +1. [**WASI**][wasi], explains how to use the [WebAssembly System Interface][WASI] (WASI), i.e. the [`wasmer-wasi`] crate. _Keywords_: wasi, system, interface @@ -284,6 +344,7 @@ example. [exported-memory]: ./exports_memory.rs [imported-global]: ./imports_global.rs [imported-function]: ./imports_function.rs +[instance]: ./instance.rs [wasi]: ./wasi.rs [table]: ./table.rs [memory]: ./memory.rs diff --git a/examples/early_exit.rs b/examples/early_exit.rs index 814ab01ff..911fd3d60 100644 --- a/examples/early_exit.rs +++ b/examples/early_exit.rs @@ -1,5 +1,18 @@ -//! This example shows how the host can terminate execution of Wasm early from -//! inside a host function called by the Wasm. +//! There are cases where you may want to interrupt this synchronous execution of the WASM module +//! while the it is calling a host function. This can be useful for saving resources, and not +//! returning back to the guest WASM for execution, when you already know the WASM execution will +//! fail, or no longer be needed. +//! +//! In this example, we will run a WASM module that calls the imported host function +//! interrupt_execution. This host function will immediately stop executing the WebAssembly module. +//! +//! You can run the example directly by executing in Wasmer root: +//! +//! ```shell +//! cargo run --example early-exit --release --features "cranelift" +//! ``` +//! +//! Ready? use anyhow::bail; use std::fmt; @@ -21,12 +34,6 @@ impl fmt::Display for ExitCode { // And then we implement `std::error::Error`. impl std::error::Error for ExitCode {} -// The host function that we'll use to terminate execution. -fn early_exit() { - // This is where it happens. - RuntimeError::raise(Box::new(ExitCode(1))); -} - fn main() -> anyhow::Result<()> { // Let's declare the Wasm module with the text representation. let wasm_bytes = wat2wasm( @@ -44,21 +51,40 @@ fn main() -> anyhow::Result<()> { "#, )?; + // Create a Store. + // Note that we don't need to specify the engine/compiler if we want to use + // the default provided by Wasmer. + // You can use `Store::default()` for that. let store = Store::new(&JIT::new(&Cranelift::default()).engine()); + + println!("Compiling module..."); + // Let's compile the Wasm module. let module = Module::new(&store, wasm_bytes)?; + // We declare the host function that we'll use to terminate execution. + fn early_exit() { + // This is where it happens. + RuntimeError::raise(Box::new(ExitCode(1))); + } + + // Create an import object. let import_object = imports! { "env" => { "early_exit" => Function::new_native(&store, early_exit), } }; + + println!("Instantiating module..."); + // Let's instantiate the Wasm module. let instance = Instance::new(&module, &import_object)?; + // Here we go. + // // Get the `run` function which we'll use as our entrypoint. - let run_func: NativeFunc<(i32, i32), i32> = - instance.exports.get_native_function("run").unwrap(); + println!("Calling `run` function..."); + let run_func: NativeFunc<(i32, i32), i32> = instance.exports.get_native_function("run")?; - // When we call a function it can either succeed or fail. + // When we call a function it can either succeed or fail. We expect it to fail. match run_func.call(1, 7) { Ok(result) => { bail!( @@ -66,12 +92,13 @@ fn main() -> anyhow::Result<()> { result ); } - // We're expecting it to fail. - // We attempt to downcast the error into the error type that we were expecting. + // In case of a failure, which we expect, we attempt to downcast the error into the error + // type that we were expecting. Err(e) => match e.downcast::() { // We found the exit code used to terminate execution. Ok(exit_code) => { println!("Exited early with exit code: {}", exit_code); + Ok(()) } Err(e) => { diff --git a/examples/errors.rs b/examples/errors.rs new file mode 100644 index 000000000..fef46c26f --- /dev/null +++ b/examples/errors.rs @@ -0,0 +1,103 @@ +//! A Wasm module can sometimes be invalid or trigger traps, and in those case we will get +//! an error back from the API. +//! +//! In this example we'll see how to handle such errors in the most +//! basic way. To do that we'll use a Wasm module that we know will +//! produce an error. +//! +//! You can run the example directly by executing in Wasmer root: +//! +//! ```shell +//! cargo run --example errors --release --features "cranelift" +//! ``` +//! +//! Ready? + +use wasmer::{imports, wat2wasm, Instance, Module, Store}; +use wasmer_compiler_cranelift::Cranelift; +use wasmer_engine_jit::JIT; + +fn main() -> Result<(), Box> { + // Let's declare the Wasm module with the text representation. + let wasm_bytes = wat2wasm( + br#" +(module + (type $do_div_by_zero_t (func (result i32))) + (func $do_div_by_zero_f (type $do_div_by_zero_t) (result i32) + i32.const 4 + i32.const 0 + i32.div_s) + + (type $div_by_zero_t (func (result i32))) + (func $div_by_zero_f (type $div_by_zero_t) (result i32) + call $do_div_by_zero_f) + (export "div_by_zero" (func $div_by_zero_f))) +"#, + )?; + + // Create a Store. + // Note that we don't need to specify the engine/compiler if we want to use + // the default provided by Wasmer. + // You can use `Store::default()` for that. + let store = Store::new(&JIT::new(&Cranelift::default()).engine()); + + println!("Compiling module..."); + // Let's compile the Wasm module. + let module = Module::new(&store, wasm_bytes)?; + + // Create an import object. + let import_object = imports! {}; + + println!("Instantiating module..."); + // Let's instantiate the Wasm module. + let instance = Instance::new(&module, &import_object)?; + + // Here we go. + // + // The Wasm module exports a function called `div_by_zero`. As its name + // implies, this function will try to do a division by zero and thus + // produce an error. + // + // Let's get it. + let div_by_zero = instance + .exports + .get_function("div_by_zero")? + .native::<(), i32>()?; + + println!("Calling `div_by_zero` function..."); + // Let's call the `div_by_zero` exported function. + let result = div_by_zero.call(); + + // When we call a function it can either succeed or fail. We expect it to fail. + match result { + Ok(_) => { + // This should have thrown an error, return an error + panic!("div_by_zero did not error"); + } + Err(e) => { + // Log the error + println!("Error caught from `div_by_zero`: {}", e.message()); + + // Errors come with a trace we can inspect to get more + // information on the execution flow. + let frames = e.trace(); + let frames_len = frames.len(); + + for i in 0..frames_len { + println!( + " Frame #{}: {:?}::{:?}", + frames_len - i, + frames[i].module_name(), + frames[i].function_name().or(Some("")).unwrap() + ); + } + } + } + + Ok(()) +} + +#[test] +fn test_exported_function() -> Result<(), Box> { + main() +} diff --git a/examples/exports_function.rs b/examples/exports_function.rs index 941733847..853f36998 100644 --- a/examples/exports_function.rs +++ b/examples/exports_function.rs @@ -72,10 +72,11 @@ fn main() -> Result<(), Box> { println!("Calling `sum` function..."); // Let's call the `sum` exported function. The parameters are a // slice of `Value`s. The results are a boxed slice of `Value`s. - let results = sum.call(&[Value::I32(1), Value::I32(2)])?; + let args = [Value::I32(1), Value::I32(2)]; + let result = sum.call(&args)?; - println!("Results: {:?}", results); - assert_eq!(results.to_vec(), vec![Value::I32(3)]); + println!("Results: {:?}", result); + assert_eq!(result.to_vec(), vec![Value::I32(3)]); // That was fun. But what if we can get rid of the `Value`s? Well, // that's possible with the `NativeFunction` API. The function @@ -85,16 +86,16 @@ fn main() -> Result<(), Box> { // `Rets`, respectively for the parameters and the results. If // those values don't match the exported function signature, an // error will be raised. - let sum = sum.native::<(i32, i32), i32>()?; + let sum_native = sum.native::<(i32, i32), i32>()?; println!("Calling `sum` function (natively)..."); // Let's call the `sum` exported function. The parameters are // statically typed Rust values of type `i32` and `i32`. The // result, in this case particular case, in a unit of type `i32`. - let result = sum.call(1, 2)?; + let result = sum_native.call(3, 4)?; println!("Results: {:?}", result); - assert_eq!(result, 3); + assert_eq!(result, 7); // Much nicer, isn't it? // diff --git a/examples/exports_global.rs b/examples/exports_global.rs index 0ad1e9b65..8884a1406 100644 --- a/examples/exports_global.rs +++ b/examples/exports_global.rs @@ -68,16 +68,16 @@ fn main() -> Result<(), Box> { let one = instance.exports.get_global("one")?; let some = instance.exports.get_global("some")?; - println!("Getting global type informations..."); + println!("Getting globals types information..."); // Let's get the globals types. The results are `GlobalType`s. let one_type = one.ty(); let some_type = some.ty(); - println!("one type: {:?} {:?}", one_type.mutability, one_type.ty); + println!("`one` type: {:?} {:?}", one_type.mutability, one_type.ty); assert_eq!(one_type.mutability, Mutability::Const); assert_eq!(one_type.ty, Type::F32); - println!("some type: {:?} {:?}", some_type.mutability, some_type.ty); + println!("`some` type: {:?} {:?}", some_type.mutability, some_type.ty); assert_eq!(some_type.mutability, Mutability::Var); assert_eq!(some_type.ty, Type::F32); @@ -93,14 +93,14 @@ fn main() -> Result<(), Box> { .get_function("get_one")? .native::<(), f32>()?; - let one_result = get_one.call()?; - let some_result = some.get(); + let one_value = get_one.call()?; + let some_value = some.get(); - println!("one value: {:?}", one_result); - assert_eq!(one_result, 1.0); + println!("`one` value: {:?}", one_value); + assert_eq!(one_value, 1.0); - println!("some value: {:?}", some_result); - assert_eq!(some_result, Value::F32(0.0)); + println!("`some` value: {:?}", some_value); + assert_eq!(some_value, Value::F32(0.0)); println!("Setting global values..."); // Trying to set the value of a immutable global (`const`) @@ -112,7 +112,7 @@ fn main() -> Result<(), Box> { ); let one_result = one.get(); - println!("one value after `set`: {:?}", one_result); + println!("`one` value after `set`: {:?}", one_result); assert_eq!(one_result, Value::F32(1.0)); // Setting the values of globals can be done in two ways: @@ -126,12 +126,12 @@ fn main() -> Result<(), Box> { .native::()?; set_some.call(21.0)?; let some_result = some.get(); - println!("some value after `set_some`: {:?}", some_result); + println!("`some` value after `set_some`: {:?}", some_result); assert_eq!(some_result, Value::F32(21.0)); some.set(Value::F32(42.0))?; let some_result = some.get(); - println!("some value after `set`: {:?}", some_result); + println!("`some` value after `set`: {:?}", some_result); assert_eq!(some_result, Value::F32(42.0)); Ok(()) diff --git a/examples/imports_function.rs b/examples/imports_function.rs index 7007b2f4f..56496fefe 100644 --- a/examples/imports_function.rs +++ b/examples/imports_function.rs @@ -70,7 +70,7 @@ fn main() -> Result<(), Box> { } let multiply_native = Function::new_native(&store, multiply); - // Create an empty import object. + // Create an import object. let import_object = imports! { "env" => { "multiply_dynamic" => multiply_dynamic, diff --git a/examples/imports_function_env.rs b/examples/imports_function_env.rs new file mode 100644 index 000000000..88caf3c6e --- /dev/null +++ b/examples/imports_function_env.rs @@ -0,0 +1,129 @@ +//! A Wasm module can import entities, like functions, memories, +//! globals and tables. +//! +//! In this example, we'll create a system for getting and adjusting a counter value. However, host +//! functions are not limited to storing data outside of WASM, they're normal host functions and +//! can do anything that the host can do. +//! +//! 1. There will be a `get_counter` function that will return an i32 of +//! the current global counter, +//! 2. There will be an `add_to_counter` function will add the passed +//! i32 value to the counter, and return an i32 of the current +//! global counter. +//! +//! You can run the example directly by executing in Wasmer root: +//! +//! ```shell +//! cargo run --example imported-function-env --release --features "cranelift" +//! ``` +//! +//! Ready? + +use std::cell::RefCell; +use std::sync::Arc; +use wasmer::{imports, wat2wasm, Function, Instance, Module, Store}; +use wasmer_compiler_cranelift::Cranelift; +use wasmer_engine_jit::JIT; + +fn main() -> Result<(), Box> { + // Let's declare the Wasm module with the text representation. + let wasm_bytes = wat2wasm( + br#" +(module + (func $get_counter (import "env" "get_counter") (result i32)) + (func $add_to_counter (import "env" "add_to_counter") (param i32) (result i32)) + + (type $increment_t (func (param i32) (result i32))) + (func $increment_f (type $increment_t) (param $x i32) (result i32) + (block + (loop + (call $add_to_counter (i32.const 1)) + (set_local $x (i32.sub (get_local $x) (i32.const 1))) + (br_if 1 (i32.eq (get_local $x) (i32.const 0))) + (br 0))) + call $get_counter) + (export "increment_counter_loop" (func $increment_f))) +"#, + )?; + + // Create a Store. + // Note that we don't need to specify the engine/compiler if we want to use + // the default provided by Wasmer. + // You can use `Store::default()` for that. + let store = Store::new(&JIT::new(&Cranelift::default()).engine()); + + println!("Compiling module..."); + // Let's compile the Wasm module. + let module = Module::new(&store, wasm_bytes)?; + + // We create some shared data here, `Arc` is required because we may + // move our WebAssembly instance to another thread to run it. RefCell + // lets us get shared mutabilty which is fine because we know we won't + // run host calls concurrently. If concurrency is a possibilty, we'd have + // to use a `Mutex`. + let shared_counter: Arc> = Arc::new(RefCell::new(0)); + + // Once we have our counter we'll wrap it inside en `Env` which we'll pass + // to our imported functions. + // + // This struct may have been anything. The only constraint is it must be + // possible to know the size of the `Env` at compile time (i.e it has to + // implement the `Sized` trait). + struct Env { + counter: Arc>, + } + + // Create the functions + fn get_counter(env: &mut Env) -> i32 { + *env.counter.borrow() + } + fn add_to_counter(env: &mut Env, add: i32) -> i32 { + let mut counter_ref = env.counter.borrow_mut(); + + *counter_ref += add; + *counter_ref + } + + // Create an import object. + let import_object = imports! { + "env" => { + "get_counter" => Function::new_native_with_env(&store, Env { counter: shared_counter.clone() }, get_counter), + "add_to_counter" => Function::new_native_with_env(&store, Env { counter: shared_counter.clone() }, add_to_counter), + } + }; + + println!("Instantiating module..."); + // Let's instantiate the Wasm module. + let instance = Instance::new(&module, &import_object)?; + + // Here we go. + // + // The Wasm module exports a function called `increment_counter_loop`. Let's get it. + let increment_counter_loop = instance + .exports + .get_function("increment_counter_loop")? + .native::()?; + + let counter_value: i32 = *shared_counter.borrow(); + println!("Initial ounter value: {:?}", counter_value); + + println!("Calling `increment_counter_loop` function..."); + // Let's call the `increment_counter_loop` exported function. + // + // It will loop five times thus incrementing our counter five times. + let result = increment_counter_loop.call(5)?; + + let counter_value: i32 = *shared_counter.borrow(); + println!("New counter value (host): {:?}", counter_value); + assert_eq!(counter_value, 5); + + println!("New counter value (guest): {:?}", counter_value); + assert_eq!(result, 5); + + Ok(()) +} + +#[test] +fn test_imported_function_env() -> Result<(), Box> { + main() +} diff --git a/examples/instance.rs b/examples/instance.rs new file mode 100644 index 000000000..9adc7910c --- /dev/null +++ b/examples/instance.rs @@ -0,0 +1,80 @@ +//! Wasmer will let you easily run Wasm module in a Rust host. +//! +//! This example illustrates the basics of using Wasmer through a "Hello World"-like project: +//! +//! 1. How to load a Wasm modules as bytes +//! 2. How to compile the module +//! 3. How to create an instance of the module +//! +//! You can run the example directly by executing in Wasmer root: +//! +//! ```shell +//! cargo run --example instance --release --features "cranelift" +//! ``` +//! +//! Ready? + +use wasmer::{imports, wat2wasm, Instance, Module, Store}; +use wasmer_compiler_cranelift::Cranelift; +use wasmer_engine_jit::JIT; + +fn main() -> Result<(), Box> { + // Let's declare the Wasm module. + // + // We are using the text representation of the module here but you can also load `.wasm` + // files using the `include_bytes!` macro. + let wasm_bytes = wat2wasm( + br#" +(module + (type $add_one_t (func (param i32) (result i32))) + (func $add_one_f (type $add_one_t) (param $value i32) (result i32) + local.get $value + i32.const 1 + i32.add) + (export "add_one" (func $add_one_f))) +"#, + )?; + + // Create a Store. + // Note that we don't need to specify the engine/compiler if we want to use + // the default provided by Wasmer. + // You can use `Store::default()` for that. + let store = Store::new(&JIT::new(&Cranelift::default()).engine()); + + println!("Compiling module..."); + // Let's compile the Wasm module. + let module = Module::new(&store, wasm_bytes)?; + + // Create an empty import object. + let import_object = imports! {}; + + println!("Instantiating module..."); + // Let's instantiate the Wasm module. + let instance = Instance::new(&module, &import_object)?; + + // We now have an instance ready to be used. + // + // From an `Instance` we can retrieve any exported entities. + // Each of these entities is covered in others examples. + // + // Here we are retrieving the exported function. We won't go into details here + // as the main focus of this example is to show how to create an instance out + // of a Wasm module and have basic interactions with it. + let add_one = instance + .exports + .get_function("add_one")? + .native::()?; + + println!("Calling `add_one` function..."); + let result = add_one.call(1)?; + + println!("Results of `add_one`: {:?}", result); + assert_eq!(result, 2); + + Ok(()) +} + +#[test] +fn test_exported_function() -> Result<(), Box> { + main() +} diff --git a/examples/memory.rs b/examples/memory.rs index 21b978de9..d78b6dda5 100644 --- a/examples/memory.rs +++ b/examples/memory.rs @@ -1,7 +1,21 @@ -use wasmer::{ - imports, wat2wasm, Extern, Function, Instance, Memory, MemoryType, Module, NativeFunc, Pages, - Store, Table, TableType, Type, Value, -}; +//! With Wasmer you'll be able to interact with guest module memory. +//! +//! This example illustrates the basics of interacting with Wasm module memory.: +//! +//! 1. How to load a Wasm modules as bytes +//! 2. How to compile the module +//! 3. How to create an instance of the module +//! +//! You can run the example directly by executing in Wasmer root: +//! +//! ```shell +//! cargo run --example memory --release --features "cranelift" +//! ``` +//! +//! Ready? + +use std::mem; +use wasmer::{imports, wat2wasm, Bytes, Instance, Module, NativeFunc, Pages, Store}; use wasmer_compiler_cranelift::Cranelift; use wasmer_engine_jit::JIT; @@ -9,6 +23,10 @@ use wasmer_engine_jit::JIT; // TODO: clean it up and comment it https://github.com/wasmerio/wasmer/issues/1749 fn main() -> anyhow::Result<()> { + // Let's declare the Wasm module. + // + // We are using the text representation of the module here but you can also load `.wasm` + // files using the `include_bytes!` macro. let wasm_bytes = wat2wasm( r#" (module @@ -35,47 +53,87 @@ fn main() -> anyhow::Result<()> { .as_bytes(), )?; - // We set up our store with an engine and a compiler. + // Create a Store. + // Note that we don't need to specify the engine/compiler if we want to use + // the default provided by Wasmer. + // You can use `Store::default()` for that. let store = Store::new(&JIT::new(&Cranelift::default()).engine()); - // Then compile our Wasm. + + println!("Compiling module..."); + // Let's compile the Wasm module. let module = Module::new(&store, wasm_bytes)?; + + // Create an empty import object. let import_object = imports! {}; - // And instantiate it with no imports. + + println!("Instantiating module..."); + // Let's instantiate the Wasm module. let instance = Instance::new(&module, &import_object)?; + // The module exports some utility functions, let's get them. + // + // These function will be used later in this example. let mem_size: NativeFunc<(), i32> = instance.exports.get_native_function("mem_size")?; let get_at: NativeFunc = instance.exports.get_native_function("get_at")?; let set_at: NativeFunc<(i32, i32), ()> = instance.exports.get_native_function("set_at")?; let memory = instance.exports.get_memory("memory")?; - let mem_addr = 0x2220; - let val = 0xFEFEFFE; - + // We now have an instance ready to be used. + // + // We will start by querying the most intersting information + // about the memory: its size. There are mainly two ways of getting + // this: + // * the size as a number of `Page`s + // * the size as a number of bytes + // + // The size in bytes can be found either by querying its pages or by + // querying the memory directly. + println!("Querying memory size..."); assert_eq!(memory.size(), Pages::from(1)); + assert_eq!(memory.size().bytes(), Bytes::from(65536 as usize)); + assert_eq!(memory.data_size(), 65536); + + // Sometimes, the guest module may also export a function to let you + // query the memory. Here we have a `mem_size` function, let's try it: + let result = mem_size.call()?; + println!("Memory size: {:?}", result); + assert_eq!(Pages::from(result as u32), memory.size()); + + // Now that we know the size of our memory, it's time to see how wa + // can change this. + // + // A memory can be grown to allow storing more things into it. Let's + // see how we can do that: + println!("Growing memory..."); + // Here we are requesting two more pages for our memory. memory.grow(2)?; assert_eq!(memory.size(), Pages::from(3)); - let result = mem_size.call()?; - assert_eq!(result, 3); + assert_eq!(memory.data_size(), 65536 * 3); - // ------------- + // Now that we know how to query and adjust the size of the memory, + // let's see how wa can write to it or read from it. + // + // We'll only focus on how to do this using exported functions, the goal + // is to show how to work with memory addresses. Here we'll use absolute + // addresses to write and read a value. + let mem_addr = 0x2220; + let val = 0xFEFEFFE; set_at.call(mem_addr, val)?; - // ------------- - let page_size = 0x1_0000; - let result = get_at.call(page_size * 3 - 4)?; - memory.grow(1025)?; - assert_eq!(memory.size(), Pages::from(1028)); - set_at.call(page_size * 1027 - 4, 123456)?; - let result = get_at.call(page_size * 1027 - 4)?; - assert_eq!(result, 123456); - set_at.call(1024, 123456)?; - let result = get_at.call(1024)?; - assert_eq!(result, 123456); - - // ------------- let result = get_at.call(mem_addr)?; + println!("Value at {:#x?}: {:?}", mem_addr, result); + assert_eq!(result, val); + + // Now instead of using hard coded memory addresses, let's try to write + // something at the end of the second memory page and read it. + let page_size = 0x1_0000; + let mem_addr = (page_size * 2) - mem::size_of_val(&val) as i32; + let val = 0xFEA09; + set_at.call(mem_addr, val)?; + + let result = get_at.call(mem_addr)?; + println!("Value at {:#x?}: {:?}", mem_addr, result); assert_eq!(result, val); - // ------------- Ok(()) } diff --git a/examples/tunables_limit_memory.rs b/examples/tunables_limit_memory.rs new file mode 100644 index 000000000..c87f371bc --- /dev/null +++ b/examples/tunables_limit_memory.rs @@ -0,0 +1,184 @@ +use std::ptr::NonNull; +use std::sync::Arc; + +use wasmer::{ + imports, + vm::{self, MemoryError, MemoryStyle, TableStyle, VMMemoryDefinition, VMTableDefinition}, + wat2wasm, Instance, Memory, MemoryType, Module, Pages, Store, TableType, Target, + Tunables as ReferenceTunables, +}; +use wasmer_compiler_cranelift::Cranelift; +use wasmer_engine::Tunables; +use wasmer_engine_jit::JIT; + +/// A custom tunables that allows you to set a memory limit. +/// +/// After adjusting the memory limits, it delegates all other logic +/// to the base tunables. +pub struct LimitingTunables { + /// The maximum a linear memory is allowed to be (in Wasm pages, 64 KiB each). + /// Since Wasmer ensures there is only none or one memory, this is practically + /// an upper limit for the guest memory. + limit: Pages, + /// The base implementation we delegate all the logic to + base: T, +} + +impl LimitingTunables { + pub fn new(base: T, limit: Pages) -> Self { + Self { limit, base } + } + + /// Takes in input memory type as requested by the guest and sets + /// a maximum if missing. The resulting memory type is final if + /// valid. However, this can produce invalid types, such that + /// validate_memory must be called before creating the memory. + fn adjust_memory(&self, requested: &MemoryType) -> MemoryType { + let mut adjusted = requested.clone(); + if requested.maximum.is_none() { + adjusted.maximum = Some(self.limit); + } + adjusted + } + + /// Ensures the a given memory type does not exceed the memory limit. + /// Call this after adjusting the memory. + fn validate_memory(&self, ty: &MemoryType) -> Result<(), MemoryError> { + if ty.minimum > self.limit { + return Err(MemoryError::Generic( + "Minimum exceeds the allowed memory limit".to_string(), + )); + } + + if let Some(max) = ty.maximum { + if max > self.limit { + return Err(MemoryError::Generic( + "Maximum exceeds the allowed memory limit".to_string(), + )); + } + } else { + return Err(MemoryError::Generic("Maximum unset".to_string())); + } + + Ok(()) + } +} + +impl Tunables for LimitingTunables { + /// Construct a `MemoryStyle` for the provided `MemoryType` + /// + /// Delegated to base. + fn memory_style(&self, memory: &MemoryType) -> MemoryStyle { + let adjusted = self.adjust_memory(memory); + self.base.memory_style(&adjusted) + } + + /// Construct a `TableStyle` for the provided `TableType` + /// + /// Delegated to base. + fn table_style(&self, table: &TableType) -> TableStyle { + self.base.table_style(table) + } + + /// Create a memory owned by the host given a [`MemoryType`] and a [`MemoryStyle`]. + /// + /// The requested memory type is validated, adjusted to the limited and then passed to base. + fn create_host_memory( + &self, + ty: &MemoryType, + style: &MemoryStyle, + ) -> Result, MemoryError> { + let adjusted = self.adjust_memory(ty); + self.validate_memory(&adjusted)?; + self.base.create_host_memory(&adjusted, style) + } + + /// Create a memory owned by the VM given a [`MemoryType`] and a [`MemoryStyle`]. + /// + /// Delegated to base. + unsafe fn create_vm_memory( + &self, + ty: &MemoryType, + style: &MemoryStyle, + vm_definition_location: NonNull, + ) -> Result, MemoryError> { + let adjusted = self.adjust_memory(ty); + self.validate_memory(&adjusted)?; + self.base + .create_vm_memory(&adjusted, style, vm_definition_location) + } + + /// Create a table owned by the host given a [`TableType`] and a [`TableStyle`]. + /// + /// Delegated to base. + fn create_host_table( + &self, + ty: &TableType, + style: &TableStyle, + ) -> Result, String> { + self.base.create_host_table(ty, style) + } + + /// Create a table owned by the VM given a [`TableType`] and a [`TableStyle`]. + /// + /// Delegated to base. + unsafe fn create_vm_table( + &self, + ty: &TableType, + style: &TableStyle, + vm_definition_location: NonNull, + ) -> Result, String> { + self.base.create_vm_table(ty, style, vm_definition_location) + } +} + +fn main() -> Result<(), Box> { + // A Wasm module with one exported memory (min: 7 pages, max: unset) + let wat = br#"(module (memory 7) (export "memory" (memory 0)))"#; + + // Alternatively: A Wasm module with one exported memory (min: 7 pages, max: 80 pages) + // let wat = br#"(module (memory 7 80) (export "memory" (memory 0)))"#; + + let wasm_bytes = wat2wasm(wat)?; + + // Any compiler and any engine do the job here + let compiler = Cranelift::default(); + let engine = JIT::new(&compiler).engine(); + + // Here is where the fun begins + + let base = ReferenceTunables::for_target(&Target::default()); + let tunables = LimitingTunables::new(base, Pages(24)); + + // Create a store, that holds the engine and our custom tunables + let store = Store::new_with_tunables(&engine, tunables); + + println!("Compiling module..."); + let module = Module::new(&store, wasm_bytes)?; + + println!("Instantiating module..."); + let import_object = imports! {}; + + // Now at this point, our custom tunables are used + let instance = Instance::new(&module, &import_object)?; + + // Check what happened + let mut memories: Vec = instance + .exports + .iter() + .memories() + .map(|pair| pair.1.clone()) + .collect(); + assert_eq!(memories.len(), 1); + + let first_memory = memories.pop().unwrap(); + println!("Memory of this instance: {:?}", first_memory); + assert_eq!(first_memory.ty().maximum.unwrap(), Pages(24)); + + Ok(()) +} + +#[test] +fn test_tunables_limit_memory() -> Result<(), Box> { + main() +} diff --git a/lib/api/Cargo.toml b/lib/api/Cargo.toml index d2e059947..11634c35f 100644 --- a/lib/api/Cargo.toml +++ b/lib/api/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "wasmer" -version = "1.0.0-alpha4" +version = "1.0.0-alpha5" description = "High-performant WebAssembly runtime" categories = ["wasm"] keywords = ["wasm", "webassembly", "runtime", "vm"] @@ -11,29 +11,29 @@ readme = "README.md" edition = "2018" [dependencies] -wasmer-vm = { path = "../vm", version = "1.0.0-alpha4" } -wasmer-compiler-singlepass = { path = "../compiler-singlepass", version = "1.0.0-alpha4", optional = true } -wasmer-compiler-cranelift = { path = "../compiler-cranelift", version = "1.0.0-alpha4", optional = true } -wasmer-compiler-llvm = { path = "../compiler-llvm", version = "1.0.0-alpha4", optional = true } -wasmer-compiler = { path = "../compiler", version = "1.0.0-alpha4" } -wasmer-derive = { path = "../derive", version = "1.0.0-alpha4" } -wasmer-engine = { path = "../engine", version = "1.0.0-alpha4" } -wasmer-engine-jit = { path = "../engine-jit", version = "1.0.0-alpha4", optional = true } -wasmer-engine-native = { path = "../engine-native", version = "1.0.0-alpha4", optional = true } -wasmer-types = { path = "../wasmer-types", version = "1.0.0-alpha4" } +wasmer-vm = { path = "../vm", version = "1.0.0-alpha5" } +wasmer-compiler-singlepass = { path = "../compiler-singlepass", version = "1.0.0-alpha5", optional = true } +wasmer-compiler-cranelift = { path = "../compiler-cranelift", version = "1.0.0-alpha5", optional = true } +wasmer-compiler-llvm = { path = "../compiler-llvm", version = "1.0.0-alpha5", optional = true } +wasmer-compiler = { path = "../compiler", version = "1.0.0-alpha5" } +wasmer-derive = { path = "../derive", version = "1.0.0-alpha5" } +wasmer-engine = { path = "../engine", version = "1.0.0-alpha5" } +wasmer-engine-jit = { path = "../engine-jit", version = "1.0.0-alpha5", optional = true } +wasmer-engine-native = { path = "../engine-native", version = "1.0.0-alpha5", optional = true } +wasmer-types = { path = "../wasmer-types", version = "1.0.0-alpha5" } indexmap = { version = "1.4", features = ["serde-1"] } cfg-if = "0.1" wat = { version = "1.0", optional = true } thiserror = "1.0" more-asserts = "0.2" -target-lexicon = { version = "0.10", default-features = false } +target-lexicon = { version = "0.11", default-features = false } [target.'cfg(target_os = "windows")'.dependencies] winapi = "0.3" [dev-dependencies] # for the binary wasmer.rs -libc = { version = "^0.2.69", default-features = false } +libc = { version = "^0.2", default-features = false } wat = "1.0" tempfile = "3.1" anyhow = "1.0" diff --git a/lib/api/src/externals/function.rs b/lib/api/src/externals/function.rs index 9dcbf6f86..a86753b81 100644 --- a/lib/api/src/externals/function.rs +++ b/lib/api/src/externals/function.rs @@ -12,8 +12,8 @@ use std::cmp::max; use std::fmt; use wasmer_vm::{ raise_user_trap, resume_panic, wasmer_call_trampoline, Export, ExportFunction, - VMCallerCheckedAnyfunc, VMContext, VMDynamicFunctionContext, VMFunctionBody, VMFunctionKind, - VMTrampoline, + VMCallerCheckedAnyfunc, VMDynamicFunctionContext, VMFunctionBody, VMFunctionEnvironment, + VMFunctionKind, VMTrampoline, }; /// A function defined in the Wasm module @@ -86,7 +86,9 @@ impl Function { // The engine linker will replace the address with one pointing to a // generated dynamic trampoline. let address = std::ptr::null() as *const VMFunctionBody; - let vmctx = Box::into_raw(Box::new(dynamic_ctx)) as *mut VMContext; + let vmctx = VMFunctionEnvironment { + host_env: Box::into_raw(Box::new(dynamic_ctx)) as *mut _, + }; Self { store: store.clone(), @@ -138,7 +140,9 @@ impl Function { // The engine linker will replace the address with one pointing to a // generated dynamic trampoline. let address = std::ptr::null() as *const VMFunctionBody; - let vmctx = Box::into_raw(Box::new(dynamic_ctx)) as *mut VMContext; + let vmctx = VMFunctionEnvironment { + host_env: Box::into_raw(Box::new(dynamic_ctx)) as *mut _, + }; // TODO: look into removing transmute by changing API type signatures let function_ptr = Some(unsafe { std::mem::transmute:: Result<(), _>, fn(_, _) -> Result<(), _>>(Env::finish) @@ -184,7 +188,9 @@ impl Function { { let function = inner::Function::::new(func); let address = function.address() as *const VMFunctionBody; - let vmctx = std::ptr::null_mut() as *mut VMContext; + let vmctx = VMFunctionEnvironment { + host_env: std::ptr::null_mut() as *mut _, + }; let signature = function.ty(); Self { @@ -242,7 +248,9 @@ impl Function { // In the case of Host-defined functions `VMContext` is whatever environment // the user want to attach to the function. let box_env = Box::new(env); - let vmctx = Box::into_raw(box_env) as *mut VMContext; + let vmctx = VMFunctionEnvironment { + host_env: Box::into_raw(box_env) as *mut _, + }; // TODO: look into removing transmute by changing API type signatures let function_ptr = Some(unsafe { std::mem::transmute:: Result<(), _>, fn(_, _) -> Result<(), _>>(Env::finish) diff --git a/lib/api/src/externals/memory.rs b/lib/api/src/externals/memory.rs index 38c7e237a..32583c82f 100644 --- a/lib/api/src/externals/memory.rs +++ b/lib/api/src/externals/memory.rs @@ -87,21 +87,26 @@ impl Memory { &self.store } - /// TODO: document this function. + /// Retrieve a slice of the memory contents. /// /// # Safety /// - /// To be defined (TODO). + /// Until the returned slice is dropped, it is undefined behaviour to + /// modify the memory contents in any way including by calling a wasm + /// function that writes to the memory or by resizing the memory. pub unsafe fn data_unchecked(&self) -> &[u8] { self.data_unchecked_mut() } - /// TODO: document this function, it's trivial to cause UB/break soundness with this - /// method. + /// Retrieve a mutable slice of the memory contents. /// /// # Safety /// - /// To be defined (TODO). + /// This method provides interior mutability without an UnsafeCell. Until + /// the returned value is dropped, it is undefined behaviour to read or + /// write to the pointed-to memory in any way except through this slice, + /// including by calling a wasm function that reads the memory contents or + /// by resizing this Memory. #[allow(clippy::mut_from_ref)] pub unsafe fn data_unchecked_mut(&self) -> &mut [u8] { let definition = self.memory.vmmemory(); diff --git a/lib/api/src/lib.rs b/lib/api/src/lib.rs index 7bf193bcf..9d7cc828f 100644 --- a/lib/api/src/lib.rs +++ b/lib/api/src/lib.rs @@ -83,7 +83,17 @@ pub use wasmer_types::{ Atomically, Bytes, GlobalInit, LocalFunctionIndex, MemoryView, Pages, ValueType, WASM_MAX_PAGES, WASM_MIN_PAGES, WASM_PAGE_SIZE, }; + +// TODO: should those be moved into wasmer::vm as well? pub use wasmer_vm::{raise_user_trap, Export, MemoryError}; +pub mod vm { + //! We use the vm module for re-exporting wasmer-vm types + + pub use wasmer_vm::{ + Memory, MemoryError, MemoryStyle, Table, TableStyle, VMMemoryDefinition, VMTableDefinition, + }; +} + #[cfg(feature = "wat")] pub use wat::parse_bytes as wat2wasm; diff --git a/lib/api/src/native.rs b/lib/api/src/native.rs index b8f6c291d..8e82e41e2 100644 --- a/lib/api/src/native.rs +++ b/lib/api/src/native.rs @@ -17,7 +17,7 @@ use crate::{FromToNativeWasmType, Function, FunctionType, RuntimeError, Store, W use std::panic::{catch_unwind, AssertUnwindSafe}; use wasmer_types::NativeWasmType; use wasmer_vm::{ - ExportFunction, VMContext, VMDynamicFunctionContext, VMFunctionBody, VMFunctionKind, + ExportFunction, VMDynamicFunctionContext, VMFunctionBody, VMFunctionEnvironment, VMFunctionKind, }; /// A WebAssembly function that can be called natively @@ -26,7 +26,7 @@ pub struct NativeFunc { definition: FunctionDefinition, store: Store, address: *const VMFunctionBody, - vmctx: *mut VMContext, + vmctx: VMFunctionEnvironment, arg_kind: VMFunctionKind, // exported: ExportFunction, _phantom: PhantomData<(Args, Rets)>, @@ -42,7 +42,7 @@ where pub(crate) fn new( store: Store, address: *const VMFunctionBody, - vmctx: *mut VMContext, + vmctx: VMFunctionEnvironment, arg_kind: VMFunctionKind, definition: FunctionDefinition, ) -> Self { @@ -169,7 +169,7 @@ macro_rules! impl_native_traits { match self.arg_kind { VMFunctionKind::Static => { let results = catch_unwind(AssertUnwindSafe(|| unsafe { - let f = std::mem::transmute::<_, unsafe extern "C" fn( *mut VMContext, $( $x, )*) -> Rets::CStruct>(self.address); + let f = std::mem::transmute::<_, unsafe extern "C" fn( VMFunctionEnvironment, $( $x, )*) -> Rets::CStruct>(self.address); // We always pass the vmctx f( self.vmctx, $( $x, )* ) })).map_err(|e| RuntimeError::new(format!("{:?}", e)))?; @@ -179,12 +179,16 @@ macro_rules! impl_native_traits { let params_list = [ $( $x.to_native().to_value() ),* ]; let results = if !has_env { type VMContextWithoutEnv = VMDynamicFunctionContext; - let ctx = self.vmctx as *mut VMContextWithoutEnv; - unsafe { (*ctx).ctx.call(¶ms_list)? } + unsafe { + let ctx = self.vmctx.host_env as *mut VMContextWithoutEnv; + (*ctx).ctx.call(¶ms_list)? + } } else { type VMContextWithEnv = VMDynamicFunctionContext>; - let ctx = self.vmctx as *mut VMContextWithEnv; - unsafe { (*ctx).ctx.call(¶ms_list)? } + unsafe { + let ctx = self.vmctx.host_env as *mut VMContextWithEnv; + (*ctx).ctx.call(¶ms_list)? + } }; let mut rets_list_array = Rets::empty_array(); let mut_rets = rets_list_array.as_mut() as *mut [i128] as *mut i128; diff --git a/lib/api/src/tunables.rs b/lib/api/src/tunables.rs index e24ccabe2..d83d794f8 100644 --- a/lib/api/src/tunables.rs +++ b/lib/api/src/tunables.rs @@ -71,6 +71,7 @@ impl BaseTunables for Tunables { let maximum = memory.maximum.unwrap_or_else(Pages::max_value); if maximum <= self.static_memory_bound { MemoryStyle::Static { + // Bound can be larger than the maximum for performance reasons bound: self.static_memory_bound, offset_guard_size: self.static_memory_offset_guard_size, } @@ -140,3 +141,47 @@ impl BaseTunables for Tunables { )?)) } } + +#[cfg(test)] +mod tests { + use super::*; + + #[test] + fn memory_style() { + let tunables = Tunables { + static_memory_bound: Pages(2048), + static_memory_offset_guard_size: 128, + dynamic_memory_offset_guard_size: 256, + }; + + // No maximum + let requested = MemoryType::new(3, None, true); + let style = tunables.memory_style(&requested); + match style { + MemoryStyle::Dynamic { offset_guard_size } => assert_eq!(offset_guard_size, 256), + s => panic!("Unexpected memory style: {:?}", s), + } + + // Large maximum + let requested = MemoryType::new(3, Some(5_000_000), true); + let style = tunables.memory_style(&requested); + match style { + MemoryStyle::Dynamic { offset_guard_size } => assert_eq!(offset_guard_size, 256), + s => panic!("Unexpected memory style: {:?}", s), + } + + // Small maximum + let requested = MemoryType::new(3, Some(16), true); + let style = tunables.memory_style(&requested); + match style { + MemoryStyle::Static { + bound, + offset_guard_size, + } => { + assert_eq!(bound, Pages(2048)); + assert_eq!(offset_guard_size, 128); + } + s => panic!("Unexpected memory style: {:?}", s), + } + } +} diff --git a/lib/api/src/types.rs b/lib/api/src/types.rs index f55bfc42a..5839b8f77 100644 --- a/lib/api/src/types.rs +++ b/lib/api/src/types.rs @@ -56,7 +56,9 @@ impl ValFuncRef for Val { Self::ExternRef(ExternRef::Null) => wasmer_vm::VMCallerCheckedAnyfunc { func_ptr: ptr::null(), type_index: wasmer_vm::VMSharedSignatureIndex::default(), - vmctx: ptr::null_mut(), + vmctx: wasmer_vm::VMFunctionEnvironment { + host_env: ptr::null_mut(), + }, }, Self::FuncRef(f) => f.checked_anyfunc(), _ => return Err(RuntimeError::new("val is not funcref")), diff --git a/lib/c-api/Cargo.toml b/lib/c-api/Cargo.toml index 312900c9f..3e37ffa52 100644 --- a/lib/c-api/Cargo.toml +++ b/lib/c-api/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "wasmer-c-api" -version = "1.0.0-alpha4" +version = "1.0.0-alpha5" description = "Wasmer C API library" categories = ["wasm", "api-bindings"] keywords = ["wasm", "webassembly", "runtime"] @@ -15,21 +15,21 @@ edition = "2018" crate-type = ["cdylib", "rlib", "staticlib"] [dependencies] -wasmer = { version = "1.0.0-alpha4", path = "../api", default-features = false } -wasmer-compiler = { version = "1.0.0-alpha4", path = "../compiler" } -wasmer-compiler-cranelift = { version = "1.0.0-alpha4", path = "../compiler-cranelift", optional = true } -wasmer-compiler-singlepass = { version = "1.0.0-alpha4", path = "../compiler-singlepass", optional = true } -wasmer-compiler-llvm = { version = "1.0.0-alpha4", path = "../compiler-llvm", optional = true } -wasmer-emscripten = { version = "1.0.0-alpha4", path = "../emscripten", optional = true } -wasmer-engine = { version = "1.0.0-alpha4", path = "../engine" } -wasmer-engine-jit = { version = "1.0.0-alpha4", path = "../engine-jit", optional = true } -wasmer-engine-native = { version = "1.0.0-alpha4", path = "../engine-native", optional = true } -wasmer-engine-object-file = { version = "1.0.0-alpha4", path = "../engine-object-file", optional = true } -wasmer-wasi = { version = "1.0.0-alpha4", path = "../wasi", optional = true } -wasmer-types = { version = "1.0.0-alpha4", path = "../wasmer-types" } -cfg-if = "0.1" +wasmer = { version = "1.0.0-alpha5", path = "../api", default-features = false } +wasmer-compiler = { version = "1.0.0-alpha5", path = "../compiler" } +wasmer-compiler-cranelift = { version = "1.0.0-alpha5", path = "../compiler-cranelift", optional = true } +wasmer-compiler-singlepass = { version = "1.0.0-alpha5", path = "../compiler-singlepass", optional = true } +wasmer-compiler-llvm = { version = "1.0.0-alpha5", path = "../compiler-llvm", optional = true } +wasmer-emscripten = { version = "1.0.0-alpha5", path = "../emscripten", optional = true } +wasmer-engine = { version = "1.0.0-alpha5", path = "../engine" } +wasmer-engine-jit = { version = "1.0.0-alpha5", path = "../engine-jit", optional = true } +wasmer-engine-native = { version = "1.0.0-alpha5", path = "../engine-native", optional = true } +wasmer-engine-object-file = { version = "1.0.0-alpha5", path = "../engine-object-file", optional = true } +wasmer-wasi = { version = "1.0.0-alpha5", path = "../wasi", optional = true } +wasmer-types = { version = "1.0.0-alpha5", path = "../wasmer-types" } +cfg-if = "1.0" lazy_static = "1" -libc = { version = "^0.2.69", default-features = false } +libc = { version = "^0.2", default-features = false } libffi = { version = "0.9" } serde = { version = "1", optional = true, features = ["derive"] } thiserror = "1" @@ -37,7 +37,10 @@ typetag = { version = "0.1", optional = true } paste = "0.1" # for generating code in the same way thot the wasm-c-api does # Commented out for now until we can find a solution to the exported function problem -# wasmer-wasm-c-api = { version = "1.0.0-alpha4", path = "crates/wasm-c-api" } +# wasmer-wasm-c-api = { version = "1.0.0-alpha5", path = "crates/wasm-c-api" } + +[dev-dependencies] +inline-c = "0.1.2" [features] default = [ @@ -89,4 +92,4 @@ cranelift-backend = ["cranelift"] llvm-backend = ["llvm"] [build-dependencies] -cbindgen = "0.15" +cbindgen = "0.15" \ No newline at end of file diff --git a/lib/c-api/build.rs b/lib/c-api/build.rs index d0147057f..f2a57aa28 100644 --- a/lib/c-api/build.rs +++ b/lib/c-api/build.rs @@ -61,6 +61,7 @@ fn main() { build_wasm_c_api_headers(&crate_dir, &out_dir); build_wasmer_headers(&crate_dir, &out_dir); + build_inline_c_env_vars(); } /// Build the header files for the `wasm_c_api` API. @@ -389,3 +390,44 @@ fn exclude_items_from_wasm_c_api(builder: Builder) -> Builder { .exclude_item("wasmer_engine_t") .exclude_item("wat2wasm") } + +fn build_inline_c_env_vars() { + use std::ffi::OsStr; + + let mut shared_object_dir = PathBuf::from(env::var("CARGO_MANIFEST_DIR").unwrap()); + + assert_eq!(shared_object_dir.file_name(), Some(OsStr::new("c-api"))); + shared_object_dir.pop(); + + assert_eq!(shared_object_dir.file_name(), Some(OsStr::new("lib"))); + shared_object_dir.pop(); + + shared_object_dir.push("target"); + shared_object_dir.push(env::var("PROFILE").unwrap()); + + let shared_object_dir = shared_object_dir.as_path().to_string_lossy(); + let include_dir = env::var("CARGO_MANIFEST_DIR").unwrap(); + + // The following options mean: + // + // * `-I`, add `include_dir` to include search path, + // * `-L`, add `shared_object_dir` to library search path, + // * `-D_DEBUG`, enable debug mode to enable `assert.h`. + println!( + "cargo:rustc-env=INLINE_C_RS_CFLAGS=-I{I} -L{L} -D_DEBUG", + I = include_dir, + L = shared_object_dir.clone(), + ); + + println!( + "cargo:rustc-env=INLINE_C_RS_LDFLAGS={shared_object_dir}/{lib}", + shared_object_dir = shared_object_dir, + lib = if cfg!(target_os = "windows") { + "wasmer_c_api.dll".to_string() + } else if cfg!(target_os = "macos") { + "libwasmer_c_api.dylib".to_string() + } else { + "libwasmer_c_api.so".to_string() + } + ); +} diff --git a/lib/c-api/doc/deprecated/doxyfile b/lib/c-api/doc/deprecated/doxyfile index fa289b1e6..8e4ea8759 100644 --- a/lib/c-api/doc/deprecated/doxyfile +++ b/lib/c-api/doc/deprecated/doxyfile @@ -1,20 +1,131 @@ -# Doxyfile 1.8.17 +# Doxyfile 1.8.18 + +# This file describes the settings to be used by the documentation system +# doxygen (www.doxygen.org) for a project. +# +# All text after a double hash (##) is considered a comment and is placed in +# front of the TAG it is preceding. +# +# All text after a single hash (#) is considered a comment and will be ignored. +# The format is: +# TAG = value [value, ...] +# For lists, items can also be appended using: +# TAG += value [value, ...] +# Values that contain spaces should be placed between quotes (\" \"). #--------------------------------------------------------------------------- # Project related configuration options #--------------------------------------------------------------------------- + +# This tag specifies the encoding used for all characters in the configuration +# file that follow. The default is UTF-8 which is also the encoding used for all +# text before the first occurrence of this tag. Doxygen uses libiconv (or the +# iconv built into libc) for the transcoding. See +# https://www.gnu.org/software/libiconv/ for the list of possible encodings. +# The default value is: UTF-8. + DOXYFILE_ENCODING = UTF-8 + +# The PROJECT_NAME tag is a single word (or a sequence of words surrounded by +# double-quotes, unless you are using Doxywizard) that should identify the +# project for which the documentation is generated. This name is used in the +# title of most generated pages and in a few other places. +# The default value is: My Project. + PROJECT_NAME = "wasmer-c-api" + +# The PROJECT_NUMBER tag can be used to enter a project or revision number. This +# could be handy for archiving the generated documentation or if some version +# control system is used. + PROJECT_NUMBER = -PROJECT_BRIEF = + +# Using the PROJECT_BRIEF tag one can provide an optional one line description +# for a project that appears at the top of each page and should give viewer a +# quick idea about the purpose of the project. Keep the description short. + +PROJECT_BRIEF = + +# With the PROJECT_LOGO tag one can specify a logo or an icon that is included +# in the documentation. The maximum height of the logo should not exceed 55 +# pixels and the maximum width should not exceed 200 pixels. Doxygen will copy +# the logo to the output directory. + PROJECT_LOGO = ../../../../assets/logo.png + +# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) path +# into which the generated documentation will be written. If a relative path is +# entered, it will be relative to the location where doxygen was started. If +# left blank the current directory will be used. + OUTPUT_DIRECTORY = . + +# If the CREATE_SUBDIRS tag is set to YES then doxygen will create 4096 sub- +# directories (in 2 levels) under the output directory of each output format and +# will distribute the generated files over these directories. Enabling this +# option can be useful when feeding doxygen a huge amount of source files, where +# putting all generated files in the same directory would otherwise causes +# performance problems for the file system. +# The default value is: NO. + CREATE_SUBDIRS = NO + +# If the ALLOW_UNICODE_NAMES tag is set to YES, doxygen will allow non-ASCII +# characters to appear in the names of generated files. If set to NO, non-ASCII +# characters will be escaped, for example _xE3_x81_x84 will be used for Unicode +# U+3044. +# The default value is: NO. + ALLOW_UNICODE_NAMES = NO + +# The OUTPUT_LANGUAGE tag is used to specify the language in which all +# documentation generated by doxygen is written. Doxygen will use this +# information to generate all constant output in the proper language. +# Possible values are: Afrikaans, Arabic, Armenian, Brazilian, Catalan, Chinese, +# Chinese-Traditional, Croatian, Czech, Danish, Dutch, English (United States), +# Esperanto, Farsi (Persian), Finnish, French, German, Greek, Hungarian, +# Indonesian, Italian, Japanese, Japanese-en (Japanese with English messages), +# Korean, Korean-en (Korean with English messages), Latvian, Lithuanian, +# Macedonian, Norwegian, Persian (Farsi), Polish, Portuguese, Romanian, Russian, +# Serbian, Serbian-Cyrillic, Slovak, Slovene, Spanish, Swedish, Turkish, +# Ukrainian and Vietnamese. +# The default value is: English. + OUTPUT_LANGUAGE = English + +# The OUTPUT_TEXT_DIRECTION tag is used to specify the direction in which all +# documentation generated by doxygen is written. Doxygen will use this +# information to generate all generated output in the proper direction. +# Possible values are: None, LTR, RTL and Context. +# The default value is: None. + OUTPUT_TEXT_DIRECTION = None + +# If the BRIEF_MEMBER_DESC tag is set to YES, doxygen will include brief member +# descriptions after the members that are listed in the file and class +# documentation (similar to Javadoc). Set to NO to disable this. +# The default value is: YES. + BRIEF_MEMBER_DESC = YES + +# If the REPEAT_BRIEF tag is set to YES, doxygen will prepend the brief +# description of a member or function before the detailed description +# +# Note: If both HIDE_UNDOC_MEMBERS and BRIEF_MEMBER_DESC are set to NO, the +# brief descriptions will be completely suppressed. +# The default value is: YES. + REPEAT_BRIEF = YES + +# This tag implements a quasi-intelligent brief description abbreviator that is +# used to form the text in various listings. Each string in this list, if found +# as the leading text of the brief description, will be stripped from the text +# and the result, after processing the whole list, is used as the annotated +# text. Otherwise, the brief description is used as-is. If left blank, the +# following values are used ($name is automatically replaced with the name of +# the entity):The $name class, The $name widget, The $name file, is, provides, +# specifies, contains, represents, a, an and the. + ABBREVIATE_BRIEF = "The $name class" \ "The $name widget" \ "The $name file" \ @@ -26,313 +137,2373 @@ ABBREVIATE_BRIEF = "The $name class" \ a \ an \ the + +# If the ALWAYS_DETAILED_SEC and REPEAT_BRIEF tags are both set to YES then +# doxygen will generate a detailed section even if there is only a brief +# description. +# The default value is: NO. + ALWAYS_DETAILED_SEC = NO + +# If the INLINE_INHERITED_MEMB tag is set to YES, doxygen will show all +# inherited members of a class in the documentation of that class as if those +# members were ordinary class members. Constructors, destructors and assignment +# operators of the base classes will not be shown. +# The default value is: NO. + INLINE_INHERITED_MEMB = NO + +# If the FULL_PATH_NAMES tag is set to YES, doxygen will prepend the full path +# before files name in the file list and in the header files. If set to NO the +# shortest path that makes the file name unique will be used +# The default value is: YES. + FULL_PATH_NAMES = YES + +# The STRIP_FROM_PATH tag can be used to strip a user-defined part of the path. +# Stripping is only done if one of the specified strings matches the left-hand +# part of the path. The tag can be used to show relative paths in the file list. +# If left blank the directory from which doxygen is run is used as the path to +# strip. +# +# Note that you can specify absolute paths here, but also relative paths, which +# will be relative from the directory where doxygen is started. +# This tag requires that the tag FULL_PATH_NAMES is set to YES. + STRIP_FROM_PATH = + +# The STRIP_FROM_INC_PATH tag can be used to strip a user-defined part of the +# path mentioned in the documentation of a class, which tells the reader which +# header file to include in order to use a class. If left blank only the name of +# the header file containing the class definition is used. Otherwise one should +# specify the list of include paths that are normally passed to the compiler +# using the -I flag. + STRIP_FROM_INC_PATH = + +# If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter (but +# less readable) file names. This can be useful is your file systems doesn't +# support long names like on DOS, Mac, or CD-ROM. +# The default value is: NO. + SHORT_NAMES = NO + +# If the JAVADOC_AUTOBRIEF tag is set to YES then doxygen will interpret the +# first line (until the first dot) of a Javadoc-style comment as the brief +# description. If set to NO, the Javadoc-style will behave just like regular Qt- +# style comments (thus requiring an explicit @brief command for a brief +# description.) +# The default value is: NO. + JAVADOC_AUTOBRIEF = NO + +# If the JAVADOC_BANNER tag is set to YES then doxygen will interpret a line +# such as +# /*************** +# as being the beginning of a Javadoc-style comment "banner". If set to NO, the +# Javadoc-style will behave just like regular comments and it will not be +# interpreted by doxygen. +# The default value is: NO. + JAVADOC_BANNER = NO + +# If the QT_AUTOBRIEF tag is set to YES then doxygen will interpret the first +# line (until the first dot) of a Qt-style comment as the brief description. If +# set to NO, the Qt-style will behave just like regular Qt-style comments (thus +# requiring an explicit \brief command for a brief description.) +# The default value is: NO. + QT_AUTOBRIEF = NO + +# The MULTILINE_CPP_IS_BRIEF tag can be set to YES to make doxygen treat a +# multi-line C++ special comment block (i.e. a block of //! or /// comments) as +# a brief description. This used to be the default behavior. The new default is +# to treat a multi-line C++ comment block as a detailed description. Set this +# tag to YES if you prefer the old behavior instead. +# +# Note that setting this tag to YES also means that rational rose comments are +# not recognized any more. +# The default value is: NO. + MULTILINE_CPP_IS_BRIEF = NO + +# If the INHERIT_DOCS tag is set to YES then an undocumented member inherits the +# documentation from any documented member that it re-implements. +# The default value is: YES. + INHERIT_DOCS = YES + +# If the SEPARATE_MEMBER_PAGES tag is set to YES then doxygen will produce a new +# page for each member. If set to NO, the documentation of a member will be part +# of the file/class/namespace that contains it. +# The default value is: NO. + SEPARATE_MEMBER_PAGES = NO + +# The TAB_SIZE tag can be used to set the number of spaces in a tab. Doxygen +# uses this value to replace tabs by spaces in code fragments. +# Minimum value: 1, maximum value: 16, default value: 4. + TAB_SIZE = 4 + +# This tag can be used to specify a number of aliases that act as commands in +# the documentation. An alias has the form: +# name=value +# For example adding +# "sideeffect=@par Side Effects:\n" +# will allow you to put the command \sideeffect (or @sideeffect) in the +# documentation, which will result in a user-defined paragraph with heading +# "Side Effects:". You can put \n's in the value part of an alias to insert +# newlines (in the resulting output). You can put ^^ in the value part of an +# alias to insert a newline as if a physical newline was in the original file. +# When you need a literal { or } or , in the value part of an alias you have to +# escape them by means of a backslash (\), this can lead to conflicts with the +# commands \{ and \} for these it is advised to use the version @{ and @} or use +# a double escape (\\{ and \\}) + ALIASES = -TCL_SUBST = + +# Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C sources +# only. Doxygen will then generate output that is more tailored for C. For +# instance, some of the names that are used will be different. The list of all +# members will be omitted, etc. +# The default value is: NO. + OPTIMIZE_OUTPUT_FOR_C = YES + +# Set the OPTIMIZE_OUTPUT_JAVA tag to YES if your project consists of Java or +# Python sources only. Doxygen will then generate output that is more tailored +# for that language. For instance, namespaces will be presented as packages, +# qualified scopes will look different, etc. +# The default value is: NO. + OPTIMIZE_OUTPUT_JAVA = NO + +# Set the OPTIMIZE_FOR_FORTRAN tag to YES if your project consists of Fortran +# sources. Doxygen will then generate output that is tailored for Fortran. +# The default value is: NO. + OPTIMIZE_FOR_FORTRAN = NO + +# Set the OPTIMIZE_OUTPUT_VHDL tag to YES if your project consists of VHDL +# sources. Doxygen will then generate output that is tailored for VHDL. +# The default value is: NO. + OPTIMIZE_OUTPUT_VHDL = NO + +# Set the OPTIMIZE_OUTPUT_SLICE tag to YES if your project consists of Slice +# sources only. Doxygen will then generate output that is more tailored for that +# language. For instance, namespaces will be presented as modules, types will be +# separated into more groups, etc. +# The default value is: NO. + OPTIMIZE_OUTPUT_SLICE = NO + +# Doxygen selects the parser to use depending on the extension of the files it +# parses. With this tag you can assign which parser to use for a given +# extension. Doxygen has a built-in mapping, but you can override or extend it +# using this tag. The format is ext=language, where ext is a file extension, and +# language is one of the parsers supported by doxygen: IDL, Java, JavaScript, +# Csharp (C#), C, C++, D, PHP, md (Markdown), Objective-C, Python, Slice, VHDL, +# Fortran (fixed format Fortran: FortranFixed, free formatted Fortran: +# FortranFree, unknown formatted Fortran: Fortran. In the later case the parser +# tries to guess whether the code is fixed or free formatted code, this is the +# default for Fortran type files). For instance to make doxygen treat .inc files +# as Fortran files (default is PHP), and .f files as C (default is Fortran), +# use: inc=Fortran f=C. +# +# Note: For files without extension you can use no_extension as a placeholder. +# +# Note that for custom extensions you also need to set FILE_PATTERNS otherwise +# the files are not read by doxygen. + EXTENSION_MAPPING = dox=md + +# If the MARKDOWN_SUPPORT tag is enabled then doxygen pre-processes all comments +# according to the Markdown format, which allows for more readable +# documentation. See https://daringfireball.net/projects/markdown/ for details. +# The output of markdown processing is further processed by doxygen, so you can +# mix doxygen, HTML, and XML commands with Markdown formatting. Disable only in +# case of backward compatibilities issues. +# The default value is: YES. + MARKDOWN_SUPPORT = YES + +# When the TOC_INCLUDE_HEADINGS tag is set to a non-zero value, all headings up +# to that level are automatically included in the table of contents, even if +# they do not have an id attribute. +# Note: This feature currently applies only to Markdown headings. +# Minimum value: 0, maximum value: 99, default value: 5. +# This tag requires that the tag MARKDOWN_SUPPORT is set to YES. + TOC_INCLUDE_HEADINGS = 5 + +# When enabled doxygen tries to link words that correspond to documented +# classes, or namespaces to their corresponding documentation. Such a link can +# be prevented in individual cases by putting a % sign in front of the word or +# globally by setting AUTOLINK_SUPPORT to NO. +# The default value is: YES. + AUTOLINK_SUPPORT = YES + +# If you use STL classes (i.e. std::string, std::vector, etc.) but do not want +# to include (a tag file for) the STL sources as input, then you should set this +# tag to YES in order to let doxygen match functions declarations and +# definitions whose arguments contain STL classes (e.g. func(std::string); +# versus func(std::string) {}). This also make the inheritance and collaboration +# diagrams that involve STL classes more complete and accurate. +# The default value is: NO. + BUILTIN_STL_SUPPORT = NO + +# If you use Microsoft's C++/CLI language, you should set this option to YES to +# enable parsing support. +# The default value is: NO. + CPP_CLI_SUPPORT = NO + +# Set the SIP_SUPPORT tag to YES if your project consists of sip (see: +# https://www.riverbankcomputing.com/software/sip/intro) sources only. Doxygen +# will parse them like normal C++ but will assume all classes use public instead +# of private inheritance when no explicit protection keyword is present. +# The default value is: NO. + SIP_SUPPORT = NO + +# For Microsoft's IDL there are propget and propput attributes to indicate +# getter and setter methods for a property. Setting this option to YES will make +# doxygen to replace the get and set methods by a property in the documentation. +# This will only work if the methods are indeed getting or setting a simple +# type. If this is not the case, or you want to show the methods anyway, you +# should set this option to NO. +# The default value is: YES. + IDL_PROPERTY_SUPPORT = YES + +# If member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC +# tag is set to YES then doxygen will reuse the documentation of the first +# member in the group (if any) for the other members of the group. By default +# all members of a group must be documented explicitly. +# The default value is: NO. + DISTRIBUTE_GROUP_DOC = NO + +# If one adds a struct or class to a group and this option is enabled, then also +# any nested class or struct is added to the same group. By default this option +# is disabled and one has to add nested compounds explicitly via \ingroup. +# The default value is: NO. + GROUP_NESTED_COMPOUNDS = NO + +# Set the SUBGROUPING tag to YES to allow class member groups of the same type +# (for instance a group of public functions) to be put as a subgroup of that +# type (e.g. under the Public Functions section). Set it to NO to prevent +# subgrouping. Alternatively, this can be done per class using the +# \nosubgrouping command. +# The default value is: YES. + SUBGROUPING = YES + +# When the INLINE_GROUPED_CLASSES tag is set to YES, classes, structs and unions +# are shown inside the group in which they are included (e.g. using \ingroup) +# instead of on a separate page (for HTML and Man pages) or section (for LaTeX +# and RTF). +# +# Note that this feature does not work in combination with +# SEPARATE_MEMBER_PAGES. +# The default value is: NO. + INLINE_GROUPED_CLASSES = NO + +# When the INLINE_SIMPLE_STRUCTS tag is set to YES, structs, classes, and unions +# with only public data fields or simple typedef fields will be shown inline in +# the documentation of the scope in which they are defined (i.e. file, +# namespace, or group documentation), provided this scope is documented. If set +# to NO, structs, classes, and unions are shown on a separate page (for HTML and +# Man pages) or section (for LaTeX and RTF). +# The default value is: NO. + INLINE_SIMPLE_STRUCTS = NO + +# When TYPEDEF_HIDES_STRUCT tag is enabled, a typedef of a struct, union, or +# enum is documented as struct, union, or enum with the name of the typedef. So +# typedef struct TypeS {} TypeT, will appear in the documentation as a struct +# with name TypeT. When disabled the typedef will appear as a member of a file, +# namespace, or class. And the struct will be named TypeS. This can typically be +# useful for C code in case the coding convention dictates that all compound +# types are typedef'ed and only the typedef is referenced, never the tag name. +# The default value is: NO. + TYPEDEF_HIDES_STRUCT = NO + +# The size of the symbol lookup cache can be set using LOOKUP_CACHE_SIZE. This +# cache is used to resolve symbols given their name and scope. Since this can be +# an expensive process and often the same symbol appears multiple times in the +# code, doxygen keeps a cache of pre-resolved symbols. If the cache is too small +# doxygen will become slower. If the cache is too large, memory is wasted. The +# cache size is given by this formula: 2^(16+LOOKUP_CACHE_SIZE). The valid range +# is 0..9, the default is 0, corresponding to a cache size of 2^16=65536 +# symbols. At the end of a run doxygen will report the cache usage and suggest +# the optimal cache size from a speed point of view. +# Minimum value: 0, maximum value: 9, default value: 0. + LOOKUP_CACHE_SIZE = 0 + #--------------------------------------------------------------------------- # Build related configuration options #--------------------------------------------------------------------------- + +# If the EXTRACT_ALL tag is set to YES, doxygen will assume all entities in +# documentation are documented, even if no documentation was available. Private +# class members and static file members will be hidden unless the +# EXTRACT_PRIVATE respectively EXTRACT_STATIC tags are set to YES. +# Note: This will also disable the warnings about undocumented members that are +# normally produced when WARNINGS is set to YES. +# The default value is: NO. + EXTRACT_ALL = YES + +# If the EXTRACT_PRIVATE tag is set to YES, all private members of a class will +# be included in the documentation. +# The default value is: NO. + EXTRACT_PRIVATE = NO + +# If the EXTRACT_PRIV_VIRTUAL tag is set to YES, documented private virtual +# methods of a class will be included in the documentation. +# The default value is: NO. + EXTRACT_PRIV_VIRTUAL = NO + +# If the EXTRACT_PACKAGE tag is set to YES, all members with package or internal +# scope will be included in the documentation. +# The default value is: NO. + EXTRACT_PACKAGE = NO + +# If the EXTRACT_STATIC tag is set to YES, all static members of a file will be +# included in the documentation. +# The default value is: NO. + EXTRACT_STATIC = NO + +# If the EXTRACT_LOCAL_CLASSES tag is set to YES, classes (and structs) defined +# locally in source files will be included in the documentation. If set to NO, +# only classes defined in header files are included. Does not have any effect +# for Java sources. +# The default value is: YES. + EXTRACT_LOCAL_CLASSES = YES + +# This flag is only useful for Objective-C code. If set to YES, local methods, +# which are defined in the implementation section but not in the interface are +# included in the documentation. If set to NO, only methods in the interface are +# included. +# The default value is: NO. + EXTRACT_LOCAL_METHODS = NO + +# If this flag is set to YES, the members of anonymous namespaces will be +# extracted and appear in the documentation as a namespace called +# 'anonymous_namespace{file}', where file will be replaced with the base name of +# the file that contains the anonymous namespace. By default anonymous namespace +# are hidden. +# The default value is: NO. + EXTRACT_ANON_NSPACES = NO + +# If the HIDE_UNDOC_MEMBERS tag is set to YES, doxygen will hide all +# undocumented members inside documented classes or files. If set to NO these +# members will be included in the various overviews, but no documentation +# section is generated. This option has no effect if EXTRACT_ALL is enabled. +# The default value is: NO. + HIDE_UNDOC_MEMBERS = NO + +# If the HIDE_UNDOC_CLASSES tag is set to YES, doxygen will hide all +# undocumented classes that are normally visible in the class hierarchy. If set +# to NO, these classes will be included in the various overviews. This option +# has no effect if EXTRACT_ALL is enabled. +# The default value is: NO. + HIDE_UNDOC_CLASSES = NO + +# If the HIDE_FRIEND_COMPOUNDS tag is set to YES, doxygen will hide all friend +# declarations. If set to NO, these declarations will be included in the +# documentation. +# The default value is: NO. + HIDE_FRIEND_COMPOUNDS = NO + +# If the HIDE_IN_BODY_DOCS tag is set to YES, doxygen will hide any +# documentation blocks found inside the body of a function. If set to NO, these +# blocks will be appended to the function's detailed documentation block. +# The default value is: NO. + HIDE_IN_BODY_DOCS = NO + +# The INTERNAL_DOCS tag determines if documentation that is typed after a +# \internal command is included. If the tag is set to NO then the documentation +# will be excluded. Set it to YES to include the internal documentation. +# The default value is: NO. + INTERNAL_DOCS = NO + +# If the CASE_SENSE_NAMES tag is set to NO then doxygen will only generate file +# names in lower-case letters. If set to YES, upper-case letters are also +# allowed. This is useful if you have classes or files whose names only differ +# in case and if your file system supports case sensitive file names. Windows +# (including Cygwin) ands Mac users are advised to set this option to NO. +# The default value is: system dependent. + CASE_SENSE_NAMES = NO + +# If the HIDE_SCOPE_NAMES tag is set to NO then doxygen will show members with +# their full class and namespace scopes in the documentation. If set to YES, the +# scope will be hidden. +# The default value is: NO. + HIDE_SCOPE_NAMES = NO + +# If the HIDE_COMPOUND_REFERENCE tag is set to NO (default) then doxygen will +# append additional text to a page's title, such as Class Reference. If set to +# YES the compound reference will be hidden. +# The default value is: NO. + HIDE_COMPOUND_REFERENCE= NO + +# If the SHOW_INCLUDE_FILES tag is set to YES then doxygen will put a list of +# the files that are included by a file in the documentation of that file. +# The default value is: YES. + SHOW_INCLUDE_FILES = YES + +# If the SHOW_GROUPED_MEMB_INC tag is set to YES then Doxygen will add for each +# grouped member an include statement to the documentation, telling the reader +# which file to include in order to use the member. +# The default value is: NO. + SHOW_GROUPED_MEMB_INC = NO + +# If the FORCE_LOCAL_INCLUDES tag is set to YES then doxygen will list include +# files with double quotes in the documentation rather than with sharp brackets. +# The default value is: NO. + FORCE_LOCAL_INCLUDES = NO + +# If the INLINE_INFO tag is set to YES then a tag [inline] is inserted in the +# documentation for inline members. +# The default value is: YES. + INLINE_INFO = YES + +# If the SORT_MEMBER_DOCS tag is set to YES then doxygen will sort the +# (detailed) documentation of file and class members alphabetically by member +# name. If set to NO, the members will appear in declaration order. +# The default value is: YES. + SORT_MEMBER_DOCS = YES + +# If the SORT_BRIEF_DOCS tag is set to YES then doxygen will sort the brief +# descriptions of file, namespace and class members alphabetically by member +# name. If set to NO, the members will appear in declaration order. Note that +# this will also influence the order of the classes in the class list. +# The default value is: NO. + SORT_BRIEF_DOCS = NO + +# If the SORT_MEMBERS_CTORS_1ST tag is set to YES then doxygen will sort the +# (brief and detailed) documentation of class members so that constructors and +# destructors are listed first. If set to NO the constructors will appear in the +# respective orders defined by SORT_BRIEF_DOCS and SORT_MEMBER_DOCS. +# Note: If SORT_BRIEF_DOCS is set to NO this option is ignored for sorting brief +# member documentation. +# Note: If SORT_MEMBER_DOCS is set to NO this option is ignored for sorting +# detailed member documentation. +# The default value is: NO. + SORT_MEMBERS_CTORS_1ST = NO + +# If the SORT_GROUP_NAMES tag is set to YES then doxygen will sort the hierarchy +# of group names into alphabetical order. If set to NO the group names will +# appear in their defined order. +# The default value is: NO. + SORT_GROUP_NAMES = NO + +# If the SORT_BY_SCOPE_NAME tag is set to YES, the class list will be sorted by +# fully-qualified names, including namespaces. If set to NO, the class list will +# be sorted only by class name, not including the namespace part. +# Note: This option is not very useful if HIDE_SCOPE_NAMES is set to YES. +# Note: This option applies only to the class list, not to the alphabetical +# list. +# The default value is: NO. + SORT_BY_SCOPE_NAME = NO + +# If the STRICT_PROTO_MATCHING option is enabled and doxygen fails to do proper +# type resolution of all parameters of a function it will reject a match between +# the prototype and the implementation of a member function even if there is +# only one candidate or it is obvious which candidate to choose by doing a +# simple string match. By disabling STRICT_PROTO_MATCHING doxygen will still +# accept a match between prototype and implementation in such cases. +# The default value is: NO. + STRICT_PROTO_MATCHING = NO + +# The GENERATE_TODOLIST tag can be used to enable (YES) or disable (NO) the todo +# list. This list is created by putting \todo commands in the documentation. +# The default value is: YES. + GENERATE_TODOLIST = NO + +# The GENERATE_TESTLIST tag can be used to enable (YES) or disable (NO) the test +# list. This list is created by putting \test commands in the documentation. +# The default value is: YES. + GENERATE_TESTLIST = YES + +# The GENERATE_BUGLIST tag can be used to enable (YES) or disable (NO) the bug +# list. This list is created by putting \bug commands in the documentation. +# The default value is: YES. + GENERATE_BUGLIST = NO + +# The GENERATE_DEPRECATEDLIST tag can be used to enable (YES) or disable (NO) +# the deprecated list. This list is created by putting \deprecated commands in +# the documentation. +# The default value is: YES. + GENERATE_DEPRECATEDLIST= YES + +# The ENABLED_SECTIONS tag can be used to enable conditional documentation +# sections, marked by \if ... \endif and \cond +# ... \endcond blocks. + ENABLED_SECTIONS = + +# The MAX_INITIALIZER_LINES tag determines the maximum number of lines that the +# initial value of a variable or macro / define can have for it to appear in the +# documentation. If the initializer consists of more lines than specified here +# it will be hidden. Use a value of 0 to hide initializers completely. The +# appearance of the value of individual variables and macros / defines can be +# controlled using \showinitializer or \hideinitializer command in the +# documentation regardless of this setting. +# Minimum value: 0, maximum value: 10000, default value: 30. + MAX_INITIALIZER_LINES = 30 + +# Set the SHOW_USED_FILES tag to NO to disable the list of files generated at +# the bottom of the documentation of classes and structs. If set to YES, the +# list will mention the files that were used to generate the documentation. +# The default value is: YES. + SHOW_USED_FILES = YES + +# Set the SHOW_FILES tag to NO to disable the generation of the Files page. This +# will remove the Files entry from the Quick Index and from the Folder Tree View +# (if specified). +# The default value is: YES. + SHOW_FILES = YES + +# Set the SHOW_NAMESPACES tag to NO to disable the generation of the Namespaces +# page. This will remove the Namespaces entry from the Quick Index and from the +# Folder Tree View (if specified). +# The default value is: YES. + SHOW_NAMESPACES = YES + +# The FILE_VERSION_FILTER tag can be used to specify a program or script that +# doxygen should invoke to get the current version for each file (typically from +# the version control system). Doxygen will invoke the program by executing (via +# popen()) the command command input-file, where command is the value of the +# FILE_VERSION_FILTER tag, and input-file is the name of an input file provided +# by doxygen. Whatever the program writes to standard output is used as the file +# version. For an example see the documentation. + FILE_VERSION_FILTER = + +# The LAYOUT_FILE tag can be used to specify a layout file which will be parsed +# by doxygen. The layout file controls the global structure of the generated +# output files in an output format independent way. To create the layout file +# that represents doxygen's defaults, run doxygen with the -l option. You can +# optionally specify a file name after the option, if omitted DoxygenLayout.xml +# will be used as the name of the layout file. +# +# Note that if you run doxygen from a directory containing a file called +# DoxygenLayout.xml, doxygen will parse it automatically even if the LAYOUT_FILE +# tag is left empty. + LAYOUT_FILE = + +# The CITE_BIB_FILES tag can be used to specify one or more bib files containing +# the reference definitions. This must be a list of .bib files. The .bib +# extension is automatically appended if omitted. This requires the bibtex tool +# to be installed. See also https://en.wikipedia.org/wiki/BibTeX for more info. +# For LaTeX the style of the bibliography can be controlled using +# LATEX_BIB_STYLE. To use this feature you need bibtex and perl available in the +# search path. See also \cite for info how to create references. + CITE_BIB_FILES = + #--------------------------------------------------------------------------- # Configuration options related to warning and progress messages #--------------------------------------------------------------------------- + +# The QUIET tag can be used to turn on/off the messages that are generated to +# standard output by doxygen. If QUIET is set to YES this implies that the +# messages are off. +# The default value is: NO. + QUIET = NO + +# The WARNINGS tag can be used to turn on/off the warning messages that are +# generated to standard error (stderr) by doxygen. If WARNINGS is set to YES +# this implies that the warnings are on. +# +# Tip: Turn warnings on while writing the documentation. +# The default value is: YES. + WARNINGS = YES + +# If the WARN_IF_UNDOCUMENTED tag is set to YES then doxygen will generate +# warnings for undocumented members. If EXTRACT_ALL is set to YES then this flag +# will automatically be disabled. +# The default value is: YES. + WARN_IF_UNDOCUMENTED = YES + +# If the WARN_IF_DOC_ERROR tag is set to YES, doxygen will generate warnings for +# potential errors in the documentation, such as not documenting some parameters +# in a documented function, or documenting parameters that don't exist or using +# markup commands wrongly. +# The default value is: YES. + WARN_IF_DOC_ERROR = YES + +# This WARN_NO_PARAMDOC option can be enabled to get warnings for functions that +# are documented, but have no documentation for their parameters or return +# value. If set to NO, doxygen will only warn about wrong or incomplete +# parameter documentation, but not about the absence of documentation. If +# EXTRACT_ALL is set to YES then this flag will automatically be disabled. +# The default value is: NO. + WARN_NO_PARAMDOC = NO + +# If the WARN_AS_ERROR tag is set to YES then doxygen will immediately stop when +# a warning is encountered. +# The default value is: NO. + WARN_AS_ERROR = NO + +# The WARN_FORMAT tag determines the format of the warning messages that doxygen +# can produce. The string should contain the $file, $line, and $text tags, which +# will be replaced by the file and line number from which the warning originated +# and the warning text. Optionally the format may contain $version, which will +# be replaced by the version of the file (if it could be obtained via +# FILE_VERSION_FILTER) +# The default value is: $file:$line: $text. + WARN_FORMAT = "$file:$line: $text" + +# The WARN_LOGFILE tag can be used to specify a file to which warning and error +# messages should be written. If left blank the output is written to standard +# error (stderr). + WARN_LOGFILE = + #--------------------------------------------------------------------------- # Configuration options related to the input files #--------------------------------------------------------------------------- -INPUT = index.md -INPUT += ../../wasmer.h + +# The INPUT tag is used to specify the files and/or directories that contain +# documented source files. You may enter file names like myfile.cpp or +# directories like /usr/src/myproject. Separate the files or directories with +# spaces. See also FILE_PATTERNS and EXTENSION_MAPPING +# Note: If this tag is empty the current directory is searched. + +INPUT = index.md \ + ../../wasmer.h + +# This tag can be used to specify the character encoding of the source files +# that doxygen parses. Internally doxygen uses the UTF-8 encoding. Doxygen uses +# libiconv (or the iconv built into libc) for the transcoding. See the libiconv +# documentation (see: https://www.gnu.org/software/libiconv/) for the list of +# possible encodings. +# The default value is: UTF-8. + INPUT_ENCODING = UTF-8 + +# If the value of the INPUT tag contains directories, you can use the +# FILE_PATTERNS tag to specify one or more wildcard patterns (like *.cpp and +# *.h) to filter out the source-files in the directories. +# +# Note that for custom extensions or not directly supported extensions you also +# need to set EXTENSION_MAPPING for the extension otherwise the files are not +# read by doxygen. +# +# If left blank the following patterns are tested:*.c, *.cc, *.cxx, *.cpp, +# *.c++, *.java, *.ii, *.ixx, *.ipp, *.i++, *.inl, *.idl, *.ddl, *.odl, *.h, +# *.hh, *.hxx, *.hpp, *.h++, *.cs, *.d, *.php, *.php4, *.php5, *.phtml, *.inc, +# *.m, *.markdown, *.md, *.mm, *.dox (to be provided as doxygen C comment), +# *.doc (to be provided as doxygen C comment), *.txt (to be provided as doxygen +# C comment), *.py, *.pyw, *.f90, *.f95, *.f03, *.f08, *.f18, *.f, *.for, *.vhd, +# *.vhdl, *.ucf, *.qsf and *.ice. + FILE_PATTERNS = *.h \ *.hh + +# The RECURSIVE tag can be used to specify whether or not subdirectories should +# be searched for input files as well. +# The default value is: NO. + RECURSIVE = NO + +# The EXCLUDE tag can be used to specify files and/or directories that should be +# excluded from the INPUT source files. This way you can easily exclude a +# subdirectory from a directory tree whose root is specified with the INPUT tag. +# +# Note that relative paths are relative to the directory from which doxygen is +# run. + EXCLUDE = doc + +# The EXCLUDE_SYMLINKS tag can be used to select whether or not files or +# directories that are symbolic links (a Unix file system feature) are excluded +# from the input. +# The default value is: NO. + EXCLUDE_SYMLINKS = NO + +# If the value of the INPUT tag contains directories, you can use the +# EXCLUDE_PATTERNS tag to specify one or more wildcard patterns to exclude +# certain files from those directories. +# +# Note that the wildcards are matched against the file with absolute path, so to +# exclude all test directories for example use the pattern */test/* + EXCLUDE_PATTERNS = + +# The EXCLUDE_SYMBOLS tag can be used to specify one or more symbol names +# (namespaces, classes, functions, etc.) that should be excluded from the +# output. The symbol name can be a fully qualified name, a word, or if the +# wildcard * is used, a substring. Examples: ANamespace, AClass, +# AClass::ANamespace, ANamespace::*Test +# +# Note that the wildcards are matched against the file with absolute path, so to +# exclude all test directories use the pattern */test/* + EXCLUDE_SYMBOLS = + +# The EXAMPLE_PATH tag can be used to specify one or more files or directories +# that contain example code fragments that are included (see the \include +# command). + EXAMPLE_PATH = + +# If the value of the EXAMPLE_PATH tag contains directories, you can use the +# EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp and +# *.h) to filter out the source-files in the directories. If left blank all +# files are included. + EXAMPLE_PATTERNS = * + +# If the EXAMPLE_RECURSIVE tag is set to YES then subdirectories will be +# searched for input files to be used with the \include or \dontinclude commands +# irrespective of the value of the RECURSIVE tag. +# The default value is: NO. + EXAMPLE_RECURSIVE = NO + +# The IMAGE_PATH tag can be used to specify one or more files or directories +# that contain images that are to be included in the documentation (see the +# \image command). + IMAGE_PATH = + +# The INPUT_FILTER tag can be used to specify a program that doxygen should +# invoke to filter for each input file. Doxygen will invoke the filter program +# by executing (via popen()) the command: +# +# +# +# where is the value of the INPUT_FILTER tag, and is the +# name of an input file. Doxygen will then use the output that the filter +# program writes to standard output. If FILTER_PATTERNS is specified, this tag +# will be ignored. +# +# Note that the filter must not add or remove lines; it is applied before the +# code is scanned, but not when the output code is generated. If lines are added +# or removed, the anchors will not be placed correctly. +# +# Note that for custom extensions or not directly supported extensions you also +# need to set EXTENSION_MAPPING for the extension otherwise the files are not +# properly processed by doxygen. + INPUT_FILTER = + +# The FILTER_PATTERNS tag can be used to specify filters on a per file pattern +# basis. Doxygen will compare the file name with each pattern and apply the +# filter if there is a match. The filters are a list of the form: pattern=filter +# (like *.cpp=my_cpp_filter). See INPUT_FILTER for further information on how +# filters are used. If the FILTER_PATTERNS tag is empty or if none of the +# patterns match the file name, INPUT_FILTER is applied. +# +# Note that for custom extensions or not directly supported extensions you also +# need to set EXTENSION_MAPPING for the extension otherwise the files are not +# properly processed by doxygen. + FILTER_PATTERNS = + +# If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using +# INPUT_FILTER) will also be used to filter the input files that are used for +# producing the source files to browse (i.e. when SOURCE_BROWSER is set to YES). +# The default value is: NO. + FILTER_SOURCE_FILES = NO + +# The FILTER_SOURCE_PATTERNS tag can be used to specify source filters per file +# pattern. A pattern will override the setting for FILTER_PATTERN (if any) and +# it is also possible to disable source filtering for a specific pattern using +# *.ext= (so without naming a filter). +# This tag requires that the tag FILTER_SOURCE_FILES is set to YES. + FILTER_SOURCE_PATTERNS = + +# If the USE_MDFILE_AS_MAINPAGE tag refers to the name of a markdown file that +# is part of the input, its contents will be placed on the main page +# (index.html). This can be useful if you have a project on for instance GitHub +# and want to reuse the introduction page also for the doxygen output. + USE_MDFILE_AS_MAINPAGE = index.md + #--------------------------------------------------------------------------- # Configuration options related to source browsing #--------------------------------------------------------------------------- + +# If the SOURCE_BROWSER tag is set to YES then a list of source files will be +# generated. Documented entities will be cross-referenced with these sources. +# +# Note: To get rid of all source code in the generated output, make sure that +# also VERBATIM_HEADERS is set to NO. +# The default value is: NO. + SOURCE_BROWSER = YES + +# Setting the INLINE_SOURCES tag to YES will include the body of functions, +# classes and enums directly into the documentation. +# The default value is: NO. + INLINE_SOURCES = NO + +# Setting the STRIP_CODE_COMMENTS tag to YES will instruct doxygen to hide any +# special comment blocks from generated source code fragments. Normal C, C++ and +# Fortran comments will always remain visible. +# The default value is: YES. + STRIP_CODE_COMMENTS = NO + +# If the REFERENCED_BY_RELATION tag is set to YES then for each documented +# entity all documented functions referencing it will be listed. +# The default value is: NO. + REFERENCED_BY_RELATION = YES + +# If the REFERENCES_RELATION tag is set to YES then for each documented function +# all documented entities called/used by that function will be listed. +# The default value is: NO. + REFERENCES_RELATION = YES + +# If the REFERENCES_LINK_SOURCE tag is set to YES and SOURCE_BROWSER tag is set +# to YES then the hyperlinks from functions in REFERENCES_RELATION and +# REFERENCED_BY_RELATION lists will link to the source code. Otherwise they will +# link to the documentation. +# The default value is: YES. + REFERENCES_LINK_SOURCE = YES + +# If SOURCE_TOOLTIPS is enabled (the default) then hovering a hyperlink in the +# source code will show a tooltip with additional information such as prototype, +# brief description and links to the definition and documentation. Since this +# will make the HTML file larger and loading of large files a bit slower, you +# can opt to disable this feature. +# The default value is: YES. +# This tag requires that the tag SOURCE_BROWSER is set to YES. + SOURCE_TOOLTIPS = YES + +# If the USE_HTAGS tag is set to YES then the references to source code will +# point to the HTML generated by the htags(1) tool instead of doxygen built-in +# source browser. The htags tool is part of GNU's global source tagging system +# (see https://www.gnu.org/software/global/global.html). You will need version +# 4.8.6 or higher. +# +# To use it do the following: +# - Install the latest version of global +# - Enable SOURCE_BROWSER and USE_HTAGS in the configuration file +# - Make sure the INPUT points to the root of the source tree +# - Run doxygen as normal +# +# Doxygen will invoke htags (and that will in turn invoke gtags), so these +# tools must be available from the command line (i.e. in the search path). +# +# The result: instead of the source browser generated by doxygen, the links to +# source code will now point to the output of htags. +# The default value is: NO. +# This tag requires that the tag SOURCE_BROWSER is set to YES. + USE_HTAGS = NO + +# If the VERBATIM_HEADERS tag is set the YES then doxygen will generate a +# verbatim copy of the header file for each class for which an include is +# specified. Set to NO to disable this. +# See also: Section \class. +# The default value is: YES. + VERBATIM_HEADERS = YES + #--------------------------------------------------------------------------- # Configuration options related to the alphabetical class index #--------------------------------------------------------------------------- + +# If the ALPHABETICAL_INDEX tag is set to YES, an alphabetical index of all +# compounds will be generated. Enable this if the project contains a lot of +# classes, structs, unions or interfaces. +# The default value is: YES. + ALPHABETICAL_INDEX = YES + +# The COLS_IN_ALPHA_INDEX tag can be used to specify the number of columns in +# which the alphabetical index list will be split. +# Minimum value: 1, maximum value: 20, default value: 5. +# This tag requires that the tag ALPHABETICAL_INDEX is set to YES. + COLS_IN_ALPHA_INDEX = 5 + +# In case all classes in a project start with a common prefix, all classes will +# be put under the same header in the alphabetical index. The IGNORE_PREFIX tag +# can be used to specify a prefix (or a list of prefixes) that should be ignored +# while generating the index headers. +# This tag requires that the tag ALPHABETICAL_INDEX is set to YES. + IGNORE_PREFIX = + #--------------------------------------------------------------------------- # Configuration options related to the HTML output #--------------------------------------------------------------------------- + +# If the GENERATE_HTML tag is set to YES, doxygen will generate HTML output +# The default value is: YES. + GENERATE_HTML = YES + +# The HTML_OUTPUT tag is used to specify where the HTML docs will be put. If a +# relative path is entered the value of OUTPUT_DIRECTORY will be put in front of +# it. +# The default directory is: html. +# This tag requires that the tag GENERATE_HTML is set to YES. + HTML_OUTPUT = html + +# The HTML_FILE_EXTENSION tag can be used to specify the file extension for each +# generated HTML page (for example: .htm, .php, .asp). +# The default value is: .html. +# This tag requires that the tag GENERATE_HTML is set to YES. + HTML_FILE_EXTENSION = .html + +# The HTML_HEADER tag can be used to specify a user-defined HTML header file for +# each generated HTML page. If the tag is left blank doxygen will generate a +# standard header. +# +# To get valid HTML the header file that includes any scripts and style sheets +# that doxygen needs, which is dependent on the configuration options used (e.g. +# the setting GENERATE_TREEVIEW). It is highly recommended to start with a +# default header using +# doxygen -w html new_header.html new_footer.html new_stylesheet.css +# YourConfigFile +# and then modify the file new_header.html. See also section "Doxygen usage" +# for information on how to generate the default header that doxygen normally +# uses. +# Note: The header is subject to change so you typically have to regenerate the +# default header when upgrading to a newer version of doxygen. For a description +# of the possible markers and block names see the documentation. +# This tag requires that the tag GENERATE_HTML is set to YES. + HTML_HEADER = theme/header.html + +# The HTML_FOOTER tag can be used to specify a user-defined HTML footer for each +# generated HTML page. If the tag is left blank doxygen will generate a standard +# footer. See HTML_HEADER for more information on how to generate a default +# footer and what special commands can be used inside the footer. See also +# section "Doxygen usage" for information on how to generate the default footer +# that doxygen normally uses. +# This tag requires that the tag GENERATE_HTML is set to YES. + HTML_FOOTER = theme/footer.html + +# The HTML_STYLESHEET tag can be used to specify a user-defined cascading style +# sheet that is used by each HTML page. It can be used to fine-tune the look of +# the HTML output. If left blank doxygen will generate a default style sheet. +# See also section "Doxygen usage" for information on how to generate the style +# sheet that doxygen normally uses. +# Note: It is recommended to use HTML_EXTRA_STYLESHEET instead of this tag, as +# it is more robust and this tag (HTML_STYLESHEET) will in the future become +# obsolete. +# This tag requires that the tag GENERATE_HTML is set to YES. + HTML_STYLESHEET = + +# The HTML_EXTRA_STYLESHEET tag can be used to specify additional user-defined +# cascading style sheets that are included after the standard style sheets +# created by doxygen. Using this option one can overrule certain style aspects. +# This is preferred over using HTML_STYLESHEET since it does not replace the +# standard style sheet and is therefore more robust against future updates. +# Doxygen will copy the style sheet files to the output directory. +# Note: The order of the extra style sheet files is of importance (e.g. the last +# style sheet in the list overrules the setting of the previous ones in the +# list). For an example see the documentation. +# This tag requires that the tag GENERATE_HTML is set to YES. + HTML_EXTRA_STYLESHEET = theme/css/wasmer.css + +# The HTML_EXTRA_FILES tag can be used to specify one or more extra images or +# other source files which should be copied to the HTML output directory. Note +# that these files will be copied to the base HTML output directory. Use the +# $relpath^ marker in the HTML_HEADER and/or HTML_FOOTER files to load these +# files. In the HTML_STYLESHEET file, use the file name only. Also note that the +# files will be copied as-is; there are no commands or markers available. +# This tag requires that the tag GENERATE_HTML is set to YES. + HTML_EXTRA_FILES = + +# The HTML_COLORSTYLE_HUE tag controls the color of the HTML output. Doxygen +# will adjust the colors in the style sheet and background images according to +# this color. Hue is specified as an angle on a colorwheel, see +# https://en.wikipedia.org/wiki/Hue for more information. For instance the value +# 0 represents red, 60 is yellow, 120 is green, 180 is cyan, 240 is blue, 300 +# purple, and 360 is red again. +# Minimum value: 0, maximum value: 359, default value: 220. +# This tag requires that the tag GENERATE_HTML is set to YES. + HTML_COLORSTYLE_HUE = 220 + +# The HTML_COLORSTYLE_SAT tag controls the purity (or saturation) of the colors +# in the HTML output. For a value of 0 the output will use grayscales only. A +# value of 255 will produce the most vivid colors. +# Minimum value: 0, maximum value: 255, default value: 100. +# This tag requires that the tag GENERATE_HTML is set to YES. + HTML_COLORSTYLE_SAT = 100 + +# The HTML_COLORSTYLE_GAMMA tag controls the gamma correction applied to the +# luminance component of the colors in the HTML output. Values below 100 +# gradually make the output lighter, whereas values above 100 make the output +# darker. The value divided by 100 is the actual gamma applied, so 80 represents +# a gamma of 0.8, The value 220 represents a gamma of 2.2, and 100 does not +# change the gamma. +# Minimum value: 40, maximum value: 240, default value: 80. +# This tag requires that the tag GENERATE_HTML is set to YES. + HTML_COLORSTYLE_GAMMA = 80 + +# If the HTML_TIMESTAMP tag is set to YES then the footer of each generated HTML +# page will contain the date and time when the page was generated. Setting this +# to YES can help to show when doxygen was last run and thus if the +# documentation is up to date. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTML is set to YES. + HTML_TIMESTAMP = NO + +# If the HTML_DYNAMIC_MENUS tag is set to YES then the generated HTML +# documentation will contain a main index with vertical navigation menus that +# are dynamically created via JavaScript. If disabled, the navigation index will +# consists of multiple levels of tabs that are statically embedded in every HTML +# page. Disable this option to support browsers that do not have JavaScript, +# like the Qt help browser. +# The default value is: YES. +# This tag requires that the tag GENERATE_HTML is set to YES. + HTML_DYNAMIC_MENUS = YES + +# If the HTML_DYNAMIC_SECTIONS tag is set to YES then the generated HTML +# documentation will contain sections that can be hidden and shown after the +# page has loaded. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTML is set to YES. + HTML_DYNAMIC_SECTIONS = YES + +# With HTML_INDEX_NUM_ENTRIES one can control the preferred number of entries +# shown in the various tree structured indices initially; the user can expand +# and collapse entries dynamically later on. Doxygen will expand the tree to +# such a level that at most the specified number of entries are visible (unless +# a fully collapsed tree already exceeds this amount). So setting the number of +# entries 1 will produce a full collapsed tree by default. 0 is a special value +# representing an infinite number of entries and will result in a full expanded +# tree by default. +# Minimum value: 0, maximum value: 9999, default value: 100. +# This tag requires that the tag GENERATE_HTML is set to YES. + HTML_INDEX_NUM_ENTRIES = 100 + +# If the GENERATE_DOCSET tag is set to YES, additional index files will be +# generated that can be used as input for Apple's Xcode 3 integrated development +# environment (see: https://developer.apple.com/xcode/), introduced with OSX +# 10.5 (Leopard). To create a documentation set, doxygen will generate a +# Makefile in the HTML output directory. Running make will produce the docset in +# that directory and running make install will install the docset in +# ~/Library/Developer/Shared/Documentation/DocSets so that Xcode will find it at +# startup. See https://developer.apple.com/library/archive/featuredarticles/Doxy +# genXcode/_index.html for more information. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTML is set to YES. + GENERATE_DOCSET = NO + +# This tag determines the name of the docset feed. A documentation feed provides +# an umbrella under which multiple documentation sets from a single provider +# (such as a company or product suite) can be grouped. +# The default value is: Doxygen generated docs. +# This tag requires that the tag GENERATE_DOCSET is set to YES. + DOCSET_FEEDNAME = "Doxygen generated docs" + +# This tag specifies a string that should uniquely identify the documentation +# set bundle. This should be a reverse domain-name style string, e.g. +# com.mycompany.MyDocSet. Doxygen will append .docset to the name. +# The default value is: org.doxygen.Project. +# This tag requires that the tag GENERATE_DOCSET is set to YES. + DOCSET_BUNDLE_ID = org.doxygen.Project + +# The DOCSET_PUBLISHER_ID tag specifies a string that should uniquely identify +# the documentation publisher. This should be a reverse domain-name style +# string, e.g. com.mycompany.MyDocSet.documentation. +# The default value is: org.doxygen.Publisher. +# This tag requires that the tag GENERATE_DOCSET is set to YES. + DOCSET_PUBLISHER_ID = org.doxygen.Publisher + +# The DOCSET_PUBLISHER_NAME tag identifies the documentation publisher. +# The default value is: Publisher. +# This tag requires that the tag GENERATE_DOCSET is set to YES. + DOCSET_PUBLISHER_NAME = Publisher + +# If the GENERATE_HTMLHELP tag is set to YES then doxygen generates three +# additional HTML index files: index.hhp, index.hhc, and index.hhk. The +# index.hhp is a project file that can be read by Microsoft's HTML Help Workshop +# (see: https://www.microsoft.com/en-us/download/details.aspx?id=21138) on +# Windows. +# +# The HTML Help Workshop contains a compiler that can convert all HTML output +# generated by doxygen into a single compiled HTML file (.chm). Compiled HTML +# files are now used as the Windows 98 help format, and will replace the old +# Windows help format (.hlp) on all Windows platforms in the future. Compressed +# HTML files also contain an index, a table of contents, and you can search for +# words in the documentation. The HTML workshop also contains a viewer for +# compressed HTML files. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTML is set to YES. + GENERATE_HTMLHELP = NO + +# The CHM_FILE tag can be used to specify the file name of the resulting .chm +# file. You can add a path in front of the file if the result should not be +# written to the html output directory. +# This tag requires that the tag GENERATE_HTMLHELP is set to YES. + CHM_FILE = + +# The HHC_LOCATION tag can be used to specify the location (absolute path +# including file name) of the HTML help compiler (hhc.exe). If non-empty, +# doxygen will try to run the HTML help compiler on the generated index.hhp. +# The file has to be specified with full path. +# This tag requires that the tag GENERATE_HTMLHELP is set to YES. + HHC_LOCATION = + +# The GENERATE_CHI flag controls if a separate .chi index file is generated +# (YES) or that it should be included in the master .chm file (NO). +# The default value is: NO. +# This tag requires that the tag GENERATE_HTMLHELP is set to YES. + GENERATE_CHI = NO + +# The CHM_INDEX_ENCODING is used to encode HtmlHelp index (hhk), content (hhc) +# and project file content. +# This tag requires that the tag GENERATE_HTMLHELP is set to YES. + CHM_INDEX_ENCODING = + +# The BINARY_TOC flag controls whether a binary table of contents is generated +# (YES) or a normal table of contents (NO) in the .chm file. Furthermore it +# enables the Previous and Next buttons. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTMLHELP is set to YES. + BINARY_TOC = NO + +# The TOC_EXPAND flag can be set to YES to add extra items for group members to +# the table of contents of the HTML help documentation and to the tree view. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTMLHELP is set to YES. + TOC_EXPAND = NO + +# If the GENERATE_QHP tag is set to YES and both QHP_NAMESPACE and +# QHP_VIRTUAL_FOLDER are set, an additional index file will be generated that +# can be used as input for Qt's qhelpgenerator to generate a Qt Compressed Help +# (.qch) of the generated HTML documentation. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTML is set to YES. + GENERATE_QHP = NO + +# If the QHG_LOCATION tag is specified, the QCH_FILE tag can be used to specify +# the file name of the resulting .qch file. The path specified is relative to +# the HTML output folder. +# This tag requires that the tag GENERATE_QHP is set to YES. + QCH_FILE = + +# The QHP_NAMESPACE tag specifies the namespace to use when generating Qt Help +# Project output. For more information please see Qt Help Project / Namespace +# (see: https://doc.qt.io/archives/qt-4.8/qthelpproject.html#namespace). +# The default value is: org.doxygen.Project. +# This tag requires that the tag GENERATE_QHP is set to YES. + QHP_NAMESPACE = org.doxygen.Project + +# The QHP_VIRTUAL_FOLDER tag specifies the namespace to use when generating Qt +# Help Project output. For more information please see Qt Help Project / Virtual +# Folders (see: https://doc.qt.io/archives/qt-4.8/qthelpproject.html#virtual- +# folders). +# The default value is: doc. +# This tag requires that the tag GENERATE_QHP is set to YES. + QHP_VIRTUAL_FOLDER = doc + +# If the QHP_CUST_FILTER_NAME tag is set, it specifies the name of a custom +# filter to add. For more information please see Qt Help Project / Custom +# Filters (see: https://doc.qt.io/archives/qt-4.8/qthelpproject.html#custom- +# filters). +# This tag requires that the tag GENERATE_QHP is set to YES. + QHP_CUST_FILTER_NAME = + +# The QHP_CUST_FILTER_ATTRS tag specifies the list of the attributes of the +# custom filter to add. For more information please see Qt Help Project / Custom +# Filters (see: https://doc.qt.io/archives/qt-4.8/qthelpproject.html#custom- +# filters). +# This tag requires that the tag GENERATE_QHP is set to YES. + QHP_CUST_FILTER_ATTRS = + +# The QHP_SECT_FILTER_ATTRS tag specifies the list of the attributes this +# project's filter section matches. Qt Help Project / Filter Attributes (see: +# https://doc.qt.io/archives/qt-4.8/qthelpproject.html#filter-attributes). +# This tag requires that the tag GENERATE_QHP is set to YES. + QHP_SECT_FILTER_ATTRS = + +# The QHG_LOCATION tag can be used to specify the location of Qt's +# qhelpgenerator. If non-empty doxygen will try to run qhelpgenerator on the +# generated .qhp file. +# This tag requires that the tag GENERATE_QHP is set to YES. + QHG_LOCATION = + +# If the GENERATE_ECLIPSEHELP tag is set to YES, additional index files will be +# generated, together with the HTML files, they form an Eclipse help plugin. To +# install this plugin and make it available under the help contents menu in +# Eclipse, the contents of the directory containing the HTML and XML files needs +# to be copied into the plugins directory of eclipse. The name of the directory +# within the plugins directory should be the same as the ECLIPSE_DOC_ID value. +# After copying Eclipse needs to be restarted before the help appears. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTML is set to YES. + GENERATE_ECLIPSEHELP = NO + +# A unique identifier for the Eclipse help plugin. When installing the plugin +# the directory name containing the HTML and XML files should also have this +# name. Each documentation set should have its own identifier. +# The default value is: org.doxygen.Project. +# This tag requires that the tag GENERATE_ECLIPSEHELP is set to YES. + ECLIPSE_DOC_ID = org.doxygen.Project + +# If you want full control over the layout of the generated HTML pages it might +# be necessary to disable the index and replace it with your own. The +# DISABLE_INDEX tag can be used to turn on/off the condensed index (tabs) at top +# of each HTML page. A value of NO enables the index and the value YES disables +# it. Since the tabs in the index contain the same information as the navigation +# tree, you can set this option to YES if you also set GENERATE_TREEVIEW to YES. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTML is set to YES. + DISABLE_INDEX = YES + +# The GENERATE_TREEVIEW tag is used to specify whether a tree-like index +# structure should be generated to display hierarchical information. If the tag +# value is set to YES, a side panel will be generated containing a tree-like +# index structure (just like the one that is generated for HTML Help). For this +# to work a browser that supports JavaScript, DHTML, CSS and frames is required +# (i.e. any modern browser). Windows users are probably better off using the +# HTML help feature. Via custom style sheets (see HTML_EXTRA_STYLESHEET) one can +# further fine-tune the look of the index. As an example, the default style +# sheet generated by doxygen has an example that shows how to put an image at +# the root of the tree instead of the PROJECT_NAME. Since the tree basically has +# the same information as the tab index, you could consider setting +# DISABLE_INDEX to YES when enabling this option. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTML is set to YES. + GENERATE_TREEVIEW = YES + +# The ENUM_VALUES_PER_LINE tag can be used to set the number of enum values that +# doxygen will group on one line in the generated HTML documentation. +# +# Note that a value of 0 will completely suppress the enum values from appearing +# in the overview section. +# Minimum value: 0, maximum value: 20, default value: 4. +# This tag requires that the tag GENERATE_HTML is set to YES. + ENUM_VALUES_PER_LINE = 4 + +# If the treeview is enabled (see GENERATE_TREEVIEW) then this tag can be used +# to set the initial width (in pixels) of the frame in which the tree is shown. +# Minimum value: 0, maximum value: 1500, default value: 250. +# This tag requires that the tag GENERATE_HTML is set to YES. + TREEVIEW_WIDTH = 250 + +# If the EXT_LINKS_IN_WINDOW option is set to YES, doxygen will open links to +# external symbols imported via tag files in a separate window. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTML is set to YES. + EXT_LINKS_IN_WINDOW = NO + +# If the HTML_FORMULA_FORMAT option is set to svg, doxygen will use the pdf2svg +# tool (see https://github.com/dawbarton/pdf2svg) or inkscape (see +# https://inkscape.org) to generate formulas as SVG images instead of PNGs for +# the HTML output. These images will generally look nicer at scaled resolutions. +# Possible values are: png The default and svg Looks nicer but requires the +# pdf2svg tool. +# The default value is: png. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_FORMULA_FORMAT = png + +# Use this tag to change the font size of LaTeX formulas included as images in +# the HTML documentation. When you change the font size after a successful +# doxygen run you need to manually remove any form_*.png images from the HTML +# output directory to force them to be regenerated. +# Minimum value: 8, maximum value: 50, default value: 10. +# This tag requires that the tag GENERATE_HTML is set to YES. + FORMULA_FONTSIZE = 10 + +# Use the FORMULA_TRANSPARENT tag to determine whether or not the images +# generated for formulas are transparent PNGs. Transparent PNGs are not +# supported properly for IE 6.0, but are supported on all modern browsers. +# +# Note that when changing this option you need to delete any form_*.png files in +# the HTML output directory before the changes have effect. +# The default value is: YES. +# This tag requires that the tag GENERATE_HTML is set to YES. + FORMULA_TRANSPARENT = YES + +# The FORMULA_MACROFILE can contain LaTeX \newcommand and \renewcommand commands +# to create new LaTeX commands to be used in formulas as building blocks. See +# the section "Including formulas" for details. + FORMULA_MACROFILE = + +# Enable the USE_MATHJAX option to render LaTeX formulas using MathJax (see +# https://www.mathjax.org) which uses client side JavaScript for the rendering +# instead of using pre-rendered bitmaps. Use this if you do not have LaTeX +# installed or if you want to formulas look prettier in the HTML output. When +# enabled you may also need to install MathJax separately and configure the path +# to it using the MATHJAX_RELPATH option. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTML is set to YES. + USE_MATHJAX = NO + +# When MathJax is enabled you can set the default output format to be used for +# the MathJax output. See the MathJax site (see: +# http://docs.mathjax.org/en/latest/output.html) for more details. +# Possible values are: HTML-CSS (which is slower, but has the best +# compatibility), NativeMML (i.e. MathML) and SVG. +# The default value is: HTML-CSS. +# This tag requires that the tag USE_MATHJAX is set to YES. + MATHJAX_FORMAT = HTML-CSS + +# When MathJax is enabled you need to specify the location relative to the HTML +# output directory using the MATHJAX_RELPATH option. The destination directory +# should contain the MathJax.js script. For instance, if the mathjax directory +# is located at the same level as the HTML output directory, then +# MATHJAX_RELPATH should be ../mathjax. The default value points to the MathJax +# Content Delivery Network so you can quickly see the result without installing +# MathJax. However, it is strongly recommended to install a local copy of +# MathJax from https://www.mathjax.org before deployment. +# The default value is: https://cdn.jsdelivr.net/npm/mathjax@2. +# This tag requires that the tag USE_MATHJAX is set to YES. + MATHJAX_RELPATH = https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/ + +# The MATHJAX_EXTENSIONS tag can be used to specify one or more MathJax +# extension names that should be enabled during MathJax rendering. For example +# MATHJAX_EXTENSIONS = TeX/AMSmath TeX/AMSsymbols +# This tag requires that the tag USE_MATHJAX is set to YES. + MATHJAX_EXTENSIONS = + +# The MATHJAX_CODEFILE tag can be used to specify a file with javascript pieces +# of code that will be used on startup of the MathJax code. See the MathJax site +# (see: http://docs.mathjax.org/en/latest/output.html) for more details. For an +# example see the documentation. +# This tag requires that the tag USE_MATHJAX is set to YES. + MATHJAX_CODEFILE = + +# When the SEARCHENGINE tag is enabled doxygen will generate a search box for +# the HTML output. The underlying search engine uses javascript and DHTML and +# should work on any modern browser. Note that when using HTML help +# (GENERATE_HTMLHELP), Qt help (GENERATE_QHP), or docsets (GENERATE_DOCSET) +# there is already a search function so this one should typically be disabled. +# For large projects the javascript based search engine can be slow, then +# enabling SERVER_BASED_SEARCH may provide a better solution. It is possible to +# search using the keyboard; to jump to the search box use + S +# (what the is depends on the OS and browser, but it is typically +# , /