Skip to content
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

Cannot generate docs #101

Open
phil294 opened this issue Jul 20, 2022 · 1 comment
Open

Cannot generate docs #101

phil294 opened this issue Jul 20, 2022 · 1 comment

Comments

@phil294
Copy link

phil294 commented Jul 20, 2022

After a clean clone, shards run gi-doc shows

Dependencies are satisfied
Building: gi-doc
Error target gi-doc failed to compile:
Showing last frame. Use --error-trace for full trace.

In /usr/lib/crystal/compiler/crystal/program.cr:23:9

 23 | class Program < NonGenericModuleType
            ^
Error: superclass mismatch for class Crystal::Program (Crystal::NonGenericModuleType for Reference)
error trace
In src/generator/doc.cr:5:1

5 | require "compiler/crystal/"
^
Error: while requiring "compiler/crystal/
"

In /usr/lib/crystal/compiler/crystal/command.cr:13:1

13 | require "./tools/"
^
Error: while requiring "./tools/
"

In /usr/lib/crystal/compiler/crystal/tools/context.cr:3:1

3 | require "../semantic/"
^
Error: while requiring "../semantic/
"

In /usr/lib/crystal/compiler/crystal/semantic/fix_missing_types.cr:1:1

1 | require "../semantic"
^
Error: while requiring "../semantic"

In /usr/lib/crystal/compiler/crystal/semantic.cr:1:1

1 | require "./program"
^
Error: while requiring "./program"

In /usr/lib/crystal/compiler/crystal/program.cr:23:9

23 | class Program < NonGenericModuleType
^
Error: superclass mismatch for class Crystal::Program (Crystal::NonGenericModuleType for Reference)

x86_64 Linux 5.4.200-1-MANJARO, Xfce4/Xfwm4, Crystal 1.4.1 (2022-04-23), Shards 0.17.0 (2022-03-25)

Thanks for all your work. This shard is so meta, it's fascinating to read through the source.

@jhass
Copy link
Owner

jhass commented Jul 22, 2022

Might need to declare it a failed experiment, at least in the current approach. Given the compiler packages don't ship the vendored in markd sources, I don't see a sane way to go forward. That said:

diff --git a/src/generator/doc.cr b/src/generator/doc.cr
index 6d039a98..ac4c257a 100644
--- a/src/generator/doc.cr
+++ b/src/generator/doc.cr
@@ -2,7 +2,7 @@ require "xml"
 require "option_parser"
 require "../g_i_repository"
 require "./namespace"
-require "compiler/crystal/**"
+require "compiler/requires"

 module Crystal::Config
   def self.path
$ cd /opt/homebrew/Cellar/crystal/1.5.0/share/crystal/
$ mkdir lib
$ cd lib
$ git clone https://github.com/icyleaf/markd.git
$ cd ~/projects/crystal-gobject
$ shards build gi-doc
$ CRYSTAL_PATH="$(crystal env CRYSTAL_PATH):samples/lib" CRYSTAL_LIBRARY_PATH="$(crystal env CRYSTAL_LIBRARY_PATH)" bin/gi-doc -g $(brew --prefix)/share/gir-1.0 GObject
Docs written to docs/gobject
$ ls docs/gobject
404.html        Float32.html    GLib.html       Gio.html        Int8.html       String.html     UInt8.html      index.json      toplevel.html
Bool.html       Float64.html    GObject         Int32.html      Object.html     UInt32.html     css             js
Enum.html       GLib            GObject.html    Int64.html      Pointer.html    UInt64.html     index.html      search-index.js

😅 🤣

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants