-
-
Notifications
You must be signed in to change notification settings - Fork 268
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
Proposal for more first class handing of sysimages in Pkg #2008
Comments
|
Yeah, I wrote JuliaLang/julia#35794 so that user-friendly interface like this would be easy to implement. FWIW, the proposal LGTM. A few minor comments:
Maybe do what
My approach in JuliaLang/julia#35794 was to compute system image storage path from (the hash of) the path to I think it's likely that minor version would be installed in a different path so this may be enough. To be more careful, I think we can include, e.g., Julia version in the hash. |
Yes, that is better.
Not sure it will be enough on mac where I think it is |
Ah, that's unfortunate. I guess I'd have to put the version in the hash if we are going to use JuliaLang/julia#35794. |
This is only semi related to the feature proposed here, but I think it would be helpful if the resolver could take into account the sysimage when choosing versions of dependencies. E.g. if I start with a "base" sysimage with say things like Plots, and then I make an environment and start adding packages to it, it would be great if my shared dependencies / transitive dependencies chose versions that did not conflict with those baked into the sysimage already. Already the manifest you get from a Project.toml depends on the version of Julia you use, but maybe it should actually depend on the sysimage you use (of which Julia version is kind of a special case). My actual use-case isn't plots, but is very similar, something like: some process has produced a docker image with Julia and a sysimage and some code and/or other artifacts. Now I want to start from that image and add some more packages. I don't want to regenerate the sysimage (since that takes awhile and the code I'm adding is comparatively light) but I do want versions resolved correctly so I don't run into weird bugs.
I think the above could help with this; at least, if you don't have a manifest, it could try to resolve a compatible manifest instead of just giving a warning. And if you do have a Manifest, it could warn or maybe even prompt to regenerate the manifest. |
If we store the version of Plots into the sysimage, this could be done. And yes, I think that should be done as a part of this proposal. |
It seems to me there might be some overlap with #1233 in terms of merging projects. I.e. if you have a sysimage loaded, then any project you activate is kind of a "subproject" of the project baked into that sysimage (with regards to version resolution, I'm not talking about folder structure or anything like that of course). |
Yes, I think that is a pretty good way to look at it. |
It would be great if this proposal had some way of excluding packages from the sysimage, e.g. just compile the registered dependenices of the package whose environment you are in, so you don't need to recompile the sysimage if you update a dev'd / add'd dependency or the package code itself. |
Issue
Using a custom sysimage can drastically reduce load times of packages. The goto solution for this is PackageCompiler.jl and it works well but it isn't used as much as perhaps warranted considering the benefits it provides. From some discussion, it seems that it is a bit too much of a "mental overhead" to use it. To use PackageCompiler.jl for a sysimage it requires you to:
There is currently no way to automatically detect this.
Since load time of packages and "time to first plot" are a frequent gripe about Julia, it makes sense to see if
we can give a better interface to PackageCompiler.
Proposal
The proposal here is to introduce a new set of Pkg API that handles sysimages. To give a taste of what a session would look like:
Next time we start julia:
So the concrete proposal here is to add convenience functionalities to Pkg to make dealing with sysimage easier.
In addition, this proposes adding some functionality to Julia itself that allows it to automatically detect a custom sysimage next to the project and use that for the Julia process. This could be done via some naming convention.
Why in Pkg and not in a separate package.
The main point of this proposal is to reduce the friction in using e.g. PackageCompiler. Bundling it with Pkg allows it to use the super user-friendly Pkg REPL with no need to manually install anything. Also, we likely want to use a lot of the code in Pkg for dealing with projects, for status printing, etc so from that point of view, it makes sense to have it in Pkg. One question is if the code for PackageCompiler itself should move into Pkg. I think it is best to not do this but instead, just install PackageCompiler into the global project from Pkg when the
sysimage
command is used for the first time.Possible complications:
cc @tkf since I think you have thought a bit about stuff like this
The text was updated successfully, but these errors were encountered: