Skip to content

[CMake] Always patch the builtins starting from the pristine sources - #24016

Open
guitargeek wants to merge 1 commit into
root-project:masterfrom
guitargeek:fix-unuran-incremental-patch
Open

guitargeek wants to merge 1 commit into
root-project:masterfrom
guitargeek:fix-unuran-incremental-patch

Conversation

@guitargeek

Copy link
Copy Markdown
Contributor

ExternalProject re-runs the patch step not only after a new download, but also when the patch command changes, and then on the already patched tree. Since 0db7792 changed the unuran patch command, this breaks the incremental opensuse CI build. The configure-time checks of the other builtins with patches fail the other way around: after a new download, they skip the patches.

Add ROOT_BUILTIN_PATCH_COMMAND, whose patch step commits the pristine sources to a git repository in the source directory and resets to them before applying the patches, so it can always run. Trees patched by the old commands are handled by undoing their patches first, or, if that fails, by downloading the sources again. Use it for all builtins with patches.

🤖 Done with the help of AI

@github-actions

github-actions Bot commented Nov 6, 2026

Copy link
Copy Markdown

Test Results

    22 files      22 suites   3d 12h 58m 45s ⏱️
 3 884 tests  3 883 ✅ 0 💤 1 ❌
76 027 runs  76 026 ✅ 0 💤 1 ❌

For more details on these failures, see this check.

Results for commit 0ca3a70.

@guitargeek
guitargeek force-pushed the fix-unuran-incremental-patch branch from 0ca3a70 to c7b8d99 Compare November 6, 2026 07:23

@bellenot bellenot left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Comment on lines +79 to +81
# Undo those that are there, in reverse order. If this doesn't result in the
# pristine sources, applying the patches below fails, and the sources are
# downloaded again.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I fail to see where the re-download is triggered, what am I missing?

@guitargeek guitargeek Nov 6, 2026 •

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You're right, the wording is not clear here. The re-download is only triggered in the next build by the removed download stamp file (see logic around line 105). I'll change the comment here to say "downloaded again in the next build" as well.

Note that deferring the re-download to the next build was much easier than trying ExternalProject_Add to re-download. That's why I went with the easy solution with a clear error message.

ExternalProject re-runs the patch step not only after a new download, but
also when the patch command changes, and then on the already patched tree.
Since 0db7792 changed the unuran patch command, this breaks the
incremental opensuse CI build. The configure-time checks of the other
builtins with patches fail the other way around: after a new download, they
skip the patches.

Add ROOT_BUILTIN_PATCH_COMMAND, whose patch step commits the pristine
sources to a git repository in the source directory and resets to them
before applying the patches, so it can always run. Trees patched by the old
commands are handled by undoing their patches first, or, if that fails, by
downloading the sources again. Use it for all builtins with patches.

🤖 Done with the help of AI
@guitargeek
guitargeek force-pushed the fix-unuran-incremental-patch branch from c7b8d99 to 3807741 Compare November 6, 2026 10:59

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants