docurium icon indicating copy to clipboard operation
docurium copied to clipboard

Error running example (`wrong argument type nil (expected Rugged::Object)`)

Open mattt opened this issue 4 years ago • 2 comments

I'm having trouble running docurium locally based on the information in the README. Here are the commands I used:

$ git clone https://github.com/libgit2/docurium
$ cd docurium
$ curl "https://raw.githubusercontent.com/libgit2/libgit2/main/api.docurium" > api.docurium
$ bundle install
$ ./bin/cm doc api.docurium

Running the last command produces the following output:

WARNING: Pygments not found. Using webservice.
[DEPRECATION] Struct layout is already defined for class FFI::Clang::Lib::CXSourceRange. Redefinition as in ~/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/ffi-clang-0.6.0/lib/ffi/clang/lib/source_range.rb:31:in `<class:CXSourceRange>' will be disallowed in ffi-2.0.
Generating documentation for v0.0.1 [0/16]
Generating documentation for v0.0.2 [1/16]
Generating documentation for v0.1.0 [3/16]
Generating documentation for v0.0.4 [2/16]
Generating documentation for v0.2.0 [4/16]
Generating documentation for v0.2.1 [5/16]
Generating documentation for v0.2.2 [6/16]
Generating documentation for v0.3.0 [7/16]
wrong argument type nil (expected Rugged::Object)
~/docurium/lib/docurium.rb:434:in `read_tree'
~/docurium/lib/docurium.rb:434:in `read_subtree'
~/docurium/lib/docurium.rb:121:in `generate_doc_for'
~/docurium/lib/docurium.rb:145:in `block in process_project'
~/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/parallel-1.17.0/lib/parallel.rb:504:in `call_with_index'
~/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/parallel-1.17.0/lib/parallel.rb:471:in `process_incoming_jobs'
~/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/parallel-1.17.0/lib/parallel.rb:453:in `block in worker'
~/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/parallel-1.17.0/lib/parallel.rb:444:in `fork'
~/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/parallel-1.17.0/lib/parallel.rb:444:in `worker'
~/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/parallel-1.17.0/lib/parallel.rb:435:in `block in create_workers'
~/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/parallel-1.17.0/lib/parallel.rb:434:in `each'
~/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/parallel-1.17.0/lib/parallel.rb:434:in `each_with_index'
~/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/parallel-1.17.0/lib/parallel.rb:434:in `create_workers'
~/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/parallel-1.17.0/lib/parallel.rb:373:in `work_in_processes'
~/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/parallel-1.17.0/lib/parallel.rb:277:in `map'
~/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/parallel-1.17.0/lib/parallel.rb:227:in `each'
~/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/parallel-1.17.0/lib/parallel.rb:241:in `each_with_index'
~/docurium/lib/docurium.rb:130:in `process_project'
~/docurium/lib/docurium.rb:165:in `generate_docs'
~/docurium/lib/docurium/cli.rb:6:in `doc'
./bin/cm:24:in `block (2 levels) in <main>'
~/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/gli-2.20.0/lib/gli/command_support.rb:131:in `execute'
~/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/gli-2.20.0/lib/gli/app_support.rb:296:in `block in call_command'
~/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/gli-2.20.0/lib/gli/app_support.rb:309:in `call_command'
~/.rbenv/versions/2.7.1/lib/ruby/gems/2.7.0/gems/gli-2.20.0/lib/gli/app_support.rb:83:in `run'
./bin/cm:58:in `<main>'

Some additional diagnostic information:

$ sw_vers
ProductName:	Mac OS X
ProductVersion:	10.15.7
BuildVersion:	19H512
$ ruby --version
ruby 2.7.1p83 (2020-03-31 revision a0c7c23c9c) [x86_64-darwin19]
$ bundle --version 
Bundler version 2.1.4

mattt avatar Feb 23 '21 13:02 mattt

Looking at a recent successful CI run for libgit2, I noticed that the output is different from what I get locally (Generating documentation [0/70] instead of Generating documentation for v0.0.2 [1/16]). Are there changes between HEAD of master here and the Docker container used by that CI action?

mattt avatar Feb 23 '21 14:02 mattt

You seem to be using the libgit2 configuration for docurium itself, which is likely the source of the problem. That configuration includes the directory where the header files will be. That directory doesn't exist in docurium, so it errors out. It might be a bit confusing because it launches several processes in parallel so the error isn't necessarily for the version which appears just before it.

carlosmn avatar May 27 '21 18:05 carlosmn