Skip to content

Commit

Permalink
Merge branch 'php/8.1' into php/8.2
Browse files Browse the repository at this point in the history
  • Loading branch information
dktapps committed Jul 11, 2023
2 parents ca82842 + e6e2814 commit 5e8752a
Show file tree
Hide file tree
Showing 3 changed files with 187 additions and 144 deletions.
20 changes: 12 additions & 8 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,18 +40,20 @@ jobs:
# Used "set -ex" instead of hashbang since script isn't executed with hashbang
set -ex
trap "exit 1" ERR
./compile.sh -t linux64 -j 4 -f -g -P ${{ matrix.pm-version-major }} -c ./download_cache
./compile.sh -t linux64 -j 4 -g -P ${{ matrix.pm-version-major }} -c ./download_cache -D
- name: Create tarball
run: tar -czf ./PHP-Linux-x86_64-PM${{ matrix.pm-version-major }}.tar.gz bin

run: |
tar -czf ./PHP-Linux-x86_64-PM${{ matrix.pm-version-major }}.tar.gz bin
tar -czf ./PHP-Linux-x86_64-PM${{ matrix.pm-version-major }}-debugging-symbols.tar.gz bin-debug
- name: Upload artifacts
uses: actions/upload-artifact@v3
if: always()
with:
name: Linux-PM${{ matrix.pm-version-major }}
path: |
./PHP-Linux-x86_64-PM${{ matrix.pm-version-major }}.tar.gz
./PHP-Linux-x86_64-PM${{ matrix.pm-version-major }}*.tar.gz
install.log
compile.sh
if-no-files-found: error
Expand Down Expand Up @@ -95,18 +97,20 @@ jobs:
export PATH="/usr/local/opt/bison/bin:$PATH"
set -ex
trap "exit 1" ERR
./compile.sh -t mac-x86-64 -j4 -f -g -P ${{ matrix.pm-version-major }} -c ./download_cache
./compile.sh -t mac-x86-64 -j4 -g -P ${{ matrix.pm-version-major }} -c ./download_cache -D
- name: Create tarball
run: tar -czf ./PHP-MacOS-x86_64-PM${{ matrix.pm-version-major }}.tar.gz bin
run: |
tar -czf ./PHP-MacOS-x86_64-PM${{ matrix.pm-version-major }}.tar.gz bin
tar -czf ./PHP-MacOS-x86_64-PM${{ matrix.pm-version-major }}-debugging-symbols.tar.gz bin-debug
- name: Upload artifacts
uses: actions/upload-artifact@v3
if: always()
with:
name: MacOS-PM${{ matrix.pm-version-major }}
path: |
./PHP-MacOS-x86_64-PM${{ matrix.pm-version-major }}.tar.gz
./PHP-MacOS-x86_64-PM${{ matrix.pm-version-major }}*.tar.gz
install.log
compile.sh
if-no-files-found: error
Expand Down Expand Up @@ -147,7 +151,7 @@ jobs:
- name: Rename artifacts
run: |
mkdir temp
move php-debug-pack-*.zip temp/PHP-Windows-x64-debug-pack-PM${{ matrix.pm-version-major }}.zip
move php-debug-pack-*.zip temp/PHP-Windows-x64-PM${{ matrix.pm-version-major }}-debugging-symbols.zip
move php-*.zip temp/PHP-Windows-x64-PM${{ matrix.pm-version-major }}.zip
move temp\*.zip .
Expand Down
41 changes: 20 additions & 21 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
Bash script used to compile PHP on MacOS and Linux platforms. Make sure you have ``make autoconf automake libtool m4 wget getconf gzip bzip2 bison g++ git cmake pkg-config re2c ca-certificates``.

### Recommendations
- `-f` makes the compiled binary much faster, don't forget to use it if you're targeting production.
- If you're going to use the compiled binary only on the machine you're build it on, remove the `-t` option for best performance - this will allow the script to optimize for the current machine rather than a generic one.
- [`ext-gd2`](https://www.php.net/manual/en/book.image.php) is NOT included unless the `-g` flag is provided, as PocketMine-MP doesn't need it. However, if your plugins need it, don't forget to enable it using `-g`.
- The `-c` and `-l` options can be used to specify cache folders to speed up recompiling if you're recompiling many times (e.g. to improve the script).
Expand All @@ -26,29 +25,29 @@ Bash script used to compile PHP on MacOS and Linux platforms. Make sure you have
- The `aarch64-linux-musl` toolchain is required. You can compile and install it using https://github.com/pmmp/musl-cross-make (PMMP fork includes musl-libc patches for DNS resolver config path and increasing stack size limit for LevelDB)
- It is strongly recommended that you enable abusive optimizations for Android targets (`-f` flag) for best performance.

| Script flags | Description |
|--------------|----------------------------------------------------------------------------------------------------|
| -c | Uses the folder specified for caching downloaded tarballs, zipballs etc. |
| -d | Will compile with debug and the xdebug PHP extension |
| -f | Enable optimizations (increases compile time, but improves performance) |
| -g | Will compile GD2 |
| -j | Set make threads to # |
| -l | Uses the folder specified for caching compilation artifacts (useful for rapid rebuild and testing) |
| -n | Don't remove sources after completing compilation |
| -s | Will compile everything statically |
| -t | Set target |
| -v | Enable Valgrind support in PHP |
| -x | Specifies we are doing cross-compile |
| -P | Compiles extensions for the major PocketMine-MP version specified (can be `4` or `5`) |
| Script flags | Description |
|--------------|-------------------------------------------------------------------------------------------------------------|
| -c | Uses the folder specified for caching downloaded tarballs, zipballs etc. |
| -d | Compiles with debugging symbols and disables optimizations (slow, but useful for debugging segfaults) |
| -D | Compiles with separated debugging symbols, but leaves optimizations enabled (used for distributed binaries) |
| -g | Will compile GD2 |
| -j | Set make threads to # |
| -l | Uses the folder specified for caching compilation artifacts (useful for rapid rebuild and testing) |
| -n | Don't remove sources after completing compilation |
| -s | Will compile everything statically |
| -t | Set target |
| -v | Enable Valgrind support in PHP |
| -x | Specifies we are doing cross-compile |
| -P | Compiles extensions for the major PocketMine-MP version specified (can be `4` or `5`) |

### Example:

| Target | Arguments |
|-----------------|--------------------------------------|
| linux64 | ``-t linux64 -j4 -P5 -f`` |
| linux64, PM4 | ``-t linux64 -j4 -P4 -f`` |
| mac64 | ``-t mac-x86-64 -j4 -P5 -f`` |
| android-aarch64 | ``-t android-aarch64 -x -j4 -P5 -f`` |
| Target | Arguments |
|-----------------|-----------------------------------|
| linux64 | ``-t linux64 -j4 -P5`` |
| linux64, PM4 | ``-t linux64 -j4 -P4`` |
| mac64 | ``-t mac-x86-64 -j4 -P5`` |
| android-aarch64 | ``-t android-aarch64 -x -j4 -P5`` |

## windows-compile-vs.bat

Expand Down
Loading

0 comments on commit 5e8752a

Please sign in to comment.