protobuf icon indicating copy to clipboard operation
protobuf copied to clipboard

Compile error using elixir v1.19-rc0

Open Ljzn opened this issue 10 months ago • 3 comments

versions

protobuf 0.14.1

Erlang/OTP 26 [erts-14.2.2] [source] [64-bit] [smp:8:8] [ds:8:8:10] [async-threads:1] [jit]

IEx 1.19.0-rc.0 (2a9a4f2) (compiled with Erlang/OTP 26)

to reproduce

mix deps.compile

== Compilation error in file lib/google/protobuf/struct.pb.ex ==
** (RuntimeError) module Google.Protobuf.Struct.FieldsEntry was not loaded, but was expected to be since it's used as a map entry
    lib/protobuf/dsl/typespecs.ex:62: Protobuf.DSL.Typespecs.field_prop_to_spec/2
    lib/protobuf/dsl/typespecs.ex:23: anonymous fn/3 in Protobuf.DSL.Typespecs.quoted_message_typespec/1
    (stdlib 5.2) maps.erl:416: :maps.fold_1/4
    lib/protobuf/dsl/typespecs.ex:22: Protobuf.DSL.Typespecs.quoted_message_typespec/1
    lib/protobuf/dsl.ex:268: Protobuf.DSL.def_t_typespec/3
    expanding macro: Protobuf.DSL.__before_compile__/1
    lib/google/protobuf/struct.pb.ex:93: Google.Protobuf.Struct (module)
could not compile dependency :protobuf, "mix compile" failed. Errors may have been logged above. You can recompile this dependency with "mix deps.compile protobuf --force", update it with "mix deps.update protobuf" or clean it with "mix deps.clean protobuf"

Ljzn avatar Jun 12 '25 06:06 Ljzn

it looks like an issue of elixir, created a new issue https://github.com/elixir-lang/elixir/issues/14578

Ljzn avatar Jun 13 '25 05:06 Ljzn

The code should be using Code.ensure_compiled! instead, as ensure_loaded does not guarantee the module would be available during compilation.

josevalim avatar Jun 13 '25 05:06 josevalim

This was fixed in https://github.com/elixir-protobuf/protobuf/pull/405 but it was not released yet.

v0idpwn avatar Jun 13 '25 12:06 v0idpwn

When will the new version be released? I'm on elixir 1.18.3 and I want to publish a package on hexpm which uses this library.

briankariuki avatar Jun 28 '25 19:06 briankariuki

Hi folks, also wanted to bump this, was curious to know when the next release would be or if there is something I can do to help push towards that. Also dependent on this.

asinghbrar avatar Jul 19 '25 00:07 asinghbrar

Ignore my previous (now deleted) comment. I commented on the wrong thread. :) we need a new release indeed. :)

josevalim avatar Jul 19 '25 20:07 josevalim

@whatyouhide when can we expect a new release on hexpm?

briankariuki avatar Jul 21 '25 16:07 briankariuki

Released v0.15.0.

whatyouhide avatar Jul 22 '25 15:07 whatyouhide