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

Add build configuration for php 5.5 #5

Merged
merged 6 commits into from
Mar 17, 2021

Conversation

glensc
Copy link
Contributor

@glensc glensc commented Mar 10, 2021

Based on 5.3 config.

To build locally:

export DOCKER_BUILDKIT=1
export BUILDKIT_STEP_LOG_MAX_SIZE: -1
export BUILDKIT_STEP_LOG_MAX_SPEED: -1
docker build --build-arg=PHP_VERSION=5.3 -t php-5.3 .
docker build --build-arg=PHP_VERSION=5.5 -t php-5.5 .

This does not add any CI integration.

@glensc
Copy link
Contributor Author

glensc commented Mar 10, 2021

@shivammathur sorry, I forgot about this.

I've left out CI integration, as I don't have really place to test it and you may want to simplify it and I don't know how you intend to invoke the building.

Here's some draft with merge conflicts that you may use as starting point

Click to open diff
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index 2ad8bfb..24ff68b 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -5,36 +5,39 @@ on:
       build-php53:
         description: Whether to build PHP 5.3
         required: true
+      build-php55:
+        description: Whether to build PHP 5.5
+        required: true
   push:
 jobs:
-  build53:
+  build-php:
     if: "!contains(github.event.head_commit.message, 'skip-build')"
-    name: Build PHP 5.3
+    name: Build PHP ${{ matrix.php-version }}
     runs-on: ${{ matrix.operating-system }}
     strategy:
       fail-fast: false
       matrix:
         operating-system: [ubuntu-20.04]
-        php-version: ['5.3']
+        php-version: ['5.3', '5.5']
     steps:
-      - name: Checkout
-        if: github.event.inputs.build-php53 == 'true' || contains(github.event.head_commit.message, 'build-php5.3')
+      - name: "Checkout ${{ matrix.php-version }}"
+        if: github.event.inputs.build-php53 == 'true' || contains(github.event.head_commit.message, 'build-php5.3') || github.event.inputs.build-php55 == 'true' || contains(github.event.head_commit.message, 'build-php5.5')
         uses: actions/checkout@v2
 
-      - name: Build
-        if: github.event.inputs.build-php53 == 'true' || contains(github.event.head_commit.message, 'build-php5.3')
+      - name: "Build ${{ matrix.php-version }}"
+        if: github.event.inputs.build-php53 == 'true' || contains(github.event.head_commit.message, 'build-php5.3') || github.event.inputs.build-php55 == 'true' || contains(github.event.head_commit.message, 'build-php5.5')
         env:
           BUILDKIT_STEP_LOG_MAX_SIZE: -1
           BUILDKIT_STEP_LOG_MAX_SPEED: -1
           DOCKER_BUILDKIT: 1
           PHP_VERSION: ${{ matrix.php-version }}
         run: |
-          docker build . --build-arg=PHP_VERSION=$PHP_VERSION -t php-$PHP_VERSION
+          docker build . -f php-$PHP_VERSION/Dockerfile -t php-PHP_VERSION
           docker run --name=php-$PHP_VERSION php-$PHP_VERSION sh -c exit
           sudo chmod 777 /usr/local
           docker cp php-$PHP_VERSION:/usr/local/php /usr/local/php
 
-      - name: Ship
+      - name: "Ship PHP 5.3"
         if: github.event.inputs.build-php53 == 'true' || contains(github.event.head_commit.message, 'build-php5.3')
         run: bash .github/scripts/build.sh ship
         env:
@@ -42,14 +45,34 @@ jobs:
           GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
           GITHUB_WORKSPACE: ${{ github.workspace }}
 
-      - name: Upload Artifact
+      - name: "Ship PHP 5.5"
+        if: github.event.inputs.build-php55 == 'true' || contains(github.event.head_commit.message, 'build-php5.5')
+        run: bash .github/scripts/build.sh ship
+        env:
+          PHP_VERSION: ${{ matrix.php-version }}
+          BINTRAY_USER: ${{ secrets.BINTRAY_USER }}
+          BINTRAY_KEY: ${{ secrets.BINTRAY_KEY }}
+          BINTRAY_REPO: php
+
+      - name: "Upload Artifact: PHP 5.3"
         if: github.event.inputs.build-php53 == 'true' || contains(github.event.head_commit.message, 'build-php5.3')
         uses: actions/upload-artifact@v2
         with:
           name: php5.3
+<<<<<<< Updated upstream
           path: ${{ github.workspace }}/php-5.3-build.tar.zst
+=======
+          path: /usr/local/php/php-5.3-build.tar.zst
+
+      - name: "Upload Artifact: PHP 5.5"
+        if: github.event.inputs.build-php55 == 'true' || contains(github.event.head_commit.message, 'build-php5.5')
+        uses: actions/upload-artifact@v2
+        with:
+          name: php5.5
+          path: /usr/local/php/php-5.5-build.tar.zst
+>>>>>>> Stashed changes
   test:
-    needs: build53
+    needs: build-php
     name: Test PHP-${{ matrix.php-versions }} on ${{ matrix.operating-system }}
     runs-on: ${{ matrix.operating-system }}
     strategy:
@@ -67,6 +90,10 @@ jobs:
         env:
           GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
 
+      - name: Fetch PHP 5.5
+        if: matrix.php-versions == '5.5'
+        run: curl -o php-5.5/php-5.5.tar.zst -sL https://dl.bintray.com/shivammathur/php/php-5.5-build.tar.zst
+
       - name: Install PHP
         run: |
           sudo ln -sf $(pwd)/php-${{ matrix.php-versions }} /tmp/php-${{ matrix.php-versions }}
@@ -113,7 +140,12 @@ jobs:
         run: |
           bash .github/scripts/install_zstd.sh
           mkdir builds
+<<<<<<< Updated upstream
           gh release download -p 'php-5.3-build.tar.zst' -D php-5.3
+=======
+          curl -o php-5.3/php-5.3.tar.zst -sL https://dl.bintray.com/shivammathur/php/php-5.3-build.tar.zst
+          curl -o php-5.5/php-5.5.tar.zst -sL https://dl.bintray.com/shivammathur/php/php-5.5-build.tar.zst
+>>>>>>> Stashed changes
           for v in 5.3 5.4 5.5; do
             sudo XZ_OPT=-e9 tar cfJ php-$v.tar.xz php-$v
             sudo tar cf - php-$v | zstd -22 -T0 --ultra > php-$v.tar.zst
@@ -140,6 +172,12 @@ jobs:
       - name: Release
         run: |
           set -x
+<<<<<<< Updated upstream
+=======
+          find ./builds -name php53.tar.gz -delete || true
+          find ./builds -name php55.tar.gz -delete || true
+          curl -o install.sh -sL https://dl.bintray.com/shivammathur/php/php5-ubuntu.sh
+>>>>>>> Stashed changes
           assets=()
           for asset in ./builds/*; do
             assets+=("$asset")

@glensc
Copy link
Contributor Author

glensc commented Mar 10, 2021

also: please don't squash merge!

@glensc glensc marked this pull request as ready for review March 10, 2021 22:34
@shivammathur
Copy link
Owner

@glensc
Nice, I will have a look at this PR next week Tuesday.
For PHP 5.4, will you work on another PR?

@glensc
Copy link
Contributor Author

glensc commented Mar 10, 2021

For PHP 5.4, will you work on another PR?

yes, no problem. once this is merged and integrated.

@staabm
Copy link

staabm commented Mar 13, 2021

may I ask what the implications are of supporting php 5.5 in this repo (like the PR suggests)?
does this speedup setup on newer ubuntu versions?

@glensc
Copy link
Contributor Author

glensc commented Mar 13, 2021

@staabm: php 5.5 already exists, but via .deb packages. using php-build creates more manageable version of old version. adds (better) way to add patches to backport broken functionality.

and yes, it may be speedier to download and unpack one tar.xz than add deb repo, update deb repo, install N .deb packages.

My vision:

@shivammathur shivammathur merged commit 90e5b30 into shivammathur:master Mar 17, 2021
@glensc glensc deleted the build-php55 branch March 18, 2021 08:51
@glensc
Copy link
Contributor Author

glensc commented Mar 18, 2021

@shivammathur could you ping me when you add CI integration, or even better, create PR with it and tag me there. I'm interested in how you are solving the problem of setting up CI for both versions build :)

@shivammathur
Copy link
Owner

@glensc

  • Fixed CI and other install scripts in 4683465.
    Also added PHP 5.4.
    Now all three PHP versions are built from source in the first job and artifacts from that are uploaded to the builds release. Then next job tests those artifacts in each ubuntu version. Third job packages them and the fourth uploads them to the builds release.

  • In 97f5150 added some extensions which were in previous builds or available via dotdeb ppa.

  • I have not run the release job yet in CI, I think once we add the patches for known bugs then the release can be created, otherwise there might be breaking changes.

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

Successfully merging this pull request may close these issues.

3 participants