TBR todos: improve instructions and add make check for V23_ROOT
Change-Id: Ie8c4d95fac85a8d2357da3767101c3e8b0d0f460
diff --git a/Makefile b/Makefile
index a29722d..8d49831 100644
--- a/Makefile
+++ b/Makefile
@@ -41,7 +41,7 @@
.DELETE_ON_ERROR:
# Builds mounttabled, principal, and syncbased.
-bin: $(shell $(FIND) $(V23_ROOT) -name "*.go")
+bin: $(shell $(FIND) $(V23_ROOT) -name "*.go") | env-check
v23 go build -a -o $@/mounttabled v.io/x/ref/services/mounttable/mounttabled
v23 go build -a -o $@/principal v.io/x/ref/cmd/principal
v23 go build -a -o $@/syncbased v.io/syncbase/x/ref/services/syncbase/syncbased
@@ -52,7 +52,7 @@
./bin/principal seekblessings --v23.credentials creds
touch $@
-node_modules: package.json $(shell $(FIND) $(V23_ROOT)/roadmap/javascript/syncbase/{package.json,src} $(V23_ROOT)/release/javascript/core/{package.json,src})
+node_modules: package.json $(shell $(FIND) $(V23_ROOT)/roadmap/javascript/syncbase/{package.json,src} $(V23_ROOT)/release/javascript/core/{package.json,src}) | env-check
npm prune
npm install
# Link the vanadium and syncbase modules from V23_ROOT.
@@ -89,6 +89,12 @@
serve: build
npm start
+.PHONY: env-check
+env-check:
+ifndef V23_ROOT
+ $(error V23_ROOT is not set. Please install Vanadium per the contributor instructions)
+endif
+
.PHONY: clean
clean:
rm -rf bin node_modules public/bundle.*
diff --git a/README.md b/README.md
index 1e2d33b..bdf1782 100644
--- a/README.md
+++ b/README.md
@@ -6,9 +6,13 @@
## Running the web application
+We assume you've followed the [contributor instructions][contrib] to install
+prerequisites and fetch the Vanadium repositories, and installed the Syncbase
+and Node.js profiles using `v23 profile install syncbase nodejs`. We also assume
+that you've installed the [Vanadium Chrome extension][crx].
+
The commands below assume that the current working directory is
-`$V23_ROOT/release/projects/todos` and that you've installed the [Vanadium
-Chrome extension][crx].
+`$V23_ROOT/release/projects/todos`.
First, build all necessary binaries.
@@ -152,8 +156,9 @@
Currently, parallel 100 puts takes 700ms, and scanning 100 rows takes 300ms.
[syncbase]: https://docs.google.com/document/d/12wS_IEPf8HTE7598fcmlN-Y692OWMSneoe2tvyBEpi0/edit#
-[crx]: https://v.io/tools/vanadium-chrome-extension.html
+[meteor-todos]: https://github.com/meteor/simple-todos
[requirements]: https://docs.google.com/document/d/13pbomPQu73Nug8RletnbkqXooPtKMCwPKW9cVYQi_jY/edit
+[contrib]: https://staging.v.io/community/contributing.html
+[crx]: https://v.io/tools/vanadium-chrome-extension.html
[design]: https://docs.google.com/document/d/1GtBk75QmjSorUW6T6BATCoiS_LTqOrGksgqjqJ1Hiow/edit
[demo-sync-setup]: https://docs.google.com/document/d/1174a7LIL8jnV1fN174PPV4fO74LGNLi6ODAFEp5l5Rw/edit
-[meteor-todos]: https://github.com/meteor/simple-todos
diff --git a/demo.md b/demo.md
index 2f842b1..538ff00 100644
--- a/demo.md
+++ b/demo.md
@@ -1,10 +1,23 @@
# Demo setup
This page describes how to set things up for a demo.
+
+We assume you've followed the [contributor instructions][contrib] to install
+prerequisites and fetch the Vanadium repositories, and installed the Syncbase
+and Node.js profiles using `v23 profile install syncbase nodejs`. We also assume
+that you've installed the [Vanadium Chrome extension][crx].
+
+The commands below assume that the current working directory is
+`$V23_ROOT/release/projects/todos`.
+
For detailed explanations of the app setup steps, see [README.md](README.md).
## Single-machine setup
+This setup involves a single machine running two instances of Syncbase+Webapp,
+one for Alice and one for Bob. You'll probably want to open the two Webapp
+windows side-by-side.
+
Run these commands once:
DEBUG=1 make build
@@ -25,6 +38,9 @@
## Two-machine setup
+This setup involves two machines, one for Alice and the other for Bob. Each
+machine runs one instance of Syncbase+Webapp.
+
Have Alice and Bob do the following on their respective machines.
Run these commands once:
@@ -62,3 +78,6 @@
app will use `/localhost:5001` as the mount table name, and remote peers will
not be able to contact the syncgroup. If we switch to a "predefined, global
mount table" model, this will no longer be an issue.
+
+[contrib]: https://staging.v.io/community/contributing.html
+[crx]: https://v.io/tools/vanadium-chrome-extension.html