Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
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
17 changes: 17 additions & 0 deletions base/client.jl
Original file line number Diff line number Diff line change
Expand Up @@ -426,6 +426,22 @@ function load_InteractiveUtils(mod::Module=Main)
return Core.eval(mod, :(using Base.MainInclude.InteractiveUtils; Base.MainInclude.InteractiveUtils))
end

function load_LinearAlgebra(mod::Module=Main)
# load LinearAlgebra stdlib
if !isdefined(MainInclude, :LinearAlgebra)
try
let LinearAlgebra = Base.require_stdlib(Base.PkgId(Base.UUID((0x37e2e46d_f89d_539d,0xb4ee_838fcccc9c8e)), "LinearAlgebra"))
MainInclude.LinearAlgebra = LinearAlgebra
end
catch ex
@warn "Failed to import LinearAlgebra into module $mod" exception=(ex, catch_backtrace())
return nothing
end
end
Core._using(mod, MainInclude.LinearAlgebra)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think we should do this; LinearAlgebra is not using'd by default currently. We also don't need the identifier in MainInclude as far as I can tell.

return MainInclude.LinearAlgebra
end

function load_REPL()
# load interactive-only libraries
try
Expand Down Expand Up @@ -516,6 +532,7 @@ function run_main_repl(interactive::Bool, quiet::Bool, banner::Symbol, history_f
fallback_repl = parse(Bool, get(ENV, "JULIA_FALLBACK_REPL", "false"))
if !fallback_repl && interactive
load_InteractiveUtils()
load_LinearAlgebra()
REPL = REPL_MODULE_REF[]
if REPL === Base
load_REPL()
Expand Down
6 changes: 3 additions & 3 deletions base/sysimg.jl
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,8 @@ let
stdlibs = [
# No dependencies
:FileWatching, # used by loading.jl -- implicit assumption that init runs
:Libdl, # Transitive through LinAlg
:Artifacts, # Transitive through LinAlg
:Libdl,
:Artifacts,
:SHA, # transitive through Random
:Sockets, # used by stream.jl

Expand All @@ -94,7 +94,7 @@ let
# libblastrampoline_jll

# 1-depth packages
:LinearAlgebra, # Commits type-piracy and GEMM
# :LinearAlgebra, # Commits type-piracy and GEMM
:Random, # Can't be removed due to rand being exported by Base
]
end
Expand Down
3 changes: 2 additions & 1 deletion stdlib/REPL/src/REPL.jl
Original file line number Diff line number Diff line change
Expand Up @@ -820,11 +820,12 @@ setmodifiers!(c::REPLCompletionProvider, m::LineEdit.Modifiers) = c.modifiers =
Set `mod` as the default contextual module in the REPL,
both for evaluating expressions and printing them.
"""
function activate(mod::Module=Main; interactive_utils::Bool=true)
function activate(mod::Module=Main; interactive_utils::Bool=true, linearalgebra::Bool=true)
mistate = (Base.active_repl::LineEditREPL).mistate
mistate === nothing && return nothing
mistate.active_module = mod
interactive_utils && Base.load_InteractiveUtils(mod)
linearalgebra && Base.load_LinearAlgebra(mod)
return nothing
end

Expand Down
3 changes: 1 addition & 2 deletions stdlib/stdlib.mk
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
STDLIBS_WITHIN_SYSIMG := \
Artifacts FileWatching Libdl SHA libblastrampoline_jll OpenBLAS_jll Random \
LinearAlgebra Sockets
Artifacts FileWatching Libdl SHA Random Sockets

INDEPENDENT_STDLIBS := \
ArgTools Base64 CRC32c Dates DelimitedFiles Distributed Downloads Future \
Expand Down
Loading