From: stephan Date: Sat, 29 Oct 2022 09:45:01 +0000 (+0000) Subject: Expand and document the wasm doc-update make rules. Extend the dist rules to fail... X-Git-Tag: version-3.40.0~64 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=df52a0bc78053ab105660bbf1aa36aa089fc688d;p=thirdparty%2Fsqlite.git Expand and document the wasm doc-update make rules. Extend the dist rules to fail more readily if there's a problem. FossilOrigin-Name: 362ec11ec09f441b745cbd8ac8366b6bc998aba6e2b70782a88f189a3ffa9923 --- diff --git a/ext/wasm/GNUmakefile b/ext/wasm/GNUmakefile index dafe430de0..5316181208 100644 --- a/ext/wasm/GNUmakefile +++ b/ext/wasm/GNUmakefile @@ -580,24 +580,35 @@ wasm-testing.exclude = sql/speedtest1.sql wasm-testing.dir = /jail/sites/wasm-testing wasm-testing.dest ?= wasm-testing:$(wasm-testing.dir) # ---------------------^^^^^^^^^^^^ ssh alias -push: +.PHONY: push-testing +push-testing: rsync -z -e ssh --ignore-times --chown=stephan:www-data --group -r \ $(patsubst %,--exclude=%,$(wasm-testing.exclude)) \ $(wasm-testing.include) $(wasm-testing.dest) - ssh wasm-testing 'cd $(wasm-testing.dir) && bash .gzip' || \ - echo "SSH failed: it's likely that stale content will be served via old gzip files." + @echo "Updating gzipped copies..."; \ + ssh wasm-testing 'cd $(wasm-testing.dir) && bash .gzip' || \ + echo "SSH failed: it's likely that stale content will be served via old gzip files." -WDOCS.home := $(wildcard ../../../wdoc) -ifneq (,$(WDOCS.home)) -WDOCS.jswasm += $(WDOCS.home)/jswasm -update-docs: +######################################################################## +# If we find a copy of the sqlite.org/wasm docs checked out, copy +# certain files over to it, noting that some need automatable edits... +WDOCS.home ?= ../../../wdoc +.PHONY: update-docs +ifneq (,$(wildcard $(WDOCS.home)/api-index.md)) +WDOCS.jswasm := $(WDOCS.home)/jswasm +update-docs: $(bin.stripccomments) $(sqlite3.js) $(sqlite3.wasm) + @echo "Copying files to the /wasm docs. Be sure to use an -Oz build for this!" cp $(sqlite3.wasm) $(WDOCS.jswasm)/. - $(bin.stripccomments) -k -k < $(sqlite3.js) > $(WDOCS.jswasm)/sqlite3.js + $(bin.stripccomments) -k -k < $(sqlite3.js) \ + | sed -e '/^[ \t]*$$/d' > $(WDOCS.jswasm)/sqlite3.js cp demo-123.js demo-123.html demo-123-worker.html $(WDOCS.home) sed -n -e '/EXTRACT_BEGIN/,/EXTRACT_END/p' \ module-symbols.html > $(WDOCS.home)/module-symbols.html - else update-docs: - @echo "Cannot find wasm docs checkout." + @echo "Cannot find wasm docs checkout."; \ + echo "Pass WDOCS.home=/path/to/wasm/docs/checkout or edit this makefile to suit."; \ + exit 127 endif +# end /wasm docs +######################################################################## diff --git a/ext/wasm/dist.make b/ext/wasm/dist.make index 13e750dbc5..5aee8af779 100644 --- a/ext/wasm/dist.make +++ b/ext/wasm/dist.make @@ -79,7 +79,8 @@ dist: \ @$(bin.stripccomments) -k -k < $(sqlite3.js) \ > $(dist-dir.jswasm)/$(notdir $(sqlite3.js)) @cp -p $(dist.common.extras) $(dist-dir.common) - @vnum=$$($(bin.version-info) --download-version); \ + @set -e; \ + vnum=$$($(bin.version-info) --download-version); \ vdir=sqlite-wasm-$$vnum; \ arczip=$$vdir.zip; \ echo "Making $$arczip ..."; \ @@ -88,6 +89,7 @@ dist: \ zip -qr $$arczip $$vdir; \ rm -fr $$vdir; \ ls -la $$arczip; \ + set +e; \ unzip -lv $$arczip || echo "Missing unzip app? Not fatal." # We need a separate `clean` rule to account for weirdness in diff --git a/ext/wasm/module-symbols.html b/ext/wasm/module-symbols.html index 450abb9327..f2170031e4 100644 --- a/ext/wasm/module-symbols.html +++ b/ext/wasm/module-symbols.html @@ -93,7 +93,7 @@
  • sqlite3 namespace
  • sqlite3.version object
  • sqlite3_...() functions
  • -
  • SQLITE_... functions
  • +
  • SQLITE_... constants
  • sqlite3.oo1