-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
Fix documenting baremodules #13067
Fix documenting baremodules #13067
Conversation
Prior to this fix attempting to document baremodules results in an infinite error message plus segfault when trying to escape: julia> "..." baremodule M end This fix imports `call` and `@doc` into the module automatically. Also makes documenting empty baremodules an error since that was also causing segfaults. That limitation won't impact any real-world code though. Tests and documentation updates as well.
Fix documenting baremodules
I think if pure julia can segfault there is still a bug to fix somewhere ? Or did I misunderstood ? |
He catches that case and throws an error. Was going to open another issue for the bare mode segfault. |
Prior to this fix attempting to document baremodules results in an infinite error message plus segfault when trying to escape: julia> "..." baremodule M end This fix imports `call` and `@doc` into the module automatically. Also makes documenting empty baremodules an error since that was also causing segfaults. That limitation won't impact any real-world code though. Tests and documentation updates as well. (cherry picked from commit 8edd917) ref #13067
@carnaval, pushing the diff --git a/base/docs/Docs.jl b/base/docs/Docs.jl
index 6e6a4db..915bc92 100644
--- a/base/docs/Docs.jl
+++ b/base/docs/Docs.jl
@@ -471,8 +471,7 @@ function moddoc(meta, def, name)
def = unblock(def)
block = def.args[3].args
if !def.args[1]
- isempty(block) && error("empty baremodules are not documentable.")
- insert!(block, 2, :(import Base: call, @doc))
+ unshift!(block, :(import Base: call, @doc))
end
push!(block, docex)
esc(Expr(:toplevel, def)) and then doing
gives the following error. I'm having trouble reducing it much more than that though.
|
backported in #13072 |
@MichaelHatherly @carnaval the error comes from the fact that the global
|
I actually just get an BoundsError on |
You have to apply the patch to reproduce the bug. As the array is zero length, it is expected you will get a bounds error with |
Ahh.. I somehow missed the second line of the patch... |
Prior to this fix attempting to document baremodules results in an infinite error message plus segfault when trying to escape:
This fix imports
call
and@doc
into the module automatically.Also makes documenting empty baremodules an error since that was also causing segfaults. That limitation won't impact any real-world code though.
Tests and documentation updates as well.