control-toolbox / control-toolbox/CTParser.jl
Deprecated ExaCore() call warns on every :exa model, leaking a package path into built documentation
- Dominant language
- Julia
- Stars
- 3
- Forks
- 0
- Avg merge
- 4h 22m
- Merged PRs (30d)
- 2
Description
## 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:
```julia
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`:
```julia
$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](https://claude.com/claude-code)
Contributor guide
Assessment
This issue has not been assessed yet.