-
Notifications
You must be signed in to change notification settings - Fork 55
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
Make TimeZones.jl
relocatable
#479
Merged
Merged
Changes from 1 commit
Commits
Show all changes
21 commits
Select commit
Hold shift + click to select a range
56865ff
Set _COMPILED_DIR during __init__
lcontento 05d4c9e
Add fallback for older versions of TZJData
lcontento ca1ba7b
Backwards compatibility with hardcoded artifact hashes
lcontento 8879f7e
Merge branch 'master' into lc/relocatable
lcontento 0402582
remove the docs manifest
lcontento c7612a0
Turn off coverage for the setting of _COMPILED_DIR
lcontento 9af280c
Determine tree hash directly from Artifacts.toml
omus f448082
Merge branch 'master' into lc/relocatable
omus 3fbda1d
Remove CodeCov exclusion comments
omus 5aa01e6
Use `locate_package`
omus 7e3a3cb
Test for sysimage
omus 63cbb29
fixup! Test for sysimage
omus c303339
fixup! Test for sysimage
omus 99f9e7e
fixup! Test for sysimage
omus 451d241
fixup! Test for sysimage
omus 3aa1b39
fixup! Test for sysimage
omus c64babd
fixup! Test for sysimage
omus b70192c
Validate test failure
omus 73da68a
fixup! Test for sysimage
omus 549fdfd
Back to working
omus 8d430e1
Make job name unique
omus 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
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.
This will not work with a system image because
pkgdir(TZJData)
is the path of the TZJData package on the machine that created the system image.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.
One could try to take the last part of the path and look into all depots until one finds the new package path. However, I am not 100% sure that having the source of the package in the depot is a requirement; I think you can probably run the system image without downloading the source. Hence, my original, but defintely not elegant, approach of hard-coding the hashes...
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.
Really? That seems like a bug as we're calling
pkgdir
at package initialization time so this should be looked up on the system which is running the sysimageThere 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 guess it's a situation similar to
@__DIR__
which is also non-relocatable.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.
Appears to be working as intended (future reader note. You need to use TZJData 1.3.0):
Maybe there is something I'm forgetting about sysimages. Can you verify this works for your use case?
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.
Thanks. I was also working on an example:
The system image no longer requires the package contents or the
.ji
to be present in the depot. However, the artifact must still exist. The solution I have in place withpkgdir
does allowpkgdir
to point to the location where theArtifact.toml
would be but will fail when trying to load the file.Update: I just realized I was using an old version of PackageCompiler.jl
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 suspect I'll roll back to using the hardcoded hashes but I'll do a little more experimentation first
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 came up with an improved MWE:
It looks like we can use
Base.identify_package
andBase.locate_package
to get the package location with the activated sysimage.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.
How long does it take to build a sysimage that contains TimeZones.jl? If it just takes a few minutes, could we maybe add a sysimage test to CI, so that we can catch any relocatability regressions in the future?
We could check for
ENV["CI"]
, so that people who runPkg.test("TimeZones")
locally don't have to run the test if they don't want to.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 ended up writing these tests directly in GHA. If I find this to be problematic I'll pull them out into the TimeZones tests directly in the future