Packages

A WebAssembly runtime implemented in Erlang/OTP

Current section

Files

Jump to
erlang_wasm rebar.config
Raw

rebar.config

%% -*- erlang -*-
{erl_opts, [
debug_info,
warnings_as_errors,
{warn_format, 1},
warn_export_vars,
warn_obsolete_guard,
warn_unused_import
]}.
{deps, []}.
%% The NIF is optional: it closes a time-of-check-to-time-of-use window in WASI
%% path resolution, and the runtime falls back to a pure Erlang resolver when it
%% is absent. The script always exits 0 so a missing C compiler cannot fail the
%% build.
{pre_hooks, [{compile, "./scripts/build-nif.sh"}]}.
{profiles, [
{test, [
{deps, [{proper, "1.4.0"}]},
{erl_opts, [debug_info, nowarn_export_all, {d, 'TEST'}]},
{extra_src_dirs, [{"test/support", [{recursive, true}]},
{"examples", [{recursive, true}]}]}
]}
]}.
{dialyzer, [
{warnings, [unknown, no_return, error_handling]},
%% `compiler' for `cerl' and `compile:forms/2', which `wasm_core' generates
%% Core Erlang through. Without it every call into them is an unknown
%% function and the `unknown' warning class fires on all of them.
{plt_extra_apps, [crypto, compiler]}
]}.
{xref_checks, [
undefined_function_calls,
locals_not_used,
deprecated_function_calls
]}.
{ct_opts, [{sys_config, "test/sys.config"}]}.
%% Documentation is built with ex_doc, which reads the EEP-59 `-moduledoc' and
%% `-doc' attributes rather than edoc comments. The hand-written pages live in
%% `docs/' and the generated site is a build artefact, so it goes under
%% `_build/' with everything else that is generated.
{project_plugins, [rebar3_ex_doc]}.
%% Tell rebar3_hex which provider builds the docs it publishes. Without it
%% `rebar3 hex publish' stops and asks for one.
{hex, [{doc, ex_doc}]}.
%% `output' is what rebar3_ex_doc passes to ex_doc; `dir' is where rebar3_hex
%% looks for the result afterwards. They have to agree, and rebar3_ex_doc warns
%% that it does not know `dir', which is expected: it is not its option.
{ex_doc, [
{output, "_build/doc"},
{dir, "_build/doc"},
{name, <<"erlang_wasm">>},
{source_url, <<"https://github.com/benoitc/erlang_wasm">>},
{main, <<"readme">>},
{extras, [
{'README.md', #{title => <<"erlang_wasm">>}},
{'docs/getting-started.md', #{title => <<"Getting started">>}},
{'docs/guests.md', #{title => <<"Producing a module">>}},
{'docs/embedding.md', #{title => <<"Embedding">>}},
{'docs/host-functions.md', #{title => <<"Host functions">>}},
{'docs/wasi.md', #{title => <<"WASI">>}},
{'docs/worker.md', #{title => <<"Workers">>}},
{'docs/security.md', #{title => <<"Security">>}},
{'docs/features.md', #{title => <<"Features and conformance">>}},
{'docs/compiled-tier.md', #{title => <<"The compiled tier">>}},
{'docs/architecture.md', #{title => <<"Architecture">>}},
{'docs/adding-an-instruction.md',
#{title => <<"Adding an instruction">>}},
{'docs/design-notes.md', #{title => <<"Design notes">>}},
{'CHANGELOG.md', #{title => <<"Changelog">>}}
]},
{groups_for_extras, [
{<<"Guides">>, [<<"docs/getting-started.md">>, <<"docs/guests.md">>,
<<"docs/embedding.md">>, <<"docs/host-functions.md">>,
<<"docs/wasi.md">>, <<"docs/worker.md">>,
<<"docs/compiled-tier.md">>]},
{<<"Reference">>, [<<"docs/security.md">>, <<"docs/features.md">>,
<<"CHANGELOG.md">>]},
%% For somebody changing the runtime rather than using it. Everything
%% above answers "how do I run a module"; these answer "where does this
%% live and what will it break".
{<<"Internals">>, [<<"docs/architecture.md">>,
<<"docs/adding-an-instruction.md">>,
<<"docs/design-notes.md">>]}
]},
%% Every module belongs to a group. An ungrouped one lands in an unnamed
%% bucket at the bottom of the sidebar, which is where the compiled tier and
%% the numeric modules used to be.
{groups_for_modules, [
{<<"Embedding">>, [wasm, wasi, wasm_limits, wasm_engine]},
{<<"WASI">>, [wasi_preview1, wasi_net, wasi_sock, wasi_fs, wasi_path,
wasi_file_nif]},
{<<"Runtime">>, [wasm_instance, wasm_exec, wasm_memory, wasm_table,
wasm_global, wasm_heap, wasm_error, wasm_keeper,
wasm_wait, wasm_types, wasm_module_cache]},
{<<"Compiled tier">>, [wasm_jit, wasm_core, wasm_code_slots,
wasm_code_cache, wasm_jit_sup]},
{<<"Front end">>, [wasm_decode, wasm_decode_code, wasm_decode_simd,
wasm_decode_gc, wasm_decode_atomic, wasm_leb128,
wasm_validate, wasm_validate_code,
wasm_validate_simd, wasm_validate_atomic,
wasm_wat, wasm_wat_lex, wasm_wat_sexp,
wasm_wat_num, wasm_wat_instr, wasm_wast]},
{<<"Numerics">>, [wasm_num, wasm_num_float, wasm_num_trunc, wasm_simd]},
{<<"Supervision">>, [wasm_app, wasm_sup]}
]},
{api_reference, true}
]}.
{cover_enabled, true}.
{cover_opts, [verbose]}.
{alias, [
{check, [xref, dialyzer, {ct, "--cover"}]},
%% Not `{as, "bench"}': rebar3 rejects the `as' namespace inside an alias,
%% so the documented command failed outright and the published benchmark
%% numbers could not be reproduced. The benchmarks need the `test' profile
%% anyway, for `test/support'.
{bench, [{ct, "--suite=test/wasm_bench_SUITE,test/wasm_gc_bench_SUITE"}]}
]}.