You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: CHANGELOG.md
+2Lines changed: 2 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -7,6 +7,8 @@ Pkg v1.13 Release Notes
7
7
-`update` now shows a helpful tip when trying to upgrade a specific package that can be upgraded but is held back because it's part of a less optimal resolver solution ([#4266])
8
8
-`Pkg.status` now displays yanked packages with a `[yanked]` indicator and shows a warning when yanked packages are present. `Pkg.resolve` errors also display warnings about yanked packages that are not resolvable. ([#4310])
9
9
- Added `pkg> compat --current` command to automatically populate missing compat entries with the currently resolved package versions. Use `pkg> compat --current` for all packages or `pkg> compat Foo --current` for specific packages. ([#3266])
10
+
- Added `Pkg.precompile() do` block syntax to delay autoprecompilation until after multiple operations complete, improving efficiency when performing several environment changes. ([#4262])
11
+
- Added `Pkg.autoprecompilation_enabled(state::Bool)` to globally enable or disable automatic precompilation for Pkg operations. ([#4262])
Copy file name to clipboardExpand all lines: docs/src/environments.md
+40-3Lines changed: 40 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -190,16 +190,53 @@ If a given package version errors during auto-precompilation, Pkg will remember
190
190
automatically tries and will skip that package with a brief warning. Manual precompilation can be used to
191
191
force these packages to be retried, as `pkg> precompile` will always retry all packages.
192
192
193
-
To disable the auto-precompilation, set `ENV["JULIA_PKG_PRECOMPILE_AUTO"]=0`.
194
-
195
193
The indicators next to the package names displayed during precompilation
196
-
indicate the status of that package's precompilation.
194
+
indicate the status of that package's precompilation.
197
195
198
196
-`[◐, ◓, ◑, ◒]` Animated "clock" characters indicate that the package is currently being precompiled.
199
197
-`✓` A green checkmark indicates that the package has been successfully precompiled (after which that package will disappear from the list). If the checkmark is yellow it means that the package is currently loaded so the session will need to be restarted to access the version that was just precompiled.
200
198
-`?` A question mark character indicates that a `PrecompilableError` was thrown, indicating that precompilation was disallowed, i.e. `__precompile__(false)` in that package.
201
199
-`✗` A cross indicates that the package failed to precompile.
202
200
201
+
#### Controlling Auto-precompilation
202
+
203
+
Auto-precompilation can be controlled in several ways:
204
+
205
+
-**Environment variable**: Set `ENV["JULIA_PKG_PRECOMPILE_AUTO"]=0` to disable auto-precompilation globally.
206
+
-**Programmatically**: Use `Pkg.autoprecompilation_enabled(false)` to disable auto-precompilation for the current session, or `Pkg.autoprecompilation_enabled(true)` to re-enable it.
207
+
-**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.
208
+
209
+
!!! compat "Julia 1.13"
210
+
The `Pkg.autoprecompilation_enabled()` function and `Pkg.precompile()` do-block syntax require at least Julia 1.13.
211
+
212
+
For example, to add multiple packages without triggering precompilation after each one:
213
+
214
+
```julia-repl
215
+
julia> Pkg.precompile() do
216
+
Pkg.add("Example")
217
+
Pkg.dev("JSON")
218
+
Pkg.update("HTTP")
219
+
end
220
+
Resolving package versions...
221
+
...
222
+
Precompiling environment...
223
+
14 dependencies successfully precompiled in 25 seconds
224
+
```
225
+
226
+
Or to temporarily disable auto-precompilation:
227
+
228
+
```julia-repl
229
+
julia> Pkg.autoprecompilation_enabled(false)
230
+
false
231
+
232
+
julia> Pkg.add("Example") # No precompilation happens
233
+
Resolving package versions...
234
+
...
235
+
236
+
julia> Pkg.autoprecompilation_enabled(true)
237
+
true
238
+
```
239
+
203
240
### Precompiling new versions of loaded packages
204
241
205
242
If a package that has been updated is already loaded in the session, the precompilation process will go ahead and precompile
0 commit comments