JuliaLang / juliaup

Julia installer and version multiplexer
MIT License
931 stars 81 forks source link

Sys.BINDIR Set Wrong on Windows #926

Closed zacharyneveu closed 1 month ago

zacharyneveu commented 1 month ago

I installed Julia with winget install julia -s msstore on a Windows machine. Running julia.exe then Sys.BINDIR gives C:\\Users\\zach\\.julia\\juliaup\\julia-1.10.3+0.x64.w64.mingw32\\bin, but the location of the running julia.exe is /mnt/c/Users/zach/AppData/Local/Microsoft/WindowsApps/julia.exe. The official Julia docs say that Sys.BINDIR should be the path to the Julia executable, and many packages rely on that, using something like joinpath(Sys.BINDIR, "julia") to find the path to the Julia executable (that example is from Genie.jl). Ideally, there would be a better way to get the path to the running Julia executable. Short of that though, juliaup should set Sys.BINDIR correctly for Windows app store installations.

Output of versioninfo()

julia> versioninfo()
Julia Version 1.10.3
Commit 0b4590a550 (2024-04-30 10:59 UTC)
Build Info:
  Official https://julialang.org/ release
Platform Info:
  OS: Windows (x86_64-w64-mingw32)
  CPU: 16 × AMD Ryzen 7 3700X 8-Core Processor
  WORD_SIZE: 64
  LIBM: libopenlibm
  LLVM: libLLVM-15.0.7 (ORCJIT, znver2)
Threads: 1 default, 0 interactive, 1 GC (on 16 virtual cores)
davidanthoff commented 1 month ago

There are two julia.exe involved in all of this. The one in WindowsApps is the Juliaup launcher, it is just a small wrapper that selects which actual Julia version to launch. The "real" julia.exe that is running in your case is the one in the ~\.julia\juliaup subfolder, so the info in Sys.BINDIR is correct. The second julia.exe should be a child process of the julia.exe that you are seeing.

Also, when you are in WSL, it probably makes more sense to install the Linux version of Julia inside WSL and use that.