Hi folks,
I'm trying to embed some version information of third party modules into a generated file, "Version.cpp.inc", and so far without success.
I have a .bazelrc with --workspace_status_command "utils/workspace_status.sh" that outputs the required STABLE_XXX lines to the stable-status.txt file, and a corresponding genrule that embeds those into the required include file.
This setup works fine until I try to add module version information into the mix. When I add:
bazel mod --output=json --depth=1 path "my_top_level_module" | jq ...<snip>...
into the workspace_status_command script, the build hangs. It turns out bazel mod cannot be used inside a workspace status command, it hangs with:
Another command (pid=68387) is running. Waiting for it to complete on the server (server_pid=61337)...
Are there better ways to get to the module version information so that it can be embedded in the generated file? Would it perhaps somehow be accessible with a genquery instead?
Cheers,
Jelle
For info, I'm trying to get to this field somehow:
{
"key": "onnx...@20250219.1035",
"name": "onnx-mlir",
"version": "20250219.1035",
"apparentName": "onnx-mlir",
... <snip> ...