From b985eafe4c22ad07f49d8f9630264e8636bd61f0 Mon Sep 17 00:00:00 2001 From: Syrus Akbary Date: Mon, 10 Jun 2024 11:17:20 +0200 Subject: [PATCH] Simplified the repo docs. Added BUILD and TEST docs --- .devcontainer/Dockerfile | 1 - .devcontainer/devcontainer.json | 18 --- .tarpaulin.toml | 17 --- .vscode/settings.json | 13 -- CODE_OF_CONDUCT.md | 76 ---------- Makefile | 4 +- README.md | 9 ++ ATTRIBUTIONS.md => docs/ATTRIBUTIONS.md | 0 docs/BUILD.md | 143 ++++++++++++++++++ CONTRIBUTING.md => docs/CONTRIBUTING.md | 0 PACKAGING.md => docs/PACKAGING.md | 0 SECURITY.md => docs/SECURITY.md | 0 docs/TEST.md | 22 +++ fuzzbuzz.yaml | 9 -- lib/compiler-cranelift/README.md | 2 +- lib/compiler-cranelift/src/address_map.rs | 2 +- lib/compiler-cranelift/src/func_environ.rs | 2 +- .../src/trampoline/dynamic_function.rs | 2 +- .../src/trampoline/function_call.rs | 2 +- .../src/translator/code_translator.rs | 2 +- .../src/translator/func_environ.rs | 2 +- .../src/translator/func_state.rs | 2 +- .../src/translator/func_translator.rs | 2 +- lib/compiler/README.md | 2 +- lib/compiler/src/engine/code_memory.rs | 2 +- lib/compiler/src/engine/unwind/systemv.rs | 2 +- lib/compiler/src/engine/unwind/windows_x64.rs | 2 +- lib/compiler/src/translator/environ.rs | 2 +- lib/compiler/src/translator/module.rs | 2 +- lib/compiler/src/translator/sections.rs | 2 +- lib/compiler/src/translator/state.rs | 2 +- lib/sys-utils/src/memory/fd_memory/fd_mmap.rs | 2 +- .../src/memory/fd_memory/memories.rs | 2 +- lib/types/README.md | 2 +- lib/types/src/compilation/function.rs | 2 +- lib/types/src/entity/boxed_slice.rs | 2 +- lib/types/src/entity/iter.rs | 2 +- lib/types/src/entity/keys.rs | 2 +- lib/types/src/entity/mod.rs | 2 +- lib/types/src/entity/packed_option.rs | 2 +- lib/types/src/entity/primary_map.rs | 2 +- lib/types/src/entity/secondary_map.rs | 2 +- lib/types/src/module.rs | 2 +- lib/types/src/stack/sourceloc.rs | 2 +- lib/types/src/trapcode.rs | 2 +- lib/types/src/vmoffsets.rs | 2 +- lib/vm/README.md | 2 +- lib/vm/src/export.rs | 2 +- lib/vm/src/imports.rs | 2 +- lib/vm/src/instance/mod.rs | 2 +- lib/vm/src/libcalls.rs | 2 +- lib/vm/src/memory.rs | 2 +- lib/vm/src/mmap.rs | 2 +- lib/vm/src/probestack.rs | 2 +- lib/vm/src/sig_registry.rs | 2 +- lib/vm/src/table.rs | 2 +- lib/vm/src/trap/mod.rs | 2 +- lib/vm/src/trap/traphandlers.rs | 2 +- lib/vm/src/vmcontext.rs | 2 +- rustfmt.toml | 6 - 60 files changed, 221 insertions(+), 187 deletions(-) delete mode 100644 .devcontainer/Dockerfile delete mode 100644 .devcontainer/devcontainer.json delete mode 100644 .tarpaulin.toml delete mode 100644 .vscode/settings.json delete mode 100644 CODE_OF_CONDUCT.md rename ATTRIBUTIONS.md => docs/ATTRIBUTIONS.md (100%) create mode 100644 docs/BUILD.md rename CONTRIBUTING.md => docs/CONTRIBUTING.md (100%) rename PACKAGING.md => docs/PACKAGING.md (100%) rename SECURITY.md => docs/SECURITY.md (100%) create mode 100644 docs/TEST.md delete mode 100644 fuzzbuzz.yaml delete mode 100644 rustfmt.toml diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile deleted file mode 100644 index 0db89818db0..00000000000 --- a/.devcontainer/Dockerfile +++ /dev/null @@ -1 +0,0 @@ -FROM rust:1 diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json deleted file mode 100644 index 775daa304a9..00000000000 --- a/.devcontainer/devcontainer.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "name": "Wasmer dev environment", - "dockerFile": "Dockerfile", - - // Set *default* container specific settings.json values on container create. - "settings": { - "terminal.integrated.shell.linux": "/bin/bash", - "lldb.executable": "/usr/bin/lldb" - }, - - // Add the IDs of extensions you want installed when the container is created. - "extensions": [ - "rust-lang.rust-analyzer", - "dtsvet.vscode-wasm", - "bungcip.better-toml", - "vadimcn.vscode-lldb" - ] -} diff --git a/.tarpaulin.toml b/.tarpaulin.toml deleted file mode 100644 index 08fe94c34ee..00000000000 --- a/.tarpaulin.toml +++ /dev/null @@ -1,17 +0,0 @@ -[cranelift_coverage] -features = "cranelift,singlepass,llvm,coverage,test-cranelift,test-jit" -examples = ["early-exit", "engine-jit", "engine-native", "engine-headless", "cross-compilation", "compiler-cranelift", "exported-function", "wasi"] -release = true - -[llvm_coverage] -features = "cranelift,singlepass,llvm,coverage,test-llvm,test-jit" -examples = ["compiler-llvm"] -release = true - -[singlepass_coverage] -features = "cranelift,singlepass,llvm,coverage,test-singlepass,test-jit" -examples = ["compiler-singlepass"] -release = true - -[report] -out = ["Xml"] diff --git a/.vscode/settings.json b/.vscode/settings.json deleted file mode 100644 index 8c5ad19f07b..00000000000 --- a/.vscode/settings.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "[toml]": { - "editor.formatOnSave": false, - "editor.formatOnPaste": false, - "editor.formatOnType": false - }, - "[rust]": { - "editor.formatOnSave": true, - "editor.formatOnPaste": false, - "editor.formatOnType": false - }, - "rust-analyzer.showUnlinkedFileNotification": false -} \ No newline at end of file diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md deleted file mode 100644 index d9965c509ce..00000000000 --- a/CODE_OF_CONDUCT.md +++ /dev/null @@ -1,76 +0,0 @@ -# Contributor Covenant Code of Conduct - -## Our Pledge - -In the interest of fostering an open and welcoming environment, we as -contributors and maintainers pledge to making participation in our project and -our community a harassment-free experience for everyone, regardless of age, body -size, disability, ethnicity, sex characteristics, gender identity and expression, -level of experience, education, socio-economic status, nationality, personal -appearance, race, religion, or sexual identity and orientation. - -## Our Standards - -Examples of behavior that contributes to creating a positive environment -include: - -* Using welcoming and inclusive language -* Being respectful of differing viewpoints and experiences -* Gracefully accepting constructive criticism -* Focusing on what is best for the community -* Showing empathy towards other community members - -Examples of unacceptable behavior by participants include: - -* The use of sexualized language or imagery and unwelcome sexual attention or - advances -* Trolling, insulting/derogatory comments, and personal or political attacks -* Public or private harassment -* Publishing others' private information, such as a physical or electronic - address, without explicit permission -* Other conduct which could reasonably be considered inappropriate in a - professional setting - -## Our Responsibilities - -Project maintainers are responsible for clarifying the standards of acceptable -behavior and are expected to take appropriate and fair corrective action in -response to any instances of unacceptable behavior. - -Project maintainers have the right and responsibility to remove, edit, or -reject comments, commits, code, wiki edits, issues, and other contributions -that are not aligned to this Code of Conduct, or to ban temporarily or -permanently any contributor for other behaviors that they deem inappropriate, -threatening, offensive, or harmful. - -## Scope - -This Code of Conduct applies both within project spaces and in public spaces -when an individual is representing the project or its community. Examples of -representing a project or community include using an official project e-mail -address, posting via an official social media account, or acting as an appointed -representative at an online or offline event. Representation of a project may be -further defined and clarified by project maintainers. - -## Enforcement - -Instances of abusive, harassing, or otherwise unacceptable behavior may be -reported by contacting the project team at contact@wasmer.io. All -complaints will be reviewed and investigated and will result in a response that -is deemed necessary and appropriate to the circumstances. The project team is -obligated to maintain confidentiality with regard to the reporter of an incident. -Further details of specific enforcement policies may be posted separately. - -Project maintainers who do not follow or enforce the Code of Conduct in good -faith may face temporary or permanent repercussions as determined by other -members of the project's leadership. - -## Attribution - -This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, -available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html - -[homepage]: https://www.contributor-covenant.org - -For answers to common questions about this code of conduct, see -https://www.contributor-covenant.org/faq diff --git a/Makefile b/Makefile index 9b705e2bab1..97dc61d5505 100644 --- a/Makefile +++ b/Makefile @@ -850,14 +850,14 @@ untar-wasmer: distribution-gnu: package-capi cp LICENSE package/LICENSE - cp ATTRIBUTIONS.md package/ATTRIBUTIONS + cp docs/ATTRIBUTIONS.md package/ATTRIBUTIONS mkdir -p dist tar -C package -zcvf wasmer.tar.gz lib include winsdk LICENSE ATTRIBUTIONS mv wasmer.tar.gz dist/ distribution: package cp LICENSE package/LICENSE - cp ATTRIBUTIONS.md package/ATTRIBUTIONS + cp docs/ATTRIBUTIONS.md package/ATTRIBUTIONS mkdir -p dist ifeq ($(IS_WINDOWS), 1) iscc scripts/windows-installer/wasmer.iss diff --git a/README.md b/README.md index 5fbd03dccfb..97699766ba0 100644 --- a/README.md +++ b/README.md @@ -219,6 +219,15 @@ languages** with the Wasmer SDK: [OCaml integration]: https://github.com/wasmerio/wasmer-ocaml [`wasmer` OCaml package]: https://opam.ocaml.org/packages/wasmer/ +## Develop + +We have different guides to help you develop Wasmer: + +* [Build Wasmer from Source](./docs/BUILD.md) +* [Testing](./docs/TEST.md) +* [Security advisory](./docs/SECURITY.md) + + ## Contribute We appreciate your help! 💜 diff --git a/ATTRIBUTIONS.md b/docs/ATTRIBUTIONS.md similarity index 100% rename from ATTRIBUTIONS.md rename to docs/ATTRIBUTIONS.md diff --git a/docs/BUILD.md b/docs/BUILD.md new file mode 100644 index 00000000000..09439213b80 --- /dev/null +++ b/docs/BUILD.md @@ -0,0 +1,143 @@ +# Building Wasmer from Source + +## Installing Rustup + +Building Wasmer from source requires [Rust](https://rustup.rs/) **1.67+**. + +The easiest way to install Rust on your system is via Rustup. To get Rustup on Linux and macOS, you can run the following: + +```bash +curl https://sh.rustup.rs -sSf | sh +``` + +> [!NOTE] +> To install Rust on Windows, download and run [rustup-init.exe](https://win.rustup.rs/), then follow the on-screen instructions. + +## Installing Additional Dependencies + +### Windows + +Windows is fully supported by Wasmer. WASI is also fully supported, but Emscripten support is still experimental. + +1. Install [Visual Studio](https://visualstudio.microsoft.com/thank-you-downloading-visual-studio/?sku=Community&rel=15) +2. Install [Rust for Windows](https://win.rustup.rs/) +3. Install [Git for Windows](https://git-scm.com/download/win). Allow it to add `git.exe` to your PATH (default settings for the installer are fine). +4. \(optional\) Install [LLVM 11.0](https://prereleases.llvm.org/win-snapshots/LLVM-11.0.0-2663a25f-win64.exe) + +## Building the Wasmer Runtime + +Wasmer is built with [Cargo](https://crates.io/), the Rust package manager. + +First, let's clone Wasmer: + +```text +git clone https://github.com/wasmerio/wasmer.git +cd wasmer +``` + +Wasmer supports three different compilers at the moment: + +### Singlepass Compiler + +Build Wasmer: + +```text +make build-wasmer +``` + +**Note**: you should see this `Enabled Compilers: singlepass` in console. + +You may disable Singlepass compiler with `export ENABLE_SINGLEPASS=0`. + +### Cranelift Compiler + +The Cranelift compiler will work if you are on a X86 or ARM machine. It will be detected automatically, so you don't need to do anything to your system to enable it. + +```text +make build-wasmer +``` + +**Note**: should see this as the first line in the console: +`Enabled Compilers: cranelift` + +You may disable the Cranelift compiler with `export ENABLE_CRANELIFT=0`. + +### LLVM Compiler + +If you want support for the Wasmer LLVM compiler, then you will also need to ensure: + +* Ensure that LLVM 10.0.x > is installed on your system + * You can refer to [LLVM install instructions](https://github.com/wasmerio/wasmer/tree/master/lib/compiler-llvm#requirements) + * You can also [download and use a prebuilt LLVM binary](https://releases.llvm.org/download.html) +* In case `llvm-config` is not accessible, set the correct environment variable for LLVM to access: For example, the environment variable for LLVM 11.0.x would be: `LLVM_SYS_110_PREFIX=/path/to/unpacked/llvm-11.0` + +And create a Wasmer release + +```bash +make build-wasmer +``` + +**Note**: you should see this in the console: +`Enabled Compilers: llvm` + +You may disable the LLVM compiler with `export ENABLE_LLVM=0`. + +### All compilers + +Once you have LLVM and Rust, you can just run: + +```bash +make build-wasmer +``` + +**Note**: you should see this in the console: +`Enabled Compilers: singlepass cranelift llvm` + +## Running your Wasmer binary + +Once you run the `make build-wasmer` command, you will have a new binary ready to be used! + +```text +./target/release/wasmer quickjs.wasm +``` + +## Building Wasmer C-API from source + +Wasmer provides a pre-compiled version for the C-API on its [release page](https://github.com/wasmerio/wasmer/releases). + +However, you can also compile the shared library from source: + +```text +make build-capi +``` + +This will generate the shared library (depending on your system): + +* Windows: `target/release/libwasmer_c_api.dll` +* macOS: `target/release/libwasmer_c_api.dylib` +* Linux: `target/release/libwasmer_c_api.so` + +If you want to generate the library and headers for using them easily, you can execute: + +```bash +make package-capi +``` + +This command will generate a `package` directory, that you can then use easily in the [Wasmer C API examples](./). + +```text +package/ + lib/ + libwasmer.so + headers/ + wasm.h + wasmer.h +``` + +> [!IMPORTANT] +> +> By default, the Wasmer C API shared library will include all the backends available in the system where is built. +> Defaulting to `cranelift` if available. +> +> You can generate the C-API for a specific compiler and engine with: +> `make build-capi-{ENGINE}` diff --git a/CONTRIBUTING.md b/docs/CONTRIBUTING.md similarity index 100% rename from CONTRIBUTING.md rename to docs/CONTRIBUTING.md diff --git a/PACKAGING.md b/docs/PACKAGING.md similarity index 100% rename from PACKAGING.md rename to docs/PACKAGING.md diff --git a/SECURITY.md b/docs/SECURITY.md similarity index 100% rename from SECURITY.md rename to docs/SECURITY.md diff --git a/docs/TEST.md b/docs/TEST.md new file mode 100644 index 00000000000..ce37ad7b083 --- /dev/null +++ b/docs/TEST.md @@ -0,0 +1,22 @@ +# Testing + +Thanks to [WebAssembly spec tests](https://github.com/wasmerio/wasmer/tree/master/lib/spectests/spectests) we can ensure 100% compatibility with the WebAssembly spec test suite. + +You can run all the tests with: + +```text +make test +``` + +> [!INFO] +> `make test` will automatically detect the compilers available on your system. +> +> Please follow the [Building from Source](./BUILD.md) guide see how you can[ prepare your system with the requirements needed for each of the backends](./#all-backends-default). + +## Testing Compilers + +Each compiler integration can be tested separately: + +* **Singlepass**: `make test-singlepass` +* **Cranelift**: `make test-cranelift` +* **LLVM**: `make test-llvm` diff --git a/fuzzbuzz.yaml b/fuzzbuzz.yaml deleted file mode 100644 index cbf6d4aef57..00000000000 --- a/fuzzbuzz.yaml +++ /dev/null @@ -1,9 +0,0 @@ -wasmer: - language: rust - features: - - universal - - cranelift - - singlepass - deps: - - run: apt update - - run: apt install -y zlib1g-dev libffi-dev build-essential diff --git a/lib/compiler-cranelift/README.md b/lib/compiler-cranelift/README.md index 5050505598f..625b51e744a 100644 --- a/lib/compiler-cranelift/README.md +++ b/lib/compiler-cranelift/README.md @@ -33,4 +33,4 @@ attributions of the project. [example]: https://github.com/wasmerio/wasmer/blob/main/examples/compiler_cranelift.rs [`wasmer-compiler-llvm`]: https://github.com/wasmerio/wasmer/tree/main/lib/compiler-llvm [`cranelift-wasm`]: https://crates.io/crates/cranelift-wasm -[Wasmer `ATTRIBUTIONS`]: https://github.com/wasmerio/wasmer/blob/main/ATTRIBUTIONS.md +[Wasmer `ATTRIBUTIONS`]: https://github.com/wasmerio/wasmer/blob/main/docs/ATTRIBUTIONS.md diff --git a/lib/compiler-cranelift/src/address_map.rs b/lib/compiler-cranelift/src/address_map.rs index 14d01a729f3..41c7d80f879 100644 --- a/lib/compiler-cranelift/src/address_map.rs +++ b/lib/compiler-cranelift/src/address_map.rs @@ -1,5 +1,5 @@ // This file contains code from external sources. -// Attributions: https://github.com/wasmerio/wasmer/blob/main/ATTRIBUTIONS.md +// Attributions: https://github.com/wasmerio/wasmer/blob/main/docs/ATTRIBUTIONS.md use cranelift_codegen::Context; use cranelift_codegen::MachSrcLoc; diff --git a/lib/compiler-cranelift/src/func_environ.rs b/lib/compiler-cranelift/src/func_environ.rs index fc69c55a14b..1160e00f967 100644 --- a/lib/compiler-cranelift/src/func_environ.rs +++ b/lib/compiler-cranelift/src/func_environ.rs @@ -1,5 +1,5 @@ // This file contains code from external sources. -// Attributions: https://github.com/wasmerio/wasmer/blob/main/ATTRIBUTIONS.md +// Attributions: https://github.com/wasmerio/wasmer/blob/main/docs/ATTRIBUTIONS.md use crate::translator::{ type_to_irtype, FuncEnvironment as BaseFuncEnvironment, GlobalVariable, TargetEnvironment, diff --git a/lib/compiler-cranelift/src/trampoline/dynamic_function.rs b/lib/compiler-cranelift/src/trampoline/dynamic_function.rs index 4d0a05ee0e5..7ca710a105a 100644 --- a/lib/compiler-cranelift/src/trampoline/dynamic_function.rs +++ b/lib/compiler-cranelift/src/trampoline/dynamic_function.rs @@ -1,5 +1,5 @@ // This file contains code from external sources. -// Attributions: https://github.com/wasmerio/wasmer/blob/main/ATTRIBUTIONS.md +// Attributions: https://github.com/wasmerio/wasmer/blob/main/docs/ATTRIBUTIONS.md //! A trampoline generator for calling dynamic host functions from Wasm. diff --git a/lib/compiler-cranelift/src/trampoline/function_call.rs b/lib/compiler-cranelift/src/trampoline/function_call.rs index b9769b6765b..b59b5af02fe 100644 --- a/lib/compiler-cranelift/src/trampoline/function_call.rs +++ b/lib/compiler-cranelift/src/trampoline/function_call.rs @@ -1,5 +1,5 @@ // This file contains code from external sources. -// Attributions: https://github.com/wasmerio/wasmer/blob/main/ATTRIBUTIONS.md +// Attributions: https://github.com/wasmerio/wasmer/blob/main/docs/ATTRIBUTIONS.md //! A trampoline generator for calling Wasm functions easily. //! diff --git a/lib/compiler-cranelift/src/translator/code_translator.rs b/lib/compiler-cranelift/src/translator/code_translator.rs index 5ec96f4c1ad..f994ee3b31c 100644 --- a/lib/compiler-cranelift/src/translator/code_translator.rs +++ b/lib/compiler-cranelift/src/translator/code_translator.rs @@ -1,5 +1,5 @@ // This file contains code from external sources. -// Attributions: https://github.com/wasmerio/wasmer/blob/main/ATTRIBUTIONS.md +// Attributions: https://github.com/wasmerio/wasmer/blob/main/docs/ATTRIBUTIONS.md //! This module contains the bulk of the interesting code performing the translation between //! WebAssembly bytecode and Cranelift IR. diff --git a/lib/compiler-cranelift/src/translator/func_environ.rs b/lib/compiler-cranelift/src/translator/func_environ.rs index f9e40d5047c..ced49f84a36 100644 --- a/lib/compiler-cranelift/src/translator/func_environ.rs +++ b/lib/compiler-cranelift/src/translator/func_environ.rs @@ -1,5 +1,5 @@ // This file contains code from external sources. -// Attributions: https://github.com/wasmerio/wasmer/blob/main/ATTRIBUTIONS.md +// Attributions: https://github.com/wasmerio/wasmer/blob/main/docs/ATTRIBUTIONS.md //! All the runtime support necessary for the wasm to cranelift translation is formalized by the //! traits `FunctionEnvMutironment`. diff --git a/lib/compiler-cranelift/src/translator/func_state.rs b/lib/compiler-cranelift/src/translator/func_state.rs index 8303c7f5b39..7891c8be69d 100644 --- a/lib/compiler-cranelift/src/translator/func_state.rs +++ b/lib/compiler-cranelift/src/translator/func_state.rs @@ -1,5 +1,5 @@ // This file contains code from external sources. -// Attributions: https://github.com/wasmerio/wasmer/blob/main/ATTRIBUTIONS.md +// Attributions: https://github.com/wasmerio/wasmer/blob/main/docs/ATTRIBUTIONS.md //! WebAssembly module and function translation state. //! diff --git a/lib/compiler-cranelift/src/translator/func_translator.rs b/lib/compiler-cranelift/src/translator/func_translator.rs index 40b2bc71adb..3fa329b2476 100644 --- a/lib/compiler-cranelift/src/translator/func_translator.rs +++ b/lib/compiler-cranelift/src/translator/func_translator.rs @@ -1,5 +1,5 @@ // This file contains code from external sources. -// Attributions: https://github.com/wasmerio/wasmer/blob/main/ATTRIBUTIONS.md +// Attributions: https://github.com/wasmerio/wasmer/blob/main/docs/ATTRIBUTIONS.md //! Standalone WebAssembly to Cranelift IR translator. //! diff --git a/lib/compiler/README.md b/lib/compiler/README.md index e84d21c8280..d15b26695f8 100644 --- a/lib/compiler/README.md +++ b/lib/compiler/README.md @@ -53,4 +53,4 @@ attributions of the project. [`cranelift-wasm`]: https://crates.io/crates/cranelift-wasm -[Wasmer `ATTRIBUTIONS`]: https://github.com/wasmerio/wasmer/blob/main/ATTRIBUTIONS.md +[Wasmer `ATTRIBUTIONS`]: https://github.com/wasmerio/wasmer/blob/main/docs/ATTRIBUTIONS.md diff --git a/lib/compiler/src/engine/code_memory.rs b/lib/compiler/src/engine/code_memory.rs index d5e30bf69ad..99e413243ed 100644 --- a/lib/compiler/src/engine/code_memory.rs +++ b/lib/compiler/src/engine/code_memory.rs @@ -1,5 +1,5 @@ // This file contains code from external sources. -// Attributions: https://github.com/wasmerio/wasmer/blob/main/ATTRIBUTIONS.md +// Attributions: https://github.com/wasmerio/wasmer/blob/main/docs/ATTRIBUTIONS.md //! Memory management for executable code. use super::unwind::UnwindRegistry; diff --git a/lib/compiler/src/engine/unwind/systemv.rs b/lib/compiler/src/engine/unwind/systemv.rs index d6856878b9e..c1f2365abc6 100644 --- a/lib/compiler/src/engine/unwind/systemv.rs +++ b/lib/compiler/src/engine/unwind/systemv.rs @@ -1,5 +1,5 @@ // This file contains code from external sources. -// Attributions: https://github.com/wasmerio/wasmer/blob/main/ATTRIBUTIONS.md +// Attributions: https://github.com/wasmerio/wasmer/blob/main/docs/ATTRIBUTIONS.md //! Module for System V ABI unwind registry. diff --git a/lib/compiler/src/engine/unwind/windows_x64.rs b/lib/compiler/src/engine/unwind/windows_x64.rs index 1581b8607b4..115d7233ee2 100644 --- a/lib/compiler/src/engine/unwind/windows_x64.rs +++ b/lib/compiler/src/engine/unwind/windows_x64.rs @@ -1,5 +1,5 @@ // This file contains code from external sources. -// Attributions: https://github.com/wasmerio/wasmer/blob/main/ATTRIBUTIONS.md +// Attributions: https://github.com/wasmerio/wasmer/blob/main/docs/ATTRIBUTIONS.md //! Module for Windows x64 ABI unwind registry. use std::collections::HashMap; diff --git a/lib/compiler/src/translator/environ.rs b/lib/compiler/src/translator/environ.rs index 88910507d38..c0b376b02c5 100644 --- a/lib/compiler/src/translator/environ.rs +++ b/lib/compiler/src/translator/environ.rs @@ -1,5 +1,5 @@ // This file contains code from external sources. -// Attributions: https://github.com/wasmerio/wasmer/blob/main/ATTRIBUTIONS.md +// Attributions: https://github.com/wasmerio/wasmer/blob/main/docs/ATTRIBUTIONS.md use super::state::ModuleTranslationState; use crate::lib::std::string::ToString; use crate::lib::std::{boxed::Box, string::String, vec::Vec}; diff --git a/lib/compiler/src/translator/module.rs b/lib/compiler/src/translator/module.rs index a45546ece74..68c67f807cf 100644 --- a/lib/compiler/src/translator/module.rs +++ b/lib/compiler/src/translator/module.rs @@ -1,5 +1,5 @@ // This file contains code from external sources. -// Attributions: https://github.com/wasmerio/wasmer/blob/main/ATTRIBUTIONS.md +// Attributions: https://github.com/wasmerio/wasmer/blob/main/docs/ATTRIBUTIONS.md //! Translation skeleton that traverses the whole WebAssembly module and call helper functions //! to deal with each part of it. diff --git a/lib/compiler/src/translator/sections.rs b/lib/compiler/src/translator/sections.rs index fc5ad49c163..c317184db0b 100644 --- a/lib/compiler/src/translator/sections.rs +++ b/lib/compiler/src/translator/sections.rs @@ -1,5 +1,5 @@ // This file contains code from external sources. -// Attributions: https://github.com/wasmerio/wasmer/blob/main/ATTRIBUTIONS.md +// Attributions: https://github.com/wasmerio/wasmer/blob/main/docs/ATTRIBUTIONS.md //! Helper functions to gather information for each of the non-function sections of a //! WebAssembly module. diff --git a/lib/compiler/src/translator/state.rs b/lib/compiler/src/translator/state.rs index b5393bdb615..a074a30c30a 100644 --- a/lib/compiler/src/translator/state.rs +++ b/lib/compiler/src/translator/state.rs @@ -1,5 +1,5 @@ // This file contains code from external sources. -// Attributions: https://github.com/wasmerio/wasmer/blob/main/ATTRIBUTIONS.md +// Attributions: https://github.com/wasmerio/wasmer/blob/main/docs/ATTRIBUTIONS.md use std::boxed::Box; use wasmer_types::entity::PrimaryMap; diff --git a/lib/sys-utils/src/memory/fd_memory/fd_mmap.rs b/lib/sys-utils/src/memory/fd_memory/fd_mmap.rs index ea9391b3ab6..3aa795a7f0b 100644 --- a/lib/sys-utils/src/memory/fd_memory/fd_mmap.rs +++ b/lib/sys-utils/src/memory/fd_memory/fd_mmap.rs @@ -1,5 +1,5 @@ // This file contains code from external sources. -// Attributions: https://github.com/wasmerio/wasmer/blob/main/ATTRIBUTIONS.md +// Attributions: https://github.com/wasmerio/wasmer/blob/main/docs/ATTRIBUTIONS.md use std::{ io::{self, Read, Write}, diff --git a/lib/sys-utils/src/memory/fd_memory/memories.rs b/lib/sys-utils/src/memory/fd_memory/memories.rs index c6ffa16f3d0..f11e35ce215 100644 --- a/lib/sys-utils/src/memory/fd_memory/memories.rs +++ b/lib/sys-utils/src/memory/fd_memory/memories.rs @@ -2,7 +2,7 @@ //! //! `Memory` is to WebAssembly linear memories what `Table` is to WebAssembly tables. // This file contains code from external sources. -// Attributions: https://github.com/wasmerio/wasmer/blob/main/ATTRIBUTIONS.md +// Attributions: https://github.com/wasmerio/wasmer/blob/main/docs/ATTRIBUTIONS.md use std::{cell::UnsafeCell, convert::TryInto, ptr::NonNull, rc::Rc, sync::RwLock}; diff --git a/lib/types/README.md b/lib/types/README.md index 453633f8d21..358a92dbe6f 100644 --- a/lib/types/README.md +++ b/lib/types/README.md @@ -25,4 +25,4 @@ Among other things, it defines the following _types_: This project borrowed some of the code for the entity structure from [cranelift-entity](https://crates.io/crates/cranelift-entity). We decided to move it here to help on serialization/deserialization. -Please check [Wasmer ATTRIBUTIONS](https://github.com/wasmerio/wasmer/blob/main/ATTRIBUTIONS.md) to further see licenses and other attributions of the project. +Please check [Wasmer ATTRIBUTIONS](https://github.com/wasmerio/wasmer/blob/main/docs/ATTRIBUTIONS.md) to further see licenses and other attributions of the project. diff --git a/lib/types/src/compilation/function.rs b/lib/types/src/compilation/function.rs index c36ab85076d..aabf1195674 100644 --- a/lib/types/src/compilation/function.rs +++ b/lib/types/src/compilation/function.rs @@ -1,5 +1,5 @@ // This file contains code from external sources. -// Attributions: https://github.com/wasmerio/wasmer/blob/main/ATTRIBUTIONS.md +// Attributions: https://github.com/wasmerio/wasmer/blob/main/docs/ATTRIBUTIONS.md //! A `Compilation` contains the compiled function bodies for a WebAssembly //! module (`CompiledFunction`). diff --git a/lib/types/src/entity/boxed_slice.rs b/lib/types/src/entity/boxed_slice.rs index 1b1fa34851b..eca12d89185 100644 --- a/lib/types/src/entity/boxed_slice.rs +++ b/lib/types/src/entity/boxed_slice.rs @@ -1,5 +1,5 @@ // This file contains code from external sources. -// Attributions: https://github.com/wasmerio/wasmer/blob/main/ATTRIBUTIONS.md +// Attributions: https://github.com/wasmerio/wasmer/blob/main/docs/ATTRIBUTIONS.md //! Boxed slices for `PrimaryMap`. diff --git a/lib/types/src/entity/iter.rs b/lib/types/src/entity/iter.rs index 08d5a746a13..d1456e48ef8 100644 --- a/lib/types/src/entity/iter.rs +++ b/lib/types/src/entity/iter.rs @@ -1,5 +1,5 @@ // This file contains code from external sources. -// Attributions: https://github.com/wasmerio/wasmer/blob/main/ATTRIBUTIONS.md +// Attributions: https://github.com/wasmerio/wasmer/blob/main/docs/ATTRIBUTIONS.md //! A double-ended iterator over entity references and entities. diff --git a/lib/types/src/entity/keys.rs b/lib/types/src/entity/keys.rs index 86c68cf6047..14b73fdcb2d 100644 --- a/lib/types/src/entity/keys.rs +++ b/lib/types/src/entity/keys.rs @@ -1,5 +1,5 @@ // This file contains code from external sources. -// Attributions: https://github.com/wasmerio/wasmer/blob/main/ATTRIBUTIONS.md +// Attributions: https://github.com/wasmerio/wasmer/blob/main/docs/ATTRIBUTIONS.md //! A double-ended iterator over entity references. //! diff --git a/lib/types/src/entity/mod.rs b/lib/types/src/entity/mod.rs index e3c5ba79092..f7de0b1cfeb 100644 --- a/lib/types/src/entity/mod.rs +++ b/lib/types/src/entity/mod.rs @@ -1,5 +1,5 @@ // This file contains code from external sources. -// Attributions: https://github.com/wasmerio/wasmer/blob/main/ATTRIBUTIONS.md +// Attributions: https://github.com/wasmerio/wasmer/blob/main/docs/ATTRIBUTIONS.md /// A type wrapping a small integer index should implement `EntityRef` so it can be used as the key /// of an `SecondaryMap` or `SparseMap`. diff --git a/lib/types/src/entity/packed_option.rs b/lib/types/src/entity/packed_option.rs index 1e246c6c813..ce67e75258d 100644 --- a/lib/types/src/entity/packed_option.rs +++ b/lib/types/src/entity/packed_option.rs @@ -1,5 +1,5 @@ // This file contains code from external sources. -// Attributions: https://github.com/wasmerio/wasmer/blob/main/ATTRIBUTIONS.md +// Attributions: https://github.com/wasmerio/wasmer/blob/main/docs/ATTRIBUTIONS.md //! Compact representation of `Option` for types with a reserved value. //! diff --git a/lib/types/src/entity/primary_map.rs b/lib/types/src/entity/primary_map.rs index 7fd604c5921..a810791331e 100644 --- a/lib/types/src/entity/primary_map.rs +++ b/lib/types/src/entity/primary_map.rs @@ -1,5 +1,5 @@ // This file contains code from external sources. -// Attributions: https://github.com/wasmerio/wasmer/blob/main/ATTRIBUTIONS.md +// Attributions: https://github.com/wasmerio/wasmer/blob/main/docs/ATTRIBUTIONS.md //! Densely numbered entity references as mapping keys. use crate::entity::boxed_slice::BoxedSlice; diff --git a/lib/types/src/entity/secondary_map.rs b/lib/types/src/entity/secondary_map.rs index f23d6c4c90a..554bc4278ae 100644 --- a/lib/types/src/entity/secondary_map.rs +++ b/lib/types/src/entity/secondary_map.rs @@ -1,5 +1,5 @@ // This file contains code from external sources. -// Attributions: https://github.com/wasmerio/wasmer/blob/main/ATTRIBUTIONS.md +// Attributions: https://github.com/wasmerio/wasmer/blob/main/docs/ATTRIBUTIONS.md //! Densely numbered entity references as mapping keys. diff --git a/lib/types/src/module.rs b/lib/types/src/module.rs index 2c7f36ed959..5ddea198a5a 100644 --- a/lib/types/src/module.rs +++ b/lib/types/src/module.rs @@ -1,5 +1,5 @@ // This file contains code from external sources. -// Attributions: https://github.com/wasmerio/wasmer/blob/main/ATTRIBUTIONS.md +// Attributions: https://github.com/wasmerio/wasmer/blob/main/docs/ATTRIBUTIONS.md //! Data structure for representing WebAssembly modules in a //! `wasmer::Module`. diff --git a/lib/types/src/stack/sourceloc.rs b/lib/types/src/stack/sourceloc.rs index 1f9f8e57e73..e91586f4073 100644 --- a/lib/types/src/stack/sourceloc.rs +++ b/lib/types/src/stack/sourceloc.rs @@ -1,5 +1,5 @@ // This file contains code from external sources. -// Attributions: https://github.com/wasmerio/wasmer/blob/main/ATTRIBUTIONS.md +// Attributions: https://github.com/wasmerio/wasmer/blob/main/docs/ATTRIBUTIONS.md //! Source locations. //! diff --git a/lib/types/src/trapcode.rs b/lib/types/src/trapcode.rs index 23d01fa6bf2..ae8066d89c4 100644 --- a/lib/types/src/trapcode.rs +++ b/lib/types/src/trapcode.rs @@ -1,5 +1,5 @@ // This file contains code from external sources. -// Attributions: https://github.com/wasmerio/wasmer/blob/main/ATTRIBUTIONS.md +// Attributions: https://github.com/wasmerio/wasmer/blob/main/docs/ATTRIBUTIONS.md //! Trap codes describing the reason for a trap. diff --git a/lib/types/src/vmoffsets.rs b/lib/types/src/vmoffsets.rs index 3136f1fa080..f48176d45ec 100644 --- a/lib/types/src/vmoffsets.rs +++ b/lib/types/src/vmoffsets.rs @@ -1,5 +1,5 @@ // This file contains code from external sources. -// Attributions: https://github.com/wasmerio/wasmer/blob/main/ATTRIBUTIONS.md +// Attributions: https://github.com/wasmerio/wasmer/blob/main/docs/ATTRIBUTIONS.md //! Offsets and sizes of various structs in wasmer-vm's vmcontext //! module. diff --git a/lib/vm/README.md b/lib/vm/README.md index 1ed0132d403..7854b0eae23 100644 --- a/lib/vm/README.md +++ b/lib/vm/README.md @@ -22,4 +22,4 @@ directly. The `wasmer` crate provides types that embed types from This project borrowed some of the code for the VM structure and trapping from the [wasmtime-runtime](https://crates.io/crates/wasmtime-runtime). -Please check [Wasmer ATTRIBUTIONS](https://github.com/wasmerio/wasmer/blob/main/ATTRIBUTIONS.md) to further see licenses and other attributions of the project. +Please check [Wasmer ATTRIBUTIONS](https://github.com/wasmerio/wasmer/blob/main/docs/ATTRIBUTIONS.md) to further see licenses and other attributions of the project. diff --git a/lib/vm/src/export.rs b/lib/vm/src/export.rs index f251b5897eb..3a670b14b14 100644 --- a/lib/vm/src/export.rs +++ b/lib/vm/src/export.rs @@ -1,5 +1,5 @@ // This file contains code from external sources. -// Attributions: https://github.com/wasmerio/wasmer/blob/main/ATTRIBUTIONS.md +// Attributions: https://github.com/wasmerio/wasmer/blob/main/docs/ATTRIBUTIONS.md use crate::global::VMGlobal; use crate::memory::VMMemory; diff --git a/lib/vm/src/imports.rs b/lib/vm/src/imports.rs index 6928746e2f8..c798b240850 100644 --- a/lib/vm/src/imports.rs +++ b/lib/vm/src/imports.rs @@ -1,5 +1,5 @@ // This file contains code from external sources. -// Attributions: https://github.com/wasmerio/wasmer/blob/main/ATTRIBUTIONS.md +// Attributions: https://github.com/wasmerio/wasmer/blob/main/docs/ATTRIBUTIONS.md use crate::vmcontext::{VMFunctionImport, VMGlobalImport, VMMemoryImport, VMTableImport}; use wasmer_types::entity::{BoxedSlice, PrimaryMap}; diff --git a/lib/vm/src/instance/mod.rs b/lib/vm/src/instance/mod.rs index f974f64620e..fa61069f0d3 100644 --- a/lib/vm/src/instance/mod.rs +++ b/lib/vm/src/instance/mod.rs @@ -1,5 +1,5 @@ // This file contains code from external sources. -// Attributions: https://github.com/wasmerio/wasmer/blob/main/ATTRIBUTIONS.md +// Attributions: https://github.com/wasmerio/wasmer/blob/main/docs/ATTRIBUTIONS.md //! An `Instance` contains all the runtime state used by execution of //! a WebAssembly module (except its callstack and register state). An diff --git a/lib/vm/src/libcalls.rs b/lib/vm/src/libcalls.rs index d8b2cbc6dc3..04a2a9a1b7e 100644 --- a/lib/vm/src/libcalls.rs +++ b/lib/vm/src/libcalls.rs @@ -1,5 +1,5 @@ // This file contains code from external sources. -// Attributions: https://github.com/wasmerio/wasmer/blob/main/ATTRIBUTIONS.md +// Attributions: https://github.com/wasmerio/wasmer/blob/main/docs/ATTRIBUTIONS.md //! Runtime library calls. //! diff --git a/lib/vm/src/memory.rs b/lib/vm/src/memory.rs index ca227404c86..1052b61ef0e 100644 --- a/lib/vm/src/memory.rs +++ b/lib/vm/src/memory.rs @@ -1,5 +1,5 @@ // This file contains code from external sources. -// Attributions: https://github.com/wasmerio/wasmer/blob/main/ATTRIBUTIONS.md +// Attributions: https://github.com/wasmerio/wasmer/blob/main/docs/ATTRIBUTIONS.md //! Memory management for linear memories. //! diff --git a/lib/vm/src/mmap.rs b/lib/vm/src/mmap.rs index ef301a4f678..6d1ce905494 100644 --- a/lib/vm/src/mmap.rs +++ b/lib/vm/src/mmap.rs @@ -1,5 +1,5 @@ // This file contains code from external sources. -// Attributions: https://github.com/wasmerio/wasmer/blob/main/ATTRIBUTIONS.md +// Attributions: https://github.com/wasmerio/wasmer/blob/main/docs/ATTRIBUTIONS.md //! Low-level abstraction for allocating and managing zero-filled pages //! of memory. diff --git a/lib/vm/src/probestack.rs b/lib/vm/src/probestack.rs index 614aaf86245..fd78d8d0b2c 100644 --- a/lib/vm/src/probestack.rs +++ b/lib/vm/src/probestack.rs @@ -1,5 +1,5 @@ // This file contains code from external sources. -// Attributions: https://github.com/wasmerio/wasmer/blob/main/ATTRIBUTIONS.md +// Attributions: https://github.com/wasmerio/wasmer/blob/main/docs/ATTRIBUTIONS.md //! This section defines the `PROBESTACK` intrinsic which is used in the //! implementation of "stack probes" on certain platforms. diff --git a/lib/vm/src/sig_registry.rs b/lib/vm/src/sig_registry.rs index dca3721eb98..1ae661a7edc 100644 --- a/lib/vm/src/sig_registry.rs +++ b/lib/vm/src/sig_registry.rs @@ -1,5 +1,5 @@ // This file contains code from external sources. -// Attributions: https://github.com/wasmerio/wasmer/blob/main/ATTRIBUTIONS.md +// Attributions: https://github.com/wasmerio/wasmer/blob/main/docs/ATTRIBUTIONS.md //! Implement a registry of function signatures, for fast indirect call //! signature checking. diff --git a/lib/vm/src/table.rs b/lib/vm/src/table.rs index 0347206ae9a..18f0b602de8 100644 --- a/lib/vm/src/table.rs +++ b/lib/vm/src/table.rs @@ -1,5 +1,5 @@ // This file contains code from external sources. -// Attributions: https://github.com/wasmerio/wasmer/blob/main/ATTRIBUTIONS.md +// Attributions: https://github.com/wasmerio/wasmer/blob/main/docs/ATTRIBUTIONS.md //! Memory management for tables. //! diff --git a/lib/vm/src/trap/mod.rs b/lib/vm/src/trap/mod.rs index 25b3fca8b15..e3292593248 100644 --- a/lib/vm/src/trap/mod.rs +++ b/lib/vm/src/trap/mod.rs @@ -1,5 +1,5 @@ // This file contains code from external sources. -// Attributions: https://github.com/wasmerio/wasmer/blob/main/ATTRIBUTIONS.md +// Attributions: https://github.com/wasmerio/wasmer/blob/main/docs/ATTRIBUTIONS.md //! This is the module that facilitates the usage of Traps //! in Wasmer Runtime diff --git a/lib/vm/src/trap/traphandlers.rs b/lib/vm/src/trap/traphandlers.rs index dcd6108ce28..498d1cb0fc8 100644 --- a/lib/vm/src/trap/traphandlers.rs +++ b/lib/vm/src/trap/traphandlers.rs @@ -1,5 +1,5 @@ // This file contains code from external sources. -// Attributions: https://github.com/wasmerio/wasmer/blob/main/ATTRIBUTIONS.md +// Attributions: https://github.com/wasmerio/wasmer/blob/main/docs/ATTRIBUTIONS.md //! WebAssembly trap handling, which is built on top of the lower-level //! signalhandling mechanisms. diff --git a/lib/vm/src/vmcontext.rs b/lib/vm/src/vmcontext.rs index 8c2c2b48812..c75d6b5f69e 100644 --- a/lib/vm/src/vmcontext.rs +++ b/lib/vm/src/vmcontext.rs @@ -1,5 +1,5 @@ // This file contains code from external sources. -// Attributions: https://github.com/wasmerio/wasmer/blob/main/ATTRIBUTIONS.md +// Attributions: https://github.com/wasmerio/wasmer/blob/main/docs/ATTRIBUTIONS.md //! This file declares `VMContext` and several related structs which contain //! fields that compiled wasm code accesses directly. diff --git a/rustfmt.toml b/rustfmt.toml deleted file mode 100644 index 46200973310..00000000000 --- a/rustfmt.toml +++ /dev/null @@ -1,6 +0,0 @@ -# Nightly only, sadly. -# Need to wait until they are stabilised. -# imports_granularity = "Crate" -# group_imports = "StdExternalCrate" -# reorder_imports = true -