I’m starting a new Yggdrasil script (is that what you are supposed to call them?) to build a large and complex C++ library, OR-Tools. The end goal is to provide a Julia wrapper around it.
At some point during the build, I would need to generate Julia code (automatically, that is) using ProtoBuf.jl, during the build process of the library to ensure that the generated code is up-to-date with respect to the library.
However, in my script (in build_tarballs.jl), I cannot call julia: the command is not recognised! Here is the exact error message (full log):
[13:45:47] ---> julia -e "using ProtoBuf; protojl()"
[13:45:47] /bin/bash: line 50: julia: command not found
[13:45:47] ---> julia -e "using ProtoBuf; protojl()"
[13:45:47] ---> julia -e "using ProtoBuf; protojl()"
[13:45:47] Previous command exited with 127
[13:45:47] Child Process exited, exit code 127
I know that the provided Julia script has zero chance of being correct, but the failure is that Julia cannot be built. How is that possible? Do I have to use some magic dependency? I can only find libjulia_jll that I could depend on, but that does not seem even remotely what I need (it only exposes libjulia, not the standard Julia interpreter).
Note that if you want to interpolate into the string, you can’t use raw""" ... """, so you have to escape any literal $ symbols you want to stay in the script, e.g. for $WORKSPACE.
For the generated code, unrelated to MOI, using ProtoBuf.jl. Storing this code near the JLL ensures that it always corresponds to the installed binary, with no risk that the generated code is out of date and no manual operation to update it (unlike CPLEX.jl or Gurobi.jl) — although doing everything in the .jl package would be simpler.
To add to @odow’s suggestion to do this in the wrapper - if you want to make sure that it will always use the correct jll, you can use tight constraints in the compat section of your wrapper (e.g. 6. Compatibility · Pkg.jl).
When you update the version of the jll and the bindings in your wrapper, bump the version in the compat, and it all should stay closely coupled.
To answer the original question: there is no way to call Julia from within Yggdrasil. That’s a bug no one is interested in solving (apparently, I’m the first one to have the problem). Therefore, do everything in the Julia package(s) you are building you JLL for, possibly throwing a new package in for good measure.