Julia (and VSCode Language Server) Launching Failure

I’ve been trying to install Julia and its VSCode environment on a new Windows computer for a few days, but I can’t launch it. To figure out where the problem may be, I’ve been trying for about 5 days, knowing that:

  1. Firstly, I guessed the problem was the Windows environment, but as I changed the path of Julia installation into a pure ASCII one, it ran as usual. However, the Julia language server failed to launch in VSCode – so did the Jupyter notebook.
  2. I suspected that the problem also lay in the encoding of the path, and hence I created a new user without Chinese characters, and everything worked, at least in VSCode and Jupyter notebook.
  3. The error message of the original launching failure reads
ERROR: could not load library "C:\Users\lib\julia\sys.dll"
The specified module could not be found.

If I changed my directory into AppData, the message became

ERROR: could not load library "C:\Users\���ئ�\lib\julia\sys.dll"
The specified module could not be found.

If I changed my working directory to Local later on, the message became

ERROR: could not load library "C:\Users\���ئ�\AppData\lib\julia\sys.dll"
The specified module could not be found.

So I guessed that the Julia program wanted to find sys.dll from …/lib/julia/sys.dll, which doesn’t make sense. It would have to be something like $SYSTEM_JULIA_PATH/lib/julia, which I guessed the prefix was cut off because of the non-ASCII characters there. This problem did not occur with a full English username.

  1. Even if Julia is installed on a pure ASCII path (The default path contains non-ASCII characters, so I just switched to somewhere else.) and therefore worked well, it still failed in VSCode. The error log looks like the following.
  Activating project at `c:\Users\我的名字\.vscode\extensions\julialang.language-julia-1.48.1\scripts\environments\languageserver\v1.9`
[ Info: Starting the Julia Language Server
ERROR: failed to emit output file �b�h�줸�ժ��ت��r�X�����A�S���o�� Unicode �r���i�H�����쪺�r���C

fatal: error thrown and no exception handler available.
ErrorException("cannot open system image file "c:\Users\?的名�\AppData\Roaming\Code\User\globalStorage\julialang.language-julia\lsdepot\v1\compiled\v1.9\JSON\jl_4322.tmp" for writing")
ijl_errorf at C:/workdir/src\rtutils.c:77
ijl_write_compiler_output at C:/workdir/src\precompile.c:143
ijl_atexit_hook at C:/workdir/src\init.c:258
jl_repl_entrypoint at C:/workdir/src\jlapi.c:718
mainCRTStartup at C:/workdir/cli\loader_exe.c:59
BaseThreadInitThunk at C:\Windows\System32\KERNEL32.DLL (unknown line)
RtlUserThreadStart at C:\Windows\SYSTEM32\ntdll.dll (unknown line)
ERROR: LoadError: Failed to precompile JSON [682c06a0-de6a-54ab-a142-c8b1cf79cde6] to "c:\\Users\\我的名字\\AppData\\Roaming\\Code\\User\\globalStorage\\julialang.language-julia\\lsdepot\\v1\\compiled\\v1.9\\JSON\\jl_4322.tmp".
Stacktrace:
  [1] error(s::String)
    @ Base .\error.jl:35
  [2] compilecache(pkg::Base.PkgId, path::String, internal_stderr::IO, internal_stdout::IO, keep_loaded_modules::Bool)
    @ Base .\loading.jl:2300
  [3] compilecache
    @ .\loading.jl:2167 [inlined]
  [4] _require(pkg::Base.PkgId, env::String)
    @ Base .\loading.jl:1805
  [5] _require_prelocked(uuidkey::Base.PkgId, env::String)
    @ Base .\loading.jl:1660
  [6] macro expansion
    @ .\loading.jl:1648 [inlined]
  [7] macro expansion
    @ .\lock.jl:267 [inlined]
  [8] require(into::Module, mod::Symbol)
    @ Base .\loading.jl:1611
  [9] include
    @ .\Base.jl:457 [inlined]
 [10] include_package_for_output(pkg::Base.PkgId, input::String, depot_path::Vector{String}, dl_load_path::Vector{String}, load_path::Vector{String}, concrete_deps::Vector{Pair{Base.PkgId, UInt128}}, source::String)
    @ Base .\loading.jl:2049
 [11] top-level scope
    @ stdin:3
in expression starting at c:\Users\我的名字\.vscode\extensions\julialang.language-julia-1.48.1\scripts\packages\LanguageServer\src\LanguageServer.jl:1
in expression starting at stdin:3


The Language Server failed to precompile.
Please make sure you have permissions to write to the LS depot path at
	c:\Users\我的名字\AppData\Roaming\Code\User\globalStorage\julialang.language-julia\lsdepot\v1

┌ Error: Some Julia code in the VS Code extension crashed
└ @ Main c:\Users\我的名字\.vscode\extensions\julialang.language-julia-1.48.1\scripts\error_handler.jl:15
ERROR: Failed to precompile LanguageServer [2b0e0bc5-e4fd-59b4-8912-456d1b03d8d7] to "c:\\Users\\我的名字\\AppData\\Roaming\\Code\\User\\globalStorage\\julialang.language-julia\\lsdepot\\v1\\compiled\\v1.9\\LanguageServer\\jl_41DA.tmp".
Stacktrace:
 [1] top-level scope
   @ c:\Users\我的名字\.vscode\extensions\julialang.language-julia-1.48.1\scripts\languageserver\main.jl:77
 [2] include(mod::Module, _path::String)
   @ Base .\Base.jl:457

Although I know I should avoid non-ASCII paths as much as possible, I wouldn’t change all the stuff and rebuild everything on my computer as those works are too expensive to rerun. As far as I know, the binary of Julia is compiled. I tried to fix the path encoding problem by modifying the source codes and recompiling it, but I have no idea where to start.

How to fix the problem fundamentally instead of discarding all my 99% work and restarting everything on my computer? As Julia claims to support Unicode and LaTeX symbols in its program, it’s a bit awkward to say it would fail to handle Unicode paths. Thanks a lot!

Now the advantage of using Mac comes out, as it will transform your usernames into pure ASCII characters while still displaying non-ASCII names on GUI as is, avoiding all these stuffs. However, Mac computers are too expensive for me to buy a new one. :cry:

Experiencing similar. Initially I was just having a problem with CTRL-Enter not executing selected code. Eventually decided to nuke VSCode & start fresh. I’ve got latest VSCode, Julia extension & Julia 1.9.2. When I open VSCode (after updating path to executable) I get:

ERROR: Endpoint is not running, the current state is closed.
Stacktrace:
 [1] error(s::String)
   @ Base .\error.jl:35
 [2] check_dead_endpoint!
   @ c:\Users\p003227C\.vscode\extensions\julialang.language-julia-1.47.2\scripts\packages\JSONRPC\src\core.jl:280 [inlined]
 [3] get_next_message(endpoint::JSONRPC.JSONRPCEndpoint{IOBuffer, Base.PipeEndpoint})
   @ JSONRPC c:\Users\p003227C\.vscode\extensions\julialang.language-julia-1.47.2\scripts\packages\JSONRPC\src\core.jl:212
 [4] macro expansion
   @ c:\Users\p003227C\.vscode\extensions\julialang.language-julia-1.47.2\scripts\packages\LanguageServer\src\languageserverinstance.jl:288 [inlined]
 [5] (::LanguageServer.var"#113#116"{LanguageServer.LanguageServerInstance})()
   @ LanguageServer .\task.jl:514
[ Info: Received new data from Julia Symbol Server.
[ Info: Shutting down server instance.
[ Info: Symbol server store is at 'c:\Users\p003227C\AppData\Roaming\Code\User\globalStorage\julialang.language-julia\symbolstorev5'.
[ Info: Starting LS at 1691005489
[ Info: Received new data from Julia Symbol Server.
Internal error: encountered unexpected error during compilation of getproperty:
StackOverflowError()
unknown function (ip: 00007ffc74144006)
Internal error: encountered unexpected error during compilation of getproperty:
StackOverflowError()
unknown function (ip: 00007ffc74144006)
Internal error: encountered unexpected error during compilation of getproperty:
StackOverflowError()
unknown function (ip: 00007ffc74144006)
Internal error: encountered unexpected error during compilation of getproperty:
StackOverflowError()
.text$_ZN4llvm19raw_svector_ostream10write_implEPKcy at C:\Users\p003227C\AppData\Local\Programs\Julia-1.9.2\bin\libLLVM-14jl.dll (unknown line)
.text$_ZN4llvm11raw_ostream5writeEPKcy at C:\Users\p003227C\AppData\Local\Programs\Julia-1.9.2\bin\libLLVM-14jl.dll (unknown line)
.text$_Z19write_unsigned_implIjEvRN4llvm11raw_ostreamET_yNS0_12IntegerStyleEb at C:\Users\p003227C\AppData\Local\Programs\Julia-1.9.2\bin\libLLVM-14jl.dll (unknown line)
.text$_Z14write_unsignedIyEvRN4llvm11raw_ostreamET_yNS0_12IntegerStyleEb at C:\Users\p003227C\AppData\Local\Programs\Julia-1.9.2\bin\libLLVM-14jl.dll (unknown line)
.text$_ZN4llvm13write_integerERNS_11raw_ostreamEyyNS_12IntegerStyleE at C:\Users\p003227C\AppData\Local\Programs\Julia-1.9.2\bin\libLLVM-14jl.dll (unknown line)
.text$_ZN4llvm11raw_ostreamlsEm at C:\Users\p003227C\AppData\Local\Programs\Julia-1.9.2\bin\libLLVM-14jl.dll (unknown line)
.text$_ZN4llvm16ValueSymbolTable14makeUniqueNameEPNS_5ValueERNS_11SmallStringILj256EEE at C:\Users\p003227C\AppData\Local\Programs\Julia-1.9.2\bin\libLLVM-14jl.dll (unknown line)
.text$_ZN4llvm16ValueSymbolTable15createValueNameENS_9StringRefEPNS_5ValueE at C:\Users\p003227C\AppData\Local\Programs\Julia-1.9.2\bin\libLLVM-14jl.dll (unknown line)
.text$_ZN4llvm5Value11setNameImplERKNS_5TwineE at C:\Users\p003227C\AppData\Local\Programs\Julia-1.9.2\bin\libLLVM-14jl.dll (unknown line)
.text$_ZN4llvm5Value7setNameERKNS_5TwineE at C:\Users\p003227C\AppData\Local\Programs\Julia-1.9.2\bin\libLLVM-14jl.dll (unknown line)
Internal error: encountered unexpected error during compilation of getproperty:
StackOverflowError()

Note that I’ve kept things as clean as possible… the Julia extension is the only one loaded.

[EDIT: Forgot to mention… this is on my work machine running Win10Enterprise. Everything works just fine on my Mac (Intel).]