Closed wilf-phasecraft closed 2 months ago
ERROR: LoadError: Could not find following imports: ["phasecraft/numeric.proto"] within ["/Users/wilfrid/Documents/Projects/proto-buffet/phasecraft/", "/Users/wilfrid/.julia/packages/ProtoBuf/uNPdY/src/"]
Stacktrace:
[1] error(s::String)
@ Base ./error.jl:35
[2] resolve_imports!(imported_paths::Set{String}, parsed_files::Dict{String, ProtoBuf.CodeGenerators.ResolvedProtoFile}, search_directories::Vector{String})
@ ProtoBuf.CodeGenerators ~/.julia/packages/ProtoBuf/uNPdY/src/codegen/modules.jl:255
[3] _protojl(relative_paths::Vector{String}, search_directories::String, output_directory::String, options::ProtoBuf.CodeGenerators.Options)
@ ProtoBuf.CodeGenerators ~/.julia/packages/ProtoBuf/uNPdY/src/codegen/CodeGenerators.jl:166
[4] #protojl#36
@ ~/.julia/packages/ProtoBuf/uNPdY/src/codegen/CodeGenerators.jl:138 [inlined]
[5] protojl(relative_paths::Vector{String}, search_directories::String, output_directory::String)
@ ProtoBuf.CodeGenerators ~/.julia/packages/ProtoBuf/uNPdY/src/codegen/CodeGenerators.jl:126
[6] top-level scope
@ ~/Documents/Projects/proto-buffet/mylibrary/generate_julia.jl:10
[7] include(fname::String)
@ Base.MainInclude ./client.jl:489
[8] top-level scope
@ REPL[2]:1
in expression starting at /Users/wilfrid/Documents/Projects/proto-buffet/mylibrary/generate_julia.jl:10
Fixed by simply adding the parent to the search directories
import ProtoBuf
src = [".", ".."]
dest = "../julia"
paths = ["foo.proto", "bar.proto"]
mkpath(dest)
ProtoBuf.protojl(paths, src, dest)
I have several
.proto
under the following directory structureThe
bar.proto
file importsfoo.proto
usingimport "mylibrary/foo.proto";
And this works fine when using gRPC to build Python code. However, when using ProtoBuf.jl as follows, I get a
LoadError
It works fine if I simply specify the import as
import "foo.proto";
But then the gRPC fails to build the Python code. Am I missing something here?