Skip to content

Commit 4e9b963

Browse files
committed
add a test that extension is available during precompilation
1 parent 4f93b4b commit 4e9b963

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

base/loading.jl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2153,6 +2153,7 @@ This can be used to reduce package load times. Cache files are stored in
21532153
for important notes.
21542154
"""
21552155
function compilecache(pkg::PkgId, internal_stderr::IO = stderr, internal_stdout::IO = stdout)
2156+
@info "Calling compilecache with pkg: $pkg"
21562157
@nospecialize internal_stderr internal_stdout
21572158
path = locate_package(pkg)
21582159
path === nothing && throw(ArgumentError("$pkg not found during precompilation"))

test/project/Extensions/HasDepWithExtensions.jl/src/HasDepWithExtensions.jl

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,12 @@ using HasExtensions: HasExtensions, HasExtensionsStruct
44
using ExtDep: ExtDepStruct
55
# Loading ExtDep makes the extension "Extension" load
66

7+
Base.get_extension(HasExtensions, :Extension) isa Module || error("extension not loaded during precompilation")
8+
79
function do_something()
810
HasExtensions.foo(HasExtensionsStruct()) == 1 || error()
911
HasExtensions.foo(ExtDepStruct()) == 2 || error()
12+
Base.get_extension(HasExtensions, :Extension) isa Module || error("extension not loaded during __init__")
1013
return true
1114
end
1215

0 commit comments

Comments
 (0)