add being able to pass a CacheFlags() to isprecompiled to verify against a set of custom flags#53332
Conversation
…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 |
base/loading.jl
Outdated
| return f | ||
| end | ||
|
|
||
| function _to_cmd(flags::Base.CacheFlags) |
vchuravy
left a comment
There was a problem hiding this comment.
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.
|
Sounds good to me, but haven't done a code review. |
|
I had to scale this back a bit (see latest commit) because we cannot recreate the command line flags from the Corresponding commit in Pkg: JuliaLang/Pkg.jl@7279a85 |
compilecache to pass in a CacheFlags() object insteadCacheFlags() to isprecompiled to verify against a set of custom flags
|
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. |
| XX(jl_raise_debugger) \ | ||
| XX(jl_readuntil) \ | ||
| XX(jl_cache_flags) \ | ||
| XX(jl_match_cache_flags_current) \ |
There was a problem hiding this comment.
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.
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 -->
…a precompile file against a set of custom flags (JuliaLang#53332)
This makes it easier to also update
isprecompiledto check for staleness with custom flagsThis is the second take of #53316.