Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dependency XRootD.jl does not precompile on Windows #351

Closed
TheBreadFarmer opened this issue Oct 12, 2024 · 10 comments
Closed

Dependency XRootD.jl does not precompile on Windows #351

TheBreadFarmer opened this issue Oct 12, 2024 · 10 comments

Comments

@TheBreadFarmer
Copy link

After updating UnROOT.jl from v0.10.30 to v0.10.31 (when XRootD.jl was added as a dependency), UnROOT.jl fails to precompile because XRootD.jl fails to precompile.

This occurs on both Julia v1.11.0 and v1.10.5. I tested on a fresh install of Julia with no other installed packages and got the same result. Installing XRootD.jl first does not fix issue as XRootD.jl is what fails to precompile and is preventing UnROOT.jl from precompiling.

Stated error is:

UndefVarError: `XRootD_exports` not defined in `XRootD_cxxwrap_jll`

The full error is:

PkgPrecompileError: The following 2 direct dependencies failed to precompile:

UnROOT

Failed to precompile UnROOT [3cd96dde-e98d-4713-81e9-a4a1b0235ce9] to "C:\\Users\\phfit_tgu\\.julia\\compiled\\v1.11\\UnROOT\\jl_BF65.tmp".
WARNING: could not import XRootD_jll.xrootd into XRootD
WARNING: could not import XRootD_jll.xrdfs into XRootD
WARNING: could not import XRootD_jll.xrdcp into XRootD
ERROR: LoadError: UndefVarError: `XRootD_exports` not defined in `XRootD_cxxwrap_jll`
Stacktrace:
 [1] getproperty(x::Module, f::Symbol)
   @ Base .\Base.jl:42
 [2] top-level scope
   @ C:\Users\phfit_tgu\.julia\packages\XRootD\aznk8\src\XRootD.jl:13
 [3] include
   @ .\Base.jl:557 [inlined]
 [4] 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:2806
 [5] top-level scope
   @ stdin:4
in expression starting at C:\Users\phfit_tgu\.julia\packages\XRootD\aznk8\src\XRootD.jl:1
in expression starting at stdin:4
ERROR: LoadError: Failed to precompile XRootD [164e3b87-dc46-4cbc-97a6-5b310108fce0] to "C:\\Users\\phfit_tgu\\.julia\\compiled\\v1.11\\XRootD\\jl_C2C3.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; flags::Cmd, cacheflags::Base.CacheFlags, reasons::Dict{String, Int64})
    @ Base .\loading.jl:3089
  [3] (::Base.var"#1081#1082"{Base.PkgId})()
    @ Base .\loading.jl:2477
  [4] mkpidlock(f::Base.var"#1081#1082"{Base.PkgId}, at::String, pid::Int32; kwopts::@Kwargs{stale_age::Int64, wait::Bool})
    @ FileWatching.Pidfile C:\Users\phfit_tgu\.julia\juliaup\julia-1.11.0+0.x64.w64.mingw32\share\julia\stdlib\v1.11\FileWatching\src\pidfile.jl:95
  [5] #mkpidlock#6
    @ C:\Users\phfit_tgu\.julia\juliaup\julia-1.11.0+0.x64.w64.mingw32\share\julia\stdlib\v1.11\FileWatching\src\pidfile.jl:90 [inlined]
  [6] trymkpidlock(::Function, ::Vararg{Any}; kwargs::@Kwargs{stale_age::Int64})
    @ FileWatching.Pidfile C:\Users\phfit_tgu\.julia\juliaup\julia-1.11.0+0.x64.w64.mingw32\share\julia\stdlib\v1.11\FileWatching\src\pidfile.jl:116
  [7] #invokelatest#2
    @ .\essentials.jl:1056 [inlined]
  [8] invokelatest
    @ .\essentials.jl:1051 [inlined]
  [9] maybe_cachefile_lock(f::Base.var"#1081#1082"{Base.PkgId}, pkg::Base.PkgId, srcpath::String; stale_age::Int64)
    @ Base .\loading.jl:3613
 [10] maybe_cachefile_lock
    @ .\loading.jl:3610 [inlined]
 [11] _require(pkg::Base.PkgId, env::String)
    @ Base .\loading.jl:2473
 [12] __require_prelocked(uuidkey::Base.PkgId, env::String)
    @ Base .\loading.jl:2300
 [13] #invoke_in_world#3
    @ .\essentials.jl:1088 [inlined]
 [14] invoke_in_world
    @ .\essentials.jl:1085 [inlined]
 [15] _require_prelocked(uuidkey::Base.PkgId, env::String)
    @ Base .\loading.jl:2287
 [16] macro expansion
    @ .\loading.jl:2226 [inlined]
 [17] macro expansion
    @ .\lock.jl:273 [inlined]
 [18] __require(into::Module, mod::Symbol)
    @ Base .\loading.jl:2183
 [19] #invoke_in_world#3
    @ .\essentials.jl:1088 [inlined]
 [20] invoke_in_world
    @ .\essentials.jl:1085 [inlined]
 [21] require(into::Module, mod::Symbol)
    @ Base .\loading.jl:2176
 [22] include(mod::Module, _path::String)
    @ Base .\Base.jl:557
 [23] include(x::String)
    @ UnROOT C:\Users\phfit_tgu\.julia\packages\UnROOT\4c5To\src\UnROOT.jl:1
 [24] top-level scope
    @ C:\Users\phfit_tgu\.julia\packages\UnROOT\4c5To\src\UnROOT.jl:44
 [25] include
    @ .\Base.jl:557 [inlined]
 [26] 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::Nothing)
    @ Base .\loading.jl:2806
 [27] top-level scope
    @ stdin:4
in expression starting at C:\Users\phfit_tgu\.julia\packages\UnROOT\4c5To\src\streamsource.jl:1
in expression starting at C:\Users\phfit_tgu\.julia\packages\UnROOT\4c5To\src\UnROOT.jl:1
in expression starting at stdin:4
XRootD

Failed to precompile XRootD [164e3b87-dc46-4cbc-97a6-5b310108fce0] to "C:\\Users\\phfit_tgu\\.julia\\compiled\\v1.11\\XRootD\\jl_BA80.tmp".
WARNING: could not import XRootD_jll.xrootd into XRootD
WARNING: could not import XRootD_jll.xrdfs into XRootD
WARNING: could not import XRootD_jll.xrdcp into XRootD
ERROR: LoadError: UndefVarError: `XRootD_exports` not defined in `XRootD_cxxwrap_jll`
Stacktrace:
 [1] getproperty(x::Module, f::Symbol)
   @ Base .\Base.jl:42
 [2] top-level scope
   @ C:\Users\phfit_tgu\.julia\packages\XRootD\aznk8\src\XRootD.jl:13
 [3] include
   @ .\Base.jl:557 [inlined]
 [4] 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::Nothing)
   @ Base .\loading.jl:2806
 [5] top-level scope
   @ stdin:4
in expression starting at C:\Users\phfit_tgu\.julia\packages\XRootD\aznk8\src\XRootD.jl:1
in expression starting at stdin:4
@Moelf
Copy link
Member

Moelf commented Oct 12, 2024

That's really weird, we haven't touched anything in a while, and I don't see any new release in XrootD.jl or the XRootD_cxxwrap_jll

tagging others may know @peremato @giordano

I'm trying something in the mean time

@Moelf
Copy link
Member

Moelf commented Oct 12, 2024

so when I first saw your issue, I immediatedly tried in a new ]activate --temp envoronment and I saw this:

Precompiling project...
  ✓ JLLWrappers
  ✗ UnROOT
  1 dependency successfully precompiled in 22 seconds. 130 already precompiled.
  1 dependency precompiled but a different version is currently loaded. Restart julia to access the new version
  1 dependency errored.
  For a report of the errors see `julia> err`. To retry use `pkg> precompile`

julia> err
PkgPrecompileError: The following 1 direct dependency failed to precompile:

UnROOT

Failed to precompile UnROOT [3cd96dde-e98d-4713-81e9-a4a1b0235ce9] to "/home/akako/.julia/compiled/v1.11/UnROOT/jl_G4J3xG".
ERROR: LoadError: UndefRefError: access to undefined reference
Stacktrace:
  [1] getindex
    @ ./essentials.jl:916 [inlined]
  [2] iterate
    @ ./array.jl:891 [inlined]
  [3] methodkey(f::CxxWrap.CxxWrapCore.CppFunctionInfo)
    @ CxxWrap.CxxWrapCore ~/.julia/packages/CxxWrap/5IZvn/src/CxxWrap.jl:339
  [4] _register_function_pointers(func::CxxWrap.CxxWrapCore.CppFunctionInfo, precompiling::Bool)
    @ CxxWrap.CxxWrapCore ~/.julia/packages/CxxWrap/5IZvn/src/CxxWrap.jl:356
  [5] wrap_functions(functions::Vector{CxxWrap.CxxWrapCore.CppFunctionInfo}, julia_mod::Module)
    @ CxxWrap.CxxWrapCore ~/.julia/packages/CxxWrap/5IZvn/src/CxxWrap.jl:704
  [6] wrapfunctions(jlmod::Module)
    @ CxxWrap.CxxWrapCore ~/.julia/packages/CxxWrap/5IZvn/src/CxxWrap.jl:726
  [7] wrapmodule(so_path_cb::Function, funcname::Symbol, m::Module, flags::UInt32)
    @ CxxWrap.CxxWrapCore ~/.julia/packages/CxxWrap/5IZvn/src/CxxWrap.jl:763

however, when I tried again just now:

(jl_U3RYYg) pkg> st
Status `/tmp/jl_U3RYYg/Project.toml`
  [3cd96dde] UnROOT v0.10.32

julia> using UnROOT

julia>

it works now?

@Moelf
Copy link
Member

Moelf commented Oct 12, 2024

wait, is XRootD wrapper just broken on Windows?

@TheBreadFarmer
Copy link
Author

I am running windows 11 so it would appear that it is. I've had two different windows 11 machines fail to precompile XRootD.

@peremato
Copy link
Member

XRootD_jll is not built for Windows. This is because the XRootD package is not supported for windows. Normally in this case I guess empty artifacts are used to fulfill dependencies. It should not fail pre compilation I guess.

@Moelf
Copy link
Member

Moelf commented Oct 13, 2024

Right.... Well I think in that case XRootD.jl should have unit test on CI to make sure it doesn't fail to precompole and only throw an error message at runtime telling user Windows is not supported?

@giordano
Copy link
Member

You can use Package_jll.is_available() to make sure an artifact is actually available and gracefully handle failures, instead of going into UndefVarError

@Moelf Moelf changed the title Dependency XRootD.jl does not precompile Dependency XRootD.jl does not precompile on Windows Oct 25, 2024
peremato referenced this issue in JuliaHEP/XRootD.jl Nov 4, 2024
@peremato
Copy link
Member

peremato commented Nov 4, 2024

Just released XRootD 0.2.1 which includes some protection for missing binary artefacts.

@Moelf
Copy link
Member

Moelf commented Nov 4, 2024

@TheBreadFarmer can you check if this solves the problem for you 👀

@TheBreadFarmer
Copy link
Author

I can report that XRootD v0.2.1 successfully precompiles on my windows 11 machine!

@Moelf Moelf closed this as completed Nov 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants