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

Corrupted composer is installed using v1 #239

Closed
2 of 5 tasks
stof opened this issue Jul 2, 2020 · 7 comments
Closed
2 of 5 tasks

Corrupted composer is installed using v1 #239

stof opened this issue Jul 2, 2020 · 7 comments
Assignees
Labels
upstream-issue Issue in an upstream project

Comments

@stof
Copy link

stof commented Jul 2, 2020

Describe the bug
Things where working fine yesterday in the afternoon. But workflows running yesterday evening (19:35 UTC+2) installed a corrupted version of composer (without the setup-php step reporting a failure, so the failure was only reported by a later step using composer)

Version

  • I have checked releases and the bug exists in the latest patch version of v1 or v2.
  • v2
  • v1

I haven't checked v2

Runners

  • GitHub Hosted
  • Self Hosted

Operating systems
linux

PHP versions
7.3

To Reproduce

jobs:
  phpstan:
    name: PHPStan
    runs-on: ubuntu-latest
    steps:
      - name: Checkout
        uses: actions/checkout@v2
      - name: Setup PHP
        uses: shivammathur/setup-php@v1
        with:
          php-version: 7.3
          extensions: intl
          coverage: none
      # more steps following, where using composer would throw the same fatal error and break the build

Expected behavior
A usable version of composer is installed.
And another expectation would be that such fatal error actually makes the setup report a failure rather than failing silently.

Screenshots/Logs
Here is the output of the setup-php step:

 Setup PHP
24s
    coverage: none
Run shivammathur/setup-php@v1
  with:
    php-version: 7.3
    extensions: intl
    coverage: none
/bin/bash /opt/hostedtoolcache/linux.sh 7.3 /home/runner/work/_actions/shivammathur/setup-php/v1/dist

==> Setup PHP
✓ PHP Switched to PHP 7.3.19

==> Setup Tools
PHP Fatal error:  Uncaught PharException: internal corruption of phar "/usr/local/bin/composer" (truncated manifest header) in /usr/local/bin/composer:23
Stack trace:
#0 /usr/local/bin/composer(23): Phar::mapPhar('composer.phar')
#1 {main}
  thrown in /usr/local/bin/composer on line 23
✓ composer Added

==> Setup Extensions
✓ intl Enabled

==> Setup Coverage
✓ none Disabled Xdebug and PCOV

Additional context

Are you willing to submit a PR?

@stof stof added the bug Something isn't working label Jul 2, 2020
@shivammathur

This comment has been minimized.

@shivammathur shivammathur added upstream-issue Issue in an upstream project and removed bug Something isn't working labels Jul 2, 2020
@mfn
Copy link
Contributor

mfn commented Jul 7, 2020

@shivammathur
I had just the same happen to me too:
image

Can't there be some exit code check added to break this GHA step if the setup couldn't finish properly?

@shivammathur
Copy link
Owner

@mfn Added, will be there in next release.

@mfn
Copy link
Contributor

mfn commented Jul 7, 2020

Wow, I saw the commit 82a0dd8 . So much work what I thought would be just an exit somewhere.

Much appreciated 🙇

@shivammathur
Copy link
Owner

Also improved how different versions of composer are setup, so most of 82a0dd8 is that.

@shivammathur shivammathur mentioned this issue Jul 21, 2020
@shivammathur
Copy link
Owner

@mfn @stof After 2.4.0 release if composer does not download correctly, setup will fail with the message "Could not download composer".

@mfn
Copy link
Contributor

mfn commented Jul 21, 2020

Awesome, will try it out!

😼

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
upstream-issue Issue in an upstream project
Projects
None yet
Development

No branches or pull requests

3 participants