Zigler error compiling on livebook: (KeyError) key :function_groups not found

I’m trying to learn zigler with livebook

When I install it…

Mix.install([
  {:zigler, "~> 0.9.1"}
])

I got next error message

== Compilation error in file lib/zig/doc/parser.ex ==
** (KeyError) key :function_groups not found
    (ex_doc 0.29.1) expanding struct: ExDoc.ModuleNode.__struct__/1
    lib/zig/doc/parser.ex:33: Zig.Doc.Parser.moduledocs_from_file/3
could not compile dependency :zigler, "mix compile" failed. Errors may have been logged above. You can recompile this dependency with "mix deps.compile zigler", update it with "mix deps.update zigler" or clean it with "mix deps.clean zigler"

Is anyone using this library with livebook?

my elixir and livebook versions are…

Erlang/OTP 25 [erts-13.1.1] [source] [64-bit] [smp:8:8] [ds:8:8:10] [async-threads:1] [jit:ns]

Elixir 1.13.2 (compiled with Erlang/OTP 24)

Livebook 0.6.3

2 Likes

Looks like :function_groups was removed in ExDoc v0.29.1. Specifying an older version explicitly seems to work:

Mix.install([
  {:ex_doc, "0.29.0"},
  {:zigler, "~> 0.9.1"}
])
3 Likes

Yep, sorry I was doing a bad and using some private apis. The next version will not include zigdoc, it’s going to be a separate dependency

5 Likes

Just a word of warning, don’t get too attached to how things work in zigler 0.9.1, a lot of things are changing in 0.10.x

3 Likes

now it compiles zigler on install

but I got next error with the github example

** (UndefinedFunctionError) function nil.project/0 is undefined.

compiling

defmodule ExampleZig do
  use Zig
  ~Z"""
  /// nif: example_fun/2
  fn example_fun(value1: f64, value2: f64) bool {
    return value1 > value2;
  }
  """
end

ExampleZig.example_fun(0.8, -0.8)

Hm I think you might need otp_app parameter for use Zig (that will stay for 0.10.0)

Ops!
Then… it cannot be used from livebook, right?

In any case, great job, it’s a fantastic library.
thanks

? Just make the otp_app be livebook!

I did, It works perfect
very nice job

@jle I got stuck exactly here… :slight_smile: How do I set otp_app to Livebook? Is the below code works?

use Zig, otp_app: :livebook