Skip to content

Import AbstractMCMC to fix package precompilation (UndefVarError)#298

Merged
ChrisRackauckas merged 1 commit into
SciML:mainfrom
ChrisRackauckas-Claude:fix-abstractmcmc-import
Jun 17, 2026
Merged

Import AbstractMCMC to fix package precompilation (UndefVarError)#298
ChrisRackauckas merged 1 commit into
SciML:mainfrom
ChrisRackauckas-Claude:fix-abstractmcmc-import

Conversation

@ChrisRackauckas-Claude

Copy link
Copy Markdown
Contributor

Problem

main CI is red across four checks (Core, Datafit, QA ×2 Julia 1/lts, and Documentation build). All fail at the same root cause: the package no longer precompiles.

ERROR: LoadError: UndefVarError: `AbstractMCMC` not defined in `EasyModelAnalysis`
Hint: AbstractMCMC is loaded but not imported in the active module Main.
  @ ~/.../src/datafit.jl:262

The mcmcensemble keyword of both bayesian_datafit methods is annotated AbstractMCMC.AbstractMCMCEnsemble (added in commit 6a350b8, July 2023), but AbstractMCMC was never imported into the module. It was only reachable transitively because older Turing versions re-exported the bare AbstractMCMC binding. The Turing version now resolved in CI no longer brings AbstractMCMC into the module's scope, so the type annotation fails at precompile/load time and every test group + the docs build dies before running.

Fix

Declare AbstractMCMC as a direct dependency and using AbstractMCMC. This is the symbol the source actually references. AbstractMCMC was already present transitively in the resolved environment (v5.15.1), so no manifest/version churn beyond declaring it. Compat set to 4, 5 (the AbstractMCMCEnsemble abstract type has been stable across both).

Local verification (Julia 1.10)

Reproduced the failure on a clean main checkout (package failed to load), then confirmed the fix:

  23504.7 ms  ✓ EasyModelAnalysis
RESULT: LOADED OK
AbstractMCMCEnsemble resolves: AbstractMCMC.AbstractMCMCEnsemble
bayesian_datafit methods: 2

The package now precompiles and loads, and both bayesian_datafit method signatures resolve.

Please ignore until reviewed by @ChrisRackauckas.

The mcmcensemble keyword of bayesian_datafit is annotated
AbstractMCMC.AbstractMCMCEnsemble, but AbstractMCMC was never imported
into the module; it was only reachable transitively through older Turing
versions that re-exported the bare binding. Newer Turing no longer brings
AbstractMCMC into scope, so the package fails to precompile with
UndefVarError: `AbstractMCMC` not defined. Declare AbstractMCMC as a
direct dependency and import it.

Co-Authored-By: Chris Rackauckas <accounts@chrisrackauckas.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@ChrisRackauckas ChrisRackauckas marked this pull request as ready for review June 17, 2026 10:28
@ChrisRackauckas ChrisRackauckas merged commit b450a3c into SciML:main Jun 17, 2026
7 of 10 checks passed
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.

2 participants