Skip to content

Commit c2f433e

Browse files
authored
Update LOAD_PATH in dump_preferences to include @stdlibs (#878)
* Update LOAD_PATH in `dump_preferences` to include `@stdlibs` * Reuse content of `JULIA_LOAD_PATH` * Apply suggestion by fredrikekre
1 parent 07d900f commit c2f433e

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

src/PackageCompiler.jl

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1535,7 +1535,10 @@ function dump_preferences(io::IO, project_dir)
15351535
# Note: in `command` we cannot just use `Base.get_preferences()`, since this API was
15361536
# only introduced in Julia v1.8
15371537
command = """
1538+
# Ensure that `@stdlib` is part of `LOAD_PATH` such that we get TOML and Pkg
1539+
pushfirst!(LOAD_PATH, "@stdlib")
15381540
using TOML, Pkg
1541+
popfirst!(LOAD_PATH)
15391542
# For each dependency pair (UUID => PackageInfo), store preferences in Dict
15401543
prefs = Dict{String,Any}(last(dep).name => Base.get_preferences(first(dep)) for dep in Pkg.dependencies())
15411544
# Filter out packages without preferences

0 commit comments

Comments
 (0)