-
Notifications
You must be signed in to change notification settings - Fork 7.8k
Docs/php win build local and remote #12179
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
Docs/php win build local and remote #12179
Conversation
Firebird.zip | ||
hMailServer.exe |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These two uglies showed up on my local
@@ -91,16 +92,16 @@ rem work-around for failing to dl(mysqli) with OPcache (https://github.com/php/p | |||
if "%OPCACHE%" equ "1" set OPCACHE_OPTS=%OPCACHE_OPTS% -d extension=mysqli | |||
|
|||
rem prepare for enchant | |||
mkdir %~d0\usr\local\lib\enchant-2 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
%~d0 apparently means current drive. I believe using C:\ will make this more readable
@@ -77,7 +78,7 @@ if "%PLATFORM%" == "x64" ( | |||
if /i "%GITHUB_ACTIONS%" equ "True" ( | |||
rmdir /s /q %OPENSSLDIR% >nul 2>&1 | |||
) | |||
mkdir %OPENSSLDIR% | |||
if NOT exist %OPENSSLDIR% mkdir %OPENSSLDIR% |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is what passes for mkdir -p
in windows 🤮
@@ -54,7 +55,7 @@ set PDOTEST_DSN=odbc:%ODBC_TEST_DSN% | |||
|
|||
rem setup Firebird related exts | |||
curl -sLo Firebird.zip https://github.com/FirebirdSQL/firebird/releases/download/v3.0.9/Firebird-3.0.9.33560-0_x64.zip | |||
7z x -oC:\Firebird Firebird.zip | |||
7z x -yoC:\Firebird Firebird.zip |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To be able to run multiple times, I just tell 7zip (undocumented dependency btw) to answer yes to all (overwrites existing)
if %errorlevel% neq 0 exit /b 3 | ||
|
||
rem setup PostgreSQL related exts | ||
set PGUSER=postgres | ||
set PGPASSWORD=Password12! | ||
rem set PGSQL_TEST_CONNSTR=host=127.0.0.1 dbname=test port=5432 user=postgres password=Password12! | ||
git checkout "./ext/pgsql/tests/config.inc" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
without this the config.inc gets constantly appended to. This ensures there is one line 😄
set PATH=%PATH%;%PGBIN% | ||
psql -U postgres -c "DROP SCHEMA IF EXISTS test" | ||
psql -U postgres -c "CREATE SCHEMA IF NOT EXISTS test" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you'll see this pattern copied with mysql. Basically the createdb command does not exist on my local install of postgres. This makes sure there is a schema and that it's fresh. It also uses path so if the path explicitly supplied did exist, then we can use that set of binaries. But respects user paths if not.
set PATH=%PATH%;C:\mysql\bin | ||
mysql.exe --host=%PDO_MYSQL_TEST_HOST% --port=%MYSQL_TEST_PORT% --user=%MYSQL_TEST_USER% --password=%MYSQL_TEST_PASSWD% -e "CREATE DATABASE IF NOT EXISTS test" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No idea why C:\mysql is expected, but chocolatey doesn't set it up, so here is a workaround to allow GH actions to work at the same time as allowing any mysql cli binary to be executed
powershell -Command wget http://windows.php.net/downloads/qa/appveyor/ext/enchant/dict.zip -OutFile dict.zip | ||
unzip dict.zip | ||
unzip -o dict.zip |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overwrite files when unzipping
0900d37
to
bbdf4f4
Compare
set OPCACHE=1 | ||
|
||
set GITHUB_ACTIONS=True | ||
set BRANCH=master |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
adjust to whatever command you like; I forgot the one-liner to get the currently checked out git branch is all
No idea what travis is doing, but it seems to be running different checks on this run, to last run |
d8c7ae0
to
599eb2b
Compare
599eb2b
to
99740ef
Compare
@Lewiscowles1986 Are you using this PR for testing purposes? Since you've never contributed GitHub actions requires manual triggering of CI. It might be easier in this case if you open a PR against your own fork. GitHub actions should work there. |
Hey, well I'm running on my computer and it's working, but as I don't have access to your runners, or all the setup, this is trying to work out why it's failing. You'll notice ARM and FREEBSD are now failing, but this runs from windows. I have not touched any shared files. The CI is a bin-fire. |
@Lewiscowles1986 The cirrus jobs are broken atm. I can trigger GitHub actions for you, but this will have to be done for every commit until you are a contributor (i.e. the first PR has been merged), which is why I'm suggesting to open it against your own fork. |
I changed our policy, if your GitHub account isn't new the actions should run from now on. |
Right this builds on my local as well as on Windows here (no idea what the flakes for OSX are); Anyone care to review (and discuss as necessary)? If this is acceptable, then I can start to work on notes for folks that want to build. |
@@ -54,7 +55,7 @@ set PDOTEST_DSN=odbc:%ODBC_TEST_DSN% | |||
|
|||
rem setup Firebird related exts | |||
curl -sLo Firebird.zip https://github.com/FirebirdSQL/firebird/releases/download/v3.0.9/Firebird-3.0.9.33560-0_x64.zip | |||
7z x -oC:\Firebird Firebird.zip | |||
7z x -y -oC:\Firebird Firebird.zip |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this flag answers yes to overwriting files if run more than once. As a result the cleanup.bat and other such scripts provide improvement (can't remove or overwrite if firebird exists, which it never will in GitHub actions)
Can you clarify what the goal is? The bat scripts you added are never called. |
I Can remove the batch files I never called.
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm still somewhat lost on what the purpose of these changes are. Are they for simpler building on Windows on a local machine? If so, I'm not sure they should live under .github
. Furthermore, in that case we should document how/when to run those scripts, rather than just dumping them in the project. Please provide some more information on the intent.
powershell -Command wget http://windows.php.net/downloads/qa/appveyor/ext/enchant/dict.zip -OutFile dict.zip | ||
unzip dict.zip | ||
unzip -o dict.zip | ||
del /q dict.zip | ||
popd |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we want to use this locally we should separate installation (i.e. downloading of libs, unzipping, etc.) into a separate script that doesn't have to be run every time PHP is built.
Closing this out in favor of other PR's |
This is mostly documentation. It should not substantively affect the Github actions runner. It's part of my investigations into "[How] does Windows build work?"
permalink