Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,3 +0,0 @@
[submodule "vendor/wasm-spec"]
path = vendor/wasm-spec
url = https://github.com/WebAssembly/multi-value/
40 changes: 24 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,34 +48,42 @@ To build `asc.js`, the JavaScript library, use
nix-build -A js
```

If you want to install `wasm` and `dvm` binaries with nix (for example because
you maintain your Ocaml installation manually), run

```
nix-env -i -f . -A wasm
nix-env -i -f . -A dvm
```
To update the `dev` checkout and install `dvm` in one go, run `./update-dvm.sh`.

By default, `dvm` is built using the V8 engine. To build with the Haskell
engine, pass `--arg v8 false` to any of the above `nix-*` commands.

## Installation and development without Nix
## Development without Nix

You do not have to use nix:
You can get a development environment that is independent of nix (although
installing all required tools without nix is out of scope).

* Use your system’s package manager to install `ocaml` and
[`opam`](https://opam.ocaml.org/doc/Install.html)
* Install the packages listed as `OPAM_PACKAGES` in `src/Makefile`:
```
opam install num vlq yojson bisect_ppx bisect_ppx-ocamlbuild menhir
```
* Install the `wasm` package in `vendor/wasm-spec/interpreter/` by running
`make install` therein.
* Make sure `wasm` (a binary found in `vendor/wasm-spec/interpreter`) is in
the path to run the `run` tests.
* Make sure `dvm` (a binary from the `hs-dfinity-dvm` package) is in the path
to run the `run-dfinity` tests.
* Install the `wasm` package. We use a newer version than is on opam, and a
fork that supports the multi-value extension. See `nix/ocaml-wasm.nix` for
the precise repository and version. You can use `nix` to fetch the correct
source for you, and run the manual installation inside:
```
cd $(nix-build -Q -A wasm.src)
make install
```
* Install the `wasm` tool, using
```
nix-env -i -f . -A wasm
```
* Install the `dvm` tool, using
```
nix-env -i -f . -A dvm
```
or simply
```
./update-dvm.sh
```
which also updates the `dev` checkout.

## Create a coverage report

Expand Down
6 changes: 0 additions & 6 deletions nix/ocaml-wasm.nix
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,10 @@ if !stdenv.lib.versionAtLeast ocaml.version "4.02"
then throw "wasm is not available for OCaml ${ocaml.version}"
else

# Lets use fetch from git, this way nix has to cache less
# if !builtins.pathExists ../vendor/wasm-spec/interpreter
# then throw "submodule in vendor/wasm-spec missing. Run git submodule update --init"
# else

stdenv.mkDerivation rec {
name = "ocaml${ocaml.version}-wasm-${version}";
version = "1.0";

#src = ../vendor/wasm-spec;
src = fetchFromGitHub {
owner = "WebAssembly";
repo = "multi-value";
Expand Down
1 change: 0 additions & 1 deletion vendor/wasm-spec
Submodule wasm-spec deleted from fa755d