Skip to content
This repository was archived by the owner on Jun 9, 2023. It is now read-only.

Commit 6a2393d

Browse files
committed
say that automatic replacing default sysimage is problematic on Windows
1 parent 1e5e834 commit 6a2393d

File tree

2 files changed

+21
-4
lines changed

2 files changed

+21
-4
lines changed

docs/src/sysimages.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,14 @@ If this is the first time `create_sysimage` is called with `replace_default`, a
108108
backup of the default sysimage is created. The default sysimage can then be
109109
restored with [`restore_default_sysimage()`](@ref).
110110

111+
!!! note
112+
113+
Automatically replacing the default sysimage does not work well on Windows
114+
since replacing open files is problematic there. Therefore, on
115+
Windows, it is in general better to manually replace the default sysimage
116+
(the `lib/julia/sys.dll` file in the installation folder) than to use the
117+
more automatic functionalities.
118+
111119
Note that sysimages are created "incrementally" in the sense that they add to
112120
the sysimage of the process running PackageCompilerX. If the default sysimage
113121
has been replaced, the next `create_sysimage` call will create a new sysimage

src/PackageCompilerX.jl

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -273,8 +273,13 @@ by setting the envirnment variable `JULIA_CC` to a path to a compiler
273273
- `filter_stdlibs::Bool`: If `true`, only include stdlibs that are in the project file.
274274
Defaults to `false`, only set to `true` if you know the potential pitfalls.
275275
276-
- `replace_default::Bool`: If `true`, replaces the default system image which is automatically
277-
used when Julia starts. To replace with the one Julia ships with, use [`restore_default_sysimage()`](@ref)
276+
- `replace_default::Bool`: If `true`, replaces the default system image which
277+
is automatically used when Julia starts. To restore the default sysimage to one
278+
Julia ships with, use [`restore_default_sysimage()`](@ref). Note that this
279+
option does not work well on Windows since replacing open files is problematic
280+
on Windows. Therefore, on Windows, it is in general better to manually replace
281+
the default sysimage (the `lib/julia/sys.dll` file in the installation folder)
282+
than to use this option.
278283
279284
- `cpu_target::String`: The value to use for `JULIA_CPU_TARGET` when building the system image.
280285
"""
@@ -382,8 +387,12 @@ end
382387
"""
383388
restore_default_sysimage()
384389
385-
Restores the default system image to the one that Julia shipped with.
386-
Useful after running [`create_sysimage`](@ref) with `replace_default=true`.
390+
Restores the default system image to the one that Julia shipped with. Useful
391+
after running [`create_sysimage`](@ref) with `replace_default=true`. Note that
392+
this function does not work well on Windows since replacing open files is
393+
problematic on Windows. Therefore, on Windows, it is in general better to
394+
manually replace and restore the default sysimage (the `lib/julia/sys.dll`
395+
file in the installation folder) than to use this function.
387396
"""
388397
function restore_default_sysimage()
389398
if !isfile(backup_default_sysimg_path())

0 commit comments

Comments
 (0)