-
Notifications
You must be signed in to change notification settings - Fork 2
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
avoid loading pkg until needed #1
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 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 |
---|---|---|
|
@@ -14,32 +14,25 @@ jobs: | |
strategy: | ||
fail-fast: false | ||
matrix: | ||
julia-version: | ||
- "nightly" | ||
os: | ||
- ubuntu-latest | ||
julia-arch: | ||
- x64 | ||
include: | ||
- os: ubuntu-latest | ||
julia-arch: x64 | ||
julia-version: 'nightly' | ||
- os: windows-latest | ||
julia-arch: x64 | ||
julia-version: 'nightly' | ||
- os: macos-latest | ||
julia-arch: aarch64 | ||
julia-version: 'nightly' | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: julia-actions/setup-julia@v1 | ||
- uses: actions/checkout@v4 | ||
- uses: julia-actions/setup-julia@v2 | ||
with: | ||
version: ${{ matrix.julia-version }} | ||
arch: ${{ matrix.julia-arch }} | ||
- name: Cache artifacts | ||
uses: actions/cache@v2 | ||
env: | ||
cache-name: cache-artifacts | ||
- uses: julia-actions/julia-buildpkg@v1 | ||
- uses: julia-actions/julia-runtest@v1 | ||
- uses: julia-actions/julia-processcoverage@v1 | ||
- uses: codecov/codecov-action@v2 | ||
with: | ||
path: ~/.julia/artifacts | ||
key: ${{ runner.os }}-test-${{ env.cache-name }}-${{ hashFiles('**/Project.toml') }} | ||
restore-keys: | | ||
${{ runner.os }}-test-${{ env.cache-name }}- | ||
${{ runner.os }}-test- | ||
${{ runner.os }}- | ||
- uses: julia-actions/julia-buildpkg@latest | ||
- uses: julia-actions/julia-runtest@latest | ||
- uses: julia-actions/[email protected] | ||
continue-on-error: true | ||
- uses: julia-actions/[email protected] | ||
continue-on-error: true | ||
files: lcov.info |
This file contains 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 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
Oops, something went wrong.
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
--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.
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
--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.
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 thetrue
branch is not inferable/compilable forjuliac
, but we have ways to letjuliac
know that only thefalse
branch 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.
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
--trim
would have for artifact downloads a la PackageCompiler.As it is now seems more generally legal.
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_stdlib
is 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
--trim
unfortunatelyWe might have to find a way to load Pkg eagerly for
--trim
alone (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
.ji
file 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_sources
and also ensure that its code is available in the loaded pkgimage (or our own sysimage)