nixpacks icon indicating copy to clipboard operation
nixpacks copied to clipboard

Build fails using PHP 7.4 due to nix-env

Open dwillmc opened this issue 2 years ago • 2 comments

Is there an existing issue for this?

  • [X] I have searched the existing issues

Describe the bug

The documentation shows support for PHP 7.4, and I've successfully configured Nixpacks to use that version. However, the build eventually fails:

╔═══════════════════════════════ Nixpacks v0.5.2 ══════════════════════════════╗
║ setup      │ php74, perl, nginx, php74Packages.composer,                     ║
║            │ php74Extensions.imagick, nodejs-16_x, yarn-1_x                  ║
║──────────────────────────────────────────────────────────────────────────────║
║ install    │ mkdir -p /var/log/nginx && mkdir -p /var/cache/nginx            ║
║            │ composer install                                                ║
║            │ yarn install --frozen-lockfile                                  ║
║──────────────────────────────────────────────────────────────────────────────║
║ start      │ vendor/bin/heroku-php-apache2 web                               ║
╚══════════════════════════════════════════════════════════════════════════════╝

[+] Building 60.5s (9/13)                                                                                                                                                                  
 => [internal] load build definition from Dockerfile                                                                                                                                  0.2s
 => => transferring dockerfile: 593B                                                                                                                                                  0.1s
 => [internal] load .dockerignore                                                                                                                                                     0.1s
 => => transferring context: 2B                                                                                                                                                       0.0s
 => [internal] load metadata for ghcr.io/railwayapp/nixpacks:debian-1662834156                                                                                                        0.6s
 => [1/9] FROM ghcr.io/railwayapp/nixpacks:debian-1662834156@sha256:2703ce13ac5bb1fa9e45b2530080306e4da4b2cf366a3e2f1b08778233a5a461                                                  0.0s
 => [internal] load build context                                                                                                                                                     0.7s
 => => transferring context: 26.98MB                                                                                                                                                  0.7s
 => CACHED [2/9] WORKDIR /app/                                                                                                                                                        0.0s
 => CACHED [3/9] COPY .nixpacks/assets /assets/                                                                                                                                       0.0s
 => CACHED [4/9] COPY .nixpacks/setup.nix .nixpacks/setup.nix                                                                                                                         0.0s
 => ERROR [5/9] RUN nix-env -if .nixpacks/setup.nix && nix-collect-garbage -d                                                                                                        58.9s
------                                                                                                                                                                                     
 > [5/9] RUN nix-env -if .nixpacks/setup.nix && nix-collect-garbage -d:                                                                                                                    
#9 57.02 installing 'setup-env'                                                                                                                                                            
#9 58.12 error: php74 has been dropped due to the lack of maintanence from upstream for future releases
#9 58.13 (use '--show-trace' to show detailed location information)
------
executor failed running [/bin/bash -ol pipefail -c nix-env -if .nixpacks/setup.nix && nix-collect-garbage -d]: exit code: 1
Error: Docker build failed

To reproduce

The issue occurs on our own internal project. I've also reproduced the issue by converting the php-laravel example to PHP 7.4 and running the build command.

nixpacks build ./php-laravel

Expected behavior

No response

Environment

OS's:

  • MacOS 12.4 (M1)
  • Ubuntu 20.04

Nixpacks:

  • v0.52
  • Various older versions since v0.0.24

dwillmc avatar Sep 12 '22 18:09 dwillmc

@JakeCooper Is this intentionally non-functional? We see the error but the docs say 7.4 is supported.

austinkettner avatar Sep 19 '22 22:09 austinkettner

@coffee-cup Is PHP 7.4 support feasible in railway?

dwillmc avatar Sep 22 '22 17:09 dwillmc

Unfortunately, PHP 7.4 has reached end of life and is no longer supported on Nix so we will have to drop support for it in Nixpacks. It should still be possible to use with a combination of custom apt packages and setup/install commands, and we would be happy to accept a PR that adds first class support for it. But in the current state we will have to drop support and update the docs.

coffee-cup avatar Nov 29 '22 17:11 coffee-cup