vercel-community / php

🐘 PHP Runtime for ▲ Vercel Serverless Functions (support 7.4-8.3)

Home Page:https://php.vercel.app

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Composer validation always fails

asispts opened this issue · comments

Bug report

  • Version: 0.5.2
  • URL: No
  • Repository: No

Description

When modify composer.json (e.q: add/remove a package), build process always fail to detect the change. The build process always use the same cache.

Installing Composer dependencies [START]
[8.0MiB/0.13s] Installing dependencies from lock file
[8.2MiB/0.13s] Verifying lock file contents can be installed on current platform.
[8.4MiB/0.13s] 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>`.
[9.8MiB/0.18s] Nothing to install, update or remove
[9.8MiB/0.18s] Generating optimized autoload files

Composer validation shows that composer.json is valid.

$ composer validate
./composer.json is valid

Solution

Redeploy without using existing build cache manually.

Just want to share with anyone else. You can use ENV to skip using build cache.

See: https://vercel.com/docs/concepts/deployments/troubleshoot-a-build#managing-build-cache

Hi @asispts. Do you have composer.lock versioned in your project?

Hi @asispts. Do you have composer.lock versioned in your project?

Yes

So let me summarize this problem.

  1. Create project with composer.json + composer.lock + vercel.json + /api/index.php.
  2. Deploy to vercel.
  3. Modify composer.json + composer.lock (after calling composer update for example).
  4. Deploy to vercel.
  5. See -> 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>.

Right?

Yes, that's the steps to reproduce the issue. However, on the step 3, it's better to add a new package and use it in /api/index.php.