Skip to content
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

PEAR roles don't install properly on PHP 7 #5410

Closed
yunosh opened this issue Jan 5, 2016 · 16 comments
Closed

PEAR roles don't install properly on PHP 7 #5410

yunosh opened this issue Jan 5, 2016 · 16 comments
Assignees
Labels

Comments

@yunosh
Copy link

yunosh commented Jan 5, 2016

Installing PEAR roles works fine in any PHP version but 7 and nightly. The installation seems to succeed https://travis-ci.org/horde/horde/jobs/100336432#L276 but the 'horde_dir' configuration item doesn't show up afterwards: https://travis-ci.org/horde/horde/jobs/100336432#L378
Compare to PHP 5 instead: https://travis-ci.org/horde/horde/jobs/100342634#L283

@BanzaiMan
Copy link
Contributor

What do these warnings mean? https://travis-ci.org/horde/horde/jobs/100336432#L294 Is everything in your arsenal PHP 7-compatible?

@yunosh
Copy link
Author

yunosh commented Jan 5, 2016

That's in internal issue with PEAR code. It shouldn't affect this issue though. Also, the PEAR version might be outdated, there's 1.10.1 which is supposed to be fully PHP 7 compatible. That may affect this issue indeed.

@BanzaiMan BanzaiMan added the php label Jan 5, 2016
@BanzaiMan
Copy link
Contributor

PEAR is at version 1.10.1 for the current PHP 7 archive. https://travis-ci.org/BanzaiMan/travis_production_test/builds/100353756#L101.

@yunosh
Copy link
Author

yunosh commented Jan 5, 2016

Well, then it's an issue with Travis. It works fine here with a regular PHP 7 install.

@BanzaiMan
Copy link
Contributor

OK, so those are warnings. The first error is here: https://travis-ci.org/horde/horde/jobs/100336432#L2362

Looks like one of your extensions (horde_lz4, maybe?) is failing to compile.

I don't think this is a Travis CI issue.

@yunosh
Copy link
Author

yunosh commented Jan 5, 2016

The failing compilation doesn't have anything to do with the PEAR role not being installed. The error for the missing role is earlier than the build error: https://travis-ci.org/horde/horde/jobs/100336432#L445

@BanzaiMan
Copy link
Contributor

I guess the issue circles back to the original "warning" in the pear install channel://pear.horde.org/Horde_Role output. Did it really add the channel? In the subsequent pear config-show output, "Base Horde directory" is missing.

Do you get these warnings when you run this command on a clean machine?

@BanzaiMan BanzaiMan reopened this Jan 5, 2016
@yunosh
Copy link
Author

yunosh commented Jan 5, 2016

I may have found the issue. In Travis' PHP 7 installation, the include_path setting of PHP doesn't point to the installation path of PEAR. See https://travis-ci.org/yunosh/travistest#L244 vs. https://travis-ci.org/yunosh/travistest#L210. This would also explain why the originally referenced build fails finally.

@yunosh
Copy link
Author

yunosh commented Jan 5, 2016

And indeed for PHP 5.6 for example those paths not only match, but are also completely different from PHP 7: https://travis-ci.org/yunosh/travistest/jobs/100385159#L126 and https://travis-ci.org/yunosh/travistest/jobs/100385159#L157.
To summarize:

Path PHP 5.6 PHP 7.0
include_path /home/travis/.phpenv/versions/5.6.5/pear /home/travis/.phpenv/versions/7.0.0/share/pear
php_dir /home/travis/.phpenv/versions/5.6.5/pear /home/travis/.phpenv/versions/7.0.0/lib/php/pear

@BanzaiMan
Copy link
Contributor

@yunosh Thanks for the additional information. I'll look into it.

@yunosh
Copy link
Author

yunosh commented Jan 5, 2016

What else I've found is that the original PEAR packages that come pre-installed, are indeed in /home/travis/.phpenv/versions/7.0.0/share/pear. So the fix is to set the php_dir PEAR configuration to that path too.

@BanzaiMan
Copy link
Contributor

Sorry for the long silence. I think this is a problem with the way we currently install PEAR. It is done via a custom expect script, and I suspect some answers to the interactive questions are wrong.

You can see the interaction here: https://travis-ci.org/travis-ci/php-src-builder/jobs/108402919#L269-L312

spawn ./bin/php go-pear.phar
Below is a suggested file layout for your new PEAR installation.  To
change individual locations, type the number in front of the
directory.  Type 'all' to change all of them or simply press Enter to
accept these locations.
 1. Installation base ($prefix)                   : /home/travis/pear
 2. Temporary directory for processing            : /tmp/pear/install
 3. Temporary directory for downloads             : /tmp/pear/install
 4. Binaries directory                            : /home/travis/pear/bin
 5. PHP code directory ($php_dir)                 : /home/travis/pear/share/pear
 6. Documentation directory                       : /home/travis/pear/docs
 7. Data directory                                : /home/travis/pear/data
 8. User-modifiable configuration files directory : /home/travis/pear/cfg
 9. Public Web Files directory                    : /home/travis/pear/www
10. System manual pages directory                 : /home/travis/pear/man
11. Tests directory                               : /home/travis/pear/tests
12. Name of configuration file                    : /home/travis/.pearrc
1-12, 'all' or Enter to continue: 1
(Use $prefix as a shortcut for '/home/travis/pear', etc.)
Installation base ($prefix) [/home/travis/pear] : /home/travis/.phpenv/versions/7.0snapshot
Below is a suggested file layout for your new PEAR installation.  To
change individual locations, type the number in front of the
directory.  Type 'all' to change all of them or simply press Enter to
accept these locations.
 1. Installation base ($prefix)                   : /home/travis/.phpenv/versions/7.0snapshot
 2. Temporary directory for processing            : /tmp/pear/install
 3. Temporary directory for downloads             : /tmp/pear/install
 4. Binaries directory                            : /home/travis/.phpenv/versions/7.0snapshot/bin
 5. PHP code directory ($php_dir)                 : /home/travis/.phpenv/versions/7.0snapshot/share/pear
 6. Documentation directory                       : /home/travis/.phpenv/versions/7.0snapshot/docs
 7. Data directory                                : /home/travis/.phpenv/versions/7.0snapshot/data
 8. User-modifiable configuration files directory : /home/travis/.phpenv/versions/7.0snapshot/cfg
 9. Public Web Files directory                    : /home/travis/.phpenv/versions/7.0snapshot/www
10. System manual pages directory                 : /home/travis/.phpenv/versions/7.0snapshot/man
11. Tests directory                               : /home/travis/.phpenv/versions/7.0snapshot/tests
12. Name of configuration file                    : /home/travis/.pearrc
1-12, 'all' or Enter to continue: 
Beginning install...

@BanzaiMan
Copy link
Contributor

So, we are writing /home/travis/.pearrc, but this file is not in the archive, so perhaps that causes the loss of configuration?

@BanzaiMan
Copy link
Contributor

https://travis-ci.org/BanzaiMan/travis_production_test/jobs/108440226#L166 OK, so that sort of works. But the ext_dir is still wrong. I am not sure where /lib/php comes from, though. I tend to think it is somewhere in php-build, but I'm not entirely certain.

@BanzaiMan BanzaiMan self-assigned this Feb 11, 2016
@BanzaiMan
Copy link
Contributor

I've added $HOME/.pearrc to the archive after compilation, and I think this should work. For a test with the nightly snapshot, see https://travis-ci.org/BanzaiMan/travis_production_test/jobs/108440226#L154-L198.

I've repackaged a few old ones: 7.0.1, 7.0.2, 5.6.17, 5.5.31. And created the new ones: 7.0.3, 5.6.18, and 5.5.32 (these also have aliases 7.0, 5.6, and 5.5, respectively).

The ext_dir seems still a bit off, but that is the directory that exists in the resulting archive (for 7.0.x that I inspected). This needs further testing.

Please test them. Thanks.

yunosh added a commit to horde/horde that referenced this issue Feb 11, 2016
@yunosh
Copy link
Author

yunosh commented Feb 11, 2016

Seems to work just fine now, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants