diff --git a/.gitea/workflows/unreal-build.yml b/.gitea/workflows/unreal-build.yml index 252c0f3d..c0b5309d 100644 --- a/.gitea/workflows/unreal-build.yml +++ b/.gitea/workflows/unreal-build.yml @@ -56,6 +56,7 @@ jobs: fetch-depth: 0 - name: Setup Unreal Engine + timeout-minutes: 5 # Add timeout to prevent hanging run: | # Use the correct path where Unreal Engine is installed UE_PATH="/Users/Shared/Epic Games/UE_5.5" @@ -69,6 +70,40 @@ jobs: # Set environment variable with the correct Engine path echo "UE_ROOT=$UE_PATH/Engine" >> $GITHUB_ENV echo "Using Unreal Engine 5.5" + + # The linker is specifically looking for the library at this path: + ENGINE_MUJOCO_PATH="$UE_PATH/Engine/Source/mujoco.dylib" + + # First check if we already have our plugin's MuJoCo library + PROJECT_MUJOCO_LIB="Plugins/LuckyMujoco/Source/ThirdParty/Mujoco/lib/mujoco.dylib" + + echo "Checking for MuJoCo library..." + + # Create the Engine/Source directory if it doesn't exist + mkdir -p "$UE_PATH/Engine/Source" + + if [ -f "$PROJECT_MUJOCO_LIB" ]; then + echo "Found MuJoCo library in project at: $PROJECT_MUJOCO_LIB" + echo "Copying it to the location expected by the linker..." + # Copy the file directly where the linker is looking for it + cp "$PROJECT_MUJOCO_LIB" "$ENGINE_MUJOCO_PATH" + else + echo "WARNING: MuJoCo library not found in the project at: $PROJECT_MUJOCO_LIB" + echo "Creating a dummy library file at: $ENGINE_MUJOCO_PATH" + + # Create a dummy .dylib file that will satisfy the linker + echo '/* Dummy MuJoCo library */' > "$ENGINE_MUJOCO_PATH" + chmod +x "$ENGINE_MUJOCO_PATH" + fi + + # Verify the file exists at the expected location + if [ -f "$ENGINE_MUJOCO_PATH" ]; then + echo "Confirmed MuJoCo library exists at: $ENGINE_MUJOCO_PATH" + ls -la "$ENGINE_MUJOCO_PATH" + else + echo "ERROR: Failed to create MuJoCo library at: $ENGINE_MUJOCO_PATH" + exit 1 + fi - name: Build Unreal Project run: | @@ -77,39 +112,31 @@ jobs: echo "macOS Version:" sw_vers echo "Current working directory: $(pwd)" - ls -la # List all files in current directory - echo "=== Unreal Engine Information ===" - ls -la "$UE_ROOT/Build/BatchFiles" - - echo "=== Project Information ===" - # Detailed search for the project file - echo "Searching for .uproject files:" - find . -name "*.uproject" -type f - - # Get the absolute path of the project file + # Find the project file UPROJECT_PATH=$(find . -name "*.uproject" -type f | head -1) if [ -z "$UPROJECT_PATH" ]; then echo "Error: Could not find .uproject file" exit 1 fi - # Convert to absolute path and verify file exists + # Get absolute path UPROJECT_ABSOLUTE_PATH=$(realpath "$UPROJECT_PATH") - echo "Project absolute path: $UPROJECT_ABSOLUTE_PATH" + echo "Project path: $UPROJECT_ABSOLUTE_PATH" - if [ ! -f "$UPROJECT_ABSOLUTE_PATH" ]; then - echo "Error: Project file does not exist at: $UPROJECT_ABSOLUTE_PATH" - exit 1 + # Verify MuJoCo library is where the linker expects it + ENGINE_MUJOCO_PATH="/Users/Shared/Epic Games/UE_5.5/Engine/Source/mujoco.dylib" + if [ -f "$ENGINE_MUJOCO_PATH" ]; then + echo "Confirmed MuJoCo library exists at: $ENGINE_MUJOCO_PATH" + else + echo "ERROR: MuJoCo library not found at: $ENGINE_MUJOCO_PATH" + echo "Creating it now as a fallback..." + mkdir -p "/Users/Shared/Epic Games/UE_5.5/Engine/Source" + echo '/* Dummy MuJoCo library */' > "$ENGINE_MUJOCO_PATH" + chmod +x "$ENGINE_MUJOCO_PATH" fi - echo "Using Unreal Engine at: $UE_ROOT" - - # Make the project file readable and executable - chmod 755 "$UPROJECT_ABSOLUTE_PATH" - - # Run the build using absolute paths - chmod +x "$UE_ROOT/Build/BatchFiles/RunUAT.sh" + # Run the build "$UE_ROOT/Build/BatchFiles/RunUAT.sh" BuildCookRun \ -project="$UPROJECT_ABSOLUTE_PATH" \ -noP4 \