Skip to content
This repository has been archived by the owner on Nov 19, 2024. It is now read-only.

Since the sockets php extension becomes required from 2.4.0 onwards, … #7398

Merged
merged 3 commits into from
Jun 18, 2020

Conversation

hostep
Copy link
Contributor

@hostep hostep commented Jun 12, 2020

…we can remove this warning.

Purpose of this pull request

This pull request (PR) prepares the documentation for the sockets php extension which becomes required in Magento 2.4.0 and up.
It removes this temporary warning and ext-sockets should get added to the existing list of extensions. However, this doesn't seem to happen automatically right now, see below under further discussion.

This is a follow up on #6922

Affected DevDocs pages

Links to Magento source code

See magento/magento2#27200 & magento/magento2#28585 (comment) which is in progress of being merged in 2.4.0

Further discussion

@dobooth: from what I understand, the following code should generate the required php extensions automatically, right?

<!--{% assign platform-req = site.data.codebase.v2_4.open-source.composer_lock.platform %}-->
{% include install/php-extensions-template.md %}

But somehow that's not happening yet, even though the composer.lock file in the codebase does show a requirement on the sockets extension:

Any idea why this isn't being picked up?


Also: I'm explicitly not putting this in the 2.3 docs, because in Magento 2.3.5 for example, even though the composer.lock file mentions it: https://github.com/magento/magento2/blob/2.3.5/composer.lock#L3758, it's still possible to install Magento without it, because of the version constraint on the php-amqplib/php-amqplib module still allows version 2.7.x which doesn't require the sockets extension:
https://github.com/magento/magento2/blob/2.3.5/composer.json#L74
And when setting up a Magento 2.3.5 project without the sockets extension, composer will be smart enough to downgrade php-amqplib/php-amqplib to 2.7.x


@jfrontain: I think we should also mention the requirement of this sockets php extension in the release notes for 2.4.0, just FYI

@devops-devdocs
Copy link
Collaborator

An admin must run tests on this PR before it can be merged.

@dobooth
Copy link
Contributor

dobooth commented Jun 12, 2020

Hi @hostep Thanks for the help. We manually copy the composer.json file to the devdocs repo. When we release the final docs, we grab the final composer.lock file from the main magento repo and copy it over, usually the day before release. So it may not be completely up to date in the beta docs. But in this case, the PHP extensions listed in the sys reqs file coms from the platform node:


If the extension also needs to be listed here, we will have to work that out with the engineering team.

@hostep
Copy link
Contributor Author

hostep commented Jun 13, 2020

Thanks for the info @dobooth !

Hmm, this means we do have to put it in the composer.json file as well, because since ext-sockets is introduced by a dependency, it won't be written to the platform section I believe?
But that's not very maintainable since new requirements might pop up by just updating a dependency and it would be nice if the devdocs could detect those automatically somehow?

Here's what could work, but it's a bit involved and all in theory, I haven't tested this:

  1. Use the composer.json & composer.lock file of a specific Magento version
  2. Run composer update --no-dev
  3. From the resulting composer.lock file, search for all ext-* entries in the require sections and keep them in memory
  4. Run composer update --prefer-lowest --no-dev
  5. From the resulting composer.lock file, search for all ext-* entries in the require sections and keep them in memory
  6. From the list of step 3) & 5), only take the ext-* entries which occur in both lists, now you have the bare minimum extensions which are required for a Magento installation.

Just an idea, not sure if this will be super accurate, but it's the best I could come up with right now.

@dobooth
Copy link
Contributor

dobooth commented Jun 16, 2020

Thanks @hostep for the excellent feedback. We are going to discuss this internally, and figure out if we are missing something here and what the right fix is. Thank for the good info.

@dshevtsov
Copy link
Collaborator

We manually copy the composer.json file
usually the day before release

We do this automatically at the day of release.

@dshevtsov
Copy link
Collaborator

dshevtsov commented Jun 16, 2020

We have a task (DOC-80) in our backlog to start using composer.json from a composer project (such as magento/project-community-edition) instead of composer.lock to get information about metapackages and PHP requirements there. Seems like we need to extend this task to start generating data we need instead of using raw composer.json/.lock files. We definitely need to involve engineering in this to consider all the details.

Maybe @fascinosum has something to add here.

@dshevtsov
Copy link
Collaborator

This was last resolution after a meeting with engineering (on Feb 4) from the mentioned above ticket:

  1. PHP requirements (versions and extensions): from GitHub's composer.json
  2. VBEs versions from the composer.lock generated after composer create-project ... installation. The versions can be taken from magento/product-community-edition dependencies. PHP extensions can be taken from this composer.lock too.

@dobooth
Copy link
Contributor

dobooth commented Jun 18, 2020

running tests

@dobooth dobooth merged commit 638d6f6 into magento:master Jun 18, 2020
@ghost
Copy link

ghost commented Jun 18, 2020

Hi @hostep, thank you for your contribution!
Please, complete Contribution Survey, it will take less than a minute.
Your feedback will help us to improve contribution process.

@hostep
Copy link
Contributor Author

hostep commented Jun 23, 2020

Thanks @dobooth!

I'd like to emphasise to gather the php extensions twice, one time after running composer update and looking at the resulting composer.lock and one time after running composer update --prefer-lowest, also looking at the new resulting composer.lock file and then only taking the found extensions which appear in both files.

If you would not do it this way, it would mark ext-sockets as required for Magento 2.3.5, while it isn't.
If you would do it this way, it will be more accurate.

Just FYI.

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

Successfully merging this pull request may close these issues.

5 participants