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

[BUG] @cast does not work on Julia 1.11 #272

Closed
jakobnissen opened this issue Mar 18, 2024 · 7 comments · Fixed by #273
Closed

[BUG] @cast does not work on Julia 1.11 #272

jakobnissen opened this issue Mar 18, 2024 · 7 comments · Fixed by #273
Labels
bug Something isn't working

Comments

@jakobnissen
Copy link
Contributor

During precompilation, I get

Precompiling project...
        Info Given BinBencher was explicitly requested, output will be shown live
ERROR: LoadError: MethodError: no method matching doc(::typeof(BinBencher.bench))
The function `doc` exists, but no method is defined for this combination of argument types.
Stacktrace:
 [1] split_docstring(f::Function)
   @ Comonicon ~/.julia/packages/Comonicon/AXDxW/src/frontend/markdown.jl:11
 [2] cast(f::Function, name::String, args::Vector{Comonicon.JLArgument}, options::Vector{Comonicon.JLOption}, flags::Vector{Comonicon.JLFlag}, line::LineNumberNode)
   @ Comonicon ~/.julia/packages/Comonicon/AXDxW/src/frontend/cast.jl:571

This happens because Comonicon uses Base.Docs.doc, whose methods are defined in REPL, which is not loaded during precompilation on 1.11 (because REPL is not loaded, as it has been moved out of the systemimage).

The solution is to declare REPL a dependency of Comonicon.

@jakobnissen jakobnissen added the bug Something isn't working label Mar 18, 2024
@Roger-luo
Copy link
Collaborator

for compatibility, should we declare it as a dependency for previous Julia version as well?

@jakobnissen
Copy link
Contributor Author

Yes, that can be done as well - without any issues, I believe.

@jakobnissen
Copy link
Contributor Author

Perhaps a better solution is to remove the use of any REPL internals. After all, a CLI interface shouldn't need a REPL, that's kind of the whole point of a CLI interface.

@MilesCranmer
Copy link

What's the status of this?


For anybody coming from google, my temporary workaround is to add REPL as a dependency of my project, and then do using REPL: REPL at the top of my main module.

@Roger-luo
Copy link
Collaborator

Oops I forgot to tag the fix

@Roger-luo
Copy link
Collaborator

should be fixed now.

@jakobnissen
Copy link
Contributor Author

@Roger-luo I'm still having this same issue on Julia 1.11-beta1 and Comonicon 1.0.7. Are you sure it's fixed?
Here is the stack trace:

ERROR: LoadError: MethodError: no method matching doc(::typeof(BinBencher.bench))
The function `doc` exists, but no method is defined for this combination of argument types.
Stacktrace:
 [1] split_docstring(f::Function)
   @ Comonicon ~/.julia/packages/Comonicon/keaqT/src/frontend/markdown.jl:11
 [2] cast(f::Function, name::String, args::Vector{Comonicon.JLArgument}, options::Vector{Comonicon.JLOption}, flags::Vector{Comonicon.JLFlag}, line::LineNumberNode)
   @ Comonicon ~/.julia/packages/Comonicon/keaqT/src/frontend/cast.jl:571
 [3] top-level scope
   @ ~/.julia/packages/Comonicon/keaqT/src/frontend/cast.jl:419
 [4] include(mod::Module, _path::String)
   @ Base ./Base.jl:558
 [5] include(x::String)
   @ BinBencher ~/code/BinBencher.jl/src/BinBencher.jl:1
 [6] top-level scope
   @ ~/code/BinBencher.jl/src/BinBencher.jl:25
 [7] include
   @ ./Base.jl:558 [inlined]

And the loaded dependencies:

(BinBencher) pkg> st
Project BinBencher v0.1.0
Status `~/code/BinBencher.jl/Project.toml`
  [63a9268e] BinBencherBackend v0.3.0 `../BinBencherBackend.jl`
  [944b1d66] CodecZlib v0.7.4
  [863f3e99] Comonicon v1.0.7
  [c2308a5c] FASTX v2.1.5
  [0f8b85d8] JSON3 v1.14.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants