Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Warn about cycles in extension precompilation #53882

Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
fix
  • Loading branch information
IanButterworth committed Apr 5, 2024
commit a3803379605b8bb2547b08bfcf068b2f458df91e
12 changes: 6 additions & 6 deletions base/loading.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1484,12 +1484,6 @@ function run_extension_callbacks(pkgid::PkgId)
extids = pop!(EXT_DORMITORY, pkgid, nothing)
extids === nothing && return
for extid in extids
if in(extid.id, precompilation_stack)
@warn """
Dependency cycle detected in extension precompilation: $(precompilation_stack_list()) > $(extid.id.name)
Loading $(extid.id.name) here will likely fail.
"""
end
if extid.ntriggers > 0
# indicate pkgid is loaded
extid.ntriggers -= 1
Expand All @@ -1504,6 +1498,12 @@ function run_extension_callbacks(pkgid::PkgId)
if extid.ntriggers == 0
# actually load extid, now that all dependencies are met,
# and record the result
if in(extid.id, precompilation_stack)
@warn """
Dependency cycle detected in extension precompilation: $(precompilation_stack_list()) > $(extid.id.name)
Loading $(extid.id.name) here will likely fail.
"""
end
succeeded = succeeded && run_extension_callbacks(extid)
succeeded || push!(EXT_DORMITORY_FAILED, extid)
end
Expand Down