Skip to content

Commit 6366fd2

Browse files
committed
ci: add subdir support
Signed-off-by: Roman Volosatovs <[email protected]>
1 parent 6e4fa4e commit 6366fd2

File tree

11 files changed

+54
-54
lines changed

11 files changed

+54
-54
lines changed

ci/vendor-wit.sh

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,18 +19,18 @@ make_vendor() {
1919
mkdir -p $path
2020

2121
for package in $packages; do
22-
IFS='@' read -r repo tag <<< "$package"
23-
mkdir -p $path/$package
22+
IFS='@' read -r repo tag subdir <<< "$package"
23+
mkdir -p "$path/$package"
2424
cached_extracted_dir="$cache_dir/$repo-$tag"
2525

2626
if [[ ! -d $cached_extracted_dir ]]; then
2727
mkdir -p $cached_extracted_dir
2828
curl -sL https://github.com/WebAssembly/wasi-$repo/archive/$tag.tar.gz | \
2929
tar xzf - --strip-components=1 -C $cached_extracted_dir
30-
rm -rf $cached_extracted_dir/wit/deps*
30+
rm -rf $cached_extracted_dir/${subdir:-"wit"}/deps*
3131
fi
3232

33-
cp -r $cached_extracted_dir/wit/* $path/$package
33+
cp -r $cached_extracted_dir/${subdir:-"wit"}/* $path/$package
3434
done
3535
}
3636

@@ -43,7 +43,7 @@ make_vendor "wasi" "
4343
4444
4545
46-
random@3e99124
46+
random@3e99124@wit-0.3.0-draft
4747
"
4848

4949
make_vendor "wasi-http" "
@@ -54,7 +54,7 @@ make_vendor "wasi-http" "
5454
5555
5656
57-
random@3e99124
57+
random@3e99124@wit-0.3.0-draft
5858
"
5959

6060
make_vendor "wasi-config" "config@f4d699b"

crates/wasi-http/wit/deps/random@3e99124/world.wit

Lines changed: 0 additions & 13 deletions
This file was deleted.
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
package wasi:random@0.2.3;
1+
package wasi:random@0.3.0;
22
/// The insecure-seed interface for seeding hash-map DoS resistance.
33
///
44
/// It is intended to be portable at least between Unix-family platforms and
55
/// Windows.
6-
@since(version = 0.2.0)
6+
@since(version = 0.3.0)
77
interface insecure-seed {
88
/// Return a 128-bit value that may contain a pseudo-random value.
99
///
@@ -22,6 +22,6 @@ interface insecure-seed {
2222
/// This will likely be changed to a value import, to prevent it from being
2323
/// called multiple times and potentially used for purposes other than DoS
2424
/// protection.
25-
@since(version = 0.2.0)
25+
@since(version = 0.3.0)
2626
insecure-seed: func() -> tuple<u64, u64>;
2727
}
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
package wasi:random@0.2.3;
1+
package wasi:random@0.3.0;
22
/// The insecure interface for insecure pseudo-random numbers.
33
///
44
/// It is intended to be portable at least between Unix-family platforms and
55
/// Windows.
6-
@since(version = 0.2.0)
6+
@since(version = 0.3.0)
77
interface insecure {
88
/// Return `len` insecure pseudo-random bytes.
99
///
@@ -13,13 +13,13 @@ interface insecure {
1313
/// There are no requirements on the values of the returned bytes, however
1414
/// implementations are encouraged to return evenly distributed values with
1515
/// a long period.
16-
@since(version = 0.2.0)
16+
@since(version = 0.3.0)
1717
get-insecure-random-bytes: func(len: u64) -> list<u8>;
1818

1919
/// Return an insecure pseudo-random `u64` value.
2020
///
2121
/// This function returns the same type of pseudo-random data as
2222
/// `get-insecure-random-bytes`, represented as a `u64`.
23-
@since(version = 0.2.0)
23+
@since(version = 0.3.0)
2424
get-insecure-random-u64: func() -> u64;
2525
}
Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
package wasi:random@0.2.3;
1+
package wasi:random@0.3.0;
22
/// WASI Random is a random data API.
33
///
44
/// It is intended to be portable at least between Unix-family platforms and
55
/// Windows.
6-
@since(version = 0.2.0)
6+
@since(version = 0.3.0)
77
interface random {
88
/// Return `len` cryptographically-secure random or pseudo-random bytes.
99
///
@@ -17,13 +17,13 @@ interface random {
1717
/// This function must always return fresh data. Deterministic environments
1818
/// must omit this function, rather than implementing it with deterministic
1919
/// data.
20-
@since(version = 0.2.0)
20+
@since(version = 0.3.0)
2121
get-random-bytes: func(len: u64) -> list<u8>;
2222

2323
/// Return a cryptographically-secure random or pseudo-random `u64` value.
2424
///
2525
/// This function returns the same type of data as `get-random-bytes`,
2626
/// represented as a `u64`.
27-
@since(version = 0.2.0)
27+
@since(version = 0.3.0)
2828
get-random-u64: func() -> u64;
2929
}
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
package wasi:random@0.3.0;
2+
3+
@since(version = 0.3.0)
4+
world imports {
5+
@since(version = 0.3.0)
6+
import random;
7+
8+
@since(version = 0.3.0)
9+
import insecure;
10+
11+
@since(version = 0.3.0)
12+
import insecure-seed;
13+
}

crates/wasi/wit/deps/random@3e99124/world.wit

Lines changed: 0 additions & 13 deletions
This file was deleted.
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
package wasi:random@0.2.3;
1+
package wasi:random@0.3.0;
22
/// The insecure-seed interface for seeding hash-map DoS resistance.
33
///
44
/// It is intended to be portable at least between Unix-family platforms and
55
/// Windows.
6-
@since(version = 0.2.0)
6+
@since(version = 0.3.0)
77
interface insecure-seed {
88
/// Return a 128-bit value that may contain a pseudo-random value.
99
///
@@ -22,6 +22,6 @@ interface insecure-seed {
2222
/// This will likely be changed to a value import, to prevent it from being
2323
/// called multiple times and potentially used for purposes other than DoS
2424
/// protection.
25-
@since(version = 0.2.0)
25+
@since(version = 0.3.0)
2626
insecure-seed: func() -> tuple<u64, u64>;
2727
}
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
package wasi:random@0.2.3;
1+
package wasi:random@0.3.0;
22
/// The insecure interface for insecure pseudo-random numbers.
33
///
44
/// It is intended to be portable at least between Unix-family platforms and
55
/// Windows.
6-
@since(version = 0.2.0)
6+
@since(version = 0.3.0)
77
interface insecure {
88
/// Return `len` insecure pseudo-random bytes.
99
///
@@ -13,13 +13,13 @@ interface insecure {
1313
/// There are no requirements on the values of the returned bytes, however
1414
/// implementations are encouraged to return evenly distributed values with
1515
/// a long period.
16-
@since(version = 0.2.0)
16+
@since(version = 0.3.0)
1717
get-insecure-random-bytes: func(len: u64) -> list<u8>;
1818

1919
/// Return an insecure pseudo-random `u64` value.
2020
///
2121
/// This function returns the same type of pseudo-random data as
2222
/// `get-insecure-random-bytes`, represented as a `u64`.
23-
@since(version = 0.2.0)
23+
@since(version = 0.3.0)
2424
get-insecure-random-u64: func() -> u64;
2525
}
Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
package wasi:random@0.2.3;
1+
package wasi:random@0.3.0;
22
/// WASI Random is a random data API.
33
///
44
/// It is intended to be portable at least between Unix-family platforms and
55
/// Windows.
6-
@since(version = 0.2.0)
6+
@since(version = 0.3.0)
77
interface random {
88
/// Return `len` cryptographically-secure random or pseudo-random bytes.
99
///
@@ -17,13 +17,13 @@ interface random {
1717
/// This function must always return fresh data. Deterministic environments
1818
/// must omit this function, rather than implementing it with deterministic
1919
/// data.
20-
@since(version = 0.2.0)
20+
@since(version = 0.3.0)
2121
get-random-bytes: func(len: u64) -> list<u8>;
2222

2323
/// Return a cryptographically-secure random or pseudo-random `u64` value.
2424
///
2525
/// This function returns the same type of data as `get-random-bytes`,
2626
/// represented as a `u64`.
27-
@since(version = 0.2.0)
27+
@since(version = 0.3.0)
2828
get-random-u64: func() -> u64;
2929
}
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
package wasi:random@0.3.0;
2+
3+
@since(version = 0.3.0)
4+
world imports {
5+
@since(version = 0.3.0)
6+
import random;
7+
8+
@since(version = 0.3.0)
9+
import insecure;
10+
11+
@since(version = 0.3.0)
12+
import insecure-seed;
13+
}

0 commit comments

Comments
 (0)