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
[]
= "zdc-runtime"
= true
= true
= true
= true
= true
= true
# Published so `cargo install zdc-cli` works: the binary is one compiler, but
# reaching it from crates.io means every crate it links is on crates.io too.
# Path dependencies therefore carry a version as well as a path — the path is
# what a workspace build uses, the version is what a published build resolves.
# Dev-dependencies stay path-only on purpose: cargo omits a version-less
# dev-dependency from the published manifest, which is what lets the test-only
# edges between these crates form cycles the publish order does not have to
# break.
= "Embeds the ZDeceptron JavaScript runtime and evaluates it without an external toolchain."
[]
# On by default, so every existing consumer — `zdc-cli`, `zdc-dev`,
# `zdc-host`, `zdc-codegen`'s build-time evaluator — keeps the crate it
# already had without saying anything.
= ["evaluate"]
# The half of this crate that *runs* JavaScript, as opposed to the half
# that merely holds it.
#
# The split is not a preference; it is the one thing standing between this
# workspace and a `wasm32-unknown-unknown` build (#171). `boa_engine` pulls
# `rand` -> `rand_core` -> `getrandom`, and `getrandom` 0.3 refuses to
# compile for `wasm32-unknown-unknown` unless the embedder opts into a
# JavaScript entropy backend with a `--cfg` flag. So the whole front end
# — lexer, parser, resolve, graph, types, codegen — was unbuildable for the
# browser because of one transitive dependency of a feature the browser has
# no use for: a JavaScript interpreter, inside a JavaScript engine.
#
# Turning it off leaves the embedded runtime sources, `Provided` and
# `Capability` — data and signatures, no engine — which is exactly what
# `zdc-codegen` needs to emit a bundle. What it costs is `Sandbox`, and
# therefore build-time evaluation of `static` state; a consumer that drops
# this feature is choosing to be a compiler that cannot run the fourth
# placement, and `zdc-codegen`'s own `evaluate` feature is where that
# consequence is spelled out.
#
# **What `--no-default-features` covers, exactly.** The library, and the
# unit tests, which are gated on this feature one by one so that
# `cargo test --no-default-features` runs the ones covering the half that
# remains rather than compiling nothing and calling it a pass. It does
# **not** build this crate's eight integration tests, and that is not an
# oversight: all eight evaluate JavaScript — that is what a runtime test
# is — so with no engine there is nothing for any of them to assert.
# `required-features` on every target in the directory would be a manifest
# stanza per file saying "all of them", which is longer than the sentence.
#
# The configuration is proved where it is used instead: CI builds
# `zdc-wasm` for `wasm32-wasip1` and `wasm32-unknown-unknown` on every pull
# request, and neither can link an engine. `cargo test --workspace` runs
# with the feature on, which is what every other consumer has.
= ["dep:boa_engine"]
[]
# A pure-Rust JavaScript engine. Chosen over an engine with C sources so
# `zdc` remains a single static binary with nothing to install alongside it
# (spec §7) — the same reason the compiler is not written in a language
# that needs a VM.
#
# Two jobs, now and later:
# 1. Run the runtime library's own tests through `cargo test`, so
# verifying it needs no Node, npm, or browser.
# 2. Become the host that `zdc dev` uses to execute `server` placement
# functions locally. A dev server that required a Node install would
# undercut the language's "you do not think about servers" claim on
# the very first command a developer runs.
= { = "0.21", = true }
[]