-
-
Notifications
You must be signed in to change notification settings - Fork 364
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 PHP Mapscript via SWIG #5642
Add PHP Mapscript via SWIG #5642
Conversation
|
I see you need to build SWIG from source to get this to work on Windows. Any idea when a SWIG release is planned that will produce the PHP MapScript? It may also be worth moving the PHP build commands to a separate script file in appveyor.yaml in the future (I'll try to do the same with Python) to keep it easier to read (similar to the Travis script). |
|
It' even worse. I build a developement state of swig (didnt update for a while) for PHP but we still need swig from gisinternals sdk for csharp... it is not possible to use the built swig for csharp because of any other bug. building php would be unnessesary aswell if it was in the sdk or the needed files were available as download somewhere. I really tried a lot of things. look at the commit history of the other PR i already closed and this is only the stuff i pushed to github. |
|
I tried to get the csharp bindings working with a later version of SWIG (as the Python bindings should really be built with Swig > 3.0) - see #5583 In case you are wondering why all the slashes are reversed in the appveyor.yaml paths - CMake throws errors on paths with \t and other command characters. We could maybe use Chocolatey for installation of various dependencies (SWIG, PHP etc), see The existing pull request looks good to me though and can be refined in the future. |
|
I tried chocolatey and installed php but it does not contain dvelopement files |
|
Would it be better if i opened the pullrequest against master or can you switch this when merging? |
|
@AlexanderGabriel - would you be able to open against the master branch? I'll then test locally and see if we can get this merged. |
|
Of course. Working on it right now. I dropped building with PHP 5.5. It isn's supported any more so we don't have to test with it. |
|
@AlexanderGabriel - excellent! |
|
@geographika SWIG 3.0.12 does not solve this problem. it is from january and the fix is from december last year: swig/swig@224bb9e |
|
@AlexanderGabriel - it is possible in Appveyor to leave files/folders between builds which could be done for both SWIG and PHP. Personally I wouldn't be against hosting the compiled files/libs externally and downloading them similar to the SDK. Ideally the PHP libs could be added to the SDK at GISInternals. This would retain the focus of Appveyor on the MapServer build and CI. Maybe it is something to take to the mailing list? |
|
@geographika I already cache the sdk in my working branch (https://github.com/AlexanderGabriel/mapserver/tree/TryToFixAppVeyorAndSpeedup), now working on php. it costs me so much time to wait every time so i think, it's worth it. |
|
I've had a quick attempt to run things locally. A couple of questions. SWIG compiled fine. I presume the patch required for PHP will be in the future SWIG 4.0 release? With regards to the compiling PHP, is it possible to use the binaries at https://windows.php.net/download#php-7.2-ts-VC15-x64 ? Or does this output differ from the Appveyor steps? |
|
Hi Seth, i thought about this today, too. I need current swig "only" for thread-safe php&mapscript on windows. Non-thread-safe mapscript for windows is really unuseful (can't load php it into apache as module for example) but we will for sure not be happy if mapserver relies on unstable software-dependencies. for the cache: php is too big (>1GB) but i hat the idea to delete dependencies after compiling, zipping everything and download it from my server or cache it. depends on what is faster. even don't do a snapshot build saves time. So what i will do now is:
Would that be ok? |
No. This does not contain development header... I tried this in the beginning. A few years ago, php offered headers to download... |
|
this can last a few days more. not sure, what the problem is. i opened an issue at cmake. can't build phpng-mapscript with cmake 3.12.3 but 3.11.4 works: https://gitlab.kitware.com/cmake/cmake/issues/18421 |
|
@AlexanderGabriel - I've sent a mail to the dev list to see if hosting the PHP SDK and downloading to Appveyor is ok. See https://lists.osgeo.org/pipermail/mapserver-dev/2018-October/015511.html Do we need to test all PHP v7 versions on Travis including nightly? Would sticking to just 7.2 be enough, and document this is the "supported/tested" version? I've read through the details in #5557 and the RFC on the approach taken, and have a couple of questions. Is there any easy test test that can be added to verify the build (even just outputting the MapServer version number through PHPNG MapScript)? The php7module.i doesn't contain any custom code - is this because it is unnecessary, or is this something to be added to in the future? We'll get this merged soon! |
Already saw this. Will wait for the merge.
We can drop this. Travis is new to me so i was playing around with it. Thought it would be cool to build against nightly builds ;)
Not sure if i understand this. You have questions to me? Shall we meet in the irc?
Sure. phpinfo() or something and analyze the output. Didn't try something like this yet.
Not sure, why there should be custom code. The interface is defined in mapscript.i. If everything is fine, there must not be any code here? This file exists because @geomunion added some information to phpinfo(). |
|
@geographika Letting CMake download all that stuff would not only clean up the appveyor.yml. It would work even for users when building mapserver. they will not have any work with downloading dependencies... everything is downloaded just in time. even swig-3.0.12 in you csharp module. tar is built in but you can call 7z aswell but users have to install it. repacking mapserver-sdk to tar.gz would solve this. |
|
sorry. wrong button... |
|
The <?php
phpinfo();see: |
|
@AlexanderGabriel - you answered my questions in your above comment - thanks! |
|
I think, we can forget php-mapscriptng on windows for now. At least building it with AppVeyor will fail if we don't change CMake during the build. https://gitlab.kitware.com/cmake/cmake/merge_requests/2448#note_466298 I can prepare CMakeLists.txt so CMake will throw errors on Windows until the right versions of SWIG and CMake are used. This will at least enable users to compile it if they get the latest development states of SWIG and CMake. Until that, we will also not need PHP-SDK somewhere. Hosting it on osgeo.org as suggested by Steve is good. We can change the urls as soon as we got the final urls for the sdk. |
AppVeyor has chocolatey installed. i can install php with cocholatey and it should be easy to install mapscript-module after building and produce some test-output. |
|
New PR here: #5675 |
Hi,
another try.
This will add support for PHP Mapscript via SWIG and it builds with travis and appveyor.
Kind Regards,
Alex