-
-
Notifications
You must be signed in to change notification settings - Fork 5.4k
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
add mechanism for configuring system image builds #54387
base: master
Are you sure you want to change the base?
Conversation
Kind of tangential, but having full-on Julia source code as the configuration file format seems VERY dangerous, especially if people start sharing these. Would using a TOML be an option instead? That would also have the advantage of making the configuration file easier to document in terms of what the compiler actually looks for in the configuration options. |
It would at least be good to have support for setting these from e.g. |
TOML would be good, we just don't yet have a parser available at this stage. It will be awkward, since we don't even have arrays or dicts at this stage. The target user for this is code like PackageCompiler that is building custom system images. I don't expect anyone to change these settings just when building julia with Make.user. For comparison, currently PackageCompiler literally rewrites the file |
Yeah, I figured.. It's a bootstrapping thing all over again! |
base/settings.jl
Outdated
if Intrinsics.slt_int(1, getfield(getfield(ARGS, :size), 1)) | ||
include(Settings, memoryrefget(memoryref(ARGS.ref, 2, false), :not_atomic, false)) | ||
end |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What's this magic here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is an array getindex that is hard-coded presumably due to bootstraping issues.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
specifically, this is
if 1 <= length(ARGS)
include(Settings, ARGS[2])
end
5c1ef73
to
cbf8380
Compare
OK I have a better implementation:
|
This adds the option to pass a filename of configuration settings when building the Core/compiler system image (from
base/compiler/compiler.jl
). This makes it easier to build different flavors of images, for example it can replace the hack that PackageCompiler uses to edit the list of included stdlibs, and makes it easy to change knobs you might want like max_methods.Will need corresponding changes to PackageCompiler.