OrchidIsle / UE5-Build-Project

31 stars 3 forks source link

Plugins? #18

Open Ciberusps opened 1 month ago

Ciberusps commented 1 month ago

Runned workflow without plugin - all works fine

Cloned my plugin to "Plugins" folder and get error

"Error: Plugin 'UnrealHelperLibrary' failed to load because module 'UnrealHelperLibrary' could not be found.  Please ensure the plugin is properly installed, otherwise consider disabling the plugin for this project"

image

Tried to run checkouted project by hands image And all works fine project runs after "Yes" in this window image

Looks like plugins should be build with UAT before building project? https://dev.epicgames.com/community/learning/tutorials/qz93/unreal-engine-building-plugins

edwardteach42 commented 1 month ago

The only time I ran into that issue was when my Github runner was failing to properly clone my submodules (in my case, plugins) into my project. Here are the first steps that I use on a build:

jobs:
  build:
    runs-on: self-hosted
    environment: ${{ 
        (github.ref == 'refs/heads/dev' && 'Development') || 
        (github.event_name == 'release' && startsWith(github.ref, 'refs/tags/') && contains(github.ref, '-alpha') && 'Staging') || 
        (github.event_name == 'release' && startsWith(github.ref, 'refs/tags/') && contains(github.ref, '-beta') && 'Staging') || 
        (github.event_name == 'release' && startsWith(github.ref, 'refs/tags/') && contains(github.ref, '-rc') && 'Staging') || 
        (github.event_name == 'release' && startsWith(github.ref, 'refs/tags/') && 'Production') || 
        'Development' 
      }}
    steps:
    - name: Checkout Repository
      uses: actions/checkout@v2
      with:
        token: ${{ secrets.ACCESS_TOKEN }}
        lfs: true
        fetch-depth: 0 # Fetches all history for all tags and branches
        submodules: recursive

    - name: Checkout LFS Objects
      run: git lfs checkout

I will test with Unreal Helper Library myself later to try and trace the issue.

Ciberusps commented 1 month ago

Do you store your plugins compiled with "Intermediate"/"DerivedDataCache"/"Saved"?

Ciberusps commented 1 month ago

Its important to note that I use "Blueprint" project, it builds fine without plugin(s) https://github.com/Ciberusps/UE_5_4_Blueprint

UPD my github-action setup

name: Test

on:
  push:
    branches:
      - "**"

jobs:
  build:
    runs-on: self-hosted
    steps:
      - name: Check out UE5.4 project
        uses: actions/checkout@v3
        with:
          repository: Ciberusps/UE_5_4_Blueprint
          path: UE_5_4_Blueprint

      - name: Check out UnrealHelperLibrary to Plugins folder
        uses: actions/checkout@v3
        with:
          path: UE_5_4_Blueprint/Plugins/UnrealHelperLibrary

      # - name: Build Plugins (UHL)
      #   shell: powershell
      #   run: |
      #     mkdir "Temp"
      #     $pluginPath = Resolve-Path -Path "UE_5_4_Blueprint/Plugins/UnrealHelperLibrary/UnrealHelperLibrary.uplugin"
      #     $tempDirAbsolutePath = Resolve-Path -Path "Temp"
      #     "S:/Epic Games/UE_5.4/Engine/Build/BatchFiles/RunUAT.bat BuildPlugin -plugin="$pluginPath" -package="$tempDirAbsolutePath""

      - name: Build project
        uses: OrchidIsle/UE5-Build-Project@latest
        with:
          RUNUAT_PATH: 'S:/Epic Games/UE_5.4/Engine/Build/BatchFiles/RunUAT.bat'
          UPROJECT_PATH: ${{ github.workspace }}/UE_5_4_Blueprint/UE_5_4_Blueprint.uproject
          BUILD_CONFIG: Development
          PLATFORM: Win64
          CLEAN: true
          COOK: true
          STAGE: true
          PACKAGE: true
          PAK: true
          SERVER: false
          ARCHIVE: false
          ARCHIVE_PATH: 'C:/Archives/MyGame'
          NULLRHI: true
          EDITOR: true
          ENCRYPT_INI: true
          # RELEASE: '1.0.0'
          # PATCH: '0.9.0'
          # MAPS: 'Map1,Map2'
          DELETE_PDB: true
          # ANTICHEAT_ENABLED: true
          # ANTICHEAT_PRIVATE_KEY: 'base64encodedprivatekey'
          # ANTICHEAT_PUBLIC_CERT: 'base64encodedpubliccert'
edwardteach42 commented 1 month ago

Do you store your plugins compiled with "Intermediate"/"DerivedDataCache"/"Saved"?

No I typically keep each plugin in it's own repository as source and then submodule them in to my projects as needed. I have never had any plugin compilation issues. Here is where I run this in my workflow:

    - name: Cook, Stage & Package UE Project
      uses: OrchidIsle/UE5-Build-Project@latest
      with:
        RUNUAT_PATH: ${{ env.RUNUAT_PATH }}
        UPROJECT_PATH: ${{ github.workspace }}\MyProject\MyProject.uproject
        BUILD_CONFIG: ${{ vars.BUILD_CONFIG }}
        PLATFORM: Win64
        COOK: true
        STAGE: true
        PACKAGE: true
        PAK: true
        SERVER: false
        EDITOR: true
        ENCRYPT_INI: true
        DELETE_PDB: ${{ github.event_name == 'release' }}
        ANTICHEAT_ENABLED: true
        ANTICHEAT_PRIVATE_KEY: ${{ secrets.ANTICHEAT_PRIVATE_KEY }}
        ANTICHEAT_PUBLIC_CERT: ${{ secrets.ANTICHEAT_PUBLIC_CERT }}

    - name: Compress Win64 Client using 7-Zip
      run: |
        $7zPath = "${{ env.SEVEN_Z_PATH }}"
        $sourceDir = "${{ github.workspace }}\MyProject\Saved\StagedBuilds\Windows"
        $archiveFile = "MyProject-Win64-${{ env.BUILD_ID }}.zip"
        & "$7zPath" a -tzip "$archiveFile" "$sourceDir\*"

    - name: Copy to Archive
      run: |
        $sourcePath = "MyProject-Win64-${{ env.BUILD_ID }}.zip"
        $destinationPath = "${{ env.ARCHIVE_PATH }}\Builds\Win64\MyProject-Win64-${{ env.BUILD_ID }}.zip"
        $destinationDirectory = Split-Path -Path $destinationPath -Parent

        if (-not (Test-Path -Path $destinationDirectory)) {
            New-Item -ItemType Directory -Path $destinationDirectory
        }

        Copy-Item -Path $sourcePath -Destination $destinationPath
edwardteach42 commented 1 month ago

I will give it a shot with Blueprint and UnrealHelperLibrary later.

Ciberusps commented 1 month ago

Not sure but looks like I found why I get Error: Plugin 'UnrealHelperLibrary' failed to load because module 'UnrealHelperLibrary' could not be found

This morning I received feedback from FAB on my submission of UHL to FAB, so they say that plugin not compiles, but I sure that it compiles in several projects in my studio and with production builds works fine. Looks like they use RunUAT for building plugins and building plugin via RunUAT gives same errors as FAB sended in feedback. RunUAT BuildPlugin gives somehow more errors than default build, probably RunUAT for projects internally builds plugins via RunUAT BuildPlugin if no binaries found. Thats why I get this error - I need to fix build errors in RunUAT BuildPlugin

image

Looks like that't not an issue in UE5-Build-Project. But if you want you can optionally improve such errors handling by looking in output of RunUAT and if it says that "Error: Plugin N failed to load" throw more clean error/addition Probably plugin not compiles right, try build it using "RunUAT BuildPlugin" https://dev.epicgames.com/community/learning/tutorials/qz93/unreal-engine-building-plugins

I'll test if it works after fixes and will text you here