Skip to content
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

Composer unable to apply patches #98

Closed
lukaszpilka opened this issue Mar 24, 2023 · 8 comments
Closed

Composer unable to apply patches #98

lukaszpilka opened this issue Mar 24, 2023 · 8 comments

Comments

@lukaszpilka
Copy link

lukaszpilka commented Mar 24, 2023

I created a new Issue for #62 which looks like not resolved.
I am still getting the "sh: patch: not found" error.

steps:
  - uses: actions/checkout@v3
  - uses: php-actions/composer@master
    env:
      COMPOSER_AUTH: '{"github-oauth": {"github.com": "${{ secrets.OLD_GITHUB_ORG_TOKEN }}"} }'
    with:
      dev: no
      args: --optimize-autoloader -vvv
      php_version: "8.1"
      version: 2.3.10
      php_extensions: redis gnupg apcu zip gd mysqli pdo_mysql bz2 curl exif intl opcache

The error response I get is:

Applying patches for drupal/core
https://www.drupal.org/files/issues/2022-08-01/1464354-enum-solution.patch (Solution for ENUM datatype for MySQL)
Executing command (CWD): patch '-p2' --no-backup-if-mismatch -d 'docroot/core' < '/tmp/641d4e6733326.patch'
patch '-p2' --no-backup-if-mismatch -d 'docroot/core' < '/tmp/641d4e6733326.patch'
sh: patch: not found
@RobLoach
Copy link

Ran into this issue. It seems like the alpine container that it's using doesn't have patch installed. As a stop-gap, I switched over to using shivammathur/setup-php and ramsey/composer-install.

    - name: PHP
      uses: shivammathur/setup-php@v2
      with:
        php-version: "8.1.11"

    - name: Composer
      uses: ramsey/composer-install@v2
      with:
        composer-options: "--ignore-platform-reqs"

@dmetzler1988
Copy link

Same issue here - so we needed to switch to ramsey/composer-install that our patch could be installed.
Hopefully there will be soon a new release with installed patch library - so that we can switch back to this php-actions action.

@adam-vessey
Copy link

adam-vessey commented Aug 28, 2023

Just ran into this. Bit of digging around, looks like HEAD/master would be fine; however, the current v6/v6.1.1 is still referencing cee5b9fa9fbc4c888e7a62bbb7b8eade18e3c56b, the commit before the patch fix.


Bit of follow-up, might not quite do the trick... still failed to apply the patches, despite working locally. Had to manually go delete the memoized/cached {repo}/php-actions_composer_{repo} Docker image/package that php-build deals with, and then it started working.

@pingevt
Copy link

pingevt commented Oct 11, 2023

@adam-vessey - how did you delete the {repo}/php-actions_composer_{repo}?


Of course as soon as I ask the question, I find the answer...

  • Goto your github.com user or org page
  • Click packages tab.
  • Click into a package
  • On bottom-right, Click Package settings
  • At the bottom in the Danger Zone, you can delete the package.

@pingevt
Copy link

pingevt commented Oct 11, 2023

Although its a few commits behind now, I've been pointing to a separate branch that uses the the fix:

- name: Install composer dependencies
  uses: php-actions/composer@bluecadet
  with:
    php_version: ${{ env.PHP_VERSION }}

Which will apply patches, but looks like it is now a few commits behind current v6

@g105b
Copy link
Member

g105b commented Oct 11, 2023

Hi all,

I've found some time to look into this. I think the solution is to make a new v6 release from the current master, which references the later php-build repo at v2.2.0.

A bump to the v6 tag needed doing anyway, so please can you clarify that this has resolved the issue?

FYI, please see @pingevt's message regarding deleting the cached Docker build.

Let me know how it goes!

@pingevt
Copy link

pingevt commented Oct 23, 2023

@g105b - yes, I've been using that branch for awhile now on a few production sites. Patches all applying as expected.

@g105b
Copy link
Member

g105b commented Oct 23, 2023

Great, thanks for confirming. I'll release a new v6. If anyone has any further issues please feel free to re-open.

@g105b g105b closed this as completed Oct 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

6 participants