File tree 11 files changed +55
-54
lines changed
11 files changed +55
-54
lines changed Original file line number Diff line number Diff line change @@ -13,24 +13,25 @@ set -ex
13
13
make_vendor () {
14
14
local name=$1
15
15
local packages=$2
16
+ local subdir=${3:- " wit" }
16
17
local path=" crates/$name /wit/deps"
17
18
18
19
rm -rf $path
19
20
mkdir -p $path
20
21
21
22
for package in $packages ; do
22
- IFS=' @' read -r repo tag <<< " $package"
23
- mkdir -p $path /$package
23
+ IFS=' @' read -r repo tag subdir <<< " $package"
24
+ mkdir -p " $path /$package "
24
25
cached_extracted_dir=" $cache_dir /$repo -$tag "
25
26
26
27
if [[ ! -d $cached_extracted_dir ]]; then
27
28
mkdir -p $cached_extracted_dir
28
29
curl -sL https://github.com/WebAssembly/wasi-$repo /archive/$tag .tar.gz | \
29
30
tar xzf - --strip-components=1 -C $cached_extracted_dir
30
- rm -rf $cached_extracted_dir /wit/deps*
31
+ rm -rf $cached_extracted_dir /${subdir :- " wit" } /deps*
31
32
fi
32
33
33
- cp -r $cached_extracted_dir /wit/* $path /$package
34
+ cp -r $cached_extracted_dir /${subdir :- " wit" } /* $path /$package
34
35
done
35
36
}
36
37
@@ -43,7 +44,7 @@ make_vendor "wasi" "
43
44
44
45
45
46
46
- random@3e99124
47
+ random@3e99124@wit-0.3.0-draft
47
48
"
48
49
49
50
make_vendor " wasi-http" "
@@ -54,7 +55,7 @@ make_vendor "wasi-http" "
54
55
55
56
56
57
57
- random@3e99124
58
+ random@3e99124@wit-0.3.0-draft
58
59
"
59
60
60
61
make_vendor " wasi-config" " config@f4d699b"
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 1
- package wasi : random @ 0.2.3 ;
1
+ package wasi : random @ 0.3.0 ;
2
2
/// The insecure-seed interface for seeding hash-map DoS resistance.
3
3
///
4
4
/// It is intended to be portable at least between Unix-family platforms and
5
5
/// Windows.
6
- @since(version = 0.2 .0)
6
+ @since(version = 0.3 .0)
7
7
interface insecure-seed {
8
8
/// Return a 128-bit value that may contain a pseudo-random value.
9
9
///
@@ -22,6 +22,6 @@ interface insecure-seed {
22
22
/// This will likely be changed to a value import, to prevent it from being
23
23
/// called multiple times and potentially used for purposes other than DoS
24
24
/// protection.
25
- @since(version = 0.2 .0)
25
+ @since(version = 0.3 .0)
26
26
insecure-seed : func () -> tuple <u64 , u64 >;
27
27
}
Original file line number Diff line number Diff line change 1
- package wasi : random @ 0.2.3 ;
1
+ package wasi : random @ 0.3.0 ;
2
2
/// The insecure interface for insecure pseudo-random numbers.
3
3
///
4
4
/// It is intended to be portable at least between Unix-family platforms and
5
5
/// Windows.
6
- @since(version = 0.2 .0)
6
+ @since(version = 0.3 .0)
7
7
interface insecure {
8
8
/// Return `len` insecure pseudo-random bytes.
9
9
///
@@ -13,13 +13,13 @@ interface insecure {
13
13
/// There are no requirements on the values of the returned bytes, however
14
14
/// implementations are encouraged to return evenly distributed values with
15
15
/// a long period.
16
- @since(version = 0.2 .0)
16
+ @since(version = 0.3 .0)
17
17
get-insecure-random-bytes : func (len : u64 ) -> list <u8 >;
18
18
19
19
/// Return an insecure pseudo-random `u64` value.
20
20
///
21
21
/// This function returns the same type of pseudo-random data as
22
22
/// `get-insecure-random-bytes` , represented as a `u64` .
23
- @since(version = 0.2 .0)
23
+ @since(version = 0.3 .0)
24
24
get-insecure-random-u64 : func () -> u64 ;
25
25
}
Original file line number Diff line number Diff line change 1
- package wasi : random @ 0.2.3 ;
1
+ package wasi : random @ 0.3.0 ;
2
2
/// WASI Random is a random data API.
3
3
///
4
4
/// It is intended to be portable at least between Unix-family platforms and
5
5
/// Windows.
6
- @since(version = 0.2 .0)
6
+ @since(version = 0.3 .0)
7
7
interface random {
8
8
/// Return `len` cryptographically-secure random or pseudo-random bytes.
9
9
///
@@ -17,13 +17,13 @@ interface random {
17
17
/// This function must always return fresh data. Deterministic environments
18
18
/// must omit this function, rather than implementing it with deterministic
19
19
/// data.
20
- @since(version = 0.2 .0)
20
+ @since(version = 0.3 .0)
21
21
get-random-bytes : func (len : u64 ) -> list <u8 >;
22
22
23
23
/// Return a cryptographically-secure random or pseudo-random `u64` value.
24
24
///
25
25
/// This function returns the same type of data as `get-random-bytes` ,
26
26
/// represented as a `u64` .
27
- @since(version = 0.2 .0)
27
+ @since(version = 0.3 .0)
28
28
get-random-u64 : func () -> u64 ;
29
29
}
Original file line number Diff line number Diff line change
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
+ }
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 1
- package wasi : random @ 0.2.3 ;
1
+ package wasi : random @ 0.3.0 ;
2
2
/// The insecure-seed interface for seeding hash-map DoS resistance.
3
3
///
4
4
/// It is intended to be portable at least between Unix-family platforms and
5
5
/// Windows.
6
- @since(version = 0.2 .0)
6
+ @since(version = 0.3 .0)
7
7
interface insecure-seed {
8
8
/// Return a 128-bit value that may contain a pseudo-random value.
9
9
///
@@ -22,6 +22,6 @@ interface insecure-seed {
22
22
/// This will likely be changed to a value import, to prevent it from being
23
23
/// called multiple times and potentially used for purposes other than DoS
24
24
/// protection.
25
- @since(version = 0.2 .0)
25
+ @since(version = 0.3 .0)
26
26
insecure-seed : func () -> tuple <u64 , u64 >;
27
27
}
Original file line number Diff line number Diff line change 1
- package wasi : random @ 0.2.3 ;
1
+ package wasi : random @ 0.3.0 ;
2
2
/// The insecure interface for insecure pseudo-random numbers.
3
3
///
4
4
/// It is intended to be portable at least between Unix-family platforms and
5
5
/// Windows.
6
- @since(version = 0.2 .0)
6
+ @since(version = 0.3 .0)
7
7
interface insecure {
8
8
/// Return `len` insecure pseudo-random bytes.
9
9
///
@@ -13,13 +13,13 @@ interface insecure {
13
13
/// There are no requirements on the values of the returned bytes, however
14
14
/// implementations are encouraged to return evenly distributed values with
15
15
/// a long period.
16
- @since(version = 0.2 .0)
16
+ @since(version = 0.3 .0)
17
17
get-insecure-random-bytes : func (len : u64 ) -> list <u8 >;
18
18
19
19
/// Return an insecure pseudo-random `u64` value.
20
20
///
21
21
/// This function returns the same type of pseudo-random data as
22
22
/// `get-insecure-random-bytes` , represented as a `u64` .
23
- @since(version = 0.2 .0)
23
+ @since(version = 0.3 .0)
24
24
get-insecure-random-u64 : func () -> u64 ;
25
25
}
Original file line number Diff line number Diff line change 1
- package wasi : random @ 0.2.3 ;
1
+ package wasi : random @ 0.3.0 ;
2
2
/// WASI Random is a random data API.
3
3
///
4
4
/// It is intended to be portable at least between Unix-family platforms and
5
5
/// Windows.
6
- @since(version = 0.2 .0)
6
+ @since(version = 0.3 .0)
7
7
interface random {
8
8
/// Return `len` cryptographically-secure random or pseudo-random bytes.
9
9
///
@@ -17,13 +17,13 @@ interface random {
17
17
/// This function must always return fresh data. Deterministic environments
18
18
/// must omit this function, rather than implementing it with deterministic
19
19
/// data.
20
- @since(version = 0.2 .0)
20
+ @since(version = 0.3 .0)
21
21
get-random-bytes : func (len : u64 ) -> list <u8 >;
22
22
23
23
/// Return a cryptographically-secure random or pseudo-random `u64` value.
24
24
///
25
25
/// This function returns the same type of data as `get-random-bytes` ,
26
26
/// represented as a `u64` .
27
- @since(version = 0.2 .0)
27
+ @since(version = 0.3 .0)
28
28
get-random-u64 : func () -> u64 ;
29
29
}
Original file line number Diff line number Diff line change
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
+ }
You can’t perform that action at this time.
0 commit comments