Repository navigation
Declare pp dependency of RBS signatures and validate them in CI - #4248
Merged
Merged
Conversation
The generated RBS files refer to `PP` in `pretty_print: (PP q) -> void`,
but `PP` is defined in the `pp` standard library, not in core. Without a
declaration, loading the signatures of the prism gem alone fails:
$ rbs -r prism validate
...: Could not find PP (RBS::NoTypeFoundError)
`sig/manifest.yaml` is where rbs looks for dependencies of a gem's
signatures on standard libraries. With it, `rbs -r prism` and
`rbs collection` resolve `pp` automatically.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Steep type-checks the implementation with `library "pp"` and `sig/_shims`, so it never notices when `sig/generated` refers to a type that users of the gem cannot resolve. That is how `PP` slipped in unnoticed. Add `rake typecheck:rbs`, which runs `rbs validate` on `sig/generated` with only the standard libraries declared in `sig/manifest.yaml`, i.e. exactly what users of the gem get, and run it in the typecheck job. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Collaborator
|
Thanks @ksss! Is it possible to remove it from steepfile now since we declare it in our yaml or no? |
Contributor
Author
|
No, unfortunately we can’t remove the entries that duplicate manifest.yaml from the Steepfile at the moment. manifest.yaml only takes effect when prism’s signatures are loaded as a library. It isn’t used when type-checking prism itself, at least for now. |
kddnewton
approved these changes
Oct 9, 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
The generated RBS files refer to
PP(def pretty_print: (PP q) -> voidinnode.rbsandparse_result.rbs), butPPis defined in theppstandard library, not in core. So loading the signatures of the prism gem on their own fails:Users have to know to add
-r pp(or appentry inrbs_collection.yaml) themselves.This is not in a released version yet: 1.9.0 has
pretty_print: (untyped q) -> untyped, and(PP q)came with 1fdd4c5. CI did not catch it because Steep type-checks the implementation withlibrary "pp"(andsig/_shims), so it can always resolvePP, while nothing loadedsig/generatedthe way users of the gem do.Fix
sig/manifest.yamldeclaring the dependency onpp. This is the file rbs reads to find dependencies of a gem's signatures on standard libraries (see rbs docs). It is listed in the gemspec so that it ships with the gem.rake typecheck:rbsand run it in the typecheck job. It runsrbs validateonsig/generatedwith only the libraries declared insig/manifest.yaml, i.e. exactly what users of the gem get. Withoutsig/manifest.yamlit reports the 155Could not find PPerrors above, so both a missing manifest entry and a new unresolvable reference will fail CI from now on.Steep itself is not affected:
Steepfilealready haslibrary "pp".Verified
Built a gem from this branch, installed it into an empty gem directory, and ran rbs 4.2.0 against it:
RBS::EnvironmentLoadernow resolvesppandprettyprintfrom the stdlib signatures of the rbs gem afterprism.rake check_manifestandrake typecheck:rbspass.🤖 Generated with Claude Code