JuliaPackaging/PkgServer.jl

Precompilation fails on Windows

kafisatz opened this issue · 2 comments

I was attempting to try this out today, but precompilation fails for me because of statsfs

Should this be running on Windows or not?

(PkgServer) pkg> st
     Project PkgServer v0.2.0
      Status `C:\Users\bernhard.konig\Documents\Repositories\PkgServer.jl\Project.toml`
  [89f0c457] FilesystemDatastructures v1.0.0
  [cd3eb016] HTTP v0.9.13
  [0f8b85d8] JSON3 v1.9.1
  [e6f89c97] LoggingExtras v0.4.7
  [777ac1f9] SimpleBufferStream v1.1.0
  [856f2bd8] StructTypes v1.7.2
  [be1be57a] Gzip_jll v1.10.0+0
  [ade2ca70] Dates
  [76f85450] LibGit2
  [8f399da3] Libdl
  [56ddb016] Logging
  [44cfe95a] Pkg
  [9a3f8284] Random
  [ea8e919c] SHA
  [6462fe0b] Sockets
  [a4e569a6] Tar

julia> using PkgServer
[ Info: Precompiling PkgServer [eac38ba3-4627-46d4-b1a1-bcb86ba22f8b]
ERROR: LoadError: Unable to statfs() on Val{:NT}()
Stacktrace:
  [1] error(s::String)
    @ Base .\error.jl:33
  [2] statfs(path::String, kernel::Val{:NT})
    @ FilesystemDatastructures C:\Users\bernhard.konig\.julia\packages\FilesystemDatastructures\D6JHz\src\DiskUtils.jl:58
  [3] get_disk_freespace(path::String)
    @ FilesystemDatastructures C:\Users\bernhard.konig\.julia\packages\FilesystemDatastructures\D6JHz\src\DiskUtils.jl:70
  [4] (::FilesystemDatastructures.var"#24#25"{Int64})(scfc::FilesystemDatastructures.SizeConstrainedFileCache)
    @ FilesystemDatastructures C:\Users\bernhard.konig\.julia\packages\FilesystemDatastructures\D6JHz\src\SizeConstrainedFileCache.jl:276
  [5] FilesystemDatastructures.SizeConstrainedFileCache(root::String, target_size::Function, discard_ordering::Function; predicate::Function)
    @ FilesystemDatastructures C:\Users\bernhard.konig\.julia\packages\FilesystemDatastructures\D6JHz\src\SizeConstrainedFileCache.jl:90
  [6] SizeConstrainedFileCache
    @ C:\Users\bernhard.konig\.julia\packages\FilesystemDatastructures\D6JHz\src\SizeConstrainedFileCache.jl:78 [inlined]
  [7] PkgServer.ServerConfig(; listen_addr::Sockets.InetAddr{Sockets.IPv4}, storage_root::String, registries::Dict{String, PkgServer.RegistryMeta}, storage_servers::Vector{String}, keep_free::Int64)
    @ PkgServer C:\Users\bernhard.konig\Documents\Repositories\PkgServer.jl\src\PkgServer.jl:69
  [8] PkgServer.ServerConfig()
    @ PkgServer C:\Users\bernhard.konig\Documents\Repositories\PkgServer.jl\src\PkgServer.jl:64
  [9] top-level scope
    @ C:\Users\bernhard.konig\Documents\Repositories\PkgServer.jl\src\PkgServer.jl:85
 [10] include
    @ .\Base.jl:386 [inlined]
 [11] 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, UInt64}}, source::Nothing)
    @ Base .\loading.jl:1235
 [12] top-level scope
    @ none:1
 [13] eval
    @ .\boot.jl:360 [inlined]
 [14] eval(x::Expr)
    @ Base.MainInclude .\client.jl:446
 [15] top-level scope
    @ none:1
in expression starting at C:\Users\bernhard.konig\Documents\Repositories\PkgServer.jl\src\PkgServer.jl:1
ERROR: Failed to precompile PkgServer [eac38ba3-4627-46d4-b1a1-bcb86ba22f8b] to C:\Users\bernhard.konig\.julia\compiled\v1.6\PkgServer\jl_BA6B.tmp.
Stacktrace:
 [1] error(s::String)
   @ Base .\error.jl:33
 [2] compilecache(pkg::Base.PkgId, path::String, internal_stderr::Base.TTY, internal_stdout::Base.TTY, ignore_loaded_modules::Bool)
   @ Base .\loading.jl:1385
 [3] compilecache(pkg::Base.PkgId, path::String)
   @ Base .\loading.jl:1329
 [4] _require(pkg::Base.PkgId)
   @ Base .\loading.jl:1043
 [5] require(uuidkey::Base.PkgId)
   @ Base .\loading.jl:936
 [6] require(into::Module, mod::Symbol)
   @ Base .\loading.jl:923


julia> versioninfo()
Julia Version 1.6.2
Commit 1b93d53fc4 (2021-07-14 15:36 UTC)
Platform Info:
  OS: Windows (x86_64-w64-mingw32)
  CPU: AMD Ryzen 9 5950X 16-Core Processor
  WORD_SIZE: 64
  LIBM: libopenlibm
  LLVM: libLLVM-11.0.1 (ORCJIT, generic)
Environment:
  JULIA_EDITOR = "C:\Program Files\Microsoft VS Code\Code.exe"

This isn't really intended to run on arbitrary systems, it's only meant to run on the specific Linux systems that we actually deploy it on. To the extent that it works elsewhere, that's purely because Julia code is generally pretty portable.

You can probably(?) run it on Windows if you use the docker image though.