setup-php icon indicating copy to clipboard operation
setup-php copied to clipboard

Add support for arm64 Linux and Windows GitHub hosted runners

Open LorenzoRogai opened this issue 1 year ago • 9 comments

Github released arm64 hosted runners

https://github.blog/changelog/2024-06-03-actions-arm-based-linux-and-windows-runners-are-now-in-public-beta

The install process goes slow then fails with this error

/home/runner/work/_actions/shivammathur/setup-php/v2/src/scripts/../scripts/tools/add_tools.sh: line 31: /usr/bin/php: cannot execute binary file: Exec format error

LorenzoRogai avatar Jun 03 '24 21:06 LorenzoRogai

Those are not supported by the action currently.

I will try to add support in future, but no promises until it only supports large runners.

shivammathur avatar Jun 04 '24 01:06 shivammathur

Thank you for your response. They are configurable inside large runners section instead of a fixed default GitHub runs-on tag but already available to all customers on Team/Enterprise plans. Considering that these runners also cost 0.005€ instead of 0.008€ i think that many ppl will switch to them

LorenzoRogai avatar Jun 04 '24 07:06 LorenzoRogai

@shivammathur are there any guide on how to implement a new runs-on platform? so i can help by submitting a PR

LorenzoRogai avatar Aug 08 '24 09:08 LorenzoRogai

@LorenzoRogai It would require adding support for arm builds here https://github.com/shivammathur/php-builder for linux. On Windows php does not support arm as of now as there are no arm builds, so I'm not sure, will have to test if existing x64 builds work on Windows.

shivammathur avatar Aug 09 '24 15:08 shivammathur

arm64 images have come out of public beta and are now in general availability https://github.blog/changelog/2024-09-03-github-actions-arm64-linux-and-windows-runners-are-now-generally-available/

We get a little further on our arm64 build (adding for googleibility):

Run shivammathur/setup-php@v2
/usr/bin/bash /home/runner/work/_actions/shivammathur/setup-php/v2/src/scripts/run.sh
==> Setup PHP
✓ PHP Installed PHP 8.2.21
==> Setup Extensions
/home/runner/work/_actions/shivammathur/setup-php/v2/src/scripts/../scripts/extensions/add_extensions.sh: line 13: /usr/bin/php: cannot execute binary file: Exec format error
/home/runner/work/_actions/shivammathur/setup-php/v2/src/scripts/../scripts/extensions/add_extensions.sh: line 16: /usr/bin/php: cannot execute binary file: Exec format error
/home/runner/work/_actions/shivammathur/setup-php/v2/src/scripts/../scripts/extensions/add_extensions.sh: line 16: /usr/bin/php: cannot execute binary file: Exec format error
Error: The operation was canceled.

EionRobb avatar Sep 03 '24 22:09 EionRobb

Following up here, as we'd like to move to support them as well

j-fulbright avatar Sep 09 '24 17:09 j-fulbright

At the end we just changed the workflow to use ppa:ondrej/php, if you have a simple PHP setup you can do this way. It worked fine anyway

LorenzoRogai avatar Sep 10 '24 07:09 LorenzoRogai

@LorenzoRogai, chould you please share an example of how you did it?

ihor-sviziev avatar Sep 17 '24 14:09 ihor-sviziev

@ihor-sviziev

Simply

- name: Add PHP PPA
  run: sudo add-apt-repository ppa:ondrej/php
- name: Install PHP
  run: |
    sudo apt install \
    php$(cat .php-version) \
    php$(cat .php-version)-simplexml \
    php$(cat .php-version)-curl \
    php$(cat .php-version)-dom \
    php$(cat .php-version)-xml \
    php$(cat .php-version)-bcmath \
    php$(cat .php-version)-zip \
    php$(cat .php-version)-intl

LorenzoRogai avatar Sep 17 '24 17:09 LorenzoRogai

This issue is also keeping us from using ARM in github actions

SanderMuller avatar Nov 13 '24 16:11 SanderMuller

Would also be interested once ARM is supported

DanielGSoftware avatar Nov 26 '24 13:11 DanielGSoftware

Now that we have support: https://github.blog/changelog/2025-01-16-linux-arm64-hosted-runners-now-available-for-free-in-public-repositories-public-preview/

Tracking the work required for this here

  • [X] Add support in php-builder
  • [x] Add builds in php-builder
  • [x] Add support in php-ubuntu
  • [x] Add builds in php-ubuntu
  • [x] Add support in php5-ubuntu
  • [x] Add builds in php5-ubuntu
  • [x] Test using setup-php

shivammathur avatar Jan 16 '25 20:01 shivammathur

It should work now. Test workflow: https://github.com/shivammathur/test-setup-php/actions/runs/12842826517/workflow

Added in https://github.com/shivammathur/php-builder/commit/792acf0effd942bfd414582d80ecc7e30e0b5acc, https://github.com/shivammathur/php-ubuntu/commit/d528fb9a5c1485fdd42cb3129a266d014b56279a and https://github.com/shivammathur/php5-ubuntu/commit/0dcff0821349a2a49579d40781cf612d19eedaec

Please report any issues you face.

shivammathur avatar Jan 18 '25 09:01 shivammathur