File tree Expand file tree Collapse file tree 5 files changed +31
-5
lines changed Expand file tree Collapse file tree 5 files changed +31
-5
lines changed Original file line number Diff line number Diff line change 3
3
# See https://x.com/Brooooook_lyn/status/1895848334692401270
4
4
[target .'cfg(target_env = "gnu")' ]
5
5
rustflags = [" -C" , " link-args=-Wl,-z,nodelete" ]
6
+
7
+ [target .wasm32-wasip1-threads ]
8
+ rustflags = [" -Clink-args=-zstack-size=64000000 --max-memory=4294967296" ]
Original file line number Diff line number Diff line change 61
61
files : .
62
62
63
63
wasm32-wasip1 :
64
- name : Check wasm32-wasip1
64
+ name : Test wasm32-wasip1
65
65
runs-on : ubuntu-latest
66
66
steps :
67
67
- uses : taiki-e/checkout-action@b13d20b7cda4e2f325ef19895128f7ff735c0b3d # v1.3.1
@@ -70,11 +70,17 @@ jobs:
70
70
with :
71
71
cache-key : wasm32-wasip1
72
72
save-cache : ${{ github.ref_name == 'main' }}
73
+ tools : wasmtime
73
74
74
- - name : Check
75
- run : |
76
- rustup target add wasm32-wasip1
77
- cargo check --all-features --target wasm32-wasip1
75
+ - uses : ./.github/actions/pnpm
76
+
77
+ - name : Install target
78
+ run : rustup target add wasm32-wasip1
79
+
80
+ - name : Test
81
+ run : cargo test --target wasm32-wasip1 --profile wasm-test -- --nocapture
82
+ env :
83
+ CARGO_TARGET_WASM32_WASIP1_RUNNER : " wasmtime run -W bulk-memory=y --dir ${{ github.workspace }}::/ --"
78
84
79
85
wasm32-unknown-unknown :
80
86
name : Check wasm32-unknown-unknown
@@ -102,6 +108,7 @@ jobs:
102
108
with :
103
109
cache-key : wasi
104
110
save-cache : ${{ github.ref_name == 'main' }}
111
+ tools : wasmtime
105
112
106
113
- uses : ./.github/actions/pnpm
107
114
@@ -115,4 +122,9 @@ jobs:
115
122
env :
116
123
WASI_TEST : 1
117
124
125
+ - name : Cargo Test
126
+ run : cargo test --target wasm32-wasip1-threads --profile wasm-test -- --nocapture
127
+ env :
128
+ CARGO_TARGET_WASM32_WASIP1_THREADS_RUNNER : " wasmtime run -W bulk-memory=y -W threads=y -S threads=y --dir ${{ github.workspace }}::/ --"
129
+
118
130
- run : git diff --exit-code # Must commit index.d.ts
Original file line number Diff line number Diff line change @@ -133,6 +133,11 @@ debug = false
133
133
# and we don't rely on it for debugging that much.
134
134
debug = false
135
135
136
+ [profile .wasm-test ]
137
+ inherits = " test"
138
+ debug = true
139
+ opt-level = " z" # Avoid too many locals errors during wasmtime testing
140
+
136
141
[package .metadata .docs .rs ]
137
142
all-features = true
138
143
rustdoc-args = [" --cfg" , " docsrs" ]
Original file line number Diff line number Diff line change @@ -43,6 +43,7 @@ pub fn fixture() -> PathBuf {
43
43
}
44
44
45
45
#[ test]
46
+ #[ cfg_attr( target_os = "wasi" , ignore) ]
46
47
fn threaded_environment ( ) {
47
48
let cwd = env:: current_dir ( ) . unwrap ( ) ;
48
49
let resolver = Arc :: new ( Resolver :: default ( ) ) ;
Original file line number Diff line number Diff line change @@ -31,6 +31,10 @@ fn symlink<P: AsRef<Path>, Q: AsRef<Path>>(
31
31
FileType :: File => std:: os:: windows:: fs:: symlink_file ( original. as_ref ( ) . normalize ( ) , link) ,
32
32
FileType :: Dir => std:: os:: windows:: fs:: symlink_dir ( original. as_ref ( ) . normalize ( ) , link) ,
33
33
}
34
+ #[ cfg( target_family = "wasm" ) ]
35
+ {
36
+ Err ( io:: Error :: new ( io:: ErrorKind :: Other , "not supported" ) )
37
+ }
34
38
}
35
39
36
40
fn init ( dirname : & Path , temp_path : & Path ) -> io:: Result < ( ) > {
@@ -119,6 +123,7 @@ fn prepare_symlinks<P: AsRef<Path>>(
119
123
}
120
124
121
125
#[ test]
126
+ #[ cfg_attr( target_family = "wasm" , ignore) ]
122
127
fn test ( ) {
123
128
let Some ( SymlinkFixturePaths { root, temp_path } ) = prepare_symlinks ( "temp" ) . unwrap ( ) else {
124
129
return ;
You can’t perform that action at this time.
0 commit comments