Skip to content

Declare KLUFactorization public without a non-public Meta.parse call - #77

Merged
ChrisRackauckas merged 1 commit into
mainfrom
fix-public-declaration-qa
Aug 7, 2026
Merged

Declare KLUFactorization public without a non-public Meta.parse call#77
ChrisRackauckas merged 1 commit into
mainfrom
fix-public-declaration-qa

Conversation

@ChrisRackauckas-Claude

Copy link
Copy Markdown
Member

Note

Please ignore until reviewed by @ChrisRackauckas.

Problem

QA is currently red on main. src/PureKLU.jl:34 declares KLUFactorization public with

@static if VERSION >= v"1.11"
    eval(Meta.parse("public KLUFactorization"))
end

Meta.parse is not public in Base.Meta, so ExplicitImports' all_qualified_accesses_are_public errors:

all_qualified_accesses_are_public: Error During Test
  NonPublicQualifiedAccessException
  - `parse` is not public in `Base.Meta` but it was imported from `Base.Meta`
    at src/PureKLU.jl:34:15
...
ERROR: LoadError: Some tests did not pass: 20 passed, 0 failed, 1 errored, 0 broken.

Reproduced on a clean checkout of main with GROUP=QA on Julia 1.11.

I hit this because I copied the idiom into PureUMFPACK (SciML/PureUMFPACK.jl#36) and its QA rejected it there.

Fix

Use include_string, which is exported by Base and does the same job:

@static if VERSION >= v"1.11"
    include_string(@__MODULE__, "public KLUFactorization")
end

KLUFactorization remains unexported and public on Julia >= 1.11 — verified Base.isexported(PureKLU, :KLUFactorization) == false and Base.ispublic(PureKLU, :KLUFactorization) == true after the change.

Verification

Julia 1.11:

Suite Before After
GROUP=QA 20 passed, 1 errored Testing PureKLU tests passed
Pkg.test() (Core) Testing PureKLU tests passed

No version bump: the two forms are behaviorally identical, so this is a lint/QA fix with no user-visible change.

🤖 Generated with Claude Code

https://claude.ai/code/session_01DR4AenbZvWqp2BMM42T27A

QA is red on master: `eval(Meta.parse("public KLUFactorization"))`
reaches `Base.Meta.parse`, which is not public, so ExplicitImports'
`all_qualified_accesses_are_public` errors out.

`include_string` is exported by Base and does the same job.
`KLUFactorization` stays unexported and `public` on Julia >= 1.11.

Co-Authored-By: Chris Rackauckas <accounts@chrisrackauckas.com>
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DR4AenbZvWqp2BMM42T27A
@ChrisRackauckas
ChrisRackauckas marked this pull request as ready for review August 7, 2026 02:12
@ChrisRackauckas
ChrisRackauckas merged commit 25670ac into main Aug 7, 2026
18 checks passed
@ChrisRackauckas
ChrisRackauckas deleted the fix-public-declaration-qa branch August 7, 2026 02:12
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