Skip to content

Commit

Permalink
check that file being precompiled contains a module
Browse files Browse the repository at this point in the history
  • Loading branch information
IanButterworth committed Oct 7, 2023
1 parent 60b10de commit 32a0a52
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions base/loading.jl
Original file line number Diff line number Diff line change
Expand Up @@ -2249,6 +2249,9 @@ end
# this is called in the external process that generates precompiled package files
function include_package_for_output(pkg::PkgId, input::String, depot_path::Vector{String}, dl_load_path::Vector{String}, load_path::Vector{String},
concrete_deps::typeof(_concrete_dependencies), source::Union{Nothing,String})
if !occursin("module ", readuntil(input, "module ", keep = true))
throw(ErrorException("Package $pkg source file $input does not contain a module."))
end
append!(empty!(Base.DEPOT_PATH), depot_path)
append!(empty!(Base.DL_LOAD_PATH), dl_load_path)
append!(empty!(Base.LOAD_PATH), load_path)
Expand Down

0 comments on commit 32a0a52

Please sign in to comment.