Skip to content

Fix/micro patches #811

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open

Fix/micro patches #811

wants to merge 3 commits into from

Conversation

crazywhalecc
Copy link
Owner

@crazywhalecc crazywhalecc commented Jun 28, 2025

What does this PR do?

Fix #803 .

This PR will put micro patches after init souces and reuse patchFile function to automatically skip the patched patches.

Checklist before merging

If your PR involves the changes mentioned below and completed the action, please tick the corresponding option.
If a modification is not involved, please skip it directly.

  • If you modified *.php or *.json, run them locally to ensure your changes are valid:
    • PHP_CS_FIXER_IGNORE_ENV=1 composer cs-fix
    • composer analyse
    • composer test
    • bin/spc dev:sort-config
  • If it's an extension or dependency update, please ensure the following:
    • Add your test combination to src/globals/test-extensions.php.
    • If adding new or fixing bugs, add commit message containing extension test or test extensions to trigger full test suite.

Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR introduces micro patches improvements by refactoring the patching functions, reorganizing the patch execution for the micro module, and updating configuration settings for micro patches.

  • Refactored the patchMicro method in SourcePatcher to remove unused parameters and delegate patch application to patchFile.
  • Updated the patchFile method to support both relative and absolute patch file paths and improved phar detection logic.
  • Adjusted SPC_MICRO_PATCHES values in the configuration to align with the new patching strategy.

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
src/SPC/store/SourcePatcher.php Refactored patchMicro and patchFile methods for better patch handling.
src/SPC/builder/BuilderBase.php Integrated a call to patchMicro during the build process.
config/env.ini Updated micro patch configuration values.
Comments suppressed due to low confidence (1)

src/SPC/store/SourcePatcher.php:107

  • Update the PHPDoc for patchMicro to remove outdated parameters and clarify the new method signature.
    public static function patchMicro(?array $items = null): bool

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@crazywhalecc
Copy link
Owner Author

Seems it broke windows builds. I'll figure it out tomorrow.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Extract bug: re-extract micro will apply micro-patch multiple times to php-src
2 participants