safechecker-plugin: adapt for a 9.2 base carrying the backported 9.3 assumptions API (rocq#22164) - #2
Open
claude-fable-5-theorem wants to merge 1 commit into
Conversation
The theorem-labs/rocq fork (v9.2+typewise-isomorphism) changed
Assumptions.assumptions to return theory_assumptions * ContextObjectMap.t
in commit aafca103ea ('feat: add Set Printing All Assumptions flag').
RocqCheck's retypecheck_term_dependencies only consumes the dependency
map, so destructure the pair and discard the theory flags.
Fixes the rocq-metarocq-safechecker-plugin build against that fork at
or after aafca103ea:
File "src/g_metarocq_safechecker.mlg", line 93, characters 50-54:
Error: This expression has type
Printer.theory_assumptions * Constr.types Printer.ContextObjectMap.t
but an expression was expected of type 'a Printer.ContextObjectMap.t
This mirrors the adaptation already merged upstream in MetaRocq MetaRocq#1287
("Adapt to rocq-prover/rocq#22164"), which landed on main; the fork
carries rocq#22164 backported onto a 9.2 base, so the same one-liner is
needed on the 9.2-targeting branch.
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.
Bottom line
We build a Rocq fork that is 9.2 plus one backported 9.3 API. That backport — not anything in
MetaRocq — is why this 9.2-targeting branch no longer compiles for us. The one-line change here
fixes our build, and it would break
cumul-sort-poly-fixfor anyone on a released 9.2.So this is a question, not really a merge request. What we'd like from you, in preference order:
cumul-sort-poly-fix+22164) carrying this commit, which costs yourother users nothing. This is the ask.
nothing, this is the outcome and nothing of ours is blocked.
cumul-sort-poly-fixto stop supporting stock 9.2.We are not asking for this.
Close this PR freely if (2) is your answer. We opened it mainly so the divergence is visible to you
rather than silently vendored in our image build.
Why a 9.2 branch is hitting a 9.3 signature
rocq-prover/rocq#22164 changed
Assumptions.assumptionsto return a pair. It is milestoned 9.3+rc1 and landed on Rocqmaster, so stock 9.2 is unaffected andcumul-sort-poly-fixis correct as it stands.Our fork (
theorem-labs/rocq,v9.2+typewise-isomorphism) cherry-picked that change onto a 9.2base in June, before it merged upstream. The result is a toolchain that reports itself as 9.2 but
exposes one 9.3 signature — a configuration that exists nowhere upstream. We made this problem;
we're not claiming MetaRocq broke anything.
You already made exactly this adaptation upstream in MetaRocq#1287 ("Adapt to rocq-prover/rocq#22164") on
main. This PR just carries that same one-liner to the 9.2-targeting branch, which is why the diffshould look familiar.
No conditional can paper over it: our fork self-reports as 9.2, so version macros can't separate the
two cases, and OCaml won't accept both shapes from one expression.
Build error, and why we can't just move our pin
RocqCheck'sretypecheck_term_dependenciesonly consumes the dependency map (it retypechecks eachdependency), so discarding the theory flags is the sound choice for a retypechecking walk — it cares
about the objects, not the printed theory summary.
We checked the obvious alternatives to patching, and none fit a 9.2+22164 toolchain:
MetaRocq/metacoq#mainmastergenerally — e.g. rocq#22166 makes it destructureGlobal.force_proofas a triple, while our fork still has the pair. Fails earlier, intemplate-rocq.MetaRocq/metacoq#9.2print-assumptions-fine-grainedmasterand is missing rocq#21773 (sort poly cumulativity) plus the 9.2 template fixes we need.Require (safe)files.Patch authored by @rhaps0dy (Adrià Garriga-Alonso); opened by the Theorem Labs build bot on his
behalf. Compile-verified against our fork: the full metacoq chain including
rocq-metarocq-safechecker-plugin.1.5.1+9.2installs cleanly.