Support for self compiled builds from master branch
shivammathur opened this issue · comments
Will it be possible to support functions other than Install-Php
for builds from master branch.
I think it will need adjusting ZEND_MODULE_API_NO
and UNSTABLEPHP_RX
and their use to support the 8.0.0-dev
version. I want to use functions other than Install-Php
like Enable-PhpExtension
, Update-PhpCAInfo
and Set-PhpIniKey
on the same.
You can move the check to give the error for this version from PhpVersion
to Install-Php
till alpha1
is tagged.
I agree that it'd be nice.
I see some problems though...
- people may want to install a development version from https://windows.php.net/snapshots#php-master or from a local directory
For that reason, I'd add a-FromPath
option to theInstall-Php
command. If it's specified, we'll look in that folder, otherwise we'll look in the relevant https://windows.php.net page, that is
- https://windows.php.net/downloads/releases/ and https://windows.php.net/downloads/releases/archives/ for stable PHP releases
- https://windows.php.net/downloads/qa/ for alpha/beta/RC releases
- https://windows.php.net/downloads/snaps/ for pre-alpha releases (let's call them "snapshots", maybe reading the
json
file available in these directories)
-
the PHP version of the
master
branch changes across time (it's8.0.0-dev
now, but it'll change once 8.0 is branched), so I'd let people install it with a value ofmaster
in the-Version
parameter of theInstall-Php
command. -
the value of
ZEND_MODULE_API_NO
changes across time for development builds in theZend/zend_modules.h
file.
How can we handle it? Should we consider an unknown value (that is, not listed here asmaster
? Or should we create a scheduled job (in TravisCI or in GitHub Actions) that periodically checks the constant value, and rebuilds theInspect-PhpExtension
executables if it changes?
Furthermore, if we install amaster
build, add some extensions to it, then we upgrade themaster
build to a newer version that changes the value of theZEND_MODULE_API_NO
, we'd have a broken PHP installation. Should PhpManager handle this case? Or delegate this check to the users?
-
I agree with your first and second point. Support for snapshot builds in
Install-Php
function will be great. -
For the third point I agree with your suggestion of a placeholder
master
and fetching it fromZend/zend_modules.h
in scripts dealing with extensions.
Something like this should work.
$ZEND_MODULES_H_URL = 'https://raw.githubusercontent.com/php/php-src/master/Zend/zend_modules.h'
if($ZEND_MODULE_API_NO -eq 'master') {
$ZEND_MODULE_API_NO = Invoke-WebRequest -Uri $ZEND_MODULES_H_URL | Select-String -Pattern '#define\sZEND_MODULE_API_NO\s(\d+)' | % {$_.Matches.Groups[1].Value}
}
What about #46 ? It allows users to install and update snapshots (eg 7.4snapshot
, master
) downloading them from https://windows.php.net/downloads/snaps/.
It doesn't allow users to "install" self compiled binaries, but users can copy the relevant files quite easily with simple scripts, and they can use PhpManager to manage them.
Thanks 👍. Works great.
I just released version 1.22 with support for snapshot builds.