Closed ghost closed 4 years ago
gi-doc
reuses large parts of the documentation generator, and thus parser, included into the compiler, so it is building the compiler as part of it. Are you able to build the compiler from soure?
I just built the compiler and ran the spec tests. Everything works fine, but I'm still unable to build the doc generator.
Mmh, maybe the LLVM version used to build the snap differs from the one installed into the system? I don't really know.
It'll probably work with your just built compiler, try export PATH="/path/to/your/crystal/repo/clone/bin:$PATH
.
That makes sense. IIRC the official LLVM version for Crystal is 8, while Fedora's default is 8.
That command sort of worked, but now I get a crystal error:
Error target gi-doc failed to compile:
Using compiled compiler at /home/sim/Programming/git/not_mine/crystal/.build/crystal
Showing last frame. Use --error-trace for full trace.
In src/generator/doc.cr:228:23
228 | generator = Generator.new(result.program, included_dirs, output_directory, "html", nil, "", "")
^--
Error: wrong number of arguments for 'Generator.new' (given 7, expected 2, 8)
Overloads are:
- Crystal::Doc::Generator.new(program : Program, included_dirs : Array(String), output_dir : String, output_format : String, sitemap_base_url : String | ::Nil, sitemap_priority : String, sitemap_changefreq : String, project_info : ProjectInfo)
- Crystal::Doc::Generator.new(program : Program, included_dirs : Array(String))
Ah, right, master is landing many changes to the doc generator currently, missed thinking about that :/
I'm hesitant to just update gi-doc
to that without those changes having all landed in a release yet, so I would ask you to into one more round of trial and error by doing make clean; git checkout 0.34.0; make
in your crystal-lang/crystal clone please :)
I managed to fix it by appending Crystal::Doc::ProjectInfo.new
to the function call arguments, and that fixed it.
Thanks for the help, I appreciate it :)
Whoops, runtime error. I'll try checking out that branch like you said
That didn't fix it. New error!
λ ./bin/gi-doc Gtk
Unhandled exception: while requiring "gobject" (Crystal::TypeException)
from /home/sim/Programming/git/not_mine/crystal/src/compiler/crystal/semantic/ast.cr:13:9 in 'raise'
from /home/sim/Programming/git/not_mine/crystal/src/compiler/crystal/semantic/ast.cr:12:5 in 'raise'
from /home/sim/Programming/git/not_mine/crystal/src/compiler/crystal/semantic/semantic_visitor.cr:72:5 in 'visit'
from /home/sim/Programming/git/not_mine/crystal/src/compiler/crystal/syntax/visitor.cr:27:12 in 'accept'
from /home/sim/Programming/git/not_mine/crystal/src/compiler/crystal/semantic/top_level_visitor.cr:724:9 in 'visit'
from /home/sim/Programming/git/not_mine/crystal/src/compiler/crystal/syntax/visitor.cr:27:12 in 'accept'
from /home/sim/Programming/git/not_mine/crystal/src/compiler/crystal/semantic.cr:62:7 in 'top_level_semantic'
from /home/sim/Programming/git/not_mine/crystal/src/compiler/crystal/compiler.cr:193:25 in 'top_level_semantic'
from src/generator/doc.cr:226:10 in '__crystal_main'
from /home/sim/Programming/git/not_mine/crystal/src/crystal/main.cr:105:5 in 'main_user_code'
from /home/sim/Programming/git/not_mine/crystal/src/crystal/main.cr:91:7 in 'main'
from /home/sim/Programming/git/not_mine/crystal/src/crystal/main.cr:114:3 in 'main'
from __libc_start_main
from _start
from ???
Mmh, it works if you run it from within samples/
😆 (In other words from within something that has crystal-gobject within a lib
folder).
Guess I'll have to figure out a way to always push it into the lookup path for gi-doc
🤔
Well, this is a terrible hack, but so is the entire gi-doc
thing. Let's see if that works for you :D
Terrible hacks are the best kind! T his one's even better because it works perfectly, thank you :)
I'm trying to build gi-doc so I can generate some documentation for myself. Unfortunately, running
shards build
produces this error:I've got all the dependencies and LLVM installed. Is this a problem on my end, or is this an issue with the build?