Skip to content

[WIP] Update .travis.yml for PHP 7 #45

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

Merged
merged 3 commits into from
Mar 8, 2016
Merged

[WIP] Update .travis.yml for PHP 7 #45

merged 3 commits into from
Mar 8, 2016

Conversation

cebe
Copy link
Contributor

@cebe cebe commented Mar 1, 2016

@@ -298,7 +298,7 @@ private function unsubscribeStreamEvent($stream, $flag)
*/
private function createTimerCallback()
{
$this->timerCallback = function ($_, $_, $timer) {
$this->timerCallback = function ($_, $__, $timer) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see why we would want this change, but for the reference only: Afaict this line is currently untested because the libevent extension does not (currently) compile under PHP 7, right?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep, right. The code crashes because of this line when you try to include
this class. That's something that static analysis tools can stumble upon.

So this fixes that. But there's not actually a way to run this
implementation on PHP 7.

On Tuesday, 1 March 2016, Christian Lück [email protected] wrote:

In src/LibEventLoop.php
#45 (comment):

@@ -298,7 +298,7 @@ private function unsubscribeStreamEvent($stream, $flag)
*/
private function createTimerCallback()
{

  •    $this->timerCallback = function ($_, $_, $timer) {
    
  •    $this->timerCallback = function ($_, $__, $timer) {
    

I see why we would want this change, but for the reference only: Afaict
this line is currently untested because the libevent extension does not
compile under PHP 7, right?


Reply to this email directly or view it on GitHub
https://github.com/reactphp/event-loop/pull/45/files#r54551382.

Ondřej Mirtes

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the confirmation, your reasoning makes perfect sense 👍

@clue
Copy link
Member

clue commented Mar 1, 2016

Changes LGTM :shipit: Thanks for digging into this @cebe and @ondrejmirtes!

@WyriHaximus
Copy link
Member

LGTM :shipit: Thanks for working this out 👍

@clue
Copy link
Member

clue commented Mar 2, 2016

Unfortunately, Travis still reports one error for PHP 7.. Can anybody look into why this test case fails despite working for other platforms? Thanks!

@cebe
Copy link
Contributor Author

cebe commented Mar 3, 2016

@clue will check if I find out what is wrong there.

@cebe
Copy link
Contributor Author

cebe commented Mar 3, 2016

Here are a few facts I found out, though I am not 100% sure how to fix it.

  • pecl event extension does not support in memory php streams. This was already a known problem and is described in the test case:
    public function createStream()
    {
    // Use a FIFO on linux to get around lack of support for disk-based file
    // descriptors when using the EPOLL back-end.
    if ('Linux' === PHP_OS) {
    $this->fifoPath = tempnam(sys_get_temp_dir(), 'react-');
    unlink($this->fifoPath);
    posix_mkfifo($this->fifoPath, 0600);
    $stream = fopen($this->fifoPath, 'r+');
    // ext-event (as of 1.8.1) does not yet support in-memory temporary
    // streams. Setting maxmemory:0 and performing a write forces PHP to
    // back this temporary stream with a real file.
    //
    // This problem is mentioned at https://bugs.php.net/bug.php?id=64652&edit=3
    // but remains unresolved (despite that issue being closed).
    } else {
    $stream = fopen('php://temp/maxmemory:0', 'r+');
    fwrite($stream, 'x');
    ftruncate($stream, 0);
    }
    return $stream;
    }
  • the testCanUseReadableStreamWithFeatureFds() test was added later and creates the stream itself. If I let it use createStream() method it does not fail anymore on php5 so I assume that this is not correct.
  • The PHP5 implementation of the event extension was either working with in memory streams, or just ignored this case. I was not able to find that out for sure.
  • The PHP7 implementation has an explicit check for in memory streams and fails for this. https://bitbucket.org/osmanov/pecl-event/commits/3d01b68ca44836a45fdba6ce6abc3bbff0f25494#Lphp7/src/util.cT39

I'd assume that this feature is working in php5 but not yet supported in php7?
I suggest to mark this test as skipped on php7 for now.

@cebe
Copy link
Contributor Author

cebe commented Mar 3, 2016

maybe @steverhoades (e4d6c7b) can give some input on what this test should do and why it is not using createStream()?

@cboden cboden added this to the v0.4.2 milestone Mar 3, 2016
cebe added a commit to cebe/event-loop that referenced this pull request Mar 4, 2016
do not merge yet, this currently fails on various combinations of php versions,
I'd like to fix it after reactphp#45 is merged to have tests
run against all systems.
@cebe
Copy link
Contributor Author

cebe commented Mar 4, 2016

I have also added a commit that fixes HHVM builds so we can remove them from "allow failures" on travis: df86c7b, see also #24

cebe and others added 3 commits March 4, 2016 01:19
- there is no `hhvm-nightly` anymore on travis travis-ci/travis-ci#3788 (comment)
- add php 7
   - `event` extension works
   - `libev` does not support PHP 7 (yet?) m4rw3r/php-libev#8
   - `libevent` also does not support PHP 7 https://pecl.php.net/package/libevent
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.

5 participants