Re: Creating symlink and paths for 8.1.14

Hey Remi,
Sorry to bother you!
I've create a .cfg that has now php81-build, devel and pear but I was wondering how can I generate the rpms of the php.
Until now I've only use mock -r centos-7-aarch64.cfg rebuild <your-srpm>.src.rpm but I think that rebuilds the .src.rpm and it would give me the incorrect path.

so I was wondering how can I produces the new .rpms from my .cfg without rebuild of your package ?

Re: Creating symlink and paths for 8.1.14

Don't understand the question

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

Re: Creating symlink and paths for 8.1.14

Okay!
Let me elaborate;

1. I have a working mock config file centos-7-aarch64.cfg which on dry run mock -r centos-7-aarch64.cfg --init install all the dependencies for PHP 8.1.17 (SCL)
2. I usually build the rpms for C7 aarch this way: mock -r centos-7-aarch64.cfg rebuild php81-php-8.1.17.src.rpm and I get the PHP working but with this path /opt/kkk/php81/etc/root/php.d or php.ini
3. Now with my updated centos-7-aarch64.cfg which includes the php81-build, php81-php-devel, php81-pear which are in my local repo I want to rerun the mock build with the update .cfg but I don't know how.
4. If I run mock -r centos-7-aarch64.cfg rebuild php81-php-8.1.17.remi.src.rpm --define "scl php81" I build the same php with the wrong directory (/opt/kkk/php81/etc/root/php.d) not the one I want which is /etc/opt/kkk/php81/php.d or php.ini

How can I execute the command so I get the rpms build with the correct path when I have all the dependancies in my mock configuration ?

Re: Creating symlink and paths for 8.1.14

In step 2, the "php81-build" package MUST be installed in the buildroot.

Again, see the chroot_setup_cmd config

1. build the php81 main package using

config_opts['chroot_setup_cmd'] = 'install @buildsys-build ccache scl-utils-build devtoolset-10-toolchain ccache'

2. build the php81-php package using

config_opts['chroot_setup_cmd'] = 'install @buildsys-build ccache scl-utils-build devtoolset-10-toolchain ccache php81-build'


You never need the --define "scl php81"  option, which MUST be define in the mock configuration.

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

Re: Creating symlink and paths for 8.1.14

Okay I need to have a separate .cfg for each PHP build. I already have that.

My PHP81 main package has: config_opts['chroot_setup_cmd'] = 'install @buildsys-build ccache devtoolset-10 devtoolset-10-gcc*
My PHP81-php has: config_opts['chroot_setup_cmd'] = 'install @buildsys-build ccache devtoolset-10 devtoolset-10-gcc* rust llvm llvm-devel scl-utils-build scl-utils php-pear php81-build php81-php-devel'

I will add the scl php81 in the mock file. But still I don't understand if I have to go with the options below to produce the fresh set of rpms with the correct path.

mock -r <--template.cfg--> rebuild  php81-8.1-2.remi.src.rpm
mock -r <--tempalte1.cfg--> rebuild php81-php-8.1.17~RC1-1.remi.src.rpm

Re: Creating symlink and paths for 8.1.14

> But still I don't understand if I have to go with the options below to produce the fresh set of rpms with the correct path.

Yes

> 'install @buildsys-build ccache devtoolset-10 devtoolset-10-gcc* rust llvm llvm-devel scl-utils-build scl-utils php-pear php81-build php81-php-devel'

"php81-php-devel" will only be available, in a 3rd step, after being build (and is only an optimization for speed for pecl extension)

BTW a single template is probably enough, it can be changed once the main "php81" package is built, before building the "php81-php"

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

Re: Creating symlink and paths for 8.1.14

Thanks!

I will use two templates for now. Thank you for confirming that rebuild should be the way to go.
Okay, I have to remove from the template php-pear and php81-php-devel and apply them once I have a build php81-php-8.1.17 (scl).

Let see what would happen!

Re: Creating symlink and paths for 8.1.14

Okay! I did what you've told me.
And I think the path is wrong because of this error: warning: Ignoring invalid regex ^/opt/kdg/.*$|%{_root_sysconfdir}/rpm/macros.php81-config$
I think something is wrong with my .cfg.

Re: Creating symlink and paths for 8.1.14

Sorry no idea

My mock configuration works for me
I used it to build some new SCL recently (Fedora 38 or PHP 8.2)
and never encounter such an issue

I really think I give you everything you need
pointer to my configuration files
and way to use it / rebuild

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

Re: Creating symlink and paths for 8.1.14

Thanks! It creates the .rpm even with the warning but then the path is not as I want.
As I've said before the path I get is /opt/kdg/php81/root/etc but what my goal is /etc/opt/kdg/php81.
I will try to figure it out.

Re: Creating symlink and paths for 8.1.14

Morning from what I've managed to gather from this error;

warning: Ignoring invalid regex ^%{_scl_prefix}/.*$|%{_root_sysconfdir}/rpm/macros.php81-config$

What I did was to remove the macros such as _scl_prefix and see If I would get the regex error.
It seems that when I've removed the scl_prefix I still get the regex. Although now I know that I'm not setting the _root_sysconfdir right in the .cfg.

I will keep you updated what I've done to fix the invalid regex.

Re: Creating symlink and paths for 8.1.14

You can ignore this warning
(and you can't fix it without changing scl-utils code)

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

Re: Creating symlink and paths for 8.1.14

Extracting more information from the build.log

The warning/error starts after the tests. I assume this is when the actual .rpms are being built.

Finding  Provides: /bin/sh -c " /usr/bin/grep -v  '/opt/kdg/php81/root/usr/lib64/.*\.so$' | while read FILE; do echo "${FILE}" | /usr/lib/rpm/rpmdeps -P; done | /bin/sort -u "
warning: Ignoring invalid regex ^/opt/kdg/.*$|%{_root_sysconfdir}/rpm/macros.php81-config

and

Finding  Requires: /bin/sh -c "  while read FILE; do echo "${FILE}" | /usr/lib/rpm/rpmdeps -R; done | /bin/sort -u  | /usr/bin/sed -e '/libphp.*so/d'"
warning: Ignoring invalid regex ^/opt/kdg/.*$|%{_root_sysconfdir}/rpm/macros.php81-config$

From what I'm about to conclude: Either my php81-build macros are not pulled while the php81-php is being rebuild or I'm missing the _root_sysconfdir as a macro in my first cfg template.

But comparing the .rpms with rpm -qlp php81-php-8.1.17~RC1-1.el7.kkkg.aarch64.rpm/php81-php-8.1.16-1.el7.remi.x86_64.rpm I see the same structure and etc..

Re: Creating symlink and paths for 8.1.14

Thank you Remi!
I will ignore the regex. The path I want now is reached.

Re: Creating symlink and paths for 8.1.14

Remi,
Creating php-pecl such as maxminddb do I have to apply the same procedure ?

Example;

1. mock -r my-centos-7-kdg-aarch64.cfg rebuild maxminddb.spec
or
2. mock -r new-spec-for-the-ext.cfg rebuild maxminddb.spec

Which way I should go ?

Thanks!

Re: Creating symlink and paths for 8.1.14

Same mock configuration for all the packages (no change required after "php81-php" build)

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

Re: Creating symlink and paths for 8.1.14

Thank you!
It's odd for me to get this error when I have the php81-runtime in the .cfg and I can see it being installed in the mock.

Error: Package: php81-php-pecl-apcu-5.1.22-1.el7.kkkg.aarch64 (doktor-kris-repo)
           Requires: php81-runtime(%{scl_vendor})(aarch-64)
You could try using --skip-broken to work around the problem
You could try running: rpm -Va --nofiles --nodigest

Re: Creating symlink and paths for 8.1.14

check what is provided  php81-runtime
look like %{scl_vendor} is not defined
so: bad mock configuration

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

69 (edited by kdgeorgiev 2023-03-09 09:30:23)

Re: Creating symlink and paths for 8.1.14

config_opts['macros']['%scl_vendor']="kdg"
config_opts['macros']['%_scl_prefix']="/opt/kdg"
config_opts['macros']['%_scl_name']="php81"
config_opts['macros']['%nophptag']="1"

this is from my .cfg that builds the php81-8.1.2

and this is from the .cfg that builds php81-php-8.1.17+

config_opts['macros']['%_scl_prefix']="/opt/kdg"
config_opts['macros']['%_scl_vendor']="kdg"

oopps.. I've missed the _

Re: Creating symlink and paths for 8.1.14

BTW, these value should be inherited from php82-build package (macros.php82-config file)

Which is done in https://git.remirepo.net/cgit/rpms/scl- … 3a594a48f0
and will be used for newer SCL (PHP 8.3 or Fedora 38 or RHEL-10)

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

Re: Creating symlink and paths for 8.1.14

Remi!
Correct that's how I fixed the paths. All the prefix are in php81.1.2 config templated.
My local repo was missing php-pear.

Also have you ever seen this error while building php-pecl-memcached ?

FAIL MemcachedServer [tests/memcachedserver6.phpt]

It's odd. I will look into it.

72 (edited by kdgeorgiev 2023-03-13 08:03:30)

Re: Creating symlink and paths for 8.1.14

Remi,
Another odd warning message/error I got;

[root@be3d0f845090 excel]yum install php-pear php81-php-devel gcc gcc-c++ autoconf automake
Failed to set locale, defaulting to C
Loaded plugins: fastestmirror, ovl
Loading mirror speeds from cached hostfile
* base: mirror.telepoint.bg
* epel: mirrors.neterra.net
* extras: mirror.telepoint.bg
* updates: mirror.telepoint.bg
Package 1:php81-php-pear-1.10.13-5.el7.kkkg.noarch already installed and latest version
Package php81-php-devel-8.1.17~RC1-1.el7.kkkg.aarch64 already installed and latest version
Package gcc-4.8.5-44.el7.aarch64 already installed and latest version
Package gcc-c++-4.8.5-44.el7.aarch64 already installed and latest version
Package autoconf-2.69-11.el7.noarch already installed and latest version
Package automake-1.13.4-3.el7.noarch already installed and latest version
Nothing to do
[root@be3d0f845090 excel]# phpize
Can't find PHP headers in /usr/include/php
The php-devel package is required for use of this command.
[root@be3d0f845090 excel]#

Have I build something wrong and why it the paths are not set automatically ?

Re: Creating symlink and paths for 8.1.14

> Have I build something wrong and why it the paths are not set automatically ?

Because you choose to build SCL
which need to be enabled using "scl" or "module" command

See:
https://blog.remirepo.net/post/2022/02/ … orkstation

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

Re: Creating symlink and paths for 8.1.14

Thank you! Everything works.

By the way how do you create this file: https://rpms.remirepo.net/enterprise/remi-release-7.rpm

I need a similar file where I can GPG sign it and install that single file only through my bash script.

Do you have an idea ? I wasn't able to find a how-to-article.

Thanks in advance!

Re: Creating symlink and paths for 8.1.14

See https://git.remirepo.net/cgit/rpms/remi … tree/?h=el

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