Skip to content

Allow deprecated syntax for specified versions of specified packages#154

Open
andrjohns wants to merge 1 commit into
masterfrom
compat
Open

Allow deprecated syntax for specified versions of specified packages#154
andrjohns wants to merge 1 commit into
masterfrom
compat

Conversation

@andrjohns

@andrjohns andrjohns commented Jul 15, 2026

Copy link
Copy Markdown
Collaborator

The main blocker for the rstan -> CRAN transition is the number of packages that still have not updated their deprecated syntax, despite plenty of notice.

To workaround this, the current PR adds an 'exception list', where specified packages at specified versions (currently only the broken reverse-dependencies) have their Stan code canonicalised/updated at installation-time for compatibility with stan 2.36+.

If a version for one of these packages changes, then the automatic canonicalisation does not occur and the author would be required to update their Stan syntax for their package to build.

This allows for a compromise where abandoned/unmaintained packages are no longer blocking rstan updates, while any packages still receiving active development will be forced to update their syntax once a new version of rstan is published.

As part of testing this, I've created an rstan branch at the 2.39 release point here: rstan@v2.39.0 and added handling for the RNG changes (ecuyer->mixmax).

With these rstantools changes and that rstan branch, I'm able to build all CRAN reverse-dependencies under both combinations (2.32 rstan + 2.39 StanHeaders) and (2.39 rstan + 2.39 StanHeaders) except for two (tmbstan and rmdcev)

@andrjohns

Copy link
Copy Markdown
Collaborator Author

Pinging @bgoodri for the rstan release perspective, and @WardBrian on the canonicalisation approach (thanks!)

@WardBrian WardBrian left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The overall approach seems prudent and sound.

Two questions:

  • Do any of the affected packages use #includes? Are those already processed by the time the canonicalization would happen?
  • Why 2.32? I believe 2.33 would still work, and had a few other improvements that might benefit pretty printing (though it's been a while, maybe they're the same in that regard)

@andrjohns

Copy link
Copy Markdown
Collaborator Author

Do any of the affected packages use #includes? Are those already processed by the time the canonicalization would happen?

Yeah, it uses the rstan::stanc_process function to first replace all #include chunks with the respective code so the canonicalisation is applied to the whole model

Why 2.32? I believe 2.33 would still work, and had a few other improvements that might benefit pretty printing (though it's been a while, maybe they're the same in that regard)

Pretty much just because I just copied the stanc.js file from the current CRAN rstan and it worked, so I didn't look anywhere else 😅

@WardBrian

Copy link
Copy Markdown
Member

Sounds good to me

@andrjohns

Copy link
Copy Markdown
Collaborator Author

Reverse-dependencies check with this rstantools branch plus CRAN rstan and StanHeaders 2.39.0 is here: https://github.com/andrjohns/rstan/actions/runs/29497863526#summary-87637709672

2 install failures: tmbstan (PR opened) and rxode2ll), and ~20 test/vignette/example errors - mostly issues with optimizing and unconstraining parameters

@jgabry
jgabry requested a review from bgoodri July 16, 2026 15:12
@jgabry

jgabry commented Jul 16, 2026

Copy link
Copy Markdown
Member

Thanks @andrjohns, looks good to me. @bgoodri?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants