Bug 259793 - lang/php80 mysql80 option breaks building packages depending on php80-openssl
Summary: lang/php80 mysql80 option breaks building packages depending on php80-openssl
Status: Closed Works As Intended
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Some People
Assignee: Torsten Zuehlsdorff
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-11-12 10:53 UTC by Martin Waschbüsch
Modified: 2022-02-12 15:43 UTC (History)
5 users (show)

See Also:
bugzilla: maintainer-feedback? (tz)


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Martin Waschbüsch 2021-11-12 10:53:58 UTC
Since this commit (as far as I can see):
https://cgit.freebsd.org/ports/commit/?id=91fdbed776033fd4b210135429a171ab5fed549b

setting the MYSQL80 option in php80 has the effect of building the php80-openssl extension as part of php80 instead of as a package.

The problem is that a number of packages depend on php80-openssl being installed. php-composer and php-composer2 for instance or phpmyadmin5 if you enable the openssl option.

Is there a way of making these packages aware of the possibility that their requirement w/r to php80-openssl is fulfilled if php80 was build with MYSQL80 set?
Comment 1 Martin Waschbüsch 2021-11-12 10:56:37 UTC
part of poudriere output:

[00:02:39] [02] [00:00:57] Finished security/php80-openssl | php80-openssl-8.0.12: Failed: stage
[00:02:39] [02] [00:00:57] Skipping devel/php-composer | php80-composer-1.10.22: Dependent port security/php80-openssl | php80-openssl-8.0.12 failed
[00:02:39] [02] [00:00:57] Skipping devel/php-composer2 | php80-composer2-2.1.10: Dependent port security/php80-openssl | php80-openssl-8.0.12 failed


php80-openssl fails in staging with the message:
===>  php80-openssl-8.0.12 openssl module is already built with php base.
Comment 2 Torsten Zuehlsdorff freebsd_committer freebsd_triage 2021-11-12 15:06:59 UTC
Aloha Martin,

this is known and expected behavior. I am not aware of any workarounds or solutions for this. So i have no idea - besides migrating to PostgreSQL if possible ;)

Sorry.
Torste
Comment 3 Martin Waschbüsch 2021-11-12 15:13:59 UTC
(In reply to Torsten Zuehlsdorff from comment #2)

OK. Well, I guess I can always use the composer.phar from upstream, so it is not like it severely breaks things. But still... Not pretty! :-)

Thanks!

Since this is a will not (or rather: can not) fix, I've closed it.

PS: I agree w/r to postgres btw., but it cannot always be done, sadly.
Comment 4 Sean McBride 2022-02-07 00:49:04 UTC
See also: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=252420
Comment 5 Sean McBride 2022-02-08 17:02:18 UTC
If the php port "Works As Intended" that's fine I guess, but doesn't it just mean that other ports (like php-composer2 and phpmyadmin5) are the ones that need changes?
Comment 6 Muhammad Moinur Rahman freebsd_committer freebsd_triage 2022-02-08 17:45:28 UTC
(In reply to Sean McBride from comment #5)
As you have already referenced my commit I think I have been pretty explanatory for both USERS and DEVELOPERS/COMMITTERS/MAINTAINERS. :)

If not you can advise me some changes on the WARNING message. I am all ears.
Comment 7 Sean McBride 2022-02-08 18:35:44 UTC
Muhammad, thanks for your reply, but I'm not sure I understand...

I'm just trying to run a FAMP setup. :) I discovered that I can't install php-composer2.  I googled, and I found this ticket.  But this ticket is "Closed Works As Intended".  But something is surely not working as intended: it should surely be possible to install both MySQL 8 + PHP + composer, shouldn't it?

It seems to me that if the php port is behaving correctly, then the other ports are not.  Is the correct procedure for me to create a new ticket?  Should this ticket be reopened?

I did a fast hack on my poudriere server and edited `/usr/local/poudriere/ports/default/devel/php-composer2/Makefile` to change:

-USE_PHP=       ctype filter intl json mbstring openssl phar
+USE_PHP=       ctype filter intl json mbstring phar

And now I can build php-composer2.  Of course this couldn't be committed as-is, but, although I know nothing about the abilities of the port system, hopefully it's possible to somehow conditionalize this dependency list?
Comment 8 Muhammad Moinur Rahman freebsd_committer freebsd_triage 2022-02-08 18:48:08 UTC
(In reply to Sean McBride from comment #7)
It's pretty clear from your mail that you understood it correctly as you have properly read the WARNING message and built it successfully.

The only problem is we need to change the other ports. I think if someone does a reverse test on their ports they can conditionally try to add USE_PHP=openssl. :)

+post-stage:
+	@if ${PREFIX}/bin/php -m | grep openssl 2>/dev/null && ( [ ! -f ${PREFIX}/etc/php/ext-20-openssl.ini ] && [ ! -f ${PREFIX}/etc/php/ext-30-openssl.ini ] ); then \
+		${ECHO_CMD}; \
+		${ECHO_MSG} "===>  ${PKGNAME} "openssl module is already built with php base.; \
+		${ECHO_CMD}; \
+		${FALSE}; \
+	fi

And as mentioned by tz@ this works intended so this ticket shouldn't be reopened but a new ticket with respective ports should be opened.
Comment 9 Sean McBride 2022-02-08 18:52:13 UTC
>a new ticket with respective ports should be opened.

Thanks.  This is what I was trying to determine.
Comment 10 Jochen Neumeister freebsd_committer freebsd_triage 2022-02-08 20:12:23 UTC
hello,

i was added in this PR. How can I assist?

Cheers
Jochen
Comment 11 Sean McBride 2022-02-08 20:15:19 UTC
>i was added in this PR. How can I assist?

I added you since you are the maintainer of phpmyadmin5, which Martin (who opened this bug) mentioned as being affected.  It's not a port I've ever used personally.

Muhammad, I created https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=261797 for composer.
Comment 12 Muhammad Moinur Rahman freebsd_committer freebsd_triage 2022-02-08 20:22:29 UTC
(In reply to Sean McBride from comment #11)
I have actually shared the solution at comment #8. It's just that those ports need to hackaround based on the comment. :)
Comment 13 Muhammad Moinur Rahman freebsd_committer freebsd_triage 2022-02-11 02:38:30 UTC
(In reply to Jochen Neumeister from comment #10)
Hi joneum@ .. Stay put and do not try to hack around phpmyadmin5. We are trying to make some changes at php infra side to fix this.
Comment 14 commit-hook freebsd_committer freebsd_triage 2022-02-12 15:43:04 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=e8d9493812a510f7c1cc94632836e1d5731de250

commit e8d9493812a510f7c1cc94632836e1d5731de250
Author:     Muhammad Moinur Rahman <bofh@FreeBSD.org>
AuthorDate: 2022-02-12 15:38:24 +0000
Commit:     Muhammad Moinur Rahman <bofh@FreeBSD.org>
CommitDate: 2022-02-12 15:41:51 +0000

    lang/php8[01]: Make openssl as DEFAULT

    After the 91fdbed776033fd4b210135429a171ab5fed549b commit fixing the
    issue for MySQL80 introduced another problem for the ports that depends
    on php8[01]-openssl port couldn't be built as the fix prevented
    php8[01]-openssl from being installed as it's already built with
    default php installation. As the problem has grown much bigger now and
    php80 is currently the DEFAULT php version so we are switching the
    behavior of php8[01] ports making the openssl module as default.

    - Remove non-default OPTION MYSQL80 from lang/php8[01]
    - Remove ports security/php8[01]-openssl
    - Remove OPTION OPENSSL from lang/php8[01]-extensions
    - Mark lang/php8[01] to IGNORE with libressl and libressl-devel
      Although php builds fine with those most of the extensions do not
      as they have dependency on curl. So mark it early.
    - OPTIONIZE lang/php80
    - Change openssl_DEPENDS to conditional for php74 only as this module
      is default from php80 with this commit. php74 do not have the issue
      where it fails to connect to MySQL80 due to new caching_sha2_password
    - Remove hash_DEPENDS from php.mk as it is a default module for all php
    - Change json_DEPENDS to conditional for php74 only as this module is
      default from php80

    PR:             261797 259793 252420
    Reported by:    sean@rogue-research.com martin@waschbuesch.de
    Approved by:    tz (private email) ale (private email)
    Sponsored by:   Bounce Experts

 MOVED                                  |   2 +
 Mk/Uses/php.mk                         |  11 ++-
 UPDATING                               |  12 +++
 lang/php80-extensions/Makefile         |   8 +-
 lang/php80/Makefile                    |  47 ++++-----
 lang/php80/Makefile.ext                | 173 +++++++++------------------------
 lang/php81-extensions/Makefile         |   5 +-
 lang/php81/Makefile                    |  66 ++++---------
 security/Makefile                      |   2 -
 security/php80-openssl/Makefile (gone) |   9 --
 security/php81-openssl/Makefile (gone) |   7 --
 11 files changed, 109 insertions(+), 233 deletions(-)