Open tecosaur opened 1 year ago
Thanks @tecosaur for reporting this issue. You are correct that the root cause is us not being able to handle mutual dependencies in submodules -- org.phenopackets
requires types from org.ga4gh
and vice versa (in this case, the julia module ga4gh
doesn't yet exist as we include phenopackets
first).
A quick workaround would be to use the older version of this library which (add ProtoBuf@0.11.5
) which uses dicts to represent fields of protobuf messages and thus doesn't require all proto types to be statically known when defining the julia struct.
As you noticed including sub-packages directly rarely works -- currently, whenever a reference is made to a definition in a different package or submodule, we always reach out to the top of the current package to grab the package name and then we use it to fully qualify the reference. So, as-is, we only support including the top level file which is in your case "out/org/org.jl"
.
It seems like the default python codec is not happy about this situation either, they seem to do some textual postprocessing of generated proto files.
I'm afraid that to get that the current version of ProtoBuf.jl won't work without a change to the original proto files or a manual rewrite of the generated code. Sorry about that!
I'm going to keep this issue open to discuss different approaches to handle mutual dependencies.
Hello, I"m trying to use this package with the Phenopacket protobuf files (see https://github.com/phenopackets/phenopacket-schema). However, when I cannot work out how to load the generated code to avoid hitting an
UndefVarError
.The setup
Artifacts.toml
build.jl
Generated files
out.tar.gz
Output
If I try to
include("out/org/ga4gh/ga4gh.jl")
I getI can solve this issue by running
include("out/google/google.jl")
, but then if I tryinclude("out/org/ga4gh/ga4gh.jl")
again I now see