MichaelHatherly / Docile.jl

Julia package documentation system.
Other
40 stars 15 forks source link

Fails to show anything other than method information #140

Closed gizmaa closed 9 years ago

gizmaa commented 9 years ago
module DocThis

using Docile
@docstrings

export AThing, addfive

@doc """
This type defines a thing, which is a thing. Here's some code, declared by indenting:

    ay = AThing(5)
    bee = AThing(3.14)

So that's that. 
""" ->
type AThing
    bee
end

@doc """
Adds five. Just like that.
""" ->
function addfive(x::Number)
    return x + 5.
end

end #module

Usage

julia> using Lexicon

julia> using Docile

julia> using DocThis

help?> AThing
DataType   : AThing (constructor with 1 method)
  supertype: Any
  fields   : (:bee,)

Docile: updating package list...
Docile: caching 62 modules from 'Base'.
Docile: caching 1 module from 'Aerodyne'.
Docile: caching 3 modules from 'Compat'.
Docile: caching 1 module from 'DocThis'.
Docile: caching 1 module from 'SortingAlgorithms'.
Docile: caching 1 module from 'PyPlot'.
Docile: caching 1 module from 'GZip'.
Docile: caching 9 modules from 'Docile'.
ERROR: stat: name too long (ENAMETOOLONG)
 in stat at ./stat.jl:43
 in findexternal at /home/user/.julia/v0.3/Docile/src/Collector/utilities.jl:220
 in get_docs! at /home/user/.julia/v0.3/Docile/src/Collector/docstrings.jl:100
 in process! at /home/user/.julia/v0.3/Docile/src/Collector/docstrings.jl:52
 in anonymous at /home/user/.julia/v0.3/Docile/src/Collector/docstrings.jl:41
 in cd at ./file.jl:20
 in process! at /home/user/.julia/v0.3/Docile/src/Collector/docstrings.jl:40
 in docstrings at /home/user/.julia/v0.3/Docile/src/Collector/docstrings.jl:27
 in initdocs! at /home/user/.julia/v0.3/Docile/src/Cache/storage.jl:46
 in getdocs at /home/user/.julia/v0.3/Docile/src/Cache/storage.jl:54
 in Metadata at /home/user/.julia/v0.3/Docile/src/Legacy/types.jl:66
 in metadata at /home/user/.julia/v0.3/Docile/src/Interface/legacy.jl:40
 in run at /home/user/.julia/v0.3/Lexicon/src/query.jl:165

System Information

julia> versioninfo(true)
Julia Version 0.3.8
Commit 79599ad (2015-04-30 23:40 UTC)
Platform Info:
  System: Linux (x86_64-linux-gnu)
  CPU: Intel(R) Core(TM) i5-4570 CPU @ 3.20GHz
  WORD_SIZE: 64
           Ubuntu 14.04.2 LTS
  uname: Linux 3.13.0-55-generic #92-Ubuntu SMP Sun Jun 14 18:32:20 UTC 2015 x86_64 x86_64
Memory: 15.586990356445312 GB (5280.703125 MB free)
Uptime: 269200.0 sec
Load Avg:  0.3515625  0.44482421875  0.42822265625
Intel(R) Core(TM) i5-4570 CPU @ 3.20GHz: 
       speed         user         nice          sys         idle          irq
#1  1000 MHz     549880 s       7320 s     127833 s   26112191 s          0 s
#2  3201 MHz     553526 s      10241 s     126396 s   26107097 s          0 s
#3  1300 MHz     511889 s       7137 s     128567 s   26157770 s          5 s
#4   800 MHz     551731 s       6323 s     125666 s   26137879 s          0 s

  BLAS: libopenblas (NO_LAPACK NO_LAPACKE DYNAMIC_ARCH NO_AFFINITY Haswell)
  LAPACK: liblapack.so.3
  LIBM: libopenlibm
  LLVM: libLLVM-3.3
Environment:
  TERM = xterm
  XDG_SESSION_PATH = /org/freedesktop/DisplayManager/Session0
  XDG_SEAT_PATH = /org/freedesktop/DisplayManager/Seat0
  DEFAULTS_PATH = /usr/share/gconf/kde-plasma.default.path
  PATH = /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games
  MANDATORY_PATH = /usr/share/gconf/kde-plasma.mandatory.path
  HOME = /home/user
  PROFILEHOME = 
  QT_PLUGIN_PATH = /home/user/.kde/lib/kde4/plugins/:/usr/lib/kde4/plugins/
  PYTHONHOME = /usr:/usr

Package Directory: /home/user/.julia/v0.3
10 required packages:
 - DataFrames                    0.6.6
 - Dates                         0.3.2
 - Distributions                 0.7.3
 - IJulia                        0.2.5
 - Jewel                         1.0.4
 - Lexicon                       0.1.10
 - LsqFit                        0.0.1
 - Optim                         0.4.1
 - PyPlot                        1.5.3
 - ZMQ                           0.1.18
31 additional packages:
 - ArrayViews                    0.6.2
 - BinDeps                       0.3.12
 - Calculus                      0.1.8
 - Color                         0.4.5
 - Compat                        0.4.6
 - Compose                       0.3.12
 - DataArrays                    0.2.15
 - DataStructures                0.3.9
 - Docile                        0.5.6
 - DualNumbers                   0.1.3
 - FactCheck                     0.2.7
 - FixedPointNumbers             0.0.7
 - GZip                          0.2.15
 - Graphics                      0.1.0
 - Iterators                     0.1.8
 - JSON                          0.4.3
 - JuliaParser                   0.6.2
 - LNR                           0.0.1
 - LaTeXStrings                  0.1.3
 - Lazy                          0.8.4
 - NaNMath                       0.0.2
 - Nettle                        0.1.8
 - PDMats                        0.3.3
 - PyCall                        0.8.1
 - REPLCompletions               0.0.3
 - Reexport                      0.0.2
 - Requires                      0.1.2
 - SHA                           0.0.4
 - SortingAlgorithms             0.0.5
 - StatsBase                     0.6.15
 - URIParser                     0.0.5
MichaelHatherly commented 9 years ago

Thanks for the report. I'm building Julia at that commit, 79599ad, since with current release-0.3 and master I've not been able to reproduce this.

The trouble is coming from Docile trying to check if a docstring is actually a file and automatically reading the file's content if it is.

I've push a fix for this to Docile master, could you do a Pkg.update(); Pkg.checkout("Docile") to test whether this fixes the problem?

MichaelHatherly commented 9 years ago

For the reason behind not seeing any output in Sublime, that's probably https://github.com/MichaelHatherly/Lexicon.jl/issues/29. I usually only use a terminal and vim, so it's been a lower priority. Hopefully I'll have a chance to resolve that issue in a future release of Lexicon, probably 0.2.x timeframe.

MichaelHatherly commented 9 years ago

No change on 79599ad for me. Was your Julia install done with the ubuntu binaries https://launchpad.net/~staticfloat/+archive/ubuntu/juliareleases? I'll get a 14.04 vm setup this evening to check whether that has any effect.

gizmaa commented 9 years ago

Wow, you're really on the ball here.


julia> Pkg.update()
INFO: Updating METADATA...
INFO: Updating cache of Docile...
INFO: Computing changes...
INFO: Upgrading Docile: v0.5.6 => v0.5.7

julia> Pkg.checkout("Docile")
INFO: Checking out Docile master...
INFO: Pulling Docile latest master...
INFO: No packages to install, update or remove

julia> using Lexicon

julia> using Docile

julia> using DocThis

help?> AThing
DataType   : AThing (constructor with 1 method)
  supertype: Any
  fields   : (:bee,)

Docile: updating package list...
Docile: caching 62 modules from 'Base'.
Docile: caching 1 module from 'DataFrames'.
ERROR: stat: name too long (ENAMETOOLONG)
 in stat at ./stat.jl:43
 in findexternal at /home/user/.julia/v0.3/Docile/src/Collector/utilities.jl:220
 in get_docs! at /home/user/.julia/v0.3/Docile/src/Collector/docstrings.jl:100
 in process! at /home/user/.julia/v0.3/Docile/src/Collector/docstrings.jl:52
 in anonymous at /home/user/.julia/v0.3/Docile/src/Collector/docstrings.jl:41
 in cd at ./file.jl:20
 in process! at /home/user/.julia/v0.3/Docile/src/Collector/docstrings.jl:40
 in docstrings at /home/user/.julia/v0.3/Docile/src/Collector/docstrings.jl:27
 in initdocs! at /home/user/.julia/v0.3/Docile/src/Cache/storage.jl:46
 in getdocs at /home/user/.julia/v0.3/Docile/src/Cache/storage.jl:54
 in Metadata at /home/user/.julia/v0.3/Docile/src/Legacy/types.jl:66
 in metadata at /home/user/.julia/v0.3/Docile/src/Interface/legacy.jl:40
 in run at /home/user/.julia/v0.3/Lexicon/src/query.jl:165
gizmaa commented 9 years ago

I think it comes from http://ppa.launchpad.net/staticfloat/juliareleases/ubuntu. I don't have many sources listed in Muon but that looks like one specifically dedicated to Julia.

Here is information from apt.

:~$ apt-cache show julia
Package: julia
Priority: extra
Section: science
Installed-Size: 65378
Maintainer: Debian Julia Team <pkg-julia-devel@lists.alioth.debian.org>
Architecture: amd64
Version: 0.3.8-docfix-trusty4
Suggests: ess (>= 12.09-1~), julia-doc
Depends: libc6 (>= 2.17), libdouble-conversion1, libgcc1 (>= 1:4.1.1), libgfortran3 (>= 4.6), liblapack3 | liblapack.so.3, libopenblas-base, libstdc++6 (>= 4.6), zlib1g (>= 1:1.2.0), liblapack3 | libatlas3-base, libpcre3 (>= 8.31), libfftw3-3, libcholmod1.7.1 | libcholmod2.1.2, libumfpack5.4.0 | libumfpack5.6.2, libgmp10 (>= 5.1.3), libarpack2, librmath-julia-dev, libmpfr4, git                    
Pre-Depends: multiarch-support                                                  
Filename: pool/main/j/julia/julia_0.3.8-docfix-trusty4_amd64.deb                
Size: 14024306                                                                  
MD5sum: c2cb266f8823ca57451c4ebc3e05d8e3                                        
SHA1: 40a9a5689d8fc911b0d2fd02ed4654e90a3406ef                                  
SHA256: b1ffcfcd5f3464158732852295aba8474eb9afcfc58926cd24da66a3167647e5        
Description-en: high-performance programming language for technical computing   
 Julia is a high-level, high-performance dynamic programming language for       
 technical computing, with syntax that is familiar to users of other technical  
 computing environments. It provides a sophisticated compiler, distributed      
 parallel execution, numerical accuracy, and an extensive mathematical function 
 library. The library, mostly written in Julia itself, also integrates mature,  
 best-of-breed C and Fortran libraries for linear algebra, random number        
 generation, FFTs, and string processing. Julia programs are organized around   
 defining functions, and overloading them for different combinations of         
 argument types (which can also be user-defined).                               
 .                                                                              
 This package provides a complete Julia installation (JIT compiler, standard    
 library, text-based user interface).                                           
Description-md5: 7dde6bdfecf283488c90d2886fb982c1 
MichaelHatherly commented 9 years ago

Could you run the following function:

julia> function largestfilelength(n)
           for i = 1:n
               try
                   isfile(randstring(i))
               catch err
                   return err, i
               end
           end
       end
largestfilelength (generic function with 1 method)

julia> largestfilelength(1024)
(stat: name too long (ENAMETOOLONG),256)
gizmaa commented 9 years ago
julia> function largestfilelength(n)
                  for i = 1:n
                      try
                          isfile(randstring(i))
                      catch err
                          return err, i
                      end
                  end
              end
largestfilelength (generic function with 1 method)

julia> largestfilelength(1024)
(stat: name too long (ENAMETOOLONG),144)
MichaelHatherly commented 9 years ago

Thanks, 144 is what I needed. Hopefully that's the real lower bound.

The backtrace in this, https://github.com/MichaelHatherly/Docile.jl/issues/140#issuecomment-114066965, seems to have the wrong line numbers for master. From https://github.com/MichaelHatherly/Docile.jl/blob/becdef7d4bbf1f9c8482590bdae329de9fff8cab/src/Collector/utilities.jl#L220-L237 line 220 is not aligned with findexternal, I guess Pkg.checkout didn't work, best to just use git pull origin master directly in the Docile folder to get the latest changes.

gizmaa commented 9 years ago
:~/.julia/v0.3/Docile$ git pull origin master 
From https://github.com/MichaelHatherly/Docile.jl
 * branch            master     -> FETCH_HEAD
Already up-to-date.
MichaelHatherly commented 9 years ago

Had you already called using Docile prior to Pkg.checkout("Docile") in the same REPL session? If so then the second using Docile wouldn't have any effect.

What's the hash for the current commit?

$ git rev-parse HEAD
becdef7d4bbf1f9c8482590bdae329de9fff8cab
gizmaa commented 9 years ago
$ git rev-parse HEAD
becdef7d4bbf1f9c8482590bdae329de9fff8cab

The comment above where I did the checkout is the entire Julia session.

gizmaa commented 9 years ago

Success!

I just restarted Julia and typed the following commands.

julia> using Lexicon

julia> using DocThis

help?> AThing
DataType   : AThing (constructor with 1 method)
  supertype: Any
  fields   : (:bee,)

Docile: updating package list...
Docile: caching 62 modules from 'Base'.
Docile: caching 1 module from 'Lexicon'.
Docile: caching 1 module from 'ArrayViews'.
Docile: caching 9 modules from 'Docile'.
Docile: caching 1 module from 'PyPlot'.
Docile: caching 1 module from 'FixedPointNumbers'.
Docile: caching 1 module from 'Dates'.
Docile: caching 1 module from 'DocThis'.
Docile: caching 1 module from 'Reexport'.
Docile: caching 1 module from 'LaTeXStrings'.
Docile: caching 1 module from 'Aerodyne'.
Docile: caching 1 module from 'SortingAlgorithms'.
Docile: caching 3 modules from 'Compat'.
Docile: caching 1 module from 'DataArrays'.
Docile: caching 1 module from 'GZip'.
Docile: caching 1 module from 'StatsBase'.
Docile: caching 1 module from 'Color'.
Docile: caching 1 module from 'PyCall'.
Docile: caching 1 module from 'DataFrames'.

[type]

DocThis.AThing

  This type defines a thing, which is a thing. Here's some code, declared by
  indenting:

  ay = AThing(5)
  bee = AThing(3.14)

  So that's that. 

 Details:

        source: (15,"/home/user/Code/DocThis.jl")
MichaelHatherly commented 9 years ago

Great! That's definitely the right output now. I'll tag Docile 0.5.8 shortly so you don't have to sit on master for this to work.

MichaelHatherly commented 9 years ago

Should be fixed with this tag https://github.com/JuliaLang/METADATA.jl/pull/2755.