Skip to content

Commit 488f344

Browse files
author
Guy Bedford
committed
Merge remote-tracking branch 'spec/main' into rebase
2 parents e415499 + bc76fd7 commit 488f344

File tree

287 files changed

+104522
-4533
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

287 files changed

+104522
-4533
lines changed

.github/workflows/ci-interpreter.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,11 @@ name: CI for interpreter & tests
33
on:
44
push:
55
branches: [ main ]
6-
paths: [ interpreter/**, test/** ]
6+
paths: [ .github/**, interpreter/**, test/** ]
77

88
pull_request:
99
branches: [ main ]
10-
paths: [ interpreter/**, test/** ]
10+
paths: [ .github/**, interpreter/**, test/** ]
1111

1212
# Allows you to run this workflow manually from the Actions tab
1313
workflow_dispatch:
@@ -23,7 +23,7 @@ jobs:
2323
with:
2424
ocaml-compiler: 4.12.x
2525
- name: Setup OCaml tools
26-
run: opam install --yes ocamlbuild.0.14.0 ocamlfind.1.9.5 js_of_ocaml.4.0.0 js_of_ocaml-ppx.4.0.0
26+
run: opam install --yes ocamlfind.1.9.5 js_of_ocaml.4.0.0 js_of_ocaml-ppx.4.0.0
2727
- name: Setup Node.js
2828
uses: actions/setup-node@v2
2929
with:

.github/workflows/ci-spec.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,11 @@ name: CI for specs
33
on:
44
push:
55
branches: [ main ]
6-
paths: [ document/** ]
6+
paths: [ .github/**, document/** ]
77

88
pull_request:
99
branches: [ main ]
10-
paths: [ document/** ]
10+
paths: [ .github/**, document/** ]
1111

1212
# Allows you to run this workflow manually from the Actions tab
1313
workflow_dispatch:
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
name: Mirror main branch to master branch
2+
3+
on:
4+
push:
5+
branches:
6+
- 'main'
7+
8+
jobs:
9+
mirror_job:
10+
runs-on: ubuntu-latest
11+
name: Mirror main branch to master branch
12+
steps:
13+
- name: Mirror branch
14+
uses: google/[email protected]
15+
with:
16+
github-token: ${{ secrets.GITHUB_TOKEN }}
17+
source: 'main'
18+
dest: 'master'

.github/workflows/w3c-publish.yml

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
name: Publish to W3C TR space
2+
3+
on:
4+
push:
5+
branches: [ main ]
6+
paths: [ .github/**, document/** ]
7+
8+
# Allows you to run this workflow manually from the Actions tab
9+
workflow_dispatch:
10+
11+
jobs:
12+
publish-to-w3c-TR:
13+
runs-on: ubuntu-latest
14+
steps:
15+
- name: Checkout repo
16+
uses: actions/checkout@v2
17+
with:
18+
submodules: "recursive"
19+
- name: Setup Node.js
20+
uses: actions/setup-node@v3
21+
with:
22+
node-version: 16
23+
- name: Setup Bikeshed
24+
run: pip install bikeshed && bikeshed update
25+
- name: Setup TexLive
26+
run: sudo apt-get update -y && sudo apt-get install -y latexmk texlive-latex-recommended texlive-latex-extra texlive-fonts-recommended
27+
- name: Setup Sphinx
28+
run: pip install six && pip install sphinx==5.1.0
29+
- name: Publish all specs to their https://www.w3.org/TR/ URLs
30+
run: cd document && make -e WD-echidna-CI
31+
env:
32+
STATUS: --md-status=WD
33+
W3C_ECHIDNA_TOKEN_CORE: ${{ secrets.W3C_ECHIDNA_TOKEN_CORE }}
34+
W3C_ECHIDNA_TOKEN_JSAPI: ${{ secrets.W3C_ECHIDNA_TOKEN_JSAPI }}
35+
W3C_ECHIDNA_TOKEN_WEBAPI: ${{ secrets.W3C_ECHIDNA_TOKEN_WEBAPI }}
36+
YARN_ENABLE_IMMUTABLE_INSTALLS: false

Contributing.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,6 @@
33
Interested in participating? Please follow
44
[the same contributing guidelines as the design repository][].
55

6-
[the same contributing guidelines as the design repository]: https://github.com/WebAssembly/design/blob/master/Contributing.md
6+
[the same contributing guidelines as the design repository]: https://github.com/WebAssembly/design/blob/main/Contributing.md
77

88
Also, please be sure to read [the README.md](README.md) for this repository.

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
![Build Status](https://github.com/WebAssembly/spec/actions/workflows/main.yml/badge.svg)
1+
[![CI for specs](https://github.com/WebAssembly/spec/actions/workflows/ci-spec.yml/badge.svg)](https://github.com/WebAssembly/spec/actions/workflows/ci-spec.yml)
2+
[![CI for interpreter & tests](https://github.com/WebAssembly/spec/actions/workflows/ci-interpreter.yml/badge.svg)](https://github.com/WebAssembly/spec/actions/workflows/ci-interpreter.yml)
23

34
# ES Module Integration Proposal for WebAssembly
45

document/Makefile

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
1-
DIRS = core js-api web-api
1+
DIRS = js-api web-api core
22
FILES = index.html
33
BUILDDIR = _build
4+
TAR = tar
45

56
# Global targets.
67

@@ -24,6 +25,25 @@ clean: $(DIRS:%=clean-%)
2425
.PHONY: diff
2526
diff: $(DIRS:%=diff-%)
2627

28+
# macOS: do “brew install tar” & run “make” as: TAR=gtar make -e WD-tar
29+
.PHONY: WD-tar
30+
WD-tar:
31+
for dir in $(DIRS); \
32+
do STATUS=--md-status=WD TAR=$(TAR) $(MAKE) -e -C $$dir $@;\
33+
done
34+
35+
# macOS: do “brew install tar” & run “make” as: TAR=gtar make -e WD-echidna
36+
.PHONY: WD-echidna
37+
WD-echidna:
38+
for dir in $(DIRS); \
39+
do $(MAKE) -e -C $$dir $@;\
40+
done
41+
42+
.PHONY: WD-echidna-CI
43+
WD-echidna-CI:
44+
for dir in $(DIRS); \
45+
do $(MAKE) -e -C $$dir $@;\
46+
done
2747

2848
# Directory-specific targets.
2949

document/README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@
33
This directory contains the source code for the WebAssembly spec documents, as served from the [webassembly.github.io/spec](https://webassembly.github.io/spec) pages.
44
It uses [Sphinx](http://www.sphinx-doc.org/) and [Bikeshed](https://github.com/tabatkins/bikeshed).
55

6-
To install Sphinx:
6+
To install Sphinx (and required library six):
77
```
8-
pip install sphinx
8+
pip install sphinx six
99
```
1010

1111
To install Bikeshed, see the instructions [here](https://tabatkins.github.io/bikeshed/#installing).
@@ -42,7 +42,7 @@ pipenv shell
4242
Install Python dependencies:
4343

4444
```
45-
pipenv install Sphinx==3.5.2
45+
pipenv install Sphinx==4.0.0 six
4646
```
4747

4848
### Checking out the repository

document/core/Makefile

Lines changed: 40 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ BUILDDIR = _build
99
STATICDIR = _static
1010
DOWNLOADDIR = _download
1111
NAME = WebAssembly
12+
DECISION_URL = https://github.com/WebAssembly/meetings/blob/main/main/2017/WG-12-06.md
13+
TAR = tar
1214

1315
# Internal variables.
1416
PAPEROPT_a4 = -D latex_paper_size=a4
@@ -89,12 +91,14 @@ bikeshed-keep:
8991
echo Downloaded Bikeshed.
9092

9193

92-
.PHONY: index
93-
index:
94-
(cd appendix; ./gen-index-instructions.py)
94+
GENERATED = appendix/index-instructions.rst
95+
.INTERMEDIATE: $(GENERATED)
96+
97+
%.rst: %.py
98+
(cd `dirname $@`; ./`basename $^`)
9599

96100
.PHONY: pdf
97-
pdf: index latexpdf
101+
pdf: $(GENERATED) latexpdf
98102
mkdir -p $(BUILDDIR)/html/$(DOWNLOADDIR)
99103
ln -f $(BUILDDIR)/latex/$(NAME).pdf $(BUILDDIR)/html/$(DOWNLOADDIR)/$(NAME).pdf
100104

@@ -103,9 +107,10 @@ pdf: index latexpdf
103107
clean:
104108
rm -rf $(BUILDDIR)
105109
rm -rf $(STATICDIR)
110+
rm -f $(GENERATED)
106111

107112
.PHONY: html
108-
html: index
113+
html: $(GENERATED)
109114
$(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html
110115
for file in `ls $(BUILDDIR)/html/*.html`; \
111116
do \
@@ -121,28 +126,34 @@ html: index
121126
@echo "Build finished. The HTML pages are in `pwd`/$(BUILDDIR)/html/."
122127

123128
.PHONY: dirhtml
124-
dirhtml:
129+
dirhtml: $(GENERATED)
125130
$(SPHINXBUILD) -b dirhtml $(ALLSPHINXOPTS) $(BUILDDIR)/dirhtml
126131
@echo
127132
@echo "Build finished. The HTML pages are in $(BUILDDIR)/dirhtml."
128133

129134
.PHONY: singlehtml
130-
singlehtml:
135+
singlehtml: $(GENERATED)
131136
$(SPHINXBUILD) -b singlehtml $(ALLSPHINXOPTS) $(BUILDDIR)/singlehtml
132137
@echo
133138
@echo "Build finished. The HTML page is in $(BUILDDIR)/singlehtml."
134139

135140
.PHONY: bikeshed
136-
bikeshed:
141+
bikeshed: $(GENERATED)
137142
$(SPHINXBUILD) -b singlehtml -c util/bikeshed \
138143
$(ALLSPHINXOPTS) $(BUILDDIR)/bikeshed_singlehtml
139-
python util/bikeshed_fixup.py $(BUILDDIR)/bikeshed_singlehtml/index.html \
144+
python3 util/bikeshed_fixup.py $(BUILDDIR)/bikeshed_singlehtml/index.html \
140145
>$(BUILDDIR)/bikeshed_singlehtml/index_fixed.html
146+
@echo ==== Showing contents of _build/bikeshed_singlehtml/index_fixed.html ====
147+
@head -n10 _build/bikeshed_singlehtml/index_fixed.html
148+
@echo ... skipping $$(expr `cat _build/bikeshed_singlehtml/index_fixed.html | wc -l` - 20) lines ...
149+
@tail -n10 _build/bikeshed_singlehtml/index_fixed.html
150+
@echo
151+
@echo =========================================================================
141152
mkdir -p $(BUILDDIR)/bikeshed_mathjax/
142-
bikeshed spec index.bs $(BUILDDIR)/bikeshed_mathjax/index.html
153+
bikeshed spec $(STATUS) index.bs $(BUILDDIR)/bikeshed_mathjax/index.html
143154
mkdir -p $(BUILDDIR)/html/bikeshed/
144155
(cd util/katex/ && yarn && yarn build && npm install --only=prod)
145-
python util/mathjax2katex.py $(BUILDDIR)/bikeshed_mathjax/index.html \
156+
python3 util/mathjax2katex.py $(BUILDDIR)/bikeshed_mathjax/index.html \
146157
>$(BUILDDIR)/html/bikeshed/index.html
147158
mkdir -p $(BUILDDIR)/html/bikeshed/katex/dist/
148159
cp -r util/katex/dist/* $(BUILDDIR)/html/bikeshed/katex/dist/
@@ -154,9 +165,11 @@ bikeshed:
154165
@echo "Build finished. The HTML page is in $(BUILDDIR)/html/bikeshed/."
155166

156167
.PHONY: WD-tar
168+
# macOS tar has no “--transform” option (only GNU tar does), so on macOS,
169+
# do “brew install tar” & run “make” like this: “TAR=gtar make -e WD-tar”
157170
WD-tar: bikeshed
158171
@echo "Building tar file..."
159-
tar cvf \
172+
$(TAR) cvf \
160173
$(BUILDDIR)/WD.tar \
161174
--transform='s|$(BUILDDIR)/html/bikeshed/||' \
162175
--transform='s|index.html|Overview.html|' \
@@ -181,6 +194,20 @@ WD-echidna: WD-tar
181194
@echo
182195
@echo "Published working draft. Check its status at https://labs.w3.org/echidna/api/status?id=`cat $(BUILDDIR)/WD-echidna-id.txt`"
183196

197+
.PHONY: WD-echidna-CI
198+
WD-echidna-CI: WD-tar
199+
@if [ -z $(W3C_ECHIDNA_TOKEN_CORE) ] || \
200+
[ -z $(DECISION_URL) ] ; then \
201+
echo "Must provide W3C_ECHIDNA_TOKEN_CORE and DECISION_URL environment variables"; \
202+
exit 1; \
203+
fi
204+
curl 'https://labs.w3.org/echidna/api/request' \
205+
-F "tar=@$(BUILDDIR)/WD.tar" \
206+
-F "token=$(W3C_ECHIDNA_TOKEN_CORE)" \
207+
-F "decision=$(DECISION_URL)" | tee $(BUILDDIR)/WD-echidna-id.txt
208+
@echo
209+
@echo "Published working draft. Check its status at https://labs.w3.org/echidna/api/status?id=`cat $(BUILDDIR)/WD-echidna-id.txt`"
210+
184211
.PHONY: diff
185212
diff: bikeshed
186213
@echo "Downloading the old single-file html spec..."
@@ -259,7 +286,7 @@ latex:
259286
"(use \`make latexpdf' here to do that automatically)."
260287

261288
.PHONY: latexpdf
262-
latexpdf:
289+
latexpdf: $(GENERATED)
263290
$(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
264291
@echo "Running LaTeX files through pdflatex..."
265292
$(MAKE) -C $(BUILDDIR)/latex LATEXMKOPTS=" </dev/null" all-pdf >$(BUILDDIR)/latex/LOG 2>&1 || cat $(BUILDDIR)/latex/LOG

0 commit comments

Comments
 (0)