ronisbr / TerminalPager.jl

Pure Julia implementation of the command less
MIT License
116 stars 8 forks source link

LoadError: cannot assign variables in other modules #30

Closed GregPlowman closed 11 months ago

GregPlowman commented 11 months ago

I'm getting an error when compiling TerminalPager v0.5.0 on Julia v1.6.7.

I think it might be related to resetting Base.stdin in precompilation.jl

[ Info: Precompiling TerminalPager [0c614874-6106-40ed-a7c2-2f1cd0bff883]
ERROR: LoadError: LoadError: cannot assign variables in other modules
Stacktrace:
  [1] setproperty!(x::Module, f::Symbol, v::Base.PipeEndpoint)
    @ Base .\Base.jl:27
  [2] macro expansion
    @ C:\Users\plowman\.julia\packages\TerminalPager\MpAXn\src\precompilation.jl:69 [inlined]
  [3] top-level scope
    @ C:\Users\plowman\.julia\packages\PrecompileTools\kmH5L\src\workloads.jl:140
  [4] include(mod::Module, _path::String)
    @ Base .\Base.jl:384
  [5] include(x::String)
    @ TerminalPager C:\Users\plowman\.julia\packages\TerminalPager\MpAXn\src\TerminalPager.jl:1
  [6] top-level scope
    @ C:\Users\plowman\.julia\packages\TerminalPager\MpAXn\src\TerminalPager.jl:154
  [7] include
    @ .\Base.jl:384 [inlined]
  [8] 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
  [9] top-level scope
    @ none:1
 [10] eval
    @ .\boot.jl:360 [inlined]
 [11] eval(x::Expr)
    @ Base.MainInclude .\client.jl:446
 [12] top-level scope
    @ none:1
in expression starting at C:\Users\plowman\.julia\packages\TerminalPager\MpAXn\src\precompilation.jl:12
in expression starting at C:\Users\plowman\.julia\packages\TerminalPager\MpAXn\src\TerminalPager.jl:1
ERROR: Failed to precompile TerminalPager [0c614874-6106-40ed-a7c2-2f1cd0bff883] to C:\Users\plowman\.julia\compiled\v1.6\TerminalPager\jl_873E.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
ronisbr commented 11 months ago

Hi @GregPlowman ,

In this case, maybe we need to disable pre compilation in 1.6. Can you please just delete all the content in the file precompile.jl and tell me if everything is working correctly?