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

Cannot Precompile Cthulhu #580

Closed
NuclearPowerNerd opened this issue Jul 26, 2024 · 3 comments
Closed

Cannot Precompile Cthulhu #580

NuclearPowerNerd opened this issue Jul 26, 2024 · 3 comments

Comments

@NuclearPowerNerd
Copy link

Hello!

I am not able to precompile Cthulhu. I am using Julia 1.10.0. Here is an MWE.

] activate --temp
] add Cthulhu

This adds version 2.9.6. During precompilation though I get the following error. I have no idea what this means or why it is occurring.

I'd appreciate any help getting this diagnosed and fixed so I can use Cthulhu.

Precompiling project...
  ✓ JuliaSyntax
  ✗ Cthulhu
  2 dependencies successfully precompiled in 15 seconds. 6 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> using Cthulhu
Precompiling Cthulhu
        Info Given Cthulhu was explicitly requested, output will be shown live
ERROR: LoadError: MethodError: no method matching tsn_and_mappings(::Method, ::Core.CodeInfo, ::Nothing; warn::Bool, strip_macros::Bool)

Closest candidates are:
  tsn_and_mappings(::Core.MethodInstance, ::Core.CodeInfo, ::Any; warn, strip_macros, kwargs...)
   @ TypedSyntax ~/.julia/packages/TypedSyntax/cH1Nu/src/node.jl:32
  tsn_and_mappings(::Any, ::Any; kwargs...)
   @ TypedSyntax ~/.julia/packages/TypedSyntax/cH1Nu/src/node.jl:27
  tsn_and_mappings(::Core.MethodInstance, ::Core.CodeInfo, ::Any, ::AbstractString, ::Integer; warn, strip_macros, kwargs...)
   @ TypedSyntax ~/.julia/packages/TypedSyntax/cH1Nu/src/node.jl:42
  ...

Stacktrace:
  [1] get_typed_sourcetext(mi::Core.MethodInstance, src::Core.CodeInfo, rt::Any; warn::Bool)
    @ Cthulhu ~/.julia/packages/Cthulhu/Ndnbu/src/reflection.jl:358
  [2] find_callsites(interp::Cthulhu.CthulhuInterpreter, CI::Core.CodeInfo, stmt_infos::Vector{Core.Compiler.CallInfo}, mi::Core.MethodInstance, slottypes::Vector{Any}, optimize::Bool, annotate_source::Bool)
    @ Cthulhu ~/.julia/packages/Cthulhu/Ndnbu/src/reflection.jl:36
  [3] _descend(term::REPL.Terminals.TTYTerminal, interp::Cthulhu.CthulhuInterpreter, curs::Cthulhu.CthulhuCursor; override::Nothing, debuginfo::Symbol, optimize::Bool, interruptexc::Bool, iswarn::Bool, hide_type_stable::Bool, verbose::Nothing, remarks::Bool, with_effects::Bool, inline_cost::Bool, type_annotations::Bool, annotate_source::Bool, inlay_types_vscode::Bool, diagnostics_vscode::Bool, jump_always::Bool)
    @ Cthulhu ~/.julia/packages/Cthulhu/Ndnbu/src/Cthulhu.jl:468
  [4] _descend(term::REPL.Terminals.TTYTerminal, interp::Cthulhu.CthulhuInterpreter, mi::Core.MethodInstance; kwargs::@Kwargs{iswarn::Bool})
    @ Cthulhu ~/.julia/packages/Cthulhu/Ndnbu/src/Cthulhu.jl:756
  [5] _descend(term::REPL.Terminals.TTYTerminal, args::Any; interp::Core.Compiler.NativeInterpreter, kwargs::@Kwargs{iswarn::Bool})
    @ Cthulhu ~/.julia/packages/Cthulhu/Ndnbu/src/Cthulhu.jl:772
  [6] __descend_with_error_handling(args::Any; terminal::Any, kwargs...)
    @ Cthulhu ~/.julia/packages/Cthulhu/Ndnbu/src/Cthulhu.jl:213
  [7] _descend_with_error_handling(f::Any, argtypes::Any; kwargs::@Kwargs{iswarn::Bool, terminal::REPL.Terminals.TTYTerminal})
    @ Cthulhu ~/.julia/packages/Cthulhu/Ndnbu/src/Cthulhu.jl:202
  [8] descend_code_typed(::Any, ::Vararg{Any}; kwargs::@Kwargs{terminal::REPL.Terminals.TTYTerminal})
    @ Cthulhu ~/.julia/packages/Cthulhu/Ndnbu/src/Cthulhu.jl:160
  [9] macro expansion
    @ ~/.julia/packages/Cthulhu/Ndnbu/src/Cthulhu.jl:848 [inlined]
 [10] macro expansion
    @ ~/.julia/packages/PrecompileTools/L8A3n/src/workloads.jl:78 [inlined]
 [11] macro expansion
    @ ~/.julia/packages/Cthulhu/Ndnbu/src/Cthulhu.jl:847 [inlined]
 [12] macro expansion
    @ ~/.julia/packages/PrecompileTools/L8A3n/src/workloads.jl:140 [inlined]
 [13] top-level scope
    @ ~/.julia/packages/Cthulhu/Ndnbu/src/Cthulhu.jl:843
 [14] include
    @ Base ./Base.jl:495 [inlined]
 [15] 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:2216
 [16] top-level scope
    @ stdin:3
in expression starting at /home/USERNAME/.julia/packages/Cthulhu/Ndnbu/src/Cthulhu.jl:1
in expression starting at stdin:3
  ✗ Cthulhu
  0 dependencies successfully precompiled in 6 seconds. 8 already precompiled.

ERROR: The following 1 direct dependency failed to precompile:

Cthulhu [f68482b8-f384-11e8-15f7-abe071a5a75f]

Failed to precompile Cthulhu [f68482b8-f384-11e8-15f7-abe071a5a75f] to "/home/USERNAME/.julia/compiled/v1.10/Cthulhu/jl_cBAKyI".
ERROR: LoadError: MethodError: no method matching tsn_and_mappings(::Method, ::Core.CodeInfo, ::Nothing; warn::Bool, strip_macros::Bool)

Closest candidates are:
  tsn_and_mappings(::Core.MethodInstance, ::Core.CodeInfo, ::Any; warn, strip_macros, kwargs...)
   @ TypedSyntax ~/.julia/packages/TypedSyntax/cH1Nu/src/node.jl:32
  tsn_and_mappings(::Any, ::Any; kwargs...)
   @ TypedSyntax ~/.julia/packages/TypedSyntax/cH1Nu/src/node.jl:27
  tsn_and_mappings(::Core.MethodInstance, ::Core.CodeInfo, ::Any, ::AbstractString, ::Integer; warn, strip_macros, kwargs...)
   @ TypedSyntax ~/.julia/packages/TypedSyntax/cH1Nu/src/node.jl:42
  ...

Stacktrace:
  [1] get_typed_sourcetext(mi::Core.MethodInstance, src::Core.CodeInfo, rt::Any; warn::Bool)
    @ Cthulhu ~/.julia/packages/Cthulhu/Ndnbu/src/reflection.jl:358
  [2] find_callsites(interp::Cthulhu.CthulhuInterpreter, CI::Core.CodeInfo, stmt_infos::Vector{Core.Compiler.CallInfo}, mi::Core.MethodInstance, slottypes::Vector{Any}, optimize::Bool, annotate_source::Bool)
    @ Cthulhu ~/.julia/packages/Cthulhu/Ndnbu/src/reflection.jl:36
  [3] _descend(term::REPL.Terminals.TTYTerminal, interp::Cthulhu.CthulhuInterpreter, curs::Cthulhu.CthulhuCursor; override::Nothing, debuginfo::Symbol, optimize::Bool, interruptexc::Bool, iswarn::Bool, hide_type_stable::Bool, verbose::Nothing, remarks::Bool, with_effects::Bool, inline_cost::Bool, type_annotations::Bool, annotate_source::Bool, inlay_types_vscode::Bool, diagnostics_vscode::Bool, jump_always::Bool)
    @ Cthulhu ~/.julia/packages/Cthulhu/Ndnbu/src/Cthulhu.jl:468
  [4] _descend(term::REPL.Terminals.TTYTerminal, interp::Cthulhu.CthulhuInterpreter, mi::Core.MethodInstance; kwargs::@Kwargs{iswarn::Bool})
    @ Cthulhu ~/.julia/packages/Cthulhu/Ndnbu/src/Cthulhu.jl:756
  [5] _descend(term::REPL.Terminals.TTYTerminal, args::Any; interp::Core.Compiler.NativeInterpreter, kwargs::@Kwargs{iswarn::Bool})
    @ Cthulhu ~/.julia/packages/Cthulhu/Ndnbu/src/Cthulhu.jl:772
  [6] __descend_with_error_handling(args::Any; terminal::Any, kwargs...)
    @ Cthulhu ~/.julia/packages/Cthulhu/Ndnbu/src/Cthulhu.jl:213
  [7] _descend_with_error_handling(f::Any, argtypes::Any; kwargs::@Kwargs{iswarn::Bool, terminal::REPL.Terminals.TTYTerminal})
    @ Cthulhu ~/.julia/packages/Cthulhu/Ndnbu/src/Cthulhu.jl:202
  [8] descend_code_typed(::Any, ::Vararg{Any}; kwargs::@Kwargs{terminal::REPL.Terminals.TTYTerminal})
    @ Cthulhu ~/.julia/packages/Cthulhu/Ndnbu/src/Cthulhu.jl:160
  [9] macro expansion
    @ ~/.julia/packages/Cthulhu/Ndnbu/src/Cthulhu.jl:848 [inlined]
 [10] macro expansion
    @ ~/.julia/packages/PrecompileTools/L8A3n/src/workloads.jl:78 [inlined]
 [11] macro expansion
    @ ~/.julia/packages/Cthulhu/Ndnbu/src/Cthulhu.jl:847 [inlined]
 [12] macro expansion
    @ ~/.julia/packages/PrecompileTools/L8A3n/src/workloads.jl:140 [inlined]
 [13] top-level scope
    @ ~/.julia/packages/Cthulhu/Ndnbu/src/Cthulhu.jl:843
 [14] include
    @ Base ./Base.jl:495 [inlined]
 [15] 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:2216
 [16] top-level scope
    @ stdin:3
in expression starting at /home/USERNAME/.julia/packages/Cthulhu/Ndnbu/src/Cthulhu.jl:1
in expression starting at stdin:
Stacktrace:
  [1] pkgerror(msg::String)
    @ Pkg.Types ~/julia-1.10.0/share/julia/stdlib/v1.10/Pkg/src/Types.jl:70
  [2] precompile(ctx::Pkg.Types.Context, pkgs::Vector{…}; internal_call::Bool, strict::Bool, warn_loaded::Bool, already_instantiated::Bool, timing::Bool, _from_loading::Bool, kwargs::@Kwargs{})
    @ Pkg.API ~/julia-1.10.0/share/julia/stdlib/v1.10/Pkg/src/API.jl:1656
  [3] precompile(pkgs::Vector{Pkg.Types.PackageSpec}; io::Base.TTY, kwargs::@Kwargs{_from_loading::Bool})
    @ Pkg.API ~/julia-1.10.0/share/julia/stdlib/v1.10/Pkg/src/API.jl:159
  [4] precompile
    @ Pkg.API ~/julia-1.10.0/share/julia/stdlib/v1.10/Pkg/src/API.jl:147 [inlined]
  [5] #precompile#114
    @ Pkg.API ~/julia-1.10.0/share/julia/stdlib/v1.10/Pkg/src/API.jl:146 [inlined]
  [6] #invokelatest#2
    @ Base ./essentials.jl:889 [inlined]
  [7] invokelatest
    @ Base ./essentials.jl:884 [inlined]
  [8] _require(pkg::Base.PkgId, env::String)
    @ Base ./loading.jl:1957
  [9] __require_prelocked(uuidkey::Base.PkgId, env::String)
    @ Base ./loading.jl:1806
 [10] #invoke_in_world#3
    @ Base ./essentials.jl:921 [inlined]
 [11] invoke_in_world
    @ Base ./essentials.jl:918 [inlined]
 [12] _require_prelocked(uuidkey::Base.PkgId, env::String)
    @ Base ./loading.jl:1797
 [13] macro expansion
    @ Base ./loading.jl:1784 [inlined]
 [14] macro expansion
    @ Base ./lock.jl:267 [inlined]
 [15] __require(into::Module, mod::Symbol)
    @ Base ./loading.jl:1747
 [16] #invoke_in_world#3
    @ Base ./essentials.jl:921 [inlined]
 [17] invoke_in_world
    @ Base ./essentials.jl:918 [inlined]
 [18] require(into::Module, mod::Symbol)
    @ Base ./loading.jl:1740
Some type information was truncated. Use `show(err)` to see complete types.
@timholy
Copy link
Member

timholy commented Jul 27, 2024

Works for me on 1.10.4. Here I'm installing in a fresh depot just to make sure nothing in my environment contaminates anything:

tim@diva:~$ JULIA_DEPOT_PATH=/tmp/pkgs julia
               _
   _       _ _(_)_     |  Documentation: https://docs.julialang.org
  (_)     | (_) (_)    |
   _ _   _| |_  __ _   |  Type "?" for help, "]?" for Pkg help.
  | | | | | | |/ _` |  |
  | | |_| | | | (_| |  |  Version 1.10.4 (2024-06-04)
 _/ |\__'_|_|_|\__'_|  |  Official https://julialang.org/ release
|__/                   |

(@v1.10) pkg> st
  Installing known registries into `/tmp/pkgs`
Status `/tmp/pkgs/environments/v1.10/Project.toml` (empty project)

(@v1.10) pkg> add Cthulhu
    Updating registry at `/tmp/pkgs/registries/General.toml`
   Resolving package versions...
   Installed AbstractTrees ─── v0.4.5
   Installed FoldingTrees ──── v1.2.1
   Installed Preferences ───── v1.4.3
   Installed WidthLimitedIO ── v1.0.1
   Installed CodeTracking ──── v1.3.5
   Installed JuliaSyntax ───── v0.4.9
   Installed Cthulhu ───────── v2.12.7
   Installed TypedSyntax ───── v1.3.1
   Installed PrecompileTools ─ v1.2.1
    Updating `/tmp/pkgs/environments/v1.10/Project.toml`
  [f68482b8] + Cthulhu v2.12.7
    Updating `/tmp/pkgs/environments/v1.10/Manifest.toml`
  [1520ce14] + AbstractTrees v0.4.5
  [da1fd8a2] + CodeTracking v1.3.5
  [f68482b8] + Cthulhu v2.12.7
  [1eca21be] + FoldingTrees v1.2.1
  [70703baa] + JuliaSyntax v0.4.9
  [aea7be01] + PrecompileTools v1.2.1
  [21216c6a] + Preferences v1.4.3
  [d265eb64] + TypedSyntax v1.3.1
  [b8c1c048] + WidthLimitedIO v1.0.1
  [2a0f44e3] + Base64
  [ade2ca70] + Dates
  [b77e0a4c] + InteractiveUtils
  [d6f4376e] + Markdown
  [de0858da] + Printf
  [3fa0cd96] + REPL
  [9a3f8284] + Random
  [ea8e919c] + SHA v0.7.0
  [6462fe0b] + Sockets
  [fa267f1f] + TOML v1.0.3
  [cf7118a7] + UUIDs
  [4ec0a83e] + Unicode
Precompiling project...
  9 dependencies successfully precompiled in 39 seconds

(@v1.10) pkg>

@NuclearPowerNerd
Copy link
Author

Works for me on 1.10.4. Here I'm installing in a fresh depot just to make sure nothing in my environment contaminates anything:

tim@diva:~$ JULIA_DEPOT_PATH=/tmp/pkgs julia
               _
   _       _ _(_)_     |  Documentation: https://docs.julialang.org
  (_)     | (_) (_)    |
   _ _   _| |_  __ _   |  Type "?" for help, "]?" for Pkg help.
  | | | | | | |/ _` |  |
  | | |_| | | | (_| |  |  Version 1.10.4 (2024-06-04)
 _/ |\__'_|_|_|\__'_|  |  Official https://julialang.org/ release
|__/                   |

(@v1.10) pkg> st
  Installing known registries into `/tmp/pkgs`
Status `/tmp/pkgs/environments/v1.10/Project.toml` (empty project)

(@v1.10) pkg> add Cthulhu
    Updating registry at `/tmp/pkgs/registries/General.toml`
   Resolving package versions...
   Installed AbstractTrees ─── v0.4.5
   Installed FoldingTrees ──── v1.2.1
   Installed Preferences ───── v1.4.3
   Installed WidthLimitedIO ── v1.0.1
   Installed CodeTracking ──── v1.3.5
   Installed JuliaSyntax ───── v0.4.9
   Installed Cthulhu ───────── v2.12.7
   Installed TypedSyntax ───── v1.3.1
   Installed PrecompileTools ─ v1.2.1
    Updating `/tmp/pkgs/environments/v1.10/Project.toml`
  [f68482b8] + Cthulhu v2.12.7
    Updating `/tmp/pkgs/environments/v1.10/Manifest.toml`
  [1520ce14] + AbstractTrees v0.4.5
  [da1fd8a2] + CodeTracking v1.3.5
  [f68482b8] + Cthulhu v2.12.7
  [1eca21be] + FoldingTrees v1.2.1
  [70703baa] + JuliaSyntax v0.4.9
  [aea7be01] + PrecompileTools v1.2.1
  [21216c6a] + Preferences v1.4.3
  [d265eb64] + TypedSyntax v1.3.1
  [b8c1c048] + WidthLimitedIO v1.0.1
  [2a0f44e3] + Base64
  [ade2ca70] + Dates
  [b77e0a4c] + InteractiveUtils
  [d6f4376e] + Markdown
  [de0858da] + Printf
  [3fa0cd96] + REPL
  [9a3f8284] + Random
  [ea8e919c] + SHA v0.7.0
  [6462fe0b] + Sockets
  [fa267f1f] + TOML v1.0.3
  [cf7118a7] + UUIDs
  [4ec0a83e] + Unicode
Precompiling project...
  9 dependencies successfully precompiled in 39 seconds

(@v1.10) pkg>

Hey @timholy , thanks for the response.

I agree it is strange. I also have a laptop with separate installation of Julia but also version 1.10.0 and it worked fine there. The interesting thing though was that when I did ] activate --temp and did add Cthulhu it automatically installed version 2.12.7. It precompiles fine and I can use it.

But when I install it on my PC I get 2.9.6 instead of 2.12.7. But if I do ] add [email protected] on my PC I get that version and it works fine.

@timholy
Copy link
Member

timholy commented Jul 27, 2024

You might have had a conflict with the latest until you told Pkg to go with the new version.

Since I think there's nothing that needs fixing, I'll close.

@timholy timholy closed this as completed Jul 27, 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

2 participants