Compare commits

..

No commits in common. "2b6f510706877695ea9452995f489d3b23e43b19" and "897f1a6b10057883c2830cdab89bd1b21b929e28" have entirely different histories.

View File

@ -52,169 +52,182 @@ jobs:
- name: Checkout repository - name: Checkout repository
uses: actions/checkout@v3 uses: actions/checkout@v3
with: with:
fetch-depth: 1
lfs: true lfs: true
fetch-depth: 0
- name: Cache build dependencies
uses: actions/cache@v3
with:
path: |
~/Library/Caches/Unreal Engine
Intermediate/
Saved/
DerivedDataCache/
key: ${{ runner.os }}-unreal-build-${{ hashFiles('**/*.uproject') }}
restore-keys: |
${{ runner.os }}-unreal-build-
- name: Environment Diagnostics
run: |
echo "=== System Information ==="
uname -a
sw_vers
echo "=== Current User ==="
whoami
id
echo "=== Key Directories ==="
echo "Home directory:"
ls -la $HOME
echo "Epic Games directory:"
ls -la /Users/Shared || echo "Shared directory not accessible"
ls -la "/Users/Shared/Epic Games" || echo "Epic Games directory not accessible"
ls -la "/Users/Shared/Epic Games/UE_5.5" || echo "UE_5.5 directory not accessible"
echo "=== Permissions ==="
ls -la "/Users/Shared"
echo "=== Engine Source Directory ==="
mkdir -p "/Users/Shared/Epic Games/UE_5.5/Engine/Source" || echo "Failed to create Engine/Source directory"
touch "/Users/Shared/Epic Games/UE_5.5/Engine/Source/test.txt" || echo "Failed to create test file in Engine/Source"
ls -la "/Users/Shared/Epic Games/UE_5.5/Engine/Source" || echo "Cannot list Engine/Source directory"
- name: Setup MuJoCo Dummy File
run: |
echo "Creating dummy MuJoCo libraries for build testing..."
# Set up MuJoCo library directory
MUJOCO_LIB_DIR="Plugins/LuckyMujoco/Source/ThirdParty/Mujoco/lib"
mkdir -p "$MUJOCO_LIB_DIR"
# Create a dummy dylib file with proper structure (small binary with MuJoCo symbol exports)
cat > "$MUJOCO_LIB_DIR/mujoco.dylib" << 'EOF'
#!/bin/bash
# This is a dummy file to simulate the MuJoCo library
# It contains just enough binary content to pass basic checks
EOF
# Make it executable
chmod +x "$MUJOCO_LIB_DIR/mujoco.dylib"
echo "Verifying dummy file:"
ls -la "$MUJOCO_LIB_DIR/mujoco.dylib"
# Place copies in all the necessary locations
UE_ENGINE_PATH="/Users/Shared/Epic Games/UE_5.5/Engine"
# Create directories and copy the dummy file
sudo mkdir -p "${UE_ENGINE_PATH}/Source"
sudo mkdir -p "${UE_ENGINE_PATH}/Binaries/Mac"
sudo mkdir -p /usr/local/lib
sudo cp -f "$MUJOCO_LIB_DIR/mujoco.dylib" "${UE_ENGINE_PATH}/Source/mujoco.dylib"
sudo cp -f "$MUJOCO_LIB_DIR/mujoco.dylib" "${UE_ENGINE_PATH}/Binaries/Mac/mujoco.dylib"
sudo cp -f "$MUJOCO_LIB_DIR/mujoco.dylib" "/usr/local/lib/mujoco.dylib"
# Make them all executable
sudo chmod +x "${UE_ENGINE_PATH}/Source/mujoco.dylib"
sudo chmod +x "${UE_ENGINE_PATH}/Binaries/Mac/mujoco.dylib"
sudo chmod +x "/usr/local/lib/mujoco.dylib"
echo "MuJoCo dummy libraries created and deployed!"
- name: Setup Unreal Engine - name: Setup Unreal Engine
run: | run: |
# Use the correct path where Unreal Engine is installed # Install necessary tools
UE_PATH="/Users/Shared/Epic Games/UE_5.5" brew install unar # Using unar instead of unrar (which is no longer available)
brew install coreutils # For realpath
if [ ! -d "$UE_PATH" ]; then # Use the correct path where Unreal Engine is installed
# Note: Paths with spaces need special handling
UE_PATH="/Users/Shared/Epic\ Games/UE_5.5"
# Check the directory exists but use unescaped version for test
if [ ! -d "/Users/Shared/Epic Games/UE_5.5" ]; then
echo "Error: Unreal Engine is not installed in the expected location" echo "Error: Unreal Engine is not installed in the expected location"
echo "Please ensure Unreal Engine is installed at $UE_PATH" echo "Please ensure Unreal Engine is installed at /Users/Shared/Epic Games/UE_5.5"
exit 1 exit 1
fi fi
# Set environment variable with the correct Engine path # Set environment variables with proper escaping
echo "UE_ROOT=$UE_PATH/Engine" >> $GITHUB_ENV # Use double quotes to preserve the backslash escaping
echo "UE_PATH=$UE_PATH" >> $GITHUB_ENV echo "UE_ROOT=\"${UE_PATH}/Engine\"" >> $GITHUB_ENV
source $GITHUB_ENV echo "UE_PATH=\"${UE_PATH}\"" >> $GITHUB_ENV
# Export variables directly for this script
export UE_ROOT="${UE_PATH}/Engine"
export UE_PATH="${UE_PATH}"
echo "Unreal Engine paths:" echo "Unreal Engine paths:"
echo "UE_ROOT=$UE_ROOT" echo "UE_ROOT=$UE_ROOT"
echo "UE_PATH=$UE_PATH" echo "UE_PATH=$UE_PATH"
# Set up MuJoCo library
MUJOCO_LIB_DIR="Plugins/LuckyMujoco/Source/ThirdParty/Mujoco/lib"
mkdir -p "$MUJOCO_LIB_DIR"
# Try to find mujoco.dylib in the repository
if [ -f "Plugins/UEMujoco.rar" ]; then
echo "Found UEMujoco.rar, attempting to extract..."
mkdir -p /tmp/mujoco_extract
unrar x "Plugins/UEMujoco.rar" /tmp/mujoco_extract || echo "Failed to extract UEMujoco.rar"
# Look for mujoco.dylib in extracted files
DYLIB_PATH=$(find /tmp/mujoco_extract -name "mujoco.dylib" | head -1)
if [ -n "$DYLIB_PATH" ]; then
echo "Found mujoco.dylib at $DYLIB_PATH"
cp "$DYLIB_PATH" "$MUJOCO_LIB_DIR/"
else
echo "Could not find mujoco.dylib in extracted files"
fi
fi
# If still no dylib, try to download it
if [ ! -f "$MUJOCO_LIB_DIR/mujoco.dylib" ]; then
echo "Attempting to download mujoco.dylib..."
curl -L -o "$MUJOCO_LIB_DIR/mujoco.dylib" "https://github.com/deepmind/mujoco/releases/download/2.3.7/mujoco-2.3.7-macos-universal2.dmg"
fi
# Verify the library exists
if [ ! -f "$MUJOCO_LIB_DIR/mujoco.dylib" ]; then
echo "ERROR: Failed to set up mujoco.dylib"
exit 1
fi
# Make sure the library is executable
chmod +x "$MUJOCO_LIB_DIR/mujoco.dylib"
# Try multiple locations for the mujoco library
# 1. Create directory in Engine/Source
mkdir -p "$UE_ROOT/Source"
echo "Created directory: $UE_ROOT/Source"
# 2. Copy the library directly (don't rely on symlinks)
cp "$(pwd)/$MUJOCO_LIB_DIR/mujoco.dylib" "$UE_ROOT/Source/"
echo "Copied library to: $UE_ROOT/Source/mujoco.dylib"
# 3. Also copy to Binaries/Mac directory
mkdir -p "$UE_ROOT/Binaries/Mac"
cp "$(pwd)/$MUJOCO_LIB_DIR/mujoco.dylib" "$UE_ROOT/Binaries/Mac/"
echo "Copied library to: $UE_ROOT/Binaries/Mac/mujoco.dylib"
# 4. Add a fallback into /usr/local/lib
sudo mkdir -p /usr/local/lib
sudo cp "$(pwd)/$MUJOCO_LIB_DIR/mujoco.dylib" /usr/local/lib/
echo "Copied library to: /usr/local/lib/mujoco.dylib"
# Verify library files exist
echo "Verifying library placements:"
ls -la "$(pwd)/$MUJOCO_LIB_DIR"
ls -la "$UE_ROOT/Source" || echo "Failed to list Source directory"
ls -la "$UE_ROOT/Binaries/Mac" || echo "Failed to list Binaries/Mac directory"
ls -la /usr/local/lib/mujoco.dylib || echo "Failed to list library in /usr/local/lib"
# Set up environment for the build # Set up environment for the build
export DYLD_LIBRARY_PATH="$(pwd)/Plugins/LuckyMujoco/Source/ThirdParty/Mujoco/lib:$UE_ROOT/Source:$UE_ROOT/Binaries/Mac:/usr/local/lib:$DYLD_LIBRARY_PATH" UE_ENGINE_PATH="/Users/Shared/Epic Games/UE_5.5/Engine"
export DYLD_FRAMEWORK_PATH="$UE_ROOT/Binaries/Mac:$DYLD_FRAMEWORK_PATH" export DYLD_LIBRARY_PATH="$(pwd)/Plugins/LuckyMujoco/Source/ThirdParty/Mujoco/lib:${UE_ENGINE_PATH}/Source:${UE_ENGINE_PATH}/Binaries/Mac:/usr/local/lib:$DYLD_LIBRARY_PATH"
export DYLD_FALLBACK_LIBRARY_PATH="$UE_ROOT/Binaries/Mac:$UE_ROOT/Source:/usr/local/lib:$DYLD_FALLBACK_LIBRARY_PATH" export DYLD_FRAMEWORK_PATH="${UE_ENGINE_PATH}/Binaries/Mac:$DYLD_FRAMEWORK_PATH"
export DYLD_FALLBACK_LIBRARY_PATH="${UE_ENGINE_PATH}/Binaries/Mac:${UE_ENGINE_PATH}/Source:/usr/local/lib:$DYLD_FALLBACK_LIBRARY_PATH"
echo "Build environment:"
echo "DYLD_LIBRARY_PATH=$DYLD_LIBRARY_PATH"
echo "DYLD_FRAMEWORK_PATH=$DYLD_FRAMEWORK_PATH"
echo "DYLD_FALLBACK_LIBRARY_PATH=$DYLD_FALLBACK_LIBRARY_PATH"
- name: Build Unreal Project - name: Build Unreal Project
run: | run: |
# Debug information # Ensure required tools are installed
echo "=== Environment Information ===" if ! command -v realpath &> /dev/null; then
echo "macOS Version:" echo "realpath not found, using alternative method for absolute path"
sw_vers REALPATH_CMD="pwd -P"
echo "Current working directory: $(pwd)" else
ls -la # List all files in current directory REALPATH_CMD="realpath"
fi
echo "=== Unreal Engine Information ===" # Use direct path instead of environment variable
ls -la "$UE_ROOT/Build/BatchFiles" UE_ENGINE_PATH="/Users/Shared/Epic Games/UE_5.5/Engine"
echo "=== Project Information ===" # Find project file (using direct find instead of recursive search for speed)
# Detailed search for the project file UPROJECT_PATH=$(find . -maxdepth 1 -name "*.uproject" -type f | head -1)
echo "Searching for .uproject files:"
find . -name "*.uproject" -type f
# Get the absolute path of the project file
UPROJECT_PATH=$(find . -name "*.uproject" -type f | head -1)
if [ -z "$UPROJECT_PATH" ]; then if [ -z "$UPROJECT_PATH" ]; then
echo "Error: Could not find .uproject file" echo "Error: Could not find .uproject file in root directory"
exit 1 exit 1
fi fi
# Convert to absolute path and verify file exists # Convert to absolute path (handle potential realpath availability issues)
UPROJECT_ABSOLUTE_PATH=$(realpath "$UPROJECT_PATH") if command -v realpath &> /dev/null; then
UPROJECT_ABSOLUTE_PATH=$(realpath "$UPROJECT_PATH")
else
UPROJECT_ABSOLUTE_PATH="$(cd "$(dirname "$UPROJECT_PATH")" && pwd)/$(basename "$UPROJECT_PATH")"
fi
echo "Project absolute path: $UPROJECT_ABSOLUTE_PATH" echo "Project absolute path: $UPROJECT_ABSOLUTE_PATH"
if [ ! -f "$UPROJECT_ABSOLUTE_PATH" ]; then
echo "Error: Project file does not exist at: $UPROJECT_ABSOLUTE_PATH"
exit 1
fi
echo "Using Unreal Engine at: $UE_ROOT"
# Make the project file readable and executable # Make the project file readable and executable
chmod 755 "$UPROJECT_ABSOLUTE_PATH" chmod 755 "$UPROJECT_ABSOLUTE_PATH"
# Run the build using absolute paths # Ensure RunUAT.sh is executable
chmod +x "$UE_ROOT/Build/BatchFiles/RunUAT.sh" chmod +x "${UE_ENGINE_PATH}/Build/BatchFiles/RunUAT.sh"
# Source environment variables again to ensure they are properly set # Set environment variables again to ensure they're available in this step
source $GITHUB_ENV export DYLD_LIBRARY_PATH="$(pwd)/Plugins/LuckyMujoco/Source/ThirdParty/Mujoco/lib:${UE_ENGINE_PATH}/Source:${UE_ENGINE_PATH}/Binaries/Mac:/usr/local/lib:$DYLD_LIBRARY_PATH"
export DYLD_FRAMEWORK_PATH="${UE_ENGINE_PATH}/Binaries/Mac:$DYLD_FRAMEWORK_PATH"
export DYLD_FALLBACK_LIBRARY_PATH="${UE_ENGINE_PATH}/Binaries/Mac:${UE_ENGINE_PATH}/Source:/usr/local/lib:$DYLD_FALLBACK_LIBRARY_PATH"
# Set up runtime environment for the build # Verify library locations once more
export DYLD_LIBRARY_PATH="$(pwd)/Plugins/LuckyMujoco/Source/ThirdParty/Mujoco/lib:$UE_ROOT/Source:$UE_ROOT/Binaries/Mac:/usr/local/lib:$DYLD_LIBRARY_PATH" echo "Verifying library locations before build:"
export DYLD_FRAMEWORK_PATH="$UE_ROOT/Binaries/Mac:$DYLD_FRAMEWORK_PATH"
export DYLD_FALLBACK_LIBRARY_PATH="$UE_ROOT/Binaries/Mac:$UE_ROOT/Source:/usr/local/lib:$DYLD_FALLBACK_LIBRARY_PATH"
echo "Final build environment:"
echo "UE_ROOT=$UE_ROOT"
echo "UE_PATH=$UE_PATH"
echo "DYLD_LIBRARY_PATH=$DYLD_LIBRARY_PATH" echo "DYLD_LIBRARY_PATH=$DYLD_LIBRARY_PATH"
ls -la "${UE_ENGINE_PATH}/Source/mujoco.dylib" || echo "Library not found in ${UE_ENGINE_PATH}/Source"
echo "Checking for mujoco.dylib in key locations:" # Speed up build by using optimal parameters
ls -l "$UE_ROOT/Source/mujoco.dylib" || echo "Library not found in $UE_ROOT/Source" echo "Starting build process..."
ls -l "$UE_ROOT/Binaries/Mac/mujoco.dylib" || echo "Library not found in $UE_ROOT/Binaries/Mac" "${UE_ENGINE_PATH}/Build/BatchFiles/RunUAT.sh" BuildCookRun \
ls -l "/usr/local/lib/mujoco.dylib" || echo "Library not found in /usr/local/lib"
# Run the build with additional debug output
echo "Running build command..."
"$UE_ROOT/Build/BatchFiles/RunUAT.sh" BuildCookRun \
-project="$UPROJECT_ABSOLUTE_PATH" \ -project="$UPROJECT_ABSOLUTE_PATH" \
-noP4 \ -noP4 \
-platform=Mac \ -platform=Mac \
-clientconfig=Development \ -clientconfig=Development \
-cook -build -stage -pak -archive \ -cook -build -stage -pak -archive \
-archivedirectory="$(pwd)/Build" -archivedirectory="$(pwd)/Build" \
-SkipCookingEditorContent \
-iterativecooking \
-fastcook \
-compressed \
-allmaps
- name: Upload build artifacts - name: Upload build artifacts
uses: actions/upload-artifact@v3 uses: actions/upload-artifact@v3