Topic: Help recompiling mysqlnd for PHP 7.3.4/5 with small change.

Hi,

I have submitted a PHP bug (https://bugs.php.net/bug.php?id=77955) and was suggested to recompile mysqlnd without a specific commit in order to confirm the origin of my segfault.

In order to change as few variables as possible i would like to recompile the "php-mysqlnd-7.3.4-1.el7.remi.x86_64"-package and maybe just change the mysqlnd.so library on the production server to see if it fixes the issue.

However i fail to find the source rpm, or any info regarding how to rebuild exact replicas of remi packages.

Any help will be greatly appreciated smile

Kind regards.

Re: Help recompiling mysqlnd for PHP 7.3.4/5 with small change.

> However I fail to find the source rpm,

On the repository page, see the Sources RPM link (bottom of the page)

> or any info regarding how to rebuild exact replicas of remi packages.

On the same page there is the link to the git repo
including all the mock configuration file I use:

https://git.remirepo.net/cgit/tools/mock.git/

Laptop:  Fedora 38 + rpmfusion + remi (SCL only)
x86_64 builder: Fedora 39 + rpmfusion + remi-test
aarch64 builder: RHEL 9 with EPEL
Hosting Server: CentOS 8 Stream with EPEL, rpmfusion, remi

Re: Help recompiling mysqlnd for PHP 7.3.4/5 with small change.

Hi Remi,

Thank you for your reply and the links smile

I was confused by the fact the php-mysqlnd was a part of the main php73 package and not a standalone package but that's now resolved.

But i hope you will provide a few more clues, as i'm not well-versed in packaging i don't know what i'm doing wrong, i'm trying to build the source rpm using mock and your provided config (el7x)

But i get the error (when "rebuild"-ing):
BUILDSTDERR: error: Failed to initialize NSS library
For the command:
/bin/rpm -Uvh --nodeps /builddir/build/originals/php73-php-7.3.4-1.remi.src.rpm

I'm running it on a clone of the server exhibiting the segfault (CentOS 7.6 x86_64).

I believe the problem is a fundamental issue with the mock environment, due to my lack of knowledge in the field, could you please point me to some info regarding how to setup your build environment?

Kind regards,
Victoria

4 (edited by VictoriaShark 2019-05-06 13:28:14)

Re: Help recompiling mysqlnd for PHP 7.3.4/5 with small change.

For reference, this is the complete list of commands i have run on the server (i know i shouldn't build as root but i just need to get things working, the clone VM will be discarded afterwards anyway):

cd
mkdir remi
cd remi

yum install php-devel-7.3.4-1.el7.remi
yum install mock

git clone ht+tps://git.remirepo.net/cgit/rpms/php/php73.git
git clone ht+tps://git.remirepo.net/cgit/tools/mock.git

wget ht+tps://www.php.net/distributions/php-7.3.4.tar.bz2

wget ht+tps://rpms.remirepo.net/SRPMS/php73-php-7.3.4-1.remi.src.rpm

edit el7x.cfg
    Generate repo list
        cat /etc/yum.repos.d/*
        
        *remove all disabled repos*
        
        replace
            $basearch --> x86_64
            $releasever --> 7
            
        Change repolist in el7x.cfg
        
usermod -a -G mock root

mkdir -p /builddir/build/originals

cp php73-php-7.3.4-1.remi.src.rpm /builddir/build/originals/
        
mock --configdir=./mock -r el7x --init

mock --configdir=./mock -r el7x rebuild php73-php-7.3.4-1.remi.src.rpm

Re: Help recompiling mysqlnd for PHP 7.3.4/5 with small change.

Interesting

Re: Help recompiling mysqlnd for PHP 7.3.4/5 with small change.

eloboosta wrote:

Interesting

That wasn't very helpful, do you have anything constructive to add?

Re: Help recompiling mysqlnd for PHP 7.3.4/5 with small change.

1st, you must use the right SRPM, which is php-7.3.5, not php73-php-7.3.5

Laptop:  Fedora 38 + rpmfusion + remi (SCL only)
x86_64 builder: Fedora 39 + rpmfusion + remi-test
aarch64 builder: RHEL 9 with EPEL
Hosting Server: CentOS 8 Stream with EPEL, rpmfusion, remi

Re: Help recompiling mysqlnd for PHP 7.3.4/5 with small change.

I used the php73_* one because php-7.3.4 no longer exists, thought it would be the same. (want to stay on 7.3.4 so my coredumps continue to stay valid)

However, I have tried php-7.3.5 now, but it fails with the very same error message: Failed to initialize NSS library

Mock excerpt:

# mock --configdir=./mock -r el7x rebuild php-7.3.5-1.remi.src.rpm
INFO: mock.py version 1.4.15 starting (python version = 2.7.5)...
Start: init plugins
INFO: selinux disabled
Finish: init plugins
Start: run
INFO: Start(php-7.3.5-1.remi.src.rpm)  Config(el7x)
Start: clean chroot
Finish: clean chroot
Start: chroot init
INFO: calling preinit hooks
INFO: enabled root cache
Start: unpacking root cache
Finish: unpacking root cache
INFO: enabled yum cache
Start: cleaning yum metadata
Finish: cleaning yum metadata
INFO: enabled ccache
INFO: enabled HW Info plugin
Mock Version: 1.4.15
INFO: Mock Version: 1.4.15
Start: yum update
Failed to set locale, defaulting to C
... snip yum update...
Finish: yum update
Finish: chroot init
Start: build phase for php-7.3.5-1.remi.src.rpm
Start: build setup for php-7.3.5-1.remi.src.rpm
ERROR: Exception(php-7.3.5-1.remi.src.rpm) Config(el7x) 0 minutes 31 seconds
INFO: Results and/or logs in: /var/lib/mock/el7x
ERROR: Command failed:
# /bin/rpm -Uvh --nodeps /builddir/build/originals/php-7.3.5-1.remi.src.rpm


cat /var/lib/mock/el7x/root.log:

...
DEBUG util.py:585:    python2-rpm-macros.noarch 0:3-24.el7
DEBUG util.py:732:  Child return code was: 0
DEBUG util.py:222:  touching file: /dev/shm/el7x/root/.initialized
DEBUG util.py:751:  child environment: None
DEBUG util.py:677:  Executing command: ['/bin/rpm', '-Uvh', '--nodeps', '/builddir/build/originals/php-7.3.5-1.remi.src.rpm'] with env {'LANG': 'en_US.UTF-8', 'TERM': 'vt100', 'SHELL': '/bin/bash', 'HOSTNAME': 'mock', 'PROMPT_COMMAND': 'printf "\\033]0;<mock-chroot>\\007"', 'PATH': '/usr/bin:/bin:/usr/sbin:/sbin', 'CCACHE_DIR': '/var/tmp/ccache', 'PS1': '<mock-chroot> \\s-\\v\\$ ', 'HOME': '/builddir', 'CCACHE_UMASK': '002'} and shell False
DEBUG util.py:583:  BUILDSTDERR: error: Failed to initialize NSS library
DEBUG util.py:732:  Child return code was: 1
...

Re: Help recompiling mysqlnd for PHP 7.3.4/5 with small change.

Sorry, never encounter this issue.

Laptop:  Fedora 38 + rpmfusion + remi (SCL only)
x86_64 builder: Fedora 39 + rpmfusion + remi-test
aarch64 builder: RHEL 9 with EPEL
Hosting Server: CentOS 8 Stream with EPEL, rpmfusion, remi