-
-
Notifications
You must be signed in to change notification settings - Fork 285
Add more autoprecompilation controls and Pkg.precompile() do to delay precompilation until after operations.
#4262
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 more autoprecompilation controls and Pkg.precompile() do to delay precompilation until after operations.
#4262
Conversation
6d16f7b to
3d38bb9
Compare
|
@KristofferC what do you think about this? |
Pkg.precompile(f) do to delay precompilation until after operations.Pkg.precompile() do to delay precompilation until after operations.
|
Bump @KristofferC |
|
Probably makes sense to have, yes. |
5efee07 to
16f78d9
Compare
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.
Pull Request Overview
Adds scoped and global controls for automatic package precompilation by introducing a Pkg.precompile() do ... end block to defer compilation and a Pkg.autoprecompilation_enabled(state::Bool) API to toggle auto-precompilation.
- Introduce
Pkg.precompile() do ... endsyntax that disables auto-precompilation inside the block and runs a single compile at the end. - Add
Pkg.autoprecompilation_enabled(state::Bool)for session-wide enable/disable of automatic precompilation. - Update tests, documentation, and the changelog to reflect the new features.
Reviewed Changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| test/api.jl | Add tests covering the do-block precompile behavior and global toggle |
| src/Pkg.jl | Implement global/scoped flags, extend should_autoprecompile, add docstrings |
| src/API.jl | Define the precompile(f, args...; kwargs...) method for do-block syntax |
| docs/src/environments.md | Document both environment-variable, programmatic, and scoped controls |
| docs/src/api.md | Add Pkg.autoprecompilation_enabled to the API index |
| CHANGELOG.md | Record the new block syntax and global toggle additions |
Comments suppressed due to low confidence (2)
docs/src/environments.md:207
- Clarify this bullet to highlight the do-block syntax users will write (e.g.
Pkg.precompile() do ... end) rather than referring to the internal function signature.
- **Scoped control**: Use `Pkg.precompile(f, args...; kwargs...)` to execute a function `f` with auto-precompilation temporarily disabled, then automatically trigger precompilation afterward if any packages were modified during the execution.
src/Pkg.jl:228
- [nitpick] This sentence is a fragment; consider rephrasing to
To delay auto-precompilation until after a batch of Pkg actions, use the do-block syntax:for clarity.
To delay autoprecompilation of multiple Pkg actions until the end use.
fc3b7d3 to
184e234
Compare
ae6f361 to
12bf9f1
Compare
4144e09 to
92b541a
Compare
92b541a to
ddf5666
Compare
i.e. with this it will precompile the env at the end of this, not after every step
Also a non-scoped version:
TODO: