Skip to content
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 being able to pass a CacheFlags() to isprecompiled to verify against a set of custom flags #53332

Merged
merged 4 commits into from
Feb 19, 2024

Conversation

KristofferC
Copy link
Sponsor Member

This makes it easier to also update isprecompiled to check for staleness with custom flags

This is the second take of #53316.

…eFlags()` object instead

This makes it easier to also update `isprecompiled` to check for staleness with custom flags
base/loading.jl Outdated
CacheFlags(f::Int) = CacheFlags(UInt8(f))
CacheFlags() = CacheFlags(ccall(:jl_cache_flags, UInt8, ()))

function _to_uint8(cf::CacheFlags)::UInt8
Copy link
Sponsor Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is new

base/loading.jl Outdated
return f
end

function _to_cmd(flags::Base.CacheFlags)
Copy link
Sponsor Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is new

Copy link
Sponsor Member

@vchuravy vchuravy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like this approach! Makes a lot of sense.

The only thing that is missing is -C handling which is not part of the CacheFlags, but impacts the cache in a similar way (if not more) than -O

It's the ImageTarget, but that is a more verbose representation than what we normally pass in.

@IanButterworth
Copy link
Sponsor Member

Sounds good to me, but haven't done a code review.

@KristofferC
Copy link
Sponsor Member Author

KristofferC commented Feb 15, 2024

I had to scale this back a bit (see latest commit) because we cannot recreate the command line flags from the CacheFlags object (--pkgimages=existing) so it became a bit awkward. Now you can verify a compile file against a CacheFlags at least.

Corresponding commit in Pkg: JuliaLang/Pkg.jl@7279a85

@KristofferC KristofferC changed the title change from passing in a command to compilecache to pass in a CacheFlags() object instead add being able to pass a CacheFlags() to isprecompiled to verify against a set of custom flags Feb 16, 2024
@KristofferC
Copy link
Sponsor Member Author

KristofferC commented Feb 19, 2024

Let's try this then. I'm adding a backport label because there is somewhat of a regression in Pkg now that it has to add itself to the test environment in 1.11 due to Pkg not being in the sysimage and this would help avoid that.

@KristofferC KristofferC merged commit 9c0f1dc into master Feb 19, 2024
7 checks passed
@KristofferC KristofferC deleted the kc/isprecompiled_flags branch February 19, 2024 12:11
@@ -387,6 +387,7 @@
XX(jl_raise_debugger) \
XX(jl_readuntil) \
XX(jl_cache_flags) \
XX(jl_match_cache_flags_current) \
Copy link
Sponsor Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor nit: this file is the list of functions in julia.h that are intended to be the eventual stable API for use by C programs. You don't need to add functions here merely to use them from Julia, and doing so can add confusion to what the C API is.

@KristofferC KristofferC added the backport 1.11 Change should be backported to release-1.11 label Feb 26, 2024
KristofferC added a commit that referenced this pull request Feb 26, 2024
…a precompile file against a set of custom flags (#53332)

(cherry picked from commit 9c0f1dc)
@KristofferC KristofferC mentioned this pull request Feb 26, 2024
28 tasks
KristofferC added a commit that referenced this pull request Mar 1, 2024
Backported PRs:
- [x] #53361 <!-- 🤖 [master] Bump the SparseArrays stdlib from c9f7293
to cb602d7 -->
- [x] #53300 <!-- allow external absint to hold custom data in
`codeinst.inferred` -->
- [x] #53342 <!-- Add `Base.wrap` to docs -->
- [x] #53372 <!-- Silence warnings in `test/file.jl` -->
- [x] #53357 <!-- 🤖 [master] Bump the Pkg stdlib from 6dd0e7c9e to
76070d295 -->
- [x] #53373 <!-- fix sysimage-native-code=no option with pkgimages -->
- [x] #53333 <!-- More consistent return value for annotations, take 2
-->
- [x] #53354 <!-- fix code coverage bug in tail position and `else` -->
- [x] #53407 <!-- fix sysimage-native-code=yes option -->
- [x] #53388 <!-- Fix documentation: thread pool of main thread -->
- [x] #53355 <!-- Fix synchronization issues on the GC scheduler. -->
- [x] #53429 <!-- Subtype: skip slow-path in `local_∀_∃_subtype` if
inputs contain no ∃ typevar. -->
- [x] #53437 <!-- Add debug variant of loader_trampolines.o -->
- [x] #53284 <!-- Add annotate! method for AnnotatedIOBuffer -->
- [x] #53466 <!-- [MozillaCACerts_jll] Update to v2023-12-12 -->
- [x] #53467 <!-- [LibGit2_jll] Update to v1.7.2 -->
- [x] #53326 <!-- RFC: when loading code for internal purposes, load
stdlib files directly, bypassing DEPOT_PATH, LOAD_PATH, and stale checks
-->
- [x] #53332
- [x] #53320 <!-- Add `Sys.isreadable, Sys.iswriteable`, update `ispath`
-->
- [x] #53476

Contains multiple commits, manual intervention needed:
- [ ] #53285 <!-- Add update mechanism for Terminfo, and common
user-alias data -->

Non-merged PRs with backport label:
- [ ] #53424 <!-- yet more atomics & cache-line fixes on work-stealing
queue -->
- [ ] #53408 <!-- task splitting: change additive accumulation to
multiplicative -->
- [ ] #53403 <!-- Move parallel precompilation to Base -->
- [ ] #53402 <!-- Add `jl_getaffinity` and `jl_setaffinity` -->
- [ ] #53391 <!-- Default to the medium code model in x86 linux -->
- [ ] #53125 <!-- coverage: count coverage where explicitly requested by
inference only -->
- [ ] #52694 <!-- Reinstate similar for AbstractQ for backward
compatibility -->
@KristofferC KristofferC removed the backport 1.11 Change should be backported to release-1.11 label Mar 1, 2024
tecosaur pushed a commit to tecosaur/julia that referenced this pull request Mar 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants