# Precompile error on Windows

**URL:** <https://discourse.julialang.org/t/precompile-error-on-windows/87026>\
**Category:** General Usage\
**Created:** [September 10, 2022, 1:14am UTC](https://discourse.julialang.org/t/precompile-error-on-windows/87026 "2022-09-10T01:14:55Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![mkoculak](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mkoculak/32/28310_2.png) [@mkoculak](https://discourse.julialang.org/u/mkoculak)\
**Post date:** [September 10, 2022, 1:14am UTC](https://discourse.julialang.org/t/precompile-error-on-windows/87026/1 "2022-09-10T01:14:55Z")

</div>

Since last week I am encountering problems with precompilation - with language server on VSCode and with packages in projects.

Seems to be the same issue as [here](https://github.com/JuliaLang/julia/issues/39396), although it seems it should have been fixed.  
For me, the precompilation becomes stable only when I set the number of processes to 1.

Here is the error I get most frequently:

```julia
┌ Error: Pkg.precompile error
│ exception =
│ IOError: could not spawn `'C:\Users\Marcin\AppData\Local\Programs\Julia-1.8.0\bin\julia.exe' -Cnative '-JC:\Users\Marcin\AppData\Local\Programs\Julia-1.8.0\lib\julia\sys.dll' -g1 -O0 --output-ji 'C:\Users\Marcin\.julia\compiled\v1.8\PlotUtils\jl_ADB9.tmp' --output-incremental=yes --startup-file=no --history-file=no --warn-overwrite=yes --color=yes -`: unknown error (UNKNOWN)
│ Stacktrace:
│ [1] _spawn_primitive(file::String, cmd::Cmd, stdio::Vector{Union{RawFD, Base.Libc.WindowsRawSocket, IO}})
│ @ Base .\process.jl:128
│ [2] #724
│ @ .\process.jl:139 [inlined]
│ [3] setup_stdios(f::Base.var"#724#725"{Cmd}, stdios::Vector{Union{RawFD, Base.Libc.WindowsRawSocket, IO}})
│ @ Base .\process.jl:223
│ [4] _spawn
│ @ .\process.jl:138 [inlined]
│ [5] _spawn(::Base.CmdRedirect, ::Vector{Union{RawFD, Base.Libc.WindowsRawSocket, IO}}) (repeats 2 times)
│ @ Base .\process.jl:166
│ [6] open(cmds::Base.CmdRedirect, stdio::Base.TTY; write::Bool, read::Bool)
│ @ Base .\process.jl:397
│ [7] open(cmds::Base.CmdRedirect, mode::String, stdio::Base.TTY)
│ @ Base .\process.jl:366
│ [8] create_expr_cache(pkg::Base.PkgId, input::String, output::String, concrete_deps::Vector{Pair{Base.PkgId, UInt64}}, internal_stderr::IO, internal_stdout::IO)
│ @ Base .\loading.jl:1590
│ [9] compilecache(pkg::Base.PkgId, path::String, internal_stderr::IO, internal_stdout::IO, keep_loaded_modules::Bool)
│ @ Base .\loading.jl:1671
│ [10] (::Pkg.API.var"#245#274"{IOBuffer, String, Base.PkgId})()
│ @ Pkg.API C:\Users\Marcin\AppData\Local\Programs\Julia-1.8.0\share\julia\stdlib\v1.8\Pkg\src\API.jl:1310
│ [11] with_logstate(f::Function, logstate::Any)
│ @ Base.CoreLogging .\logging.jl:511
│ [12] with_logger
│ @ .\logging.jl:623 [inlined]
│ [13] macro expansion
│ @ C:\Users\Marcin\AppData\Local\Programs\Julia-1.8.0\share\julia\stdlib\v1.8\Pkg\src\API.jl:1308 [inlined]
│ [14] (::Pkg.API.var"#242#271"{Bool, Pkg.Types.Context, Vector{Task}, Pkg.API.var"#handle_interrupt#263"{Base.Event, ReentrantLock, Base.TTY}, Pkg.API.var"#color_string#261", Base.Event, Base.Event, ReentrantLock, Vector{Base.PkgId}, Vector{Base.PkgId}, Dict{Base.PkgId, String}, Vector{Base.PkgId}, Vector{Base.PkgId}, Vector{Pkg.Types.PackageSpec}, Dict{Base.PkgId, Bool}, Dict{Base.PkgId, Base.Event}, Dict{Base.PkgId, Bool}, Vector{Base.PkgId}, Bool, Base.TTY, Base.Semaphore, String, Vector{String}, Vector{Base.PkgId}, Base.PkgId})()
│ @ Pkg.API .\task.jl:484
└ @ Pkg.API C:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.8\Pkg\src\API.jl:1183

```

My configuration from that test:

```julia
Julia Version 1.8.0
Commit 5544a0fab7 (2022-08-17 13:38 UTC)
Platform Info:
  OS: Windows (x86_64-w64-mingw32)
  CPU: 32 × AMD Ryzen 9 5950X 16-Core Processor
  WORD_SIZE: 64
  LIBM: libopenlibm
  LLVM: libLLVM-13.0.1 (ORCJIT, znver3)
  Threads: 1 on 32 virtual cores
Environment:
  JULIA_NUM_PRECOMPILE_TASKS = 8
  JULIA_EDITOR = code
  JULIA_NUM_THREADS =

```

Did something changed recently that might have brought this problem back? I had not seen it earlier.
