You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat(scaffold): honor per-target core-dependency overrides in the scripting bindings (#164)
* feat(scaffold): target_dep_overrides for the scripting backends
Extend target_dep_overrides (previously ffi/jni/dart/swift only) to the
pyo3/napi/magnus/php/rustler backends, mirroring the FFI backend: when
overrides are set, the core dependency moves out of [dependencies] into a
cfg(not(...)) default block plus one [target.'cfg(<cfg>)'.dependencies] block
per override.
- shared render_core_dep_with_overrides helper in scaffold/mod.rs
- target_dep_overrides config field on Python/Node/Ruby/Php/Elixir (+ schema)
- wired all five scaffolds
- unit tests for the renderer + an all-five-backends integration test
Fixes#163.
* fix(tests): add target_dep_overrides to integration-test config literals
The new field was added to the src/scaffold/tests literals but the
integration tests under tests/ also construct PythonConfig/NodeConfig
as full struct literals; --all-targets compilation failed with E0063.
cargo check --all-targets, clippy (CI flags), and both affected test
binaries are green.
Copy file name to clipboardExpand all lines: schemas/alef.schema.json
+40Lines changed: 40 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -2215,6 +2215,14 @@
2215
2215
"string",
2216
2216
"null"
2217
2217
]
2218
+
},
2219
+
"target_dep_overrides": {
2220
+
"default": [],
2221
+
"description": "Per-target overrides for the core-crate dependency emitted into the\ngenerated `Cargo.toml`. See [`super::FfiConfig::target_dep_overrides`].",
2222
+
"items": {
2223
+
"$ref": "#/$defs/FfiTargetDepOverride"
2224
+
},
2225
+
"type": "array"
2218
2226
}
2219
2227
},
2220
2228
"type": "object"
@@ -3793,6 +3801,14 @@
3793
3801
"null"
3794
3802
]
3795
3803
},
3804
+
"target_dep_overrides": {
3805
+
"default": [],
3806
+
"description": "Per-target overrides for the core-crate dependency emitted into the\ngenerated `Cargo.toml`. See [`super::FfiConfig::target_dep_overrides`].",
3807
+
"items": {
3808
+
"$ref": "#/$defs/FfiTargetDepOverride"
3809
+
},
3810
+
"type": "array"
3811
+
},
3796
3812
"tokio_util_features": {
3797
3813
"default": null,
3798
3814
"description": "Features for the auto-emitted `tokio-util` dependency that backs napi trait-bridge\ncancellation tokens. Defaults to `[\"rt\"]` because `tokio_util::sync::CancellationToken`\nis gated behind the `rt` feature in tokio-util 0.7+. Override when a consumer needs\nadditional tokio-util features (e.g. `[\"rt\", \"codec\"]`).",
"description": "Per-target overrides for the core-crate dependency emitted into the\ngenerated `Cargo.toml`. See [`super::FfiConfig::target_dep_overrides`].",
4351
+
"items": {
4352
+
"$ref": "#/$defs/FfiTargetDepOverride"
4353
+
},
4354
+
"type": "array"
4331
4355
}
4332
4356
},
4333
4357
"type": "object"
@@ -4684,6 +4708,14 @@
4684
4708
"type": "null"
4685
4709
}
4686
4710
]
4711
+
},
4712
+
"target_dep_overrides": {
4713
+
"default": [],
4714
+
"description": "Per-target overrides for the core-crate dependency emitted into the\ngenerated `Cargo.toml`. Mirrors [`super::FfiConfig::target_dep_overrides`]:\nwhen non-empty, the core dependency is wrapped in\n`[target.'cfg(not(<any-cfg>))'.dependencies]` plus one\n`[target.'cfg(<cfg>)'.dependencies]` block per override, so a specific\ntarget can swap the core crate's feature set.",
4715
+
"items": {
4716
+
"$ref": "#/$defs/FfiTargetDepOverride"
4717
+
},
4718
+
"type": "array"
4687
4719
}
4688
4720
},
4689
4721
"type": "object"
@@ -5652,6 +5684,14 @@
5652
5684
"type": "null"
5653
5685
}
5654
5686
]
5687
+
},
5688
+
"target_dep_overrides": {
5689
+
"default": [],
5690
+
"description": "Per-target overrides for the core-crate dependency emitted into the\ngenerated `Cargo.toml`. See [`super::FfiConfig::target_dep_overrides`].",
0 commit comments