Skip to content

Use 3-arg LLVM.lookup to avoid deprecation warning#102

Merged
gbaraldi merged 1 commit into
JuliaLang:mainfrom
ChrisRackauckas-Claude:fix-lookup-deprecation
May 15, 2026
Merged

Use 3-arg LLVM.lookup to avoid deprecation warning#102
gbaraldi merged 1 commit into
JuliaLang:mainfrom
ChrisRackauckas-Claude:fix-lookup-deprecation

Conversation

@ChrisRackauckas-Claude
Copy link
Copy Markdown
Contributor

Please ignore until reviewed by @ChrisRackauckas.

Summary

LLVM.jl v9.8.1 (released 2026-05-12) added an @deprecate for the 2-arg lookup(jljit::JuliaOJIT, name) form in favor of the new 3-arg lookup(jljit, jd, name). The old form was removed upstream in JuliaLang/julia#60988 for Julia 1.14.0-DEV.2171.

src/compiler.jl:114 calls LLVM.lookup(lljit, entry_name) from inside the @check_allocs-generated link path, so the depwarn fires at every JIT lookup. Downstream packages that exercise @check_allocs under @test_nowarn see the warning surface as a test failure — see SciML/LinearSolve.jl#984 (test/nopre/static_arrays.jl:25).

Fix

  • Pass the already-constructed jd::JITDylib explicitly: LLVM.lookup(lljit, jd, entry_name).
  • Bump LLVM compat from 9.19.8.1 because the 3-arg lookup(::JuliaOJIT, ::JITDylib, ::Any) method was first introduced in v9.8.1.
  • Bump package version 0.2.30.2.4.

Verification

Local on Julia 1.11.9 with LLVM.jl v9.8.1:

  • Pkg.test() passes (all suites green).
  • @check_allocs round-trip under --depwarn=error runs cleanly — confirming the deprecation warning is gone.
$ julia +1.11 --depwarn=error --project=. /tmp/test_depwarn.jl
OK: no deprecation warning

Test plan

  • AllocCheck.jl test suite passes locally
  • No LLVM.lookup depwarn under --depwarn=error
  • CI green on this PR
  • Confirm LinearSolve.jl test/nopre/static_arrays.jl passes once a tagged release of AllocCheck includes this fix

LLVM.jl v9.8.1 deprecated the 2-arg `lookup(jljit::JuliaOJIT, name)` form
in favor of `lookup(jljit, jd, name)` (the old form was removed in
JuliaLang/julia#60988 for Julia 1.14.0-DEV.2171). The depwarn fired
during the JIT lookup inside `@check_allocs`-generated code, which
caused downstream packages testing `@check_allocs` with `@test_nowarn`
to fail.

Pass the already-constructed `jd::JITDylib` explicitly. Bumps LLVM
compat to 9.8.1 since the 3-arg JuliaOJIT method was added in that
release.

Co-Authored-By: Chris Rackauckas <accounts@chrisrackauckas.com>
@ChrisRackauckas
Copy link
Copy Markdown
Member

Looks like a reasonable depwarn fix to me. @topolarity or @gbaraldi

@gbaraldi gbaraldi marked this pull request as ready for review May 15, 2026 11:16
@gbaraldi gbaraldi merged commit fdb8d67 into JuliaLang:main May 15, 2026
5 checks passed
@ChrisRackauckas
Copy link
Copy Markdown
Member

Did this get a tag? I'm still seeing downstream failures.

ChrisRackauckas-Claude pushed a commit to ChrisRackauckas-Claude/LinearSolve.jl that referenced this pull request May 20, 2026
AllocCheck v0.2.4 was released 2026-05-20 with the fix from
JuliaLang/AllocCheck.jl#102 ("Use 3-arg LLVM.lookup to avoid deprecation
warning"). This unblocks the NoPre test group on LinearSolve, which had
been red on every PR for 8 days due to AllocCheck 0.2.3 triggering an
LLVM.jl 9.8.1 depwarn that `@test_nowarn` in test/nopre/static_arrays.jl
correctly captured.

Co-Authored-By: Chris Rackauckas <accounts@chrisrackauckas.com>
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