Skip to content

Deprecated ExaCore() call warns on every :exa model, leaking a package path into built documentation #323

Description

@ocots

Summary

src/onepass.jl:1483 calls ExaCore in its deprecated form, so ExaModels emits a deprecation
warning for every :exa model built. In a documentation build that warning lands on the
published page, together with the absolute path of the build machine's package store.

Reproduction

Any :exa solve:

using OptimalControl, ExaModels, NLPModelsIpopt
# ... any coordinatewise ocp ...
solve(ocp, :exa; display=false)
┌ Warning: `ExaCore()` is deprecated, and will be removed. Use `ExaCore(concrete = Val(true))`
│ for the immutable ExaCore. The default behavior for `ExaCore()` will change to return the
│ immutable ExaCore.
└ @ ExaModels ~/.julia/packages/ExaModels/bwVNw/src/deprecated.jl:30

Cause

src/onepass.jl:1483:

$p_ocp = $pref.ExaCore(
    base_type;
    backend=backend,
    minimize=($p.criterion == :min),
)

Why this surfaced now

solve/choosing-a-method.md in the OptimalControl documentation is the first page in that site
to run the :exa modeler live — solve/gpu.md is Draft = true, and solve/options.md's
:exa blocks are inert. Before that, no CI documentation build had ever executed this path, so
the warning had nowhere to appear.

Rendered into the page, the block reads:

┌ Warning: `ExaCore()` is deprecated, ...
└ @ ExaModels ~/.julia/packages/ExaModels/bwVNw/src/deprecated.jl:30
Line 6: (∂(q))(t) == v(t)
unknown numerical scheme: gauss_legendre_2 (possible choices are ...)

One line of signal, three of noise — and in CI the path becomes
/home/runner/.julia/packages/ExaModels/…, published on the site. The documentation currently
works around it with an explicit with_logger(NullLogger()) inside the block, which is
scaffolding a reader should not have to see. See control-toolbox/OptimalControl.jl#877.

Suggested fix

Move to the non-deprecated call so the warning stops at the source. Per the deprecation text
that is ExaCore(base_type; concrete = Val(true), ...), but the ExaModels release notes are the
authority on the intended replacement, and the concrete choice is a real decision about which
ExaCore the generated code should build — worth confirming rather than applying blindly.

Once fixed, the with_logger wrapper comes out of the documentation.

🤖 Generated with Claude Code

Activity

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

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions