# Package Compiler doesn't download required artifact

**URL:** <https://discourse.julialang.org/t/package-compiler-doesnt-download-required-artifact/94967>\
**Category:** General Usage\
**Tags:** package-compiler\
**Created:** [February 21, 2023, 2:57pm UTC](https://discourse.julialang.org/t/package-compiler-doesnt-download-required-artifact/94967 "2023-02-21T14:57:13Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![haikal-arif](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/haikal-arif/32/47086_2.png) [@haikal-arif](https://discourse.julialang.org/u/haikal-arif)\
**Post date:** [February 21, 2023, 2:57pm UTC](https://discourse.julialang.org/t/package-compiler-doesnt-download-required-artifact/94967/1 "2023-02-21T14:57:14Z")

</div>

I am trying to precompile LanguageServer using PackageCompiler by typing this into REPL

```julia
using PackageCompiler; create_sysimage([:LanguageServer,:SymbolServer], sysimage_path="./julials.dll", precompile_statements_file="./tracecompilelsp.jl")

```

It seems to compile until i got this error

```julia
ERROR: IOError: could not spawn setenv(`'C:\Users\mhaikala\.julia\artifacts\fdff308295487f361ef6e8dc2d27f5abe8a6eee9\mingw64\bin\g++.exe' -m64 -march=x86-64 -shared '-LC:\Users\mhaikala\AppData\Local\Programs\Julia-1.8.5\bin' '-LC:\Users\mhaikala\AppData\Local\Programs\Julia-1.8.5\bin' -o ./julials.dll -Wl,--whole-archive 'C:\Users\mhaikala\AppData\Local\Temp\jl_F0VQnYBO3g.o' -Wl,--no-whole-archive -ljulia -ljulia-internal -lopenlibm -Wl,--export-all-symbols`,["PATH=...long-list-of-my-path-variable"]: no such file or directory (ENOENT)

```

So i look into ~/.julia/artifacts/fdff308295487f361ef6e8dc2d27f5abe8a6eee9/mingw64 and found out there is only ‘opt’ folder but no ‘bin’ folder. I have reinstalled PackageCompiler and tried again but no success.

My julia config is this

```julia
Julia Version 1.8.5
Commit 17cfb8e65e (2023-01-08 06:45 UTC)
Platform Info:
  OS: Windows (x86_64-w64-mingw32)
  CPU: 8 × Intel(R) Core(TM) i7-10510U CPU @ 1.80GHz
  WORD_SIZE: 64
  LIBM: libopenlibm
  LLVM: libLLVM-13.0.1 (ORCJIT, skylake)
  Threads: 1 on 8 virtual cores

```

Pkg.status()

```julia
Status `C:\Users\mhaikala\.julia\environments\nvim-lspconfig\Project.toml`
  [2b0e0bc5] LanguageServer v4.3.1
  [9b87118b] PackageCompiler v2.1.5
  [b3cc710f] StaticLint v8.1.0
  [cf896787] SymbolServer v7.2.1

```

output from ls

```julia
➜ ls

    Directory: C:\Users\mhaikala\.julia\artifacts\fdff308295487f361ef6e8dc2d27f5abe8a6eee9\mingw64

Mode LastWriteTime Length Name
---- ------------- ------ ----
d---- 18/02/2023 12:38 opt

```

---

<div class="post-metadata">

**Author:** ![Ashlin\_Harris](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ashlin_harris/32/210166_2.png) [@Ashlin\_Harris](https://discourse.julialang.org/u/Ashlin_Harris)\
**Post date:** [February 21, 2023, 5:30pm UTC](https://discourse.julialang.org/t/package-compiler-doesnt-download-required-artifact/94967/2 "2023-02-21T17:30:06Z")

</div>

I get a similar error running your code, but not when I remove the option `precompile_statements_file="./tracecompilelsp.jl"`. Are you sure that PackageCompiler can find that file on your system? And if so, what are its contents?

---

<div class="post-metadata">

**Author:** ![Ashlin\_Harris](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ashlin_harris/32/210166_2.png) [@Ashlin\_Harris](https://discourse.julialang.org/u/Ashlin_Harris)\
**Post date:** [February 21, 2023, 5:36pm UTC](https://discourse.julialang.org/t/package-compiler-doesnt-download-required-artifact/94967/3 "2023-02-21T17:36:58Z")

</div>

Running `create_sysimage([:LanguageServer,:SymbolServer], sysimage_path="./julials.dll")` eventually results in the error:

```julia
ld: warning: could not create compact unwind for _julia_YY.244_63412: stack subq instruction is too different from dwarf stack size
ld: warning: could not create compact unwind for _julia_YY.load_coreYY.23_76333: stack subq instruction is too different from dwarf stack size

```

---

<div class="post-metadata">

**Author:** ![dilumaluthge](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/dilumaluthge/32/29283_2.png) [@dilumaluthge](https://discourse.julialang.org/u/dilumaluthge)\
**Post date:** [February 21, 2023, 6:01pm UTC](https://discourse.julialang.org/t/package-compiler-doesnt-download-required-artifact/94967/4 "2023-02-21T18:01:00Z")

</div>

If you’re on Windows, you may need to enable long paths: [Maximum Path Length Limitation - Win32 apps | Microsoft Learn](https://learn.microsoft.com/en-us/windows/win32/fileio/maximum-file-path-limitation?tabs=registry#enable-long-paths-in-windows-10-version-1607-and-later)

---

<div class="post-metadata">

**Author:** ![Ashlin\_Harris](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ashlin_harris/32/210166_2.png) [@Ashlin\_Harris](https://discourse.julialang.org/u/Ashlin_Harris)\
**Post date:** [February 21, 2023, 8:34pm UTC](https://discourse.julialang.org/t/package-compiler-doesnt-download-required-artifact/94967/5 "2023-02-21T20:34:50Z")

</div>

Thanks, @dilumaluthge! That was my issue.

---

<div class="post-metadata">

**Author:** ![haikal-arif](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/haikal-arif/32/47086_2.png) [@haikal-arif](https://discourse.julialang.org/u/haikal-arif)\
**Post date:** [February 22, 2023, 12:30am UTC](https://discourse.julialang.org/t/package-compiler-doesnt-download-required-artifact/94967/6 "2023-02-22T00:30:51Z")

</div>

> Are you sure that PackageCompiler can find that file on your system? And if so, what are its contents?

It contains what should be compiled for the sysimage. It contains a lot precompile statements  
like some of these

```julia
precompile(Tuple{Type{Base.Multimedia.TextDisplay}, Base.PipeEndpoint})
precompile(Tuple{Type{REPL.Terminals.TTYTerminal}, String, Base.PipeEndpoint, Base.PipeEndpoint, Base.PipeEndpoint})
precompile(Tuple{typeof(Base.something), Nothing, Base.PipeEndpoint})
precompile(Tuple{typeof(Pkg.API.instantiate)})
precompile(Tuple{typeof(Base.deepcopy_internal), Any, Base.IdDict{Any, Any}})
precompile(Tuple{typeof(Core.Compiler.eltype), Type{Array{UInt64, 1}}})
precompile(Tuple{typeof(Base.deepcopy_internal), Tuple{UInt64}, Base.IdDict{Any, Any}})

```

to generate it I followed direction from this post

> [@Neovim Native LSP with julials using PackageCompiled LanguageServer](https://discourse.julialang.org/t/neovim-native-lsp-with-julials-using-packagecompiled-languageserver/57659):
>
> I have successfully used a custom sysimage for LanguageServer for julials for neovim native lsp. The first thing I did is to create a precompilation statements file before I created the sysimage. Here is the following lsp config inside my init.vim for neovim to record the precompilation statements: " LSP lua \<\< EOF require'lspconfig'.rust\_analyzer.setup({on\_attach=require'completion'.on\_attach}) require'lspconfig'.julials.setup({ on\_new\_config = function(new\_config,new\_root\_dir) ser…

I’m sure PackageCompiler can found it. I have tried making a symbolic link for  
`~/.julia/artifacts/fdff308295487f361ef6e8dc2d27f5abe8a6eee9/mingw64/bin` to point at my msys2 installation that has g++ and it manages to build the image. But when i use it Julia can’t load it.

---

<div class="post-metadata">

**Author:** ![Thomas008](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/thomas008/32/204169_2.png) [@Thomas008](https://discourse.julialang.org/u/Thomas008)\
**Post date:** [November 23, 2023, 11:50am UTC](https://discourse.julialang.org/t/package-compiler-doesnt-download-required-artifact/94967/7 "2023-11-23T11:50:22Z")

</div>

I had the same issue. I just removed the incomplete artifact directory, removed and added PackageCompiler in Pkg. Then it downloaded the complete artifact when I was compling the next time.
