-
-
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
RFC: use Preference system for julia itself #41295
Comments
The first step for this is to print |
Why? That doesn't seem necessary. There is a TOML parser in base already. |
I actually tried to implement this myself, I don't see the need of using Preferences.jl inside Base? or I could be wrong, I think we need a list of configurations that should go into the julia preference field first (I'll init a list of them here I found later). For whoever sees an issue related to perference or could be configured, maybe link to this issue And the other problem is should we special case the or should this UUID be recognized as the Julia UUID? |
Yes, the UUID of Julia itself is
I guess if we don't want to support writing preferences, and we don't care about marking function load_julia_preferences()
# Re-use definition in `base/loading.jl` so as to not repeat code.
d = Base.get_preferences(Base.UUID("1222c4b2-2114-5bfd-aeef-88e4692bbb3e"))
# Drop any nested `__clear__` keys:
function drop_clears(data::Dict)
delete!(data, "__clear__")
for (k, v) in data
if isa(v, Dict)
drop_clears(v)
end
end
return data
end
drop_clears(x) = x
return drop_clears(d)
end
# Initialize JULIA_PREFS with a value so it can be used at compile time
const JULIA_PREFS = Ref{Dict}(load_julia_preferences())
function __init__()
# Re-initialize JULIA_PREFS at `__init__()` time, so that users can make changes to things that are not compile-time sensitive
JULIA_PREFS[] = load_julia_preferences()
end And we tell users "if you want to modify the preferences, you either edit them by hand, or you use |
I think now with the preference system, it would be nice to configure julia itself withit per environment, e.g
-J<path to system image>
per project environmentcompile=min
or-O1
or other compiler flags for certain project while developingnot all of the above is achievable/convenient by messing up system environment variables, from user experience if we support the new configure system
one can:
.julia
which is seperate with.bashrc
/.zshrc
etc. this will make it easier to migrate the same preference to cluster etc.my proposed implementation is to support a special field like following
for
Project.toml
for
LocalPreference.toml
edit: I realize not all the options can be configured easily using the preference system since it seems to require loading stdlib TOML.jl first, which means things implemented in C won't be able to configured afterwards, but still would be nice to be able to configure things within REPL itself (even by restart REPL to activate the new configuration)
The text was updated successfully, but these errors were encountered: