VS code error

I get this error when I try to run Julia REPL in VS Code (Windows 10):

ERROR: LoadError: IOError: mkdir: invalid argument (EINVAL)
Stacktrace:
 [1] uv_error at .\libuv.jl:97 [inlined]
 [2] mkdir(::String; mode::UInt16) at .\file.jl:177
 [3] mkpath(::String; mode::UInt16) at .\file.jl:227
 [4] mkpath(::String; mode::UInt16) at .\file.jl:225 (repeats 8 times)
 [5] mkpath at .\file.jl:222 [inlined]
 [6] compilecache_path(::Base.PkgId) at .\loading.jl:1228     
 [7] compilecache(::Base.PkgId, ::String) at .\loading.jl:1258
 [8] _require(::Base.PkgId) at .\loading.jl:1030
 [9] require(::Base.PkgId) at .\loading.jl:928
 [10] require(::Module, ::Symbol) at .\loading.jl:923
 [11] include(::Function, ::Module, ::String) at .\Base.jl:380
 [12] include(::Module, ::String) at .\Base.jl:368
 [13] exec_options(::Base.JLOptions) at .\client.jl:296       
 [14] _start() at .\client.jl:506
in expression starting at c:\Users\PKrysl\Documents\work\Portable_Julia\VSCode-win32-x64-1.48.1\data\extensions\julialang.language-julia-1.0.4\scripts\terminalserver\terminalserver.jl:5
MethodError: objects of type Bool are not callable

The line 5 in the terminalserver is using VSCodeServer.
I print out LOAD_PATH:

["@", "@v#.#", "@stdlib", "c:\\Users\\PKrysl\\Documents\\work\\Portable_Julia\\VSCode-win32-x64-1.48.1\\data\\extensions\\julialang.language-julia-1.0.4\\scripts\\terminalserver\\..\\packages"]

Does it strike you as wrong?

PS: I guess it is not the path: the same path works fine when VS Code is started from the Powershell
via git bash.

The path looks good to me. This looks a bit as if something is going wrong when it tries to precompile the VSCodeServer module. I’m wondering whether we are running into the problem that if two instances of Julia try to precompile the same module at the same time, one will crash…

I do not know whether two Julias might be running, but I am running only a single instance of vscode.

Then it is something else :slight_smile:

Maybe this is related to the portable Julia stuff? Is that using the normal ~/.julia folder for precompile caches?

I start VS code (portable) by double-clicking either the Windows batch file or the bash file (Portable Julia - #5 by PetrKryslUCSD).

The former doesn’t work: when I start Julia I get the error above. The latter works without problems.

Should there be a backslah instead of a dot . in set MyDepot="%MyPortableJuliaDir%.%MyPortableJulia%-depot" in the batch file?

MyPortableJuliaDir has a \ attached at the end. The . is to emulate the .julia naming convention.

Hm, weird… I think at the end of the day this must come down to some different value for the env vars depending on whether you start it from bash or the batch file?

I gave up on it. Truth be told, I don’t particularly enjoy writing Windows batch files. I wrote a bash script which does what I want, and can be run using the same double-click procedure as a batch file.

1 Like