Documenter: SystemError while trying to read Statistics.jl

I have imported the Statistics.mean function in my package and declared new methods for it. The code is fine and works well. I have documented the methods. While building the doc, Documenter gives me two Warnings and one Error:

┌ Warning: no doc found for reference ‘missing’ in src\riemannianGeometry.md.
└ @ Documenter.CrossReferences C:\Users\congedom.julia\packages\Documenter\G5Sup\src\CrossReferences.jl:160
┌ Warning: no doc found for reference ‘skipmissing’ in src\riemannianGeometry.md.
└ @ Documenter.CrossReferences C:\Users\congedom.julia\packages\Documenter\G5Sup\src\CrossReferences.jl:160
[ Info: CheckDocument: running document checks.
ERROR: SystemError: opening file “C:\cygwin\home\Administrator\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.1\Statistics\src\Statistics.jl”: No such file or directory

I am working on Windows 10 with Julia Version 1.1.0.
I have installed cygwin, but that did not solve the error.

P.S. this seems related to 19414, but the discussion did not end there.

Yeah, it seems similar to the issue you link to. Is your code public? It’s hard to debug this without an MWE. Alternatively, if you can figure out where in Documenter the error is thrown, that might also help. What version of Documenter are you using?

Yes it is public. The branch i have tried to build that gives me the error (using Travis in the github repo but also internally on my PC) is named ‘devmean’. In the master branch the same method is named meanP and the documentation build goes fine there.
https://github.com/Marco-Congedo/PosDefManifold.jl/tree/devmean

The method for the mean function i wrote currently starts at line 995 of https://github.com/Marco-Congedo/PosDefManifold.jl/blob/devmean/src/riemannianGeometry.jl

The @docs is here: https://github.com/Marco-Congedo/PosDefManifold.jl/edit/devmean/docs/src/riemannianGeometry.md

The mean function is imported from Statistics in the main module (currently line 47):
https://github.com/Marco-Congedo/PosDefManifold.jl/blob/devmean/src/PosDefManifold.jl

These are the versions:

[e30172f5] Documenter v0.22.3
[35a29f4d] DocumenterTools v0.1.0

Finally, here is the Stacktrace of the error when i try to build the doc internally (the one generated by Travis is slightly different)

Stacktrace:
[1] #systemerror#43(::Nothing, ::Function, ::String, ::Bool) at .\error.jl:134
[2] systemerror at .\error.jl:134 [inlined]
[3] #open#309(::Nothing, ::Nothing, ::Nothing, ::Nothing, ::Nothing, ::Function, ::String) at .\iostream.jl:283
[4] open at .\iostream.jl:275 [inlined]
[5] #open#310(::Base.Iterators.Pairs{Union{},Union{},Tuple{},NamedTuple{(),Tuple{}}}, ::Function, ::getfield(Base, Symbol(“##274#275”)){String}, ::String) at .\iostream.jl:367
[6] open at .\iostream.jl:367 [inlined]
[7] read at .\io.jl:297 [inlined]
[8] find_block_in_file(::String, ::String) at C:\Users\congedom.julia\packages\Documenter\G5Sup\src\Utilities\Utilities.jl:19
[9] report(::Documenter.DocTests.Result, ::String, ::Documenter.Documents.Document) at C:\Users\congedom.julia\packages\Documenter\G5Sup\src\DocTests.jl:263
[10] checkresult(::Module, ::Documenter.DocTests.Result, ::Dict{Symbol,Any}, ::Documenter.Documents.Document) at C:\Users\congedom.julia\packages\Documenter\G5Sup\src\DocTests.jl:213
[11] eval_repl(::Markdown.Code, ::Module, ::Dict{Symbol,Any}, ::Documenter.Documents.Document, ::Documenter.Documents.Page) at
C:\Users\congedom.julia\packages\Documenter\G5Sup\src\DocTests.jl:150
[12] doctest(::Markdown.Code, ::Dict{Symbol,Any}, ::Documenter.Documents.Document, ::Documenter.Documents.Page) at C:\Users\congedom.julia\packages\Documenter\G5Sup\src\DocTests.jl:90
[13] (::getfield(Documenter.DocTests, Symbol(“##1#2”)){Documenter.Documents.Document})(::Markdown.Code) at C:\Users\congedom.julia\packages\Documenter\G5Sup\src\DocTests.jl:34
[14] walk(::getfield(Documenter.DocTests, Symbol(“##1#2”)){Documenter.Documents.Document}, ::Dict{Symbol,Any}, ::Markdown.Code) at C:\Users\congedom.julia\packages\Documenter\G5Sup\src\Documents.jl:464
[15] walk(::Function, ::Dict{Symbol,Any}, ::Array{Any,1}) at C:\Users\congedom.julia\packages\Documenter\G5Sup\src\Documents.jl:478
[16] walk(::getfield(Documenter.DocTests, Symbol(“##1#2”)){Documenter.Documents.Document}, ::Dict{Symbol,Any}, ::Markdown.MD) at C:\Users\congedom.julia\packages\Documenter\G5Sup\src\Documents.jl:471
[17] walk(::Function, ::Dict{Symbol,Any}, ::Array{Any,1}) at C:\Users\congedom.julia\packages\Documenter\G5Sup\src\Documents.jl:478
[18] walk(::getfield(Documenter.DocTests, Symbol(“##1#2”)){Documenter.Documents.Document}, ::Dict{Symbol,Any}, ::Markdown.MD) at C:\Users\congedom.julia\packages\Documenter\G5Sup\src\Documents.jl:471
[19] walk(::Function, ::Dict{Symbol,Any}, ::Array{Any,1}) at C:\Users\congedom.julia\packages\Documenter\G5Sup\src\Documents.jl:478
[20] walk(::getfield(Documenter.DocTests, Symbol(“##1#2”)){Documenter.Documents.Document}, ::Dict{Symbol,Any}, ::Markdown.MD) at C:\Users\congedom.julia\packages\Documenter\G5Sup\src\Documents.jl:471
[21] walk(::Function, ::Dict{Symbol,Any}, ::Documenter.Documents.DocsNode) at C:\Users\congedom.julia\packages\Documenter\G5Sup\src\Documents.jl:503
[22] walk(::Function, ::Dict{Symbol,Any}, ::Array{Union{DocsNode, Admonition},1}) at C:\Users\congedom.julia\packages\Documenter\G5Sup\src\Documents.jl:478
[23] walk(::Function, ::Dict{Symbol,Any}, ::Documenter.Documents.DocsNodes) at C:\Users\congedom.julia\packages\Documenter\G5Sup\src\Documents.jl:502
[24] doctest(::Documenter.Documents.Document) at C:\Users\congedom.julia\packages\Documenter\G5Sup\src\DocTests.jl:33
[25] runner(::Type{Documenter.Builder.CheckDocument}, ::Documenter.Documents.Document) at C:\Users\congedom.julia\packages\Documenter\G5Sup\src\Builder.jl:190
[26] dispatch(::Type{Documenter.Builder.DocumentPipeline}, ::Documenter.Documents.Document) at C:\Users\congedom.julia\packages\Documenter\G5Sup\src\Utilities\Selectors.jl:167
[27] (::getfield(Documenter, Symbol(“##3#8”)))() at C:\Users\congedom.julia\packages\Documenter\G5Sup\src\Documenter.jl:287
[28] cd(::getfield(Documenter, Symbol(“##3#8”)), ::String) at .\file.jl:85
[29] #makedocs#1(::Bool, ::Documenter.Writers.HTMLWriter.HTML, ::Nothing, ::Nothing, ::Nothing, ::Nothing, ::Nothing, ::Nothing, ::Base.Iterators.Pairs{Symbol,String,Tuple{Symbol},NamedTuple{(:sitename,),Tuple{String}}}, ::typeof(makedocs)) at C:\Users\congedom.julia\packages\Documenter\G5Sup\src\Documenter.jl:286
[30] (::getfield(Documenter, Symbol(“#kw##makedocs”)))(::NamedTuple{(:sitename,),Tuple{String}}, ::typeof(makedocs)) at .\none:0
[31] top-level scope at none:0

Ok, I think I have identified the problem in Documenter and have an idea for a fix (#1002).

But your setup had a configuration problem as well which exposed this. You were including the docstrings of mean from Base too. You should add modules=[PosDefManifold] to makedocs to make sure that non-PosDefManifold docstrings get filtered out.

adding

to makedocs solved the problem. Thanks :slight_smile: