fix(build): tolerate unresolvable cargo metadata in filter discovery - #1024
Merged
leseb merged 1 commit intoSep 10, 2026
Merged
Conversation
Ladas
marked this pull request as ready for review
September 9, 2026 10:33
Ladas
force-pushed
the
fix/build-script-metadata-fallback
branch
2 times, most recently
from
September 9, 2026 12:14
4ca65d9 to
2dcbaca
Compare
praxis-bot
reviewed
Sep 9, 2026
praxis-bot
left a comment
There was a problem hiding this comment.
praxis-bot review: fix(build): tolerate unresolvable cargo metadata in filter discovery
Clean, well-motivated change that restores the graceful fallback Praxis core already has. The approach is correct: load_metadata and active_features return Option, main writes an empty registration on the fallback path, and emit_static_rerun_directives ensures Cargo will re-run discovery when the workspace is repaired. The added cargo::warning is a good improvement over core's silent .ok().
Findings
| # | Severity | File | Description |
|---|---|---|---|
| 1 | Medium | server/build.rs |
Mixed Cargo directive syntax |
Details below.
The build script panicked whenever `cargo metadata` could not resolve this package's manifest in isolation. That happens whenever the manifest is read away from its workspace: `cargo publish` verification, and vendored builds such as a hermetic Konflux build, where `cargo vendor` flattens the tree so the sibling `path` dependencies are no longer beside it. Praxis core's equivalent build script already returns `Option` here and degrades to an empty registration; this restores that behaviour, which was lost when the discovery logic moved into praxis-ai-build-support. Only discovery of external filter crates is affected. Praxis AI's own filters are registered explicitly by `build_full_registry`, so a server built this way still has its full built-in pipeline. Unlike core, the fallback also emits a cargo warning, so a downstream crate that expected its filters to be discovered can see why they were not. Verified by vendoring the workspace and building it with the network disabled: before, the build aborted in this script; after, it completes. Signed-off-by: Ladislav Smola <lsmola@redhat.com>
Ladas
force-pushed
the
fix/build-script-metadata-fallback
branch
from
September 10, 2026 08:49
2dcbaca to
50437c5
Compare
leseb
approved these changes
Sep 10, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
server/build.rspanics whencargo metadatacannot resolvepraxis-ai-proxy'smanifest on its own:
This happens whenever the manifest is read away from its workspace. Two real cases:
cargo publishverification.cargo vendorflattens the tree, so the manifest'spath = "../apis"no longer points anywhere. This blocks hermetic containerbuilds, where dependencies are prefetched and the build itself runs with no
network.
Fix
Praxis core's equivalent script,
crates/server/build.rs, already handles this:load_metadatareturnsOption<Metadata>andmainfalls back to an emptyregistration. Its doc comment names the same cause — "Returns
Nonewhen metadataresolution fails (e.g. during
cargo publishverification where path dependenciesare not available)."
This restores that behaviour, which was lost when the discovery logic moved into
praxis-ai-build-support. One addition over core: the fallback emits acargo::warning, so a downstream crate that expected its filters to be discoveredcan see why they were not.
Why this is safe
build_full_registryregisters Praxis AI's own filters explicitly:The generated function only ever covers third-party crates carrying
[package.metadata.praxis-filters]. A server built in a vendored context keeps itsfull built-in pipeline; only third-party discovery is skipped, and it now says so.
Verification
--network none: before, aborted in this script;after,
Finished release profile in 2m 10sand a working binary.cargo +nightly fmt --check,cargo check -p praxis-ai-proxy(which runs thescript),
cargo clippy -p praxis-ai-proxy --all-targets -- -D warnings: clean.cargo test -p praxis-ai-build-support: 10 passed. The fallback reusesgenerate_registration_code(&[]), already covered bygenerate_registration_code_emits_calls_and_empty_case_suppression.No new tests: the change is in the build-script orchestrator, which by the file's own
note cannot carry unit tests; the logic it calls lives in
build_supportand isunchanged.
Context
Found while making the experimental gateway image buildable by Konflux for an Open
Data Hub developer preview, where builds are hermetic. Opened as a draft for
maintainer review of the approach.