Repository navigation
Expand file tree
/
Copy pathCargo.toml
More file actions
140 lines (136 loc) · 9.75 KB
/
Copy pathCargo.toml
File metadata and controls
140 lines (136 loc) · 9.75 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
[package]
name = "cddl-codegen"
version = "0.1.0"
edition = "2024"
license = "MIT"
repository = "https://github.com/dcSpark/cddl-codegen"
keywords = ["cddl", "codegen", "cbor", "wasm"]
description = "Codegen serialization logic for CBOR automatically from a CDDL specification"
[features]
default = ["which-rustfmt"]
# Dynamically discover a `rustfmt` binary using the `which` crate
which-rustfmt = ["which"]
[dependencies]
# 3.3.0 is the first release carrying the width-preserving float API the runtime is built on:
# `Deserializer::float_sz() -> (f64, Sz)` / `Serializer::write_float_sz(f64, Sz)`, with software
# NaN-payload-preserving widening/narrowing, so `(f64, Sz)` is a complete lossless wire-float
# representation. It also rejects the reserved simple values `0xfc-0xfe` at read
# (`InvalidSimpleValue`), and exports the value-width helpers: `se::smallest_float_sz(f64) -> Sz`,
# `se::f64_to_f32_exact(f64) -> Option<f32>` and `se::f32_to_f64_exact(f32) -> f64`. Needed by the
# `AnyCbor` runtime type (loose CBOR parsing) whose float slot is `Float(f64, Option<Sz>)`. The
# generated-crate templates (`static/manifest_changes/*.toml`, viewable as `static/Cargo_*.toml`)
# name this SAME version — the generated crates pass `Serializer`/`Deserializer` values across their
# boundaries, so a skew is a type mismatch.
cbor_event = "3.3.0"
# dcSpark fork pinned to fixes not yet in a crates.io release. Parser (feeds our AST): upstream
# discards all comments (breaking our @name/@newtype/@doc DSL), mis-parses a colon member key `b:`
# as an arrow/type key when a `=>` appears anywhere in the entry, and mis-lexes the RFC 8610 radix
# integer literals (`0x10` dies as "Invalid hexfloat", `0b1010` splits into `0` + identifier; the
# fix also tightens adjacent lexing: leading-zero
# decimals like `042` are now parse errors, `1e5` floats now parse). Validator (feeds the
# generated-crate conformance oracle, CDDL_ORACLE_DEP): control ops over a uint target were
# unenforced, a multi-entry group in an array only validated as the sole entry with no occurrence,
# and ranges with non-uint endpoints (`-10..10`, `0.5..10.5`) blanket-rejected every instance,
# bignum-typed (`biguint`/`bignint`/`bigint`) map keys rejected every map wholesale while
# bignum VALUES accepted any tag unchecked (fixed together in c2ebf9f), and `?`-marked
# type-domain map entries rejected the legal empty map while unmatched (alien) map entries
# were silently accepted — the closed-map check was skipped when no member consumed a key
# (fixed together in 3d56d8e; also implements JSON type-domain string keys), every CBOR float
# was rejected against the prelude `number` keyword (`number = int / float`; fixed in 90f66ff
# via a NumericKind classifier), and float-typed map keys matched NULL keys instead of floats —
# a copy-paste predicate at three find-based member-key sites inverted both verdicts
# (spec-valid `{1.5: 1}` rejected, spec-invalid `{null: 1}` accepted).
# Move back to a crates.io version once all land in anweiss/cddl + release. See tests/testing-roadmap.toml.
cddl = { git = "https://github.com/dcSpark/cddl", rev = "ac1b98ec07184236517da4511b1bbea239e35190" }
clap = { version = "4.5", features = ["derive"] }
# dcSpark fork of codegen based on upstream 0.3.0
codegen = { git = "https://github.com/dcSpark/codegen", branch = "master" }
nom = "8"
pathdiff = "0.2.3"
# Powers `import_prune.rs`, the usage-derived import-pruning post-pass over every generated `.rs`
# string. `proc-macro2`'s `span-locations` feature makes `Span::byte_range()` report real byte
# offsets when parsing a plain string, which the pass uses to splice out only the exact use-item
# range (never whole-file token re-printing, which would drop comments and break the
# comment-preservation overlay). `quote` supplies `ToTokens` to render the filtered use item back
# to source. Both are already in-tree transitively (via `syn`), so this adds no lockfile
# weight. None of the three become generated-crate deps — they run inside this tool only.
proc-macro2 = { version = "1", features = ["span-locations"] }
quote = "1"
# Parses each generated `.rs` string into an AST for `import_prune.rs` (the import-pruning post-pass;
# `features=["full"]` gets the item/use AST it walks) and drives the harness-side `syn`-based
# differentials in the test suite (`wasm_api_parity` / `recombination_tests`). NEVER a
# generated-crate dep — it runs inside this tool only.
syn = { version = "2", features = ["full", "visit"] }
# Cargo's own SemVer parser/evaluator (cargo-team maintained). Powers the dependency-spec merge in
# `cargo_manifest.rs`: a user's concrete version pin is kept verbatim when it satisfies the tool's
# version requirement (caret semantics), otherwise the tool's floor wins.
semver = "1.0"
# Levenshtein distance for the config reader's "did you mean" suggestion (`config.rs`,
# `unknown_key_advice`). Already in-tree through clap's own suggestion support, so a direct dep
# adds no lockfile weight. Never a generated-crate dep: it runs inside this tool only.
strsim = "0.11"
# Format-preserving TOML DOM (the crate `cargo add`/`cargo remove` use). Powers the declarative
# Cargo.toml changeset model in `cargo_manifest.rs`: untouched keys/comments/formatting of a
# user-edited manifest survive regeneration byte-for-byte. `default-features` keeps `parse`+`display`.
toml_edit = "0.25"
# Deserializes the `--config` TOML file (`config.rs`). A READ-ONLY, value-model parser is the right
# tool here and `toml_edit` (above) is not: that one exists to EDIT a user's manifest in place,
# preserving their formatting; a config file is an input the tool only ever reads, so the serde data
# model is what it wants. Pinned to the 1.x line because that lineage shares `toml_datetime`/
# `toml_parser`/`toml_writer` with `toml_edit` 0.25 — the 0.8 line would drag a second `toml_edit`
# major into the graph for nothing. Also navigated as `toml::Value` by the harness-side corpus
# readers (`decode_conformance_replay`, the cddl-matrix annotation gates).
toml = "1.1"
# Derives the `config.rs` schema (`deny_unknown_fields` is what turns a typoed config key into the
# hard error a misspelled CLI flag already is). Generated crates get this same dep under
# `--json-serde-derives` (cargo_manifest.rs); already in-tree transitively, so no lockfile weight.
# Also needed harness-side by the `any_cbor_tests` json shim, which `include!`s
# `static/any_cbor_json.rs` (manual serde impls + `#[serde(untagged)]`).
serde = { version = "1", features = ["derive"] }
# default-features=false to drop the optional `regex` dep; `real-sys` (the actual lookup impl) is
# off by default in which 8, so enable it explicitly.
which = { version = "8", optional = true, default-features = false, features = ["real-sys"] }
[dev-dependencies]
# golden snapshot tests of generated output (see tests/*/snapshots/)
insta = "1.48"
# Harness-side ONLY (never a generated-crate dep): the decode-side reference-codec differential in
# `ir_conformance_corpus` decodes our minted bytes through TWO independent CBOR codecs and asserts
# they agree structurally — a CDDL-blind well-formedness check the two spec validators don't perform.
# `minicbor` is used nowhere else in the pipeline (that's its decorrelation value); `ciborium` is
# otherwise only reachable inside the `cddl` validator's process, here we drive it directly.
ciborium = "0.2"
# `half` gates the `decode::Tokenizer` + `data::Token` stream API the differential drives.
minicbor = { version = "0.26", features = ["half"] }
# Harness-side ONLY (never a generated-crate dep): `recombination_tests` parses the projected
# `tests/recomb/ingredients.json` (cddl-matrix/project_recombination.ts). Already in-tree
# transitively (via the `cddl` validator), so this adds no lockfile weight. Navigated via
# `serde_json::Value` — no serde derives of our own. Also drives the `any_cbor_tests` json shim,
# which compiles the shipped `static/any_cbor_json.rs` fragment to pin the JSON round-trip laws.
serde_json = "1"
# Harness-side ONLY (never a generated-crate dep): the `json_schema_gen_tests` shim `include!`s
# `static/json_schema_gen.rs`, whose `add_schema` row registrar is written against the `schemars`
# generator API. Compiling it here is what puts the shipped helper under `cargo clippy --all-targets`
# and under real unit tests — otherwise it is reachable only through a nested-cargo run of a
# generated json-gen crate. Generated crates get this same dep under `--json-schema-export`
# (cargo_manifest.rs), at the same version.
schemars = "1.2.1"
# Harness-side ONLY: `gate_cache` content-addresses generated-crate trees (memoize-and-skip for
# the nested-cargo gates). Already in-tree transitively, so this adds no lockfile weight.
sha2 = "0.10"
# Harness-side ONLY (never a generated-crate dep): the WIT-validity gate's ORACLE. The component
# face's emitted `.wit` is parsed and resolved (`wit-parser`), encoded to a component-model package
# (`wit-component`) and then VALIDATED (`wasmparser`) — four stages, because the strong-uniqueness
# collision class the in-generator detector exists for survives resolve AND encode and fails only at
# validation.
#
# All three carry an `=` pin at the toolchain FLOOR made executable: fallible constructors, which
# this face emits for every bounds-validating type, are REJECTED by wasm-tools 1.231-era tooling and
# accepted from wit-parser 0.247 on. Since these crates ARE the gate's oracle, a floating version
# would let the oracle drift off the floor the generated WIT is written against. Bump all three
# together, and only with a re-probe of the keyword set (`generation::wit::WIT_KEYWORDS`).
wit-parser = "=0.247.0"
# Deliberately default-features: the `dummy-module` feature gates a `ComponentEncoder` path that is a
# FALSE ORACLE for worlds exporting resources (it fails a package that resolves, encodes, validates
# and builds).
wit-component = "=0.247.0"
wasmparser = "=0.247.0"