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

Issues generating ex_docs in project after adding LVN + issue with deps compilation order #51

Closed
mayel opened this issue Sep 30, 2023 · 5 comments
Labels
bug Something isn't working

Comments

@mayel
Copy link

mayel commented Sep 30, 2023

First issue I encountered was elixir-lang/ex_doc#1784 (which I can avoid using bleeding edge ex_doc).

Second issue for some reason is only appearing in our CI:

Generating docs...
** (Protocol.UndefinedError) protocol Enumerable not implemented for 
{[%ExDoc.ModuleNode{id: "Bonfire.Web.AboutLive.LiveViewNativeSwiftUi", title: "Bonfire.Web.AboutLive.LiveViewNativeSwiftUi", nested_context: "Bonfire", nested_title: ".Web.AboutLive.LiveViewNativeSwiftUi", module: Bonfire.Web.AboutLive.LiveViewNativeSwiftUi, group: :"Bonfire utilities", deprecated: nil, doc_format: "text/markdown", doc: nil, source_doc: :none, rendered_doc: nil, doc_line: 5, docs_groups: [:Callbacks, :Functions], docs: [%ExDoc.FunctionNode{id: "alert/1", name: :alert, arity: 1, defaults: [], deprecated: nil, doc: nil, source_doc: :none, rendered_doc: nil, type: :function, signature: "alert(arg1)", specs: [], annotations: [], group: :Functions, doc_line: 5, source_path: "deps/bonfire/lib/web/views/about_live.ex", source_url: "https://github.com/bonfire-networks/bonfire/blob/main/lib/web/views/about_live.ex#L5"}, %ExDoc.FunctionNode{id: "alert/2",
[...snip...]
}], []} of type Tuple. 
@supernintendo
Copy link
Contributor

@mayel I'm not able to reproduce this (I tried running mix docs within a LiveView Native project and works just fine), do you have any more info you could share or maybe a link to your repo which is affected?

@mayel
Copy link
Author

mayel commented Nov 30, 2023

@supernintendo thanks for looking at this, strangely enough I'm not able to see if this issue is still occurring in CI currently because this is blocking it instead:

==> live_view_native_platform
Compiling 11 files (.ex)
warning: redefining @moduledoc attribute previously set at line 2
  lib/live_view_native_platform/env.ex:28: LiveViewNativePlatform.Env (module)

Generated live_view_native_platform app
==> live_view_native
Compiling 18 files (.ex)

== Compilation error in file lib/live_view_native/platforms.ex ==
** (UndefinedFunctionError) function LiveViewNativeSwiftUi.platforms/0 is undefined (module LiveViewNativeSwiftUi is not available)
    LiveViewNativeSwiftUi.platforms()
    (elixir 1.15.7) lib/enum.ex:4317: Enum.flat_map_list/2
    lib/live_view_native/platforms.ex:8: (module)
could not compile dependency :live_view_native, "mix compile" failed. Errors may have been logged above. You can recompile this dependency with "mix deps.compile live_view_native --force", update it with "mix deps.update live_view_native" or clean it with "mix deps.clean live_view_native"
error: Recipe `cmd` failed on line 707 with exit code 1
error: Recipe `mix` failed on line 732 with exit code 1
error: Recipe `docs` failed on line 171 with exit code 1

This is an error I've seen locally as well and usually get around it by cleaning the live_view_native_swift_ui and live_view_native deps and recompiling as it seems the compiler is otherwise not compiling the LVN deps in the right order?

This is the repo in question: https://github.com/bonfire-networks/bonfire-app

@mayel
Copy link
Author

mayel commented Nov 30, 2023

Looks like live_view_native and live_view_native_swift_ui both depend on live_view_native_platform but nothing tells the compiler that live_view_native_swift_ui needs to be compiled before live_view_native...

@mayel
Copy link
Author

mayel commented Nov 30, 2023

Usually I'd solve that by making live_view_native_swift_ui an optional dependency of live_view_native, but not sure what's best in this context.

@supernintendo supernintendo added the bug Something isn't working label Nov 30, 2023
@mayel mayel changed the title Issues generating ex_docs in project after adding LVN Issues generating ex_docs in project after adding LVN + issue with deps compilation order Dec 4, 2023
@supernintendo supernintendo removed their assignment Dec 19, 2023
@bcardarella
Copy link
Contributor

@mayel I'm closing as I believe this is no longer a valid issue with the v0.3.0 refactor work. Thank you for reporting.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Status: Done
Development

No branches or pull requests

3 participants