v0.67.5
Added
- Added
[crates.e2e.snippets].curated_snippets: glob patterns (relative tooutput) declaring hand-authored snippet files as curated on purpose rather than alef-generated. Resolved intoSnippetGenerationReport::curated_pathsand intomigration::MigrationEntry::curated, so both the generation report andalef e2e snippets-migratecan distinguish a declared, intentional absence of a generated equivalent from a genuine coverage gap. - A
curated_snippetspattern that matches zero files, or that matches a path alef itself generates, now fails the run instead of being silently accepted. - Implemented
render_snippet_bodyfor the brew (shell) e2e code generator: documentation snippets for CLI-based bindings now render a singlebinary subcommand "<url>" --flagsline, built from the same call-config resolution the executable brew e2e suite already uses.
Fixed
-
docs.snippetsvalidation now fails fast, before any toolchain runs, when a language needs a compiled artifact (compile/typecheck/run) but has no configured session that could plausibly have produced one yet -- no session at all, an ambiguous session, or a session with an emptybeforelist. Warns always; understrict, bails immediately instead of spending an hour validating snippets that were doomed from the start (GH #256). -
alef snippets check --lang <language>(and any other filteredrun_validationcall) now prepares only the configured sessions its filtered snippet set actually needs, instead of running every configuredbeforebuild hook regardless of the filter -- a single-language diagnostic no longer pays for every other language's build. Sessions sharing a working directory with a needed one are still prepared together, so the scratch sweep never treats a cohabiting session's live build cache as abandoned. -
resolve()on analef.tomlwith zero[[crates]]entries now returnsResolveError::NoCratesConfiguredinstead ofOk(vec![]), soalef go-tag,alef validate versions --exit-code, andalef publish validatecan no longer silently process zero crates and exit 0. -
alef check-registry --registry github-releasenow warns when it verified only that the release exists (no--asset-prefixor--required-assetsgiven), so a CI variable that expanded to nothing is no longer indistinguishable from "all N artifacts are attached";--registry zig/--registry swiftare unaffected since they intentionally check existence only. -
alef e2e validatenow applies the same[e2e].languagesfallback (to the crate's scaffolded languages) thatalef e2e generate --snippets-migrateandalef test-apps runalready applied, so an unset[e2e].languagesno longer silently disables the "0 test functions" and "unsupported language" checks. The success message also now distinguishes "no fixtures found" from "N fixtures validated". -
alef lintnow fails whenpolyis not on PATH instead of warning and reporting a clean run;polyis the entire implementation ofalef lint, so there was no partial coverage to report. -
alef release-metadata --targetsnow rejects a CSV that trims to non-empty but splits into zero real target tokens (e.g.,,,or a lone,), which used to resolve identically to the deliberate--targets none(release_any: false, exit 0, no diagnostic). -
Fixed the FFI feature-drift warning comparing each binding's configured feature set against
[crates.ffi]'s configured set instead of the effective default set ([crates.ffi]'s configured features unioned with every feature discovered from emitted#[cfg(feature = "X")]gates) thatscaffold_ffiactually writes into the generated FFI crate'sCargo.toml. Two configured lists could match while the effective set was a strict superset, and the warning stayed silent through that drift. -
Added
codegen::cfg::effective_ffi_default_featuresas the single derivation of the FFI crate's effective default feature set, used by bothscaffold_ffiandwarn_on_ffi_feature_driftso the two can no longer disagree. -
warn_on_ffi_feature_driftnow distinguishes unsafe host-only features (configured for a binding but absent from the FFI crate's effective default set, which can produce glue referencing a symbol the shipped library was never built with) from safe parity gaps (in the effective default set but undeclared by a binding, which the binding simply omits). -
Fixed
FfiTargetDepOverride.default_features(per-target[crates.jni] target_dep_overrides) being ignored by the JNI Cargo.toml scaffolder: a per-targetdefault_features = falsenever reached the generated[target.'cfg(...)'.dependencies]block, unlike the equivalent FFI crate scaffolding. -
Fixed snippet session identity so multiple configured targets that resolve to the same
Language(e.g.kotlin+kotlin_android, ortypescript/node/wasm) no longer collide when they validate the same physical package/working directory.resolve_session_claimnow only reportsSessionClaim::Ambiguouswhen same-language candidates validate genuinely different working directories; candidates sharing one directory collapse to a single deterministicSessionClaim::Claimedinstead (issue #255). -
Added
SessionIdentitytrait (src/snippets/runner/session_resolution.rs) implemented forValidationSessionandSessionSpec, giving session-claim resolution access to a session's working directory alongside its language. -
Added regression coverage asserting session count collapses to one for
kotlin+kotlin_androidover one directory and fortypescript+node+wasmover one package, plus a control case proving genuinely different directories still resolve as ambiguous. -
Swift snippet validation now resolves a session's SwiftPM module directories once per run.
Every snippet previously launched its ownswift build --show-bin-path; 32 concurrent warm
lookups measured 1.33 seconds wall and 9.22 seconds CPU, versus 0.33 seconds wall and 0.26
seconds CPU for a single lookup, before anyswiftcvalidation work began. The cache is
keyed on the resolved lookup inputs (package root plus environment) rather than on session
identity, and holds no global state. -
alef validate versions --exit-codenow askschecks_passfor its verdict instead of
re-deriving it. The local copy disagreed in both directions: it exited 0 for a crate whose
check set was EMPTY — the vacuous passchecks_passexplicitly refuses — and it exited 1
on ablocked_on_publishrow, whichchecks_passdeliberately tolerates because such a
row is a lockfile entry pinning the crate at the very version being released and cannot
resolve until that version is published. Failing it made the gate unsatisfiable by
construction for any repo with a registry-depending test app.--jsonalready reported
checks_pass, so a single invocation could print"ok": trueand still exit 1. The
blocked_on_publishdoc comment, which asserted the opposite and contradicted both
checks_passand its tests, is corrected. -
Fixed
alef build/alef generaterunning the umbrellagradle build(andgradle build -Prelease) forkotlin_androidwhen no[workspace.build_commands.kotlin_android]overlay is declared, instead of the intendedgradle assembleDebug/gradle assembleRelease.build_command_for's"gradle"arm matched on the sharedbc.toolstring, which cannot distinguishKotlinfromKotlinAndroid; it now asks a new sharedbuild_defaults::gradle_build_task(Language, bool)helper, the same onedefault_build_configuses, so both derivations agree (GH #259). An explicit[workspace.build_commands.kotlin_android]overlay is unaffected and continues to win. -
Fixed
frb_version_check.rs's test module failing to compile on Windows (std::os::unix::fs::PermissionsExt,Permissions::from_mode) by gating the four unix-only items behind#[cfg(unix)], while keeping the four platform-neutral tests running unconditionally on every OS. -
Fixed
swift_shim_return_marshal(the Swift trait-box FFI shim) wrapping an enum-typed trait method return directly inRustString(...), which requires aStringargument and does not compile against an enum value; the shim now JSON-encodes the enum viaJSONEncoderbefore wrapping it, decided by consultingApiSurface::enumsrather than theTypeRef::Nameddiscriminant. Struct-typed (JSON)Namedreturns are unchanged. -
Fixed the Swift trait-bridge default method stub emitting
return "{}"for ahas_default_implmethod with a non-excluded enum-typed return, which does not type-check against the enum's own declared Swift return type; it now constructs a real case of the enum when the IR has a fieldless variant, falling back to the prior placeholder body otherwise. -
Fixed the packaging template environment (
src/publish/package/template_env.rs) never callingstrip_keep_markers, the only built-in render path that did not, so a~keepmarker left in a packaging template would have shipped verbatim into a consumer's package tree. -
Corrected the swift e2e integration test
count_min_on_optional_vec_of_named_uses_native_optional_count, which shipped red through 0.67.3 and 0.67.4. Its premise was stale rather than the codegen:field_needs_json_bridgehas no dependence on the parent's opacity and returns true for any optionalVec<_>field, so the JSON-bridged.toString().countshape is correct for both parent kinds. Split into paired opaque-parent and first-class-parent tests so a fix that corrects one shape while regressing the other is caught by whichever arm it breaks.