diff --git a/.github/actions/build-obs/action.yaml b/.github/actions/build-obs/action.yaml index bfe88ac52..5f007e506 100644 --- a/.github/actions/build-obs/action.yaml +++ b/.github/actions/build-obs/action.yaml @@ -99,7 +99,7 @@ runs: .github/scripts/Build-Windows.ps1 @BuildArgs - name: Create Summary 📊 - if: contains(fromJSON('["Linux", "macOS"]'), runner.os) + if: runner.os == 'Linux' shell: zsh --no-rcs --errexit --pipefail {0} run: | : Create Summary 📊 diff --git a/.github/scripts/.Brewfile b/.github/scripts/.Brewfile index cdc51f13e..6ee71dc76 100644 --- a/.github/scripts/.Brewfile +++ b/.github/scripts/.Brewfile @@ -1,4 +1,3 @@ -brew "ccache" brew "cmake" brew "git" brew "jq" diff --git a/.github/scripts/.build.zsh b/.github/scripts/.build.zsh index 707188423..ab417cebb 100755 --- a/.github/scripts/.build.zsh +++ b/.github/scripts/.build.zsh @@ -42,7 +42,7 @@ build() { local project_root=${SCRIPT_HOME:A:h:h} fpath=(${SCRIPT_HOME}/utils.zsh ${fpath}) - autoload -Uz log_group log_error log_output check_${host_os} setup_ccache + autoload -Uz log_group log_error log_output check_${host_os} local -i debug=0 @@ -98,10 +98,11 @@ build() { set -- ${(@)args} check_${host_os} - setup_ccache if [[ ${host_os} == ubuntu ]] { - autoload -Uz setup_ubuntu && setup_ubuntu + autoload -Uz setup_ubuntu setup_ccache + setup_ccache + setup_ubuntu } local product_name='obs-studio' @@ -116,7 +117,14 @@ build() { case ${target} { macos-*) - cmake_args+=(--preset 'macos-ci' -DCMAKE_OSX_ARCHITECTURES:STRING=${target##*-}) + cmake_args+=( + --preset 'macos-ci' + -DCMAKE_OSX_ARCHITECTURES:STRING=${target##*-} + ) + + if (( debug )) { + cmake_args+=(CMAKE_XCODE_ATTRIBUTE_COMPILATION_CACHE_ENABLE_DIAGNOSTIC_REMARKS:STRING=YES) + } typeset -gx NSUnbufferedIO=YES diff --git a/.github/workflows/build-project.yaml b/.github/workflows/build-project.yaml index b988908b4..1a799e3a2 100644 --- a/.github/workflows/build-project.yaml +++ b/.github/workflows/build-project.yaml @@ -80,8 +80,8 @@ jobs: : Set Up Environment 🔧 if (( ${+RUNNER_DEBUG} )) setopt XTRACE - print '::group::Enable Xcode 16.4' - sudo xcode-select --switch /Applications/Xcode_16.4.app/Contents/Developer + print '::group::Enable Xcode 26.1' + sudo xcode-select --switch /Applications/Xcode_26.1.app/Contents/Developer print '::endgroup::' print '::group::Clean Homebrew Environment' @@ -97,13 +97,19 @@ jobs: local -A arch_names=(x86_64 intel arm64 apple) print "cpuName=${arch_names[${{ matrix.target }}]}" >> $GITHUB_OUTPUT + local xcode_cas_path="${HOME}/Library/Developer/Xcode/DerivedData/CompilationCache.noindex" + + if ! [[ -d ${xcode_cas_path} ]] mkdir -p ${xcode_cas_path} + + print "xcodeCasPath=${xcode_cas_path}" >> $GITHUB_OUTPUT + - uses: actions/cache/restore@v4 - id: ccache-cache + id: xcode-cache with: - path: ${{ github.workspace }}/.ccache - key: ${{ runner.os }}-ccache-${{ matrix.target }}-${{ needs.check-event.outputs.config }} + path: ${{ steps.setup.outputs.xcodeCasPath }} + key: ${{ runner.os }}-xcode-${{ matrix.target }}-${{ needs.check-event.outputs.config }} restore-keys: | - ${{ runner.os }}-ccache-${{ matrix.target }}- + ${{ runner.os }}-xcode-${{ matrix.target }}- - name: Set Up Code Signing 🔑 uses: ./.github/actions/setup-macos-codesigning @@ -129,6 +135,7 @@ jobs: YOUTUBE_CLIENTID_HASH: ${{ secrets.YOUTUBE_CLIENTID_HASH }} YOUTUBE_SECRET: ${{ secrets.YOUTUBE_SECRET }} YOUTUBE_SECRET_HASH: ${{ secrets.YOUTUBE_SECRET_HASH }} + XCODE_CAS_PATH: ${{ steps.setup.outputs.xcodeCasPath }} with: target: ${{ matrix.target }} config: ${{ needs.check-event.outputs.config }} @@ -163,10 +170,10 @@ jobs: path: ${{ github.workspace }}/build_macos/obs-studio-*-macos-${{ steps.setup.outputs.cpuName }}-dSYMs.tar.xz - uses: actions/cache/save@v4 - if: github.event_name != 'pull_request' && steps.ccache-cache.outputs.cache-hit != 'true' + if: github.event_name != 'pull_request' && steps.xcode-cache.outputs.cache-hit != 'true' with: - path: ${{ github.workspace }}/.ccache - key: ${{ runner.os }}-ccache-${{ matrix.target }}-${{ needs.check-event.outputs.config }} + path: ${{ steps.setup.outputs.xcodeCasPath }} + key: ${{ runner.os }}-xcode-${{ matrix.target }}-${{ needs.check-event.outputs.config }} ubuntu-build: name: Ubuntu 🐧 diff --git a/CMakePresets.json b/CMakePresets.json index b2f8c8e02..f104a9264 100644 --- a/CMakePresets.json +++ b/CMakePresets.json @@ -115,7 +115,9 @@ "inherits": ["macos"], "warnings": {"dev": true, "deprecated": true}, "cacheVariables": { - "CMAKE_COMPILE_WARNING_AS_ERROR": true + "CMAKE_COMPILE_WARNING_AS_ERROR": true, + "CMAKE_XCODE_ATTRIBUTE_COMPILATION_CACHE_ENABLE_CACHING": "YES", + "CMAKE_XCODE_ATTRIBUTE_COMPILATION_CACHE_CAS_PATH": "$penv{XCODE_CAS_PATH}" } }, {