Fix windows non-PCH build

This commit is contained in:
sentientstardust
2026-05-20 03:41:37 +01:00
parent 6646aba3cf
commit b86100aa14
34 changed files with 116 additions and 37 deletions

View File

@ -12,7 +12,7 @@ on:
build_linux:
description: 'Build Linux AppImage artifacts'
type: boolean
default: false
default: true
build_flatpak:
description: 'Build Linux Flatpak artifacts'
type: boolean
@ -21,6 +21,10 @@ on:
description: 'Build Windows artifacts'
type: boolean
default: true
build_without_pch_windows:
description: 'Build without PCH (windows)'
type: boolean
default: false
build_macos:
description: 'Build macOS artifacts'
type: boolean
@ -49,25 +53,26 @@ concurrency:
cancel-in-progress: true
jobs:
build_linux:
strategy:
fail-fast: false
if: ${{ !cancelled() && (github.event_name != 'create' || (github.event.ref_type == 'branch' && startsWith(github.event.ref, 'release/'))) && ((inputs.build_linux || false) || vars.BUILD_LINUX == 'true') }}
uses: ./.github/workflows/build_check_cache.yml
with:
os: ${{ vars.SELF_HOSTED && 'orca-lnx-server' || 'ubuntu-24.04' }}
build-deps-only: ${{ inputs.build-deps-only || false }}
build_linux:
strategy:
fail-fast: false
if: ${{ !cancelled() && (github.event_name != 'create' || (github.event.ref_type == 'branch' && startsWith(github.event.ref, 'release/'))) && (inputs.build_linux || github.event_name != 'workflow_dispatch' || vars.BUILD_LINUX == 'true') }}
uses: ./.github/workflows/build_check_cache.yml
with:
os: ${{ vars.SELF_HOSTED && 'orca-lnx-server' || 'ubuntu-24.04' }}
build-deps-only: ${{ inputs.build-deps-only || false }}
release-version: ${{ inputs.release_version || '' }}
secrets: inherit
build_windows:
if: ${{ !cancelled() && (inputs.build_windows || github.event_name != 'workflow_dispatch') && (github.event_name != 'create' || (github.event.ref_type == 'branch' && startsWith(github.event.ref, 'release/'))) }}
uses: ./.github/workflows/build_check_cache.yml
with:
os: ${{ vars.SELF_HOSTED && 'orca-win-server' || 'windows-latest' }}
build-deps-only: ${{ inputs.build-deps-only || false }}
force-build: false
os: ${{ vars.SELF_HOSTED && 'orca-win-server' || 'windows-latest' }}
build-deps-only: ${{ inputs.build-deps-only || false }}
force-build: false
release-version: ${{ inputs.release_version || '' }}
secrets: inherit
build_without_pch_windows: ${{ inputs.build_without_pch_windows || false }}
secrets: inherit
build_macos_arch:
strategy:
fail-fast: false
@ -159,7 +164,7 @@ jobs:
name: Unit Tests
runs-on: ${{ vars.SELF_HOSTED && 'orca-lnx-server' || 'ubuntu-24.04' }}
needs: build_linux
if: ${{ !cancelled() && (github.event_name != 'create' || (github.event.ref_type == 'branch' && startsWith(github.event.ref, 'release/'))) && ((inputs.build_linux || false) || vars.BUILD_LINUX == 'true') && needs.build_linux.result == 'success' }}
if: ${{ !cancelled() && (github.event_name != 'create' || (github.event.ref_type == 'branch' && startsWith(github.event.ref, 'release/'))) && (inputs.build_linux || github.event_name != 'workflow_dispatch' || vars.BUILD_LINUX == 'true') && needs.build_linux.result == 'success' }}
steps:
- name: Checkout
uses: actions/checkout@v6

View File

@ -12,15 +12,19 @@ on:
build-deps-only:
required: false
type: boolean
force-build:
required: false
type: boolean
force-build:
required: false
type: boolean
release-version:
required: false
type: string
default: ''
jobs:
build_without_pch_windows:
required: false
type: boolean
default: false
jobs:
check_cache: # determines if there is a cache and outputs variables used in caching process
name: Check Cache
runs-on: ${{ inputs.os }}
@ -63,7 +67,8 @@ jobs:
valid-cache: ${{ needs.check_cache.outputs.valid-cache == 'true' }}
os: ${{ inputs.os }}
arch: ${{ inputs.arch }}
build-deps-only: ${{ inputs.build-deps-only }}
force-build: ${{ inputs.force-build }}
build-deps-only: ${{ inputs.build-deps-only }}
force-build: ${{ inputs.force-build }}
release-version: ${{ inputs.release-version }}
secrets: inherit
build_without_pch_windows: ${{ inputs.build_without_pch_windows }}
secrets: inherit

View File

@ -26,6 +26,10 @@ on:
required: false
type: string
default: ''
build_without_pch_windows:
required: false
type: boolean
default: false
jobs:
build_deps:
@ -142,4 +146,5 @@ jobs:
os: ${{ inputs.os }}
arch: ${{ inputs.arch }}
release-version: ${{ inputs.release-version }}
build_without_pch_windows: ${{ inputs.build_without_pch_windows }}
secrets: inherit

View File

@ -21,6 +21,10 @@ on:
required: false
type: string
default: ''
build_without_pch_windows:
required: false
type: boolean
default: false
jobs:
build_orca:
@ -57,8 +61,9 @@ jobs:
useCloudCache: true
- name: Restore sccache cache
id: restore-sccache
if: ${{ !vars.SELF_HOSTED && (runner.os == 'Windows' || runner.os == 'Linux' || (runner.os == 'macOS' && !inputs.macos-combine-only)) }}
uses: actions/cache@v5
uses: actions/cache/restore@v5
with:
path: ${{ env.SCCACHE_DIR }}
key: sccache-orcaslicer-${{ runner.os }}-${{ inputs.arch || 'default' }}-${{ github.sha }}
@ -364,7 +369,7 @@ jobs:
# env:
# WindowsSdkDir: 'C:\Program Files (x86)\Windows Kits\10\'
# WindowsSDKVersion: '10.0.26100.0\'
run: .\build_release_vs.bat slicer ${{ !vars.SELF_HOSTED && '-x -p' || '' }}
run: .\build_release_vs.bat slicer ${{ !vars.SELF_HOSTED && '-x' || '' }} ${{ !vars.SELF_HOSTED && inputs.build_without_pch_windows && '-p' || '' }}
- name: Show sccache stats Windows
if: ${{ always() && runner.os == 'Windows' && !vars.SELF_HOSTED }}
@ -473,6 +478,19 @@ jobs:
sccache --show-stats
fi
- name: Stop sccache server
if: ${{ always() && !vars.SELF_HOSTED && (runner.os == 'Windows' || runner.os == 'Linux' || (runner.os == 'macOS' && !inputs.macos-combine-only)) }}
continue-on-error: true
run: sccache --stop-server
- name: Save sccache cache
if: ${{ always() && !vars.SELF_HOSTED && (runner.os == 'Windows' || runner.os == 'Linux' || (runner.os == 'macOS' && !inputs.macos-combine-only)) && steps.restore-sccache.outputs.cache-hit != 'true' && steps.restore-sccache.outputs.cache-primary-key != '' }}
continue-on-error: true
uses: actions/cache/save@v5
with:
path: ${{ env.SCCACHE_DIR }}
key: ${{ steps.restore-sccache.outputs.cache-primary-key }}
# Use tar because upload-artifacts won't always preserve directory structure
# and doesn't preserve file permissions
- name: Upload Test Artifact