-
Notifications
You must be signed in to change notification settings - Fork 19
Expand file tree
/
Copy pathCargo.toml
More file actions
310 lines (287 loc) · 13.5 KB
/
Copy pathCargo.toml
File metadata and controls
310 lines (287 loc) · 13.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
[workspace.package]
version = "0.0.2"
edition = "2024"
license = "MIT"
repository = "https://github.com/youknowone/pyre"
homepage = "https://github.com/youknowone/pyre"
[workspace]
resolver = "2"
default-members = ["pyre/pyrex"]
members = [
# majit
"majit/majit",
"majit/majit-ir",
"majit/majit-trace",
"majit/majit-backend",
"majit/majit-backend-cranelift",
"majit/majit-backend-dynasm",
"majit/majit-backend-wasm",
"majit/majit-gc",
"majit/majit-macros",
"majit/majit-metainterp",
"majit/majit-rlib",
"majit/majit-translate",
"majit/majit-charon-reader",
"majit/examples/tlr",
"majit/examples/tl",
"majit/examples/tla",
"majit/examples/tiny2",
"majit/examples/tiny3",
"majit/examples/tinyframe",
"majit/examples/braininterp",
"majit/examples/dualtape",
"majit/examples/tlc",
"majit/examples/calc",
"majit/examples/i64env",
"majit/examples/cel",
"majit/examples/spcount",
"majit/examples/regex",
# pyre
"pyre/pyre-object",
"pyre/pyre-macros",
"pyre/pyre-native",
"pyre/pyre-interpreter",
"pyre/pyre-sandbox",
"pyre/pyre-module",
"pyre/pyre-jit",
"pyre/pyre-jit-trace",
"pyre/pyrex",
"pyre/pyre-wasm",
"pyre/pyre-wasm-test",
"pyre/pyre-wasm-runner",
]
[workspace.dependencies]
# pyre internal crates
pyre-object = { version = "0.0.2", path = "pyre/pyre-object" }
pyre-macros = { version = "0.0.2", path = "pyre/pyre-macros" }
pyre-native = { version = "0.0.2", path = "pyre/pyre-native", default-features = false }
pyre-interpreter = { version = "0.0.2", path = "pyre/pyre-interpreter" }
pyre-sandbox = { version = "0.0.2", path = "pyre/pyre-sandbox" }
pyre-module = { version = "0.0.2", path = "pyre/pyre-module" }
pyre-jit = { version = "0.0.2", path = "pyre/pyre-jit" }
# Defaults off so `pyre-jit` forwards `dynasm` / `cranelift` / `prepass` one by
# one and its LLBC extraction pass can leave `prepass` out (see that manifest).
pyre-jit-trace = { version = "0.0.2", path = "pyre/pyre-jit-trace", default-features = false }
pyre-wasm = { version = "0.0.2", path = "pyre/pyre-wasm" }
pyrex = { version = "0.0.2", path = "pyre/pyrex" }
# Pinned to upstream main after the pyre compatibility fixes from #8390 and
# #8506, the memoryview fixes from #8553, the runtime marshal code-byte hook
# from #8552, the `Constants` mutable-access impls from #8557, and the compiler
# parity fixes from #8550 and the posixsubprocess setgroups fix from #8609 were
# merged. `fix_code_filenames` needs `IndexMut`
# to edit nested code constants in place, and `loads` relies on the #8552 hook
# to preserve invalid code bytes, so this pin must not move below either.
#
# Moved up again for the console read-boundary fix from #8621, and now also
# names `MarshalError::DataTooShort` / `EofObject` and `CFormatType::Bytes`,
# which arrived with it.
#
# Pinned to the merge of RustPython #8631 for the feature-gated,
# VM-independent zlib stream engine shared by rustpython-stdlib and pyre-native.
#
rustpython-common = { git = "https://github.com/youknowone/RustPython.git", rev = "294ba6ba8f6205f6857eea74712ec8e943f95326", features = ["binascii", "cjk-codecs", "inet", "json", "zlib"] }
rustpython-literal = { git = "https://github.com/youknowone/RustPython.git", rev = "294ba6ba8f6205f6857eea74712ec8e943f95326" }
rustpython-compiler = { git = "https://github.com/youknowone/RustPython.git", rev = "294ba6ba8f6205f6857eea74712ec8e943f95326" }
rustpython-compiler-core = { git = "https://github.com/youknowone/RustPython.git", rev = "294ba6ba8f6205f6857eea74712ec8e943f95326" }
ruff-text-size = { package = "rustpython-ruff_text_size", git = "https://github.com/RustPython/ruff.git", tag = "0.15.19-rustpython" }
num-complex = "0.4"
rustpython-host_env = { git = "https://github.com/youknowone/RustPython.git", rev = "294ba6ba8f6205f6857eea74712ec8e943f95326" }
rustpython-wtf8 = { git = "https://github.com/youknowone/RustPython.git", rev = "294ba6ba8f6205f6857eea74712ec8e943f95326" }
rustpython-unicode = { git = "https://github.com/youknowone/RustPython.git", rev = "294ba6ba8f6205f6857eea74712ec8e943f95326" }
sre-engine = { package = "rustpython-sre_engine", git = "https://github.com/youknowone/RustPython.git", rev = "294ba6ba8f6205f6857eea74712ec8e943f95326" }
# majit JIT framework
majit = { version = "0.0.2", path = "majit/majit" }
# Defaults off although that manifest declares none: backend selection there is
# mandatory, so a `default` added to it later would otherwise arrive through
# every inheriting edge at once instead of being named per consumer.
majit-metainterp = { version = "0.0.2", path = "majit/majit-metainterp", default-features = false }
majit-ir = { version = "0.0.2", path = "majit/majit-ir" }
majit-trace = { version = "0.0.2", path = "majit/majit-trace" }
majit-backend = { version = "0.0.2", path = "majit/majit-backend" }
majit-backend-cranelift = { version = "0.0.2", path = "majit/majit-backend-cranelift" }
majit-backend-dynasm = { version = "0.0.2", path = "majit/majit-backend-dynasm" }
majit-backend-wasm = { version = "0.0.2", path = "majit/majit-backend-wasm" }
majit-gc = { version = "0.0.2", path = "majit/majit-gc" }
majit-macros = { version = "0.0.2", path = "majit/majit-macros" }
majit-rlib = { version = "0.0.2", path = "majit/majit-rlib" }
majit-translate = { version = "0.0.2", path = "majit/majit-translate" }
majit-charon-reader = { version = "0.0.2", path = "majit/majit-charon-reader" }
# shared dependencies
parking_lot = "0.12"
malachite-bigint = "0.11"
num-traits = "0.2"
num-integer = "0.1"
bit-set = "0.10"
bitflags = "2"
vecset = "0.0.4"
vecmap_rs = { package = "vecmap-rs", version = "0.2.4", features = ["serde"] }
indexmap = { version = "2.14", features = ["serde"] }
paste = "1"
# serde
serde = { version = "1", features = ["derive"] }
serde_json = { version = "1", features = ["raw_value"] }
bincode = "1.3"
# proc-macro / codegen
syn = { version = "2", features = ["full", "visit"] }
quote = "1"
proc-macro2 = "1"
# data structures
smallvec = "1"
# link-section distributed slice: `#[pyre_class]` appends each type's GC
# descriptor to a whole-program slice the JIT driver checks for completeness.
linkme = "0.3"
ctor = "1"
# cranelift backend
cranelift-codegen = "0.134"
cranelift-frontend = "0.134"
cranelift-jit = "0.134"
cranelift-module = "0.134"
cranelift-native = "0.134"
target-lexicon = "0.13"
region = "3"
# dynasm backend
dynasm = "5"
dynasmrt = "5"
# wasm
wasm-encoder = { version = "0.245", default-features = false }
wasm-bindgen = "0.2"
wasmparser = "0.225"
# `wasm_js` is enabled only by `pyre-wasm`'s `web` feature (browser crypto via
# wasm-bindgen). The native-host `wasm-host` build instead selects getrandom's
# `custom` backend (`--cfg getrandom_backend="custom"`) so it carries no
# wasm-bindgen imports. Kept on the same 0.4 line as `rustpython-host_env` so
# the `web` build's `getrandom/wasm_js` feature reaches that shared instance.
getrandom = "0.4.2"
# Native host runtime for the wasm runner. Pinned to the wasmtime release whose
# `wasmtime-internal-*` support crates already ride along with cranelift 0.134
# (the version the dynasm/cranelift backends use), so it reuses the existing
# cranelift rather than duplicating it.
wasmtime = "47"
# system
libc = "0.2"
stacker = "0.1"
# string / hash
siphasher = "1.0"
rustc-hash = "2.1.3"
md-5 = "0.10"
sha1 = "0.10"
sha2 = "0.10"
sha3 = "0.10"
blake2b_simd = { version = "1.0.4" }
blake2s_simd = { version = "1.0.4" }
scrypt = { version = "0.11", default-features = false }
# bzip2 backend (pyre-native only): the crate's default feature selects
# libbz2-rs-sys, the pure-Rust libbz2 port from the same source as zlib-rs,
# whose output is byte-identical to the reference C libbz2.
bzip2 = "0.6.1"
# liblzma backend (pyre-native only): xz-core is the pure-Rust port of
# liblzma, with the same entry points `Modules/_lzmamodule.c` calls, so
# `_lzma` needs no C toolchain and builds for wasm32 like the others.
xz-core = "0.1.0-rc.0"
# TLS backend (pyre-native only). The interpreter sees opaque, non-inlined
# entry points so rustls and its crypto provider stay outside Charon/LLBC.
# `prefer-post-quantum` is named because defaults are off, and it is the only
# thing that puts X25519MLKEM768 first in `DEFAULT_KX_GROUPS` instead of last;
# `_ssl` installs that provider process-wide and hands the list to every
# handshake that does not call `set_ecdh_curve`, so last means a server
# supporting both picks the classical group every time. `logging` stays off:
# it only feeds the `log` crate, which nothing here consumes.
rustls = { version = "0.23.39", default-features = false, features = ["std", "tls12", "aws_lc_rs", "prefer-post-quantum"] }
rustls-webpki = { version = "0.103.5", default-features = false, features = ["alloc"] }
rustls-pemfile = "2.2"
x509-parser = "0.18"
pem-rfc7468 = { version = "1", features = ["alloc"] }
der = { version = "0.8", features = ["alloc", "pem"] }
pkcs8 = { version = "0.11", features = ["encryption", "pkcs5", "pem"] }
rustls-native-certs = "0.8"
# math. The bigint arm stays off: `math.factorial` and its siblings are
# implemented here on `RBigInt`, so enabling it would only pull a second
# `malachite-bigint` major into the graph beside the one the compiler
# constants use.
pymath = "0.2.0"
# cli
lexopt = "0.3"
dirs = "6"
rustyline = "17"
# dev / build
tempfile = "3"
walkdir = "2"
insta = "1"
# xz-core 0.1.0-rc.0 files its `lzma12_optmap` static initializer in the MSVC
# `.CRT$XIB` group. `_initterm_e` walks that table as `int (__cdecl *)(void)`
# and `__scrt_common_main_seh` returns 255 when an entry reports non-zero, but
# the initializer's Rust signature returns `()`, so nothing defines the value
# that is read. Every pyre invocation on windows-latest exited 255 with empty
# stdout and stderr. The fork moves the table to `.CRT$XCU`, which `_initterm`
# walks as `_PVFV` and whose result is discarded; the change is
# simnalamburt/xz-rs#20 and this pin drops when it is released.
#
# A second defect lives at this rev and is worth fixing before the pin drops:
# `alone_decoder.rs` validates a picky LZMA-alone dictionary size by smearing
# `dict_size - 1` down and then adding 1 back. When the smear saturates to
# `0xFFFF_FFFF` — `dict_size == 0` is the reachable case — that `+ 1` is an
# overflow. The C it ports from wraps, and so does a release build, but a
# DEBUG build panics "attempt to add with overflow", which takes the whole
# process down: `test.test_tarfile` dies before its first Lzma test on a debug
# `pyre`, identically with the JIT on and off, and so do any tarfile classes
# whose module setup builds an lzma archive. Release CI never sees it. The
# fix is to spell the add as wrapping, matching the surrounding ported
# arithmetic.
[patch.crates-io]
xz-core = { git = "https://github.com/youknowone/xz-rs-simnalamburt", rev = "9c5cc27154e90b48348f713e28ab02bb2c5b52b4" }
# `cargo run --release` is the benchmark/developer performance surface too.
# Give it the same cross-crate optimization used by distributable binaries;
# codegen-units=1 additionally lets LLVM optimize the interpreter's large
# dispatch/call graph as one unit instead of preserving parallel-CGU barriers.
[profile.dev]
# Line tables instead of full DWARF. Panic backtraces keep their file and line
# numbers, which is what every crash report in this project is read from; what
# goes away is the variable and type description a debugger would use to print
# locals. Full debuginfo costs both link time and a great deal of disk: one
# worktree's `target/debug/deps` measured 50 GB, and a machine hosting a dozen
# worktrees of this workspace carries that a dozen times over.
#
# `debug-assertions` is a separate setting and is untouched, so every
# `debug_assert!` and every `cfg(debug_assertions)` arm still compiles in.
# The LLBC extraction is the one dev-profile build that turns it off, because
# the image it produces describes the release interpreter the JIT accompanies
# (`scripts/llbc_extract.py`, `CARGO_PROFILE_DEV_DEBUG_ASSERTIONS`).
#
# For a debugger session, ask for it on the command line instead of editing
# this: `CARGO_PROFILE_DEV_DEBUG=2 cargo build`.
debug = "line-tables-only"
# The LLBC artefacts the `majit-translate` integration tests read are large --
# `pyre-interpreter.ullbc` alone is around 800 MB of JSON -- and at the dev
# profile's `opt-level = 0` the two passes `Llbc::from_slice` makes over those
# bytes dominate the whole `cargo test` run: six of the 166 test binaries spend
# 211s of its 268s of test time. Optimizing the three crates that do that work
# leaves the tests themselves unoptimized, so a failing assertion still reports
# from line-table debuginfo with `debug_assertions` on.
#
# Measured over the same 166 binaries: those six go 211s -> 42s and the whole
# run 268s -> 97s. The compile side barely moves -- a clean `cargo build -p
# majit-translate --tests` measured 92s at `opt-level = 0`, 87s at 1 and 104s
# at 2, because the front end rather than codegen is what that crate spends its
# build on.
[profile.dev.package.serde_json]
opt-level = 2
[profile.dev.package.majit-charon-reader]
opt-level = 2
[profile.dev.package.majit-translate]
opt-level = 2
[profile.release]
lto = "thin"
codegen-units = 1
# The profile that 'dist' will build with
[profile.dist]
inherits = "release"
lto = "thin"
# The `pyre-jit-trace` build script runs the whole RPython-style translation
# pipeline (flowspace → annotator → rtyper → codewriter) over the interpreter.
# Cargo's default build-override profile compiles it at `opt-level = 0`, so that
# analysis — the single longest and most memory-hungry step of a cold build —
# runs unoptimized.
[profile.release.build-override]
opt-level = 1
[profile.dev.build-override]
opt-level = 1