fix: trust-only kodo.toml causes spurious warning on build#60
Merged
Conversation
…uired) load_trust_config now uses a dedicated TrustOnlyManifest struct that does not require the module and version fields. This prevents a spurious warning when a project has a minimal kodo.toml containing only [trust]. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
… config) build.rs was printing a warning when read_manifest failed on a kodo.toml that contains only [trust] (without the required module/version fields). A trust-only config has no deps, so silently returning an empty list is the correct behaviour. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
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
After #59, a
kodo.tomlcontaining only a[trust]section (withoutmodule/version) caused two issues:load_trust_configusedread_manifestwhich requires the fullManifeststruct — parse failed silently but the trust config was not loadedrun_buildcalledread_manifestseparately for dependency resolution and printed a noisywarning: error: could not parse kodo.tomlto stderrFix
manifest.rsIntroduced a
TrustOnlyManifeststruct (onlytrust: Option<TrustSection>) used exclusively byload_trust_config. A minimalkodo.tomllike this now works correctly:commands/build.rsChanged the dependency-loading path to silently return
Vec::new()whenread_manifestfails — a trust-only config has nodeps, so skipping dep resolution is the correct behaviour with no need for a warning.Test plan
cargo check --workspace— cleancargo test --workspace— all pass[trust]inkodo.tomlnow compiles with no warnings and trust enforcement active🤖 Generated with Claude Code