Using BuildGraph with Lyra 5.7 -- Target "BuildAndTest" is not in graph

I am starting work on a project and using Lyra 5.7 as the base. Right now, I’m still trying to make sure everything builds.

I am using Ubuntu 24.04.3 LTS.
I am able to build the editor from my IDE.
I am able to create and smoketest a package build of the Lyra project.

I want to use BuildGraph, so I can rely on the existing build scripts for automation:

// eg
UE5/Samples/Games/Lyra/Build/LyraTests.xml

I call these scripts from a Bash script that I wrote:

# ue root
unreal_engine_path="/home/user/Git/UnrealEngine"

# run uat
run_uat="$unreal_engine_path/Engine/Build/BatchFiles/RunUAT.sh"

# project path
project_path="$unreal_engine_path/Samples/Games/Lyra"

# build graph to run
build_graph_script="$project_path/Build/LyraTests.xml"

# The name of the Aggregate (group of nodes) we want to run, and the project we want to run against
test_target="BuildAndTest Lyra"

# the command we're gonna run
build_command="$run_uat BuildGraph -Script=$build_graph_script -Target=$test_target -UseLocalBuildStorage"

# actually running the command
$build_command

When I run this script, I get the following: “Target ‘BuildAndTest’‘ is not in graph“

Running AutomationTool…

Setting up bundled DotNet SDK

UnrealBuildTool is up to date

AutomationTool is up to date

Start UAT Interactively: dotnet AutomationTool.dll BuildGraph -Script=/home/user/Git/UnrealEngine/Samples/Games/Lyra/Build/LyraTests.xml -Target=BuildAndTest Lyra -UseLocalBuildStorage

/home/user/Git/UnrealEngine/Engine/Binaries/ThirdParty/DotNet/8.0.412/linux-x64/dotnet

Starting AutomationTool…

Parsing command line: BuildGraph -Script=/home/user/Git/UnrealEngine/Samples/Games/Lyra/Build/LyraTests.xml -Target=BuildAndTest Lyra -UseLocalBuildStorage

Initializing script modules…
Total script module initialization time: 0.16 s.
Using /home/user/Git/UnrealEngine/Engine/Binaries/ThirdParty/DotNet/8.0.412/linux-x64/dotnet
Executing commands…

Target ‘BuildAndTest’ is not in graph

AutomationTool executed for 0h 0m 0s
AutomationTool exiting with ExitCode=1 (Error_Unknown)
RunUAT ERROR: AutomationTool was unable to run successfully. Exited with code: 1

The BuildGraph Aggregate “BuildAndTest” is defined in:

UnrealEngine/Engine/Build/Graph/Tasks/BuildAndTestProject.xml

Looking there, I found the aggregate at the bottom of the file.

That aggregate is included in Lyra LyraTests.xml on line 105

<!-- This will declare an aggregate called BuildAndTest Lyra -->
<Include Script="../../../../Engine/Build/Graph/Tasks/BuildAndTestProject.xml" />

I don’t know what to make of this. I had trouble getting the build graph to work, when I had moved the Lyra project elsewhere, but I get the same results, even when running from its default Samples/Games location.

Is there an obvious thing that I’m missing? My script is calling LyraTests.xml correctly, it would seem – at least the Automation Tool is happy to load the script at my given path. However, the include from UnrealEngine’s build graph directory does not seem to be working.

I must doubt that the paths are wrong, because in this case, I’m using Lyra in its Samples/Games location—untouched since cloning the UnrealEngine git depot.

Can anyone tell what I’m doing wrong here? I have installed Mono on my machine, but that’s all I can think of at this point.