fix: Patch commands fail trying to re-apply the same patch twice#664
Open
BohdanBuinich wants to merge 2 commits into
Open
fix: Patch commands fail trying to re-apply the same patch twice#664BohdanBuinich wants to merge 2 commits into
BohdanBuinich wants to merge 2 commits into
Conversation
Author
|
@TheLartians, Could you please review this change and let me know if you agree with it? |
|
I pulled Thank you |
|
PATCH_OPTIONS are mentioned in |
5060d97 to
3c3ebf1
Compare
|
Any updates? I'm using the temp fix of |
Author
|
@TheLartians, what do you think about this fix? Or do you think it’s too messy and have a better idea for handling it? |
07e5668 to
3e2d5e1
Compare
c6b657b to
2ef2b1e
Compare
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.
Fix repeated patch application
Problem
PATCHESused to build a shell-stylePATCH_COMMANDthat applied patch files with input redirection.That made patching fragile:
What changed
Patch handling now generates a small CMake script and uses it as the
PATCH_COMMAND.The script applies patches from the dependency source directory without shell redirection. For each patch, it first checks whether the patch can apply normally. If not, it checks whether the patch is already present by running a reverse dry-run.
This makes repeated configure runs safe:
Main idea
Patch state is now stored next to the dependency source tree:
The patch-set hash includes the patch executable, patch arguments, working-directory behavior, patch file paths, and patch file contents.
That means changing a patch file creates a new patch set, even if the file path stays the same.
Fixes #618