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

Check and enable platform reqs before running composer install #332

Merged
merged 1 commit into from
Jul 2, 2024

Conversation

sophiewigmore
Copy link
Member

@sophiewigmore sophiewigmore commented Jul 2, 2024

Summary

Resolve test failures related to composer install with Composer 2.7.7 by checking/enabling platform reqs before running composer install:

[builder]   Running 'composer install --no-progress --no-dev'
[builder]       Composer could not detect the root package (paketo/composer_app) version, defaulting to '1.0.0'. See https://getcomposer.org/root-version
[builder]       Installing dependencies from lock file
[builder]       Verifying lock file contents can be installed on current platform.
[builder]       Warning: The lock file is not up to date with the latest changes in composer.json. You may be getting outdated dependencies. It is recommended that you run `composer update` or `composer update <package name>`.
[builder]       Your lock file does not contain a compatible set of packages. Please run composer update.
[builder]       
[builder]         Problem 1
[builder]           - Root composer.json requires PHP extension ext-zip * but it is missing from your system. Install or enable PHP's zip extension.
[builder]         Problem 2
[builder]           - Root composer.json requires PHP extension ext-gd * but it is missing from your system. Install or enable PHP's gd extension.
[builder]         Problem 3
[builder]           - Root composer.json requires PHP extension ext-fileinfo * but it is missing from your system. Install or enable PHP's fileinfo extension.
[builder]         Problem 4
[builder]           - Root composer.json requires PHP extension ext-mysqli * but it is missing from your system. Install or enable PHP's mysqli extension.
[builder]       
[builder]       To enable extensions, verify that they are enabled in your .ini files:
[builder]           - /layers/paketo-buildpacks_composer-install/composer-php-ini/composer-php.ini
[builder]           - /layers/paketo-buildpacks_php-dist/php/etc/buildpack.ini
[builder]           - /layers/paketo-buildpacks_php-dist/php/etc/php.ini
[builder]           - /layers/paketo-buildpacks_php-dist/php/etc/buildpack.ini
[builder]           - /layers/paketo-buildpacks_php-dist/php/etc/php.ini
[builder]       You can also run `php --ini` in a terminal to see which files are used by PHP in CLI mode.
[builder]       Alternatively, you can run Composer with `--ignore-platform-req=ext-zip --ignore-platform-req=ext-gd --ignore-platform-req=ext-fileinfo --ignore-platform-req=ext-mysqli` to temporarily ignore these required extensions.
[builder] exit status 2
[builder] ERROR: failed to build: exit status 1
ERROR: failed to build: executing lifecycle: failed with status code: 51
  • We previously checked extensions, and made them available after composer install ran

  • As of Composer 2.7.7, composer install includes a platform reqs check against the composer.json and composer.lock files. This check requires the extensions to be loaded/available to composer when the install command runs.

  • testdata: update app composer.lock

Checklist

  • I have viewed, signed, and submitted the Contributor License Agreement.
  • I have linked issue(s) that this PR should close using keywords or the Github UI (See docs)
  • I have added an integration test, if necessary.
  • I have reviewed the styleguide for guidance on my code quality.
  • I'm happy with the commit history on this PR (I have rebased/squashed as needed).

- We previously checked extensions, and made them available after
`composer install` ran

- As of Composer 2.7.7, `composer install` includes a platform reqs
check against the composer.json and composer.lock files. This check
requires the extensions to be loaded/available to composer when the
install command runs.

* testdata: update app composer.lock
@sophiewigmore sophiewigmore requested a review from a team as a code owner July 2, 2024 14:19
@sophiewigmore sophiewigmore added the semver:patch A change requiring a patch version bump label Jul 2, 2024
@sophiewigmore sophiewigmore enabled auto-merge (squash) July 2, 2024 14:23
@sophiewigmore sophiewigmore merged commit 17ed2e8 into main Jul 2, 2024
9 of 10 checks passed
@sophiewigmore sophiewigmore deleted the enable-platform-reqs branch July 2, 2024 14:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
semver:patch A change requiring a patch version bump
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants