Debian Codegraph @

third_party/rust/wasi/ci/vendor-wit.sh

raw
1 #!/usr/bin/env bash
2
3 # Script to re-vendor the WIT files that wasi-rs uses as defined by a
4 # particular tag in upstream repositories.
5 #
6 # This script is executed on CI to ensure that everything is up-to-date.
7 set -ex
8
9 # Space-separated list of wasi proposals that are vendored here along with the
10 # tag that they're all vendored at.
11 #
12 # This assumes that the repositories all have the pattern:
13 # https://github.com/WebAssembly/wasi-$repo
14 # and every repository has a tag `v$tag` here. That is currently done as part
15 # of the WASI release process.
16 repos="cli clocks filesystem http io random sockets"
17 tag=0.2.4
18 dst=wit/deps
19
20 rm -rf $dst
21 mkdir -p $dst
22
23 for repo in $repos; do
24 mkdir $dst/$repo
25 curl -L https://github.com/WebAssembly/wasi-$repo/archive/refs/tags/v$tag.tar.gz | \
26 tar xzf - --strip-components=2 -C $dst/$repo wasi-$repo-$tag/wit
27 rm -rf $dst/$repo/deps*
28 done