fix(build): fall back to patch(1) when git apply fails - #764
Merged
ReenigneArcher merged 1 commit intoAug 30, 2026
Merged
Conversation
luanweslley77
force-pushed
the
fix/patch-fallback-non-git
branch
from
August 29, 2026 13:42
2b0f744 to
d817437
Compare
luanweslley77
marked this pull request as ready for review
August 29, 2026 14:08
luanweslley77
force-pushed
the
fix/patch-fallback-non-git
branch
from
August 30, 2026 09:41
d817437 to
7cf407d
Compare
file(COPY) duplicates the nested submodule trees into the build directory, carrying their .git gitdir pointer files. In build layouts where the copy does not mirror the source depth, the pointer breaks and git apply --check aborts with "fatal: not a git repository", silently skipping every patch. Keep the check output visible and fall back to patch(1), which needs no repository, when the check fails. The patch(1) dry-run output is captured: applicable patches are applied, already-applied patches stay silent, and a patch that cannot apply is reported with its reason instead of being skipped silently.
ReenigneArcher
force-pushed
the
fix/patch-fallback-non-git
branch
from
August 30, 2026 13:23
7cf407d to
ee3d9dc
Compare
|
luanweslley77
added a commit
to luanweslley77/build-deps
that referenced
this pull request
Sep 1, 2026
…#764) + x265 multilib -j3 - Cherry-pick LizardByte#764: fallback to patch(1) when git apply fails in binary dir (file(COPY) breaks gitdir pointer), fixing 'fatal: not a git repository' silent skip for all FFmpeg/x265 patches. This restores 01-cmake-minimum_required.patch etc for CMake 4.3. - Keep x265 multilib 8/10/12-bit with -j3 and CMAKE_POLICY_VERSION_MINIMUM 3.5 / POLICY_DEFAULT for CMP0025/0054. Manual sed remains as extra safety for already-copied source.
luanweslley77
added a commit
to luanweslley77/Sunshine
that referenced
this pull request
Sep 1, 2026
…h-fallback + x265 multilib -j3) - Inclui LizardByte/build-deps#764 MERGED (fix/build fallback patch(1) when git apply fails in binary dir) que voce apontou - agora todos os patches FFmpeg/x265_git aplicam corretamente mesmo com file(COPY) gitdir quebrado. Resolve o Configuring incomplete para x265-12bit/10bit no CMake 4.3. - Mantem x265 multilib 8/10/12-bit -j3 com CMAKE_POLICY 3.5
luanweslley77
added a commit
to luanweslley77/Sunshine
that referenced
this pull request
Sep 1, 2026
…h-fallback + x265 multilib -j3) - Inclui LizardByte/build-deps#764 MERGED (fix/build fallback patch(1) when git apply fails in binary dir) que voce apontou - agora todos os patches FFmpeg/x265_git aplicam corretamente mesmo com file(COPY) gitdir quebrado. Resolve o Configuring incomplete para x265-12bit/10bit no CMake 4.3. - Mantem x265 multilib 8/10/12-bit -j3 com CMAKE_POLICY 3.5
luanweslley77
added a commit
to luanweslley77/build-deps
that referenced
this pull request
Sep 2, 2026
- Build 12-bit (HIGH_BIT_DEPTH+MAIN12) -> 10-bit (HIGH_BIT_DEPTH) -> 8-bit (EXTRA_LIB=x265_main10.a;x265_main12.a LINKED_10BIT/12BIT) via ExternalProject - Combine via ar -M with WORKING_DIRECTORY 8bit, x265_config.h from 8bit, x265.pc via true, idempotent libx265_main.a handling - Enables yuv420p10le for HEVC Main10 P010 software encoding, fixes validate_config -1 for libx265. 27M libx265.a. Requires LizardByte#764 patch fallback for CMake 4.3.
luanweslley77
added a commit
to luanweslley77/Sunshine
that referenced
this pull request
Sep 2, 2026
- Add x265 multilib 8/10/12-bit via ExternalProject for yuv420p10le HEVC Main10 P010, 27M libx265.a, requires LizardByte/build-deps#764 patch fallback for CMake 4.3
luanweslley77
added a commit
to luanweslley77/Sunshine
that referenced
this pull request
Sep 2, 2026
- Add x265 multilib 8/10/12-bit via ExternalProject for yuv420p10le HEVC Main10 P010, 27M libx265.a, requires LizardByte/build-deps#764 patch fallback for CMake 4.3
luanweslley77
added a commit
to luanweslley77/Sunshine
that referenced
this pull request
Sep 2, 2026
- Add x265 multilib 8/10/12-bit via ExternalProject for yuv420p10le HEVC Main10 P010, 27M libx265.a, requires LizardByte/build-deps#764 patch fallback for CMake 4.3
luanweslley77
added a commit
to luanweslley77/Sunshine
that referenced
this pull request
Sep 2, 2026
- Add x265 multilib 8/10/12-bit via ExternalProject for yuv420p10le HEVC Main10 P010, 27M libx265.a, requires LizardByte/build-deps#764 patch fallback for CMake 4.3
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Description
_main.cmakeduplicates the nestedthird-party/FFmpegtrees into the build directory withfile(COPY ...), which carries the submodules'.gitgitdir pointer files along. Those pointers are relative to the source checkout, so they stay valid only while the build directory mirrors the source layout — the default in-tree build used by CI, where the released artifacts confirm all patches apply.For any other layout — e.g. an out-of-tree build directory whose path does not mirror the source depth — the copied pointer no longer resolves and every
gitcommand inside the copy fails withfatal: not a git repository. A present-but-invalid.gitmakesgit apply --checkabort even thoughgit applyworks fine without any.gitat all, so all FFmpeg patches get silently skipped — and on CMake >= 4 the unpatched x265 then hard-errors oncmake_policy(SET CMP0025 OLD).This falls back to
patch(1), which needs no repository, whengit apply --checkfails, keeping the check output visible. Thepatch(1)dry-run output is captured: applicable patches are applied, already-applied patches stay silent, and a patch that cannot apply is reported with its reason instead of being skipped silently.Validated on a fresh out-of-tree build (CMake 4.3, Fedora 44): pristine submodules, no manual steps — configure applies all FFmpeg and x265 patches through the fallback and the full Sunshine test suite (395 tests) passes against the built FFmpeg.
Screenshot
Issues Fixed or Closed
Roadmap Issues
Type of Change
Checklist
AI Usage
See our AI usage policy.