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

Docs stuck on enum with methods generated at compilation time #10104

Closed
franciscoadasme opened this issue Dec 19, 2020 · 2 comments · Fixed by #10105
Closed

Docs stuck on enum with methods generated at compilation time #10104

franciscoadasme opened this issue Dec 19, 2020 · 2 comments · Fixed by #10105

Comments

@franciscoadasme
Copy link

Docs generation gets stuck when an enum has methods defined using macros.

A minimal example:

enum Foo
  A = 1

  {% for sec in %w(a b c) %}
    def {{sec.id}}
    end
  {% end %}
end

Removing the method definition from the macro loop fixes the issue... it only occurs for enums as changing the type to a class/struct also fixes the issue.

@straight-shoota told me to use strace. The following text is the last lines of the output, hope it helps.

stat("./docs/css", {st_mode=S_IFDIR|0777, st_size=4096, ...}) = 0
stat("./docs/js", {st_mode=S_IFDIR|0777, st_size=4096, ...}) = 0
open("./docs/css/style.css", O_WRONLY|O_CREAT|O_TRUNC|O_CLOEXEC, 0644) = 9
fcntl(9, F_SETFD, FD_CLOEXEC)           = 0
fcntl(9, F_GETFL)                       = 0x8001 (flags O_WRONLY|O_LARGEFILE)
write(9, "html, body {\n  background: #FFFF"..., 12194) = 12194
close(9)                                = 0
open("./docs/js/doc.js", O_WRONLY|O_CREAT|O_TRUNC|O_CLOEXEC, 0644) = 9
fcntl(9, F_SETFD, FD_CLOEXEC)           = 0
fcntl(9, F_GETFL)                       = 0x8001 (flags O_WRONLY|O_LARGEFILE)
write(9, "window.CrystalDocs = (window.Cry"..., 106) = 106
write(9, "CrystalDocs.searchIndex = (Cryst"..., 16744) = 16744
write(9, "\nNavigator = function(sidebar, s"..., 7641) = 7641
write(9, "var UsageModal = function(title,"..., 7130) = 7130
close(9)                                = 0
open("./docs/Foo.html", O_WRONLY|O_CREAT|O_TRUNC|O_CLOEXEC, 0644) = 9
fcntl(9, F_SETFD, FD_CLOEXEC)           = 0
fcntl(9, F_GETFL)                       = 0x8001 (flags O_WRONLY|O_LARGEFILE)
@asterite
Copy link
Member

Thanks for the bug report!

For future bug reports you can ignore the strace: I never use it.

@straight-shoota
Copy link
Member

In this case the stack trace actually helps to identify which type was being generated. crystal docs has no log output, so that's the easiest way ;)

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

Successfully merging a pull request may close this issue.

3 participants