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 1.x + PHP <= 5.4 + Windows = dies without installing #10495

Closed
jrfnl opened this issue Jan 30, 2022 · 3 comments
Closed

Composer 1.x + PHP <= 5.4 + Windows = dies without installing #10495

jrfnl opened this issue Jan 30, 2022 · 3 comments

Comments

@jrfnl
Copy link
Contributor

jrfnl commented Jan 30, 2022

Context

While setting up a new test matrix for a particular project on GH Actions, I ran into a segfault on the composer install step which was using ramsey/composer-install.

D:\a\_actions\ramsey\composer-install\v2/bin/composer_install.sh: line 33:  1726 Segmentation fault      $full_command

The issue occurs only for the following setups:

  • PHP 5,3 / 5.4
  • Composer v1
  • Windows 2019 / Windows 2022

To determine whether to report it here or to the ramsey/composer-install repo and to figure out the exact circumstances which generate the issue, I did quite some additional testing and have come to the conclusion that this is a Composer native issue.

Debugging checks already done:

  • Issue does not occur with PHP 5.5, 5.6 (or later)
  • Issue does not occur when using Composer 2.x
  • Issue does not occur on Ubuntu.
  • Issue seems to occur on both Windows images available on GH Actions.

I've managed to trace the issue back to the Composer 1.7.0 release. On releases before 1.7.0, the issue does not occur.

The problem appears to be the connection with Packagist as the install dies on:

Loading composer repositories with package information
Downloading https://repo.packagist.org/packages.json

Personal note

I'm fully aware that Composer 1.x is in security patch mode only and I imagine this is an issue only a few select projects may run into in CI as I can barely imagine anyone still using Composer 1.x with PHP 5.4 for their local dev environment.

With that in mind, please feel free to close this issue as won't fix.

More than anything, I'm opening this issue to make sure there is a record for other people to find. and to make sure there is awareness that Composer 1.x no longer seems to support PHP < 5.5 on Windows.

Details

Full reproduction sample

Code, including GH Actions workflows: https://github.com/jrfnl/composer-install-action-bug/tree/testing/php-5.4-vs-composer-v1

GH Actions debugging output: https://github.com/jrfnl/composer-install-action-bug/actions/runs/1767311284

My composer.json:

{
  "name": "jrfnl/composer-1-php-54-on-windows",
  "description": "Testing",
  "license": "MIT",
  "require": {
    "php": ">=5.4",
    "ehime/hello-world": "^1.0.0"
  }
}

Note: the ehime/hello-world package isn't even needed to reproduce the issue.

Output of composer diagnose:

See the transcripts in the POC GH actions run.

When I run this command:

composer install -vvv --no-interaction

I get the following output:

Reading ./composer.json
Loading config file C:/Users/runneradmin/AppData/Roaming/Composer/config.json
Loading config file C:/Users/runneradmin/AppData/Roaming/Composer/auth.json
Loading config file ./composer.json
Checked CA file /etc/pki/tls/certs/ca-bundle.crt does not exist or it is not a file.
Checked directory /etc/pki/tls/certs/ca-bundle.crt does not exist or it is not a directory.
Checked CA file /etc/ssl/certs/ca-certificates.crt does not exist or it is not a file.
Checked directory /etc/ssl/certs/ca-certificates.crt does not exist or it is not a directory.
Checked CA file /etc/ssl/ca-bundle.pem does not exist or it is not a file.
Checked directory /etc/ssl/ca-bundle.pem does not exist or it is not a directory.
Checked CA file /usr/local/share/certs/ca-root-nss.crt does not exist or it is not a file.
Checked directory /usr/local/share/certs/ca-root-nss.crt does not exist or it is not a directory.
Checked CA file /usr/ssl/certs/ca-bundle.crt does not exist or it is not a file.
Checked directory /usr/ssl/certs/ca-bundle.crt does not exist or it is not a directory.
Checked CA file /opt/local/share/curl/curl-ca-bundle.crt does not exist or it is not a file.
Checked directory /opt/local/share/curl/curl-ca-bundle.crt does not exist or it is not a directory.
Checked CA file /usr/local/share/curl/curl-ca-bundle.crt does not exist or it is not a file.
Checked directory /usr/local/share/curl/curl-ca-bundle.crt does not exist or it is not a directory.
Checked CA file /usr/share/ssl/certs/ca-bundle.crt does not exist or it is not a file.
Checked directory /usr/share/ssl/certs/ca-bundle.crt does not exist or it is not a directory.
Checked CA file /etc/ssl/cert.pem does not exist or it is not a file.
Checked directory /etc/ssl/cert.pem does not exist or it is not a directory.
Checked CA file /usr/local/etc/ssl/cert.pem does not exist or it is not a file.
Checked directory /usr/local/etc/ssl/cert.pem does not exist or it is not a directory.
Checked CA file /usr/local/etc/openssl/cert.pem does not exist or it is not a file.
Checked directory /usr/local/etc/openssl/cert.pem does not exist or it is not a directory.
Checked CA file /usr/local/etc/openssl@1.1/cert.pem does not exist or it is not a file.
Checked directory /usr/local/etc/openssl@1.1/cert.pem does not exist or it is not a directory.
Checked CA file /etc/pki/tls/certs does not exist or it is not a file.
Checked directory /etc/pki/tls/certs does not exist or it is not a directory.
Checked CA file /etc/ssl/certs does not exist or it is not a file.
Checked directory /etc/ssl/certs does not exist or it is not a directory.
Checked CA file /etc/ssl does not exist or it is not a file.
Checked directory /etc/ssl does not exist or it is not a directory.
Checked CA file /usr/local/share/certs does not exist or it is not a file.
Checked directory /usr/local/share/certs does not exist or it is not a directory.
Checked CA file /usr/ssl/certs does not exist or it is not a file.
Checked directory /usr/ssl/certs does not exist or it is not a directory.
Checked CA file /opt/local/share/curl does not exist or it is not a file.
Checked directory /opt/local/share/curl does not exist or it is not a directory.
Checked CA file /usr/local/share/curl does not exist or it is not a file.
Checked directory /usr/local/share/curl does not exist or it is not a directory.
Checked CA file /usr/share/ssl/certs does not exist or it is not a file.
Checked directory /usr/share/ssl/certs does not exist or it is not a directory.
Checked CA file /etc/ssl does not exist or it is not a file.
Checked directory /etc/ssl does not exist or it is not a directory.
Checked CA file /usr/local/etc/ssl does not exist or it is not a file.
Checked directory /usr/local/etc/ssl does not exist or it is not a directory.
Checked CA file /usr/local/etc/openssl does not exist or it is not a file.
Checked directory /usr/local/etc/openssl does not exist or it is not a directory.
Checked CA file /usr/local/etc/openssl@1.1 does not exist or it is not a file.
Checked directory /usr/local/etc/openssl@1.1 does not exist or it is not a directory.
Checked CA file C:\Users\runneradmin\AppData\Local\Temp\opeCD02.tmp: valid
Executing command (D:\a\composer-install-action-bug\composer-install-action-bug): git branch -a --no-color --no-abbrev -v
Reading C:/Users/runneradmin/AppData/Roaming/Composer/composer.json
Loading config file C:/Users/runneradmin/AppData/Roaming/Composer/config.json
Loading config file C:/Users/runneradmin/AppData/Roaming/Composer/auth.json
Loading config file C:/Users/runneradmin/AppData/Roaming/Composer/composer.json
Loading config file C:\Users\runneradmin\AppData\Roaming\Composer/auth.json
Reading C:\Users\runneradmin\AppData\Roaming\Composer/auth.json
Running 1.10.25 (2022-01-21 10:02:15) with PHP 5.4.45 on Windows NT / 6.2
You are using Composer 1 which is deprecated. You should upgrade to Composer 2, see https://blog.packagist.com/deprecating-composer-1-support/
Loading composer repositories with package information
Downloading https://repo.packagist.org/packages.json
Error: Process completed with exit code 1.

And I expected this to happen:

For the install to actually succeed and exit with exit code 0.

@johnstevenson
Copy link
Member

Windows PHP versions lower than 5.5 do not support TLS1.1 so https connections fail. The workaround is to use disable-tls.

@jrfnl
Copy link
Contributor Author

jrfnl commented Jan 30, 2022

Thanks @johnstevenson, that's useful to know. ❤️

Adding this to the workflow now (conditionally):

composer config -g -- disable-tls true

@jrfnl
Copy link
Contributor Author

jrfnl commented Jan 31, 2022

I'll got things working. I will close this issue now and hope the write up will help someone else in the future.

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

No branches or pull requests

2 participants