-
-
Notifications
You must be signed in to change notification settings - Fork 192
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
Update LOAD_PATH in dump_preferences
to include @stdlibs
#878
Update LOAD_PATH in dump_preferences
to include @stdlibs
#878
Conversation
@fredrikekre it would be great if you could have a look if this is what you had in mind |
Should be possible to always just use |
Yeah, exactly. This is what has me worried as well, since the whole point of using an external process for getting the preferences is to make sure that we do not miss anything (or mix it up with another project). Instead of using new_load_path = get(ENV, "JULIA_LOAD_PATH", "") * "$(splitter)@stdlib" That would prevent the |
Codecov Report
@@ Coverage Diff @@
## master #878 +/- ##
==========================================
- Coverage 84.28% 84.26% -0.02%
==========================================
Files 3 3
Lines 802 801 -1
==========================================
- Hits 676 675 -1
Misses 126 126
|
To be completely idiot-proof I think you should always put |
Are you sure that is necessary? In that case I would need to track if I added But which situation did you have in mind that would be guarded against using this approach with |
You should be able to do it unconditionally.
A user could theoretically have another package named Pkg or TOML in their project (with different UUID). I also think the patch becomes smaller with this approach too: diff --git a/src/PackageCompiler.jl b/src/PackageCompiler.jl
index 3624b35..572a7e1 100644
--- a/src/PackageCompiler.jl
+++ b/src/PackageCompiler.jl
@@ -1536,7 +1536,9 @@ function dump_preferences(io::IO, project_dir)
# Note: in `command` we cannot just use `Base.get_preferences()`, since this API was
# only introduced in Julia v1.8
command = """
+ pushfirst!(LOAD_PATH, "@stdlib")
using TOML, Pkg
+ popfirst!(LOAD_PATH)
# For each dependency pair (UUID => PackageInfo), store preferences in Dict
prefs = Dict{String,Any}(last(dep).name => Base.get_preferences(first(dep)) for dep in Pkg.dependencies())
# Filter out packages without preferences |
Please remove the @-mention from the squash later, looks like Github still pings when such commits are pushed... |
Hopefully fixes #873.