Repository navigation
build, compat: compare std by reach, like a vendored dependency - #275
Merged
Merged
Conversation
A version's compiled schemas include std's, but std is built in and never vendored, so a build has no `dep_std` entry. The splits that separate a package's own schemas from its dependencies' only knew the `dep_<name>` entries (or, in `facts_of_context`, the declared dependencies), so std's schemas were compared, numbered and recorded as the package's own. Every declaration std gained between two builds was then reported as the package's own feature, and bumped it: a release of a package using one std validator listed `Added validator IntRange`, `MinChars`, `MinItems` and `NonEmpty`, all std's. The docs model already treated std as a dependency (doc.rs), so only build, release and compat disagreed. `compat::dependency_names` now gives every split its dependencies plus std, and `compat::vendored` a build tree's `dep_<name>` entries; `compare`, `Loaded::of` and `facts_of_context` use them. std then goes through the existing reach path: a change to what the package uses of it is listed under std's dependency changes, and anything else doesn't count.
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
comline releasereported std's declarations as the package's own new features. A package that uses one std validator got:All four come from std. Each build's compiled schemas include std's, but std is built in and never vendored, so the build has no
dep_stdentry. Three places separate a package's own schemas from its dependencies':build::compare,compat::Loaded::ofandcompat::facts_of_context. They only knewdep_<name>entries, or the declared dependencies, so they treated std's schemas as the package's own: compared, numbered and bumped. The docs model (doc.rs) already treats std as a dependency, so only build, release and compat disagreed with it.Fix
compat::dependency_names(deps)returns a version's dependencies plusstd.compat::vendored(tree)returns a build tree'sdep_<name>entries.compare,Loaded::ofandfacts_of_contextnow use both.std now goes through the same reach path as vendored dependencies. A change to the parts of std the package uses is listed under std's dependency changes. Any other change to std is not counted.
Tests
cas::std_reach_tests::std_is_compared_by_reach_like_a_dependency: std gains a declaration the package doesn't reach. It checks there are no schema changes, no dependency changes, and a bump below minor (a tree with no stored config is unseen, so it still counts as a patch).cargo test -p comline-core --features deps: all pass (381 lib, 774 integration, plus the rest).