-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
[loading]: Rework preferences loading #38044
Conversation
71a65e3
to
f5552f0
Compare
@Keno I don't think I can use |
Yes, the GC push is for a stack location, not a value, so you can initialize the location to null and then push it. The error is correct. You need to root that value |
05f7682
to
810bb3f
Compare
@vtjnash you are probably interested in this from the perspective of communication happening between the code being compiled and the compiler. In short; when we call This should not make it any harder or easier to disallow parsing of TOML files off of the disk at compile time. Most likely what we'd do for that is change |
Yep, I was somewhat following along and that sounded like what I expected |
Implements the `Preferences` loading framework as outlined in [0]. The most drastic change is that the list of compile-time preferences is no longer sequestered within its own dictionary, but is instead autodetected at compile-time and communicated back to the compiler. This list of compile-time preferences is now embedded as an array of strings that the loader must load, then index into the preferences dictionary with that list to check the preferences hash. In a somewhat bizarre turn of events, because we want the `.ji` filename to incorporate the preferences hash, and because we can't know how to generate the hash until after we've precompiled, I had to move the `.ji` filename generation step to _after_ we precompile the `.ji` file. [0]: #37791 (comment)
810bb3f
to
c9aba74
Compare
Great, I will merge this when green then. |
Ah, wait, I don’t understand how you can look up something correctly by content hash with this scheme |
I'm not sure what you mean; what is content-hashed? |
Yeah, that's where I noticed that lookup won't work anymore. That function maybe should be replaced with |
Which function should be |
Spoke with Jameson, he's okay with this overall, so I'm going to merge. |
When preferences were first added, we originally did not have any preference merging across load path [0]. We later added that [1], but retained the requirement that for each individual element in the load path, preferences must have an entry in `Project.toml` listing the relevant package. This was partly on purpose (immediately binding the name to the UUID prevents confusion when a UUID<->name binding is not readily apparent) and partly just inheriting the way things worked back when preferences was written with just a single Project.toml in mind. This PR breaks this assumption to specifically allow an entry in the Julia load path that contains only a single `LocalPreferences.toml` file that sets preferences for packages that may or may not be in the current environment stack. The usecase and desire for this is well-motivated in [2], but basically boils down to "system admin provided preferences that should be used globally". In fact, one such convenient method that now works is to drop a `LocalPreferences.toml` file in the `stdlib` directory of your Julia distribution, as that is almost always a part of a Julia process's load path. [0] #37595 [1] #38044 [2] JuliaPackaging/Preferences.jl#33
Implements the
Preferences
loading framework as outlined in 0. Themost drastic change is that the list of compile-time preferences is no
longer sequestered within its own dictionary, but is instead
autodetected at compile-time and communicated back to the compiler.
This list of compile-time preferences is now embedded as an array of
strings that the loader must load, then index into the preferences
dictionary with that list to check the preferences hash.
In a somewhat bizarre turn of events, because we want the
.ji
filenameto incorporate the preferences hash, and because we can't know how to
generate the hash until after we've precompiled, I had to move the
.ji
filename generation step to after we precompile the
.ji
file.