-
Notifications
You must be signed in to change notification settings - Fork 3
avoid loading pkg until needed #1
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
Open
IanButterworth
wants to merge
11
commits into
main
Choose a base branch
from
ib/dont_load_pkg
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 8 commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
362299d
avoid loading pkg until we have to
IanButterworth e80fa25
tryfix
IanButterworth e3fd69f
fixes
IanButterworth 80dd849
don't cache artifacts because we need to test downloading
IanButterworth 2a6b4e4
update CI
IanButterworth 3aeb8be
fix getting output back from subprocess
IanButterworth 9999ed5
add comment
IanButterworth 80b12ab
add a precompile
IanButterworth 83e3328
only use a subprocess if generating output (precompiling)
IanButterworth 6cde8c2
add invokelatest
IanButterworth ca58bba
improve comments
IanButterworth File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,2 @@ | ||
|
|
||
| Manifest.toml |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Hmm, unfortunately running a sub-process with dynamic code like this is very incompatible with
--trimThere 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.
See #1 (comment) for some discussion
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.
And JuliaLang/julia#55725 (comment)
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.
Is it possible to do this only during pre-compilation? That behavior on its own is fine, but doing it at runtime is problematic for
--trimThere 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.
If we revert JuliaPackaging/JLLWrappers.jl#66 yes 😛
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.
I don't really agree that lazy artifacts are incompatible with AOT compilation - but they are definitely incompatible with the idea of providing a self-contained executable/package
My request was for this to be branched on
Base.generating_output()because thetruebranch is not inferable/compilable forjuliac, but we have ways to letjuliacknow that only thefalsebranch is ever taken at run-time.In that case, you're still running an AOT-compiled executable and the download works - it just happens lazily.
Uh oh!
There was an error while loading. Please reload this page.
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.
(Didn't see Cody's reply before sending this)
I think the question here is more about legality, rather than preference that something orchestrating
--trimwould have for artifact downloads a la PackageCompiler.As it is now seems more generally legal.
Uh oh!
There was an error while loading. Please reload this page.
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.
On second thought, I fear that
Base.require_stdlibis still going to be effectively impossible for us to inferWe're not even allowed to load the stdlib for inference on its own functions, because that would break the same pre-compilation assumptions we're skirting in the other branch.
I'm a bit worried that this change just makes LazyArtifacts incompatible with
--trimunfortunatelyWe might have to find a way to load Pkg eagerly for
--trimalone (which unfortunately means that AOT-compiled applications don't get this speed up)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.
I don't know if you can infer it directly, but you should be able to pre-emulate it, since it is just a shim for finding the right
.jifile to load, and that can be pre-computed and run directly (esp. for --trim)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.
Right but then I need to infer
Pkg.Artifacts.try_artifact_download_sourcesand also ensure that its code is available in the loaded pkgimage (or our own sysimage)