-
Notifications
You must be signed in to change notification settings - Fork 333
Expand file tree
/
Copy pathCargo.toml
More file actions
335 lines (300 loc) · 11.5 KB
/
Cargo.toml
File metadata and controls
335 lines (300 loc) · 11.5 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
[package]
name = "wasm-tools"
version = "1.247.0"
authors = ["The Wasmtime Project Developers"]
edition.workspace = true
description = "CLI tools for interoperating with WebAssembly files"
license.workspace = true
documentation = "https://github.com/bytecodealliance/wasm-tools"
categories = ["wasm"]
keywords = ["webassembly", "wasm"]
repository = "https://github.com/bytecodealliance/wasm-tools"
readme = "README.md"
exclude = ['tests/wabt', 'tests/testsuite', 'tests/snapshots', 'ci']
rust-version.workspace = true
[package.metadata.binstall]
pkg-url = "{repo}/releases/download/v{version}/{name}-{version}-{target-arch}-{target-family}{archive-suffix}"
bin-dir = "{name}-{version}-{target-arch}-{target-family}/{bin}{binary-ext}"
pkg-fmt = "tgz"
[package.metadata.binstall.overrides.x86_64-apple-darwin]
pkg-url = "{repo}/releases/download/v{version}/{name}-{version}-{target-arch}-macos{archive-suffix}"
bin-dir = "{name}-{version}-{target-arch}-macos/{bin}{binary-ext}"
[package.metadata.binstall.overrides.aarch64-apple-darwin]
pkg-url = "{repo}/releases/download/v{version}/{name}-{version}-{target-arch}-macos{archive-suffix}"
bin-dir = "{name}-{version}-{target-arch}-macos/{bin}{binary-ext}"
[package.metadata.binstall.overrides.x86_64-pc-windows-msvc]
pkg-fmt = "zip"
[package.metadata.binstall.overrides.x86_64-pc-windows-gnu]
pkg-fmt = "zip"
[lints]
workspace = true
[workspace]
members = [
'crates/c-api',
'crates/fuzz-stats',
'crates/wasm-mutate-stats',
'crates/wasm-wave',
'fuzz',
'crates/wit-encoder',
'crates/wit-parser/fuzz',
'crates/wit-component/dl',
'crates/wit-dylib/test-programs',
'playground/component',
]
[workspace.lints.rust]
unsafe_code = "deny"
# Turn on some lints which are otherwise allow-by-default in rustc.
unused_extern_crates = 'warn'
unstable_features = 'warn'
unused_import_braces = 'warn'
unused-lifetimes = 'warn'
unused-macro-rules = 'warn'
# Lints that are part of the `rust-2024-compatibility` group. This group is a
# bit too noisy to enable wholesale but some selective items are ones we want to
# opt-in to.
keyword_idents_2024 = 'warn'
unsafe-attr-outside-unsafe = 'warn'
deprecated-safe-2024 = 'warn'
rust-2024-guarded-string-incompatible-syntax = 'warn'
rust-2024-prelude-collisions = 'warn'
rust-2024-incompatible-pat = 'warn'
missing-unsafe-on-extern = 'warn'
unsafe-op-in-unsafe-fn = 'warn'
unexpected_cfgs = { level = 'warn', check-cfg = ['cfg(fuzzing)', 'cfg(debug_check_try_op)'] }
[workspace.lints.clippy]
# The default set of lints in Clippy is viewed as "too noisy" right now so
# they're all turned off by default. Selective lints are then enabled below as
# necessary.
all = { level = 'allow', priority = -1 }
clone_on_copy = 'warn'
map_clone = 'warn'
unnecessary_to_owned = 'warn'
manual_strip = 'warn'
uninlined_format_args = 'warn'
unnecessary_mut_passed = 'warn'
unnecessary_fallible_conversions = 'warn'
unnecessary_cast = 'warn'
# TODO: find time to re-enable this
# allow_attributes_without_reason = 'warn'
[workspace.package]
edition = '2024'
license = "Apache-2.0 WITH LLVM-exception OR Apache-2.0 OR MIT"
version = "0.247.0"
# Current thinking for wasm-tools is that the minimum supported Rust version
# (MSRV), or this number here, is no larger than the current stable release of
# Rust minus 10. This is more conservative than Wasmtime's policy which is
# stable minus two and is due to the nature of this repository and how the
# crates are expected to be used in more situations and places than Wasmtime.
#
# Note that this number is not proactively updated whenever a new release of
# Rust comes out. Instead if you run into this, for example a PR on CI is
# failing due to needing a newer feature of Rust, you're welcome to update this
# at any time so longer that it's no greater than the current release of Rust
# minus 10.
#
# If this window is too restrictive please leave a comment on your PR or send a
# message to wasm-tools maintainers to discuss. In some cases it's possible to
# add version detection to build scripts but in other cases this may not be
# reasonable to expect.
rust-version = "1.85.0"
[workspace.dependencies]
ahash = { version = "0.8.11", default-features = false }
anyhow = { version = "1.0.58", default-features = false }
arbitrary = "1.1.0"
bitflags = "2.5.0"
bytesize = "2.0.0"
clap = { version = "4.0.0", features = ["derive"] }
clap_complete = "4.4.7"
comfy-table = { version = "7.1.3", default-features = false }
criterion = { version = "0.7.0", default-features = false }
env_logger = "0.11"
gimli = "0.32.0"
hashbrown = { version = "0.17.0", default-features = false, features = ['default-hasher'] }
id-arena = { version = "2.3.0", default-features = false }
indexmap = { version = "2.14.0", default-features = false }
indoc = "2.0.5"
leb128fmt = { version = "0.1.0", default-features = false }
libfuzzer-sys = "0.4.0"
libtest-mimic = "0.8.1"
log = "0.4.17"
num_cpus = "1.13"
pretty_assertions = "1.3.0"
rand = "0.10.1"
rayon = "1.3"
semver = { version = "1.0.0", default-features = false }
serde = { version = "1.0.166", default-features = false, features = ['alloc'] }
serde_derive = "1.0.166"
serde_json = { version = "1" }
smallvec = "1.11.1"
spdx = "0.13.4"
termcolor = "1.2.0"
url = "2.0.0"
wasmtime = { version = "36.0.7", default-features = false, features = ['cranelift', 'component-model', 'runtime', 'gc-drc'] }
thiserror = { version = "2.0.12", default-features = false }
tempfile = "3.2.0"
wit-bindgen = { git = 'https://github.com/bytecodealliance/wit-bindgen', default-features = false }
wasm-compose = { version = "0.247.0", path = "crates/wasm-compose", default-features = false }
wasm-encoder = { version = "0.247.0", path = "crates/wasm-encoder", default-features = false }
wasm-metadata = { version = "0.247.0", path = "crates/wasm-metadata", default-features = false }
wasm-mutate = { version = "0.247.0", path = "crates/wasm-mutate" }
wasm-shrink = { version = "0.247.0", path = "crates/wasm-shrink" }
wasm-smith = { version = "0.247.0", path = "crates/wasm-smith" }
wasmparser = { version = "0.247.0", path = "crates/wasmparser", default-features = false, features = ['simd'] }
wasmprinter = { version = "0.247.0", path = "crates/wasmprinter", default-features = false }
wast = { version = "247.0.0", path = "crates/wast", default-features = false }
wat = { version = "1.247.0", path = "crates/wat", default-features = false }
wit-component = { version = "0.247.0", path = "crates/wit-component" }
wit-encoder = { version = "0.247.0", path = "crates/wit-encoder" }
wit-parser = { version = "0.247.0", path = "crates/wit-parser" }
wit-smith = { version = "0.247.0", path = "crates/wit-smith" }
json-from-wast = { version = "0.247.0", path = "crates/json-from-wast" }
wit-dylib = { version = "0.247.0", path = "crates/wit-dylib" }
[dependencies]
anyhow = { workspace = true }
clap = { workspace = true, features = ['wrap_help'] }
clap_complete = { workspace = true, optional = true }
comfy-table = { workspace = true }
env_logger = { workspace = true }
log = { workspace = true }
tempfile = { workspace = true }
termcolor = { workspace = true }
wasmparser = { workspace = true, features = ['std', 'component-model', 'simd'] }
wat = { workspace = true, features = ['dwarf', 'component-model'] }
# Dependencies of `validate`
bitflags = { workspace = true, optional = true }
rayon = { workspace = true, optional = true }
# Dependencies of `print`
wasmprinter = { workspace = true, features = ['component-model', 'validate'] }
# Dependencies of `smith`
arbitrary = { workspace = true, optional = true }
serde = { workspace = true, optional = true }
serde_derive = { workspace = true, optional = true }
serde_json = { workspace = true, optional = true }
wasm-smith = { workspace = true, features = ["_internal_cli", "wasmparser"], optional = true }
# Dependencies of `shrink`
wasm-shrink = { workspace = true, features = ["clap"], optional = true }
# Dependencies of `mutate`
wasm-mutate = { workspace = true, features = ["clap"], optional = true }
# Dependencies of `strip`
regex = { version = "1.6.0", optional = true }
wasm-encoder = { workspace = true, features = ["std"], optional = true }
# Dependencies of `compose`
wasm-compose = { workspace = true, optional = true, features = ['default'] }
# Dependencies of `demangle`
cpp_demangle = { version = "0.5.1", optional = true }
rustc-demangle = { version = "0.1.21", optional = true }
# Dependencies of `component`
wast = { workspace = true, optional = true, features = ['wasm-module', 'component-model'] }
wit-component = { workspace = true, optional = true, features = ['dummy-module', 'wat', 'semver-check'] }
wit-encoder = { workspace = true, optional = true }
wit-parser = { workspace = true, optional = true, features = ['decoding', 'wat', 'serde'] }
# Dependencies of `metadata`
wasm-metadata = { workspace = true, features = ["clap", "default"], optional = true }
bytesize = { workspace = true }
# Dependencies of `wit-smith`
wit-smith = { workspace = true, features = ["clap"], optional = true }
# Dependencies of `addr2line`
addr2line = { version = "0.25.0", optional = true }
gimli = { workspace = true, optional = true }
# Dependencies of `wast`
pretty_assertions = { workspace = true, optional = true }
# Dependencies of `json-from-wast`
json-from-wast = { workspace = true, optional = true }
# Dependencies of `wit-dylib`
wit-dylib = { workspace = true, optional = true }
[target.'cfg(not(target_family = "wasm"))'.dependencies]
is_executable = { version = "1.0.1", optional = true }
[dev-dependencies]
indexmap = { workspace = true }
libtest-mimic = { workspace = true }
pretty_assertions = { workspace = true }
serde_json = "1.0"
tempfile = { workspace = true }
wast = { workspace = true }
arbitrary = { workspace = true }
wasm-smith = { workspace = true }
[[test]]
name = "cli"
harness = false
[features]
# By default, all subcommands are built
default = [
'shrink',
'smith',
'mutate',
'validate',
'print',
'parse',
'dump',
'objdump',
'strip',
'compose',
'demangle',
'component',
'metadata',
'wit-smith',
'addr2line',
'completion',
'json-from-wast',
'wast',
'wit-dylib',
]
# Each subcommand is gated behind a feature and lists the dependencies it needs
validate = [
'rayon',
'dep:addr2line',
'dep:gimli',
'dep:bitflags',
'wasmparser/validate',
'wasmparser/features',
]
print = []
parse = []
smith = ['wasm-smith', 'arbitrary', 'dep:serde', 'dep:serde_derive', 'dep:serde_json']
shrink = ['wasm-shrink', 'is_executable']
mutate = ['wasm-mutate']
dump = []
objdump = []
strip = ['wasm-encoder', 'regex']
compose = ['wasm-compose']
demangle = ['rustc-demangle', 'cpp_demangle', 'wasm-encoder']
component = [
'wit-component',
'wit-encoder',
'wit-parser',
'dep:wast',
'wasm-encoder',
'dep:serde_json',
]
metadata = ['wasm-metadata', 'dep:serde_json']
wit-smith = ['dep:wit-smith', 'arbitrary']
addr2line = ['dep:addr2line', 'dep:gimli']
completion = ['dep:clap_complete']
json-from-wast = ['dep:json-from-wast', 'dep:wast', 'dep:serde_json']
wast = [
'dep:wast',
'wast/component-model',
'wasm-encoder/wasmparser',
'dep:pretty_assertions',
'validate',
# These subcommands are executed from `wasm-tools wast` so make sure they're
# built-in if this is enabled.
'dump',
'json-from-wast',
]
wit-dylib = ['dep:wit-dylib', 'wit-dylib/clap', 'wit-parser', 'wit-component']
# https://github.com/crate-ci/typos/blob/master/docs/reference.md
[workspace.metadata.typos.default]
extend-ignore-re = [
"(\\d\\w{2,}|\\w{2,}\\d)", # possible hex encoding
]
extend-ignore-words-re = [
'^[a-zA-Z]{1,2}$' # ignore words up to length 2
]
[workspace.metadata.typos.default.extend-words]
# Data Source
datas = "datas"
# type shorthand
tpe = "tpe"
# greater or equal signed
ges = "ges"