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

Upgrade to symfony/filesystem 5.4 and migrate webmozart/path-util usage #3957

Closed
wants to merge 3 commits into from

Conversation

m-vo
Copy link
Member

@m-vo m-vo commented Jan 18, 2022

This PR requires the symfony/filesystem component in version 5.4 and drops the abandoned webmozart/path-util for Contao 4.9.

see contao/image#86 (comment)

@m-vo m-vo added the bug label Jan 18, 2022
@m-vo m-vo added this to the 4.9 milestone Jan 18, 2022
@m-vo m-vo self-assigned this Jan 18, 2022
Copy link
Member

@bytehead bytehead left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't know if 4.9 should use Symfony 5 components?

@m-vo
Copy link
Member Author

m-vo commented Jan 18, 2022

I don't know if 4.9 should use Symfony 5 components?

The filesystem component is a small component that does not introduce any dependencies (besides polyfills), so it's IMHO the best option. For reference, also see the discussion in contao/image#86 (comment).

@m-vo
Copy link
Member Author

m-vo commented Jan 18, 2022

I had to remove the extra.symfony sections from the composer.json files, because they were restricting the Symfony version to 4.4 for all components. IIRC this was only there for the flex plugin to get faster installs, which would now be obsolete anyways thanks to Composer 2.

@@ -81,7 +81,7 @@
"symfony/dom-crawler": "4.4.*",
"symfony/event-dispatcher": "4.4.*",
"symfony/expression-language": "4.4.*",
"symfony/filesystem": "4.4.*",
"symfony/filesystem": "^5.4",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
"symfony/filesystem": "^5.4",
"symfony/filesystem": "4.4.* || 5.4.*",

I would have just widened this requirement and kept using the webmozart lib, to maximize compatibility with extensions. But I’m fine either way, @contao/developers WDYT?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IMHO we must get rid of the abandoned library anyways in the remaining lifetime of 4.9 (and so do all extension developers), so I'd vote for removing it.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we never got rid of abandoned libraries in any LTS. We still use lexik and other stuff. There's no reason to change this 🤷

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Optionally allowing version 5.4 in this special case would be OK for me. Then our users could require symfony/filesystem in version 5 if no other extension explicitly requires version 4.

Copy link
Member

@leofeyer leofeyer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We cannot do this, I'm afraid, since there have been breaking changes between version 4 and 5 of the component.

  • Filesystem::dumpFile() and appendToFile() don't accept arrays anymore.
  • The minimum PHP version has been raised from PHP 7.1 to PHP 7.2.
  • The method arguments now use type hints.

Also, everyone requiring "symfony/filesystem": "4.4*" would not be able to update their installation anymore.

@m-vo
Copy link
Member Author

m-vo commented Jan 19, 2022

Filesystem::dumpFile() and appendToFile() don't accept arrays anymore.
The method arguments now use type hints.

Is there anything that needs to be adjusted in this PR?

Also, everyone requiring "symfony/filesystem": "4.4*" would not be able to update their installation anymore.

This is correct. But it's the same as anyone requiring dbal in 2.* with 4.13.

It's not about pushing the boundaries but taking steps where needed.

@ausi
Copy link
Member

ausi commented Jan 19, 2022

The minimum PHP version has been raised from PHP 7.1 to PHP 7.2.

Contao 4.9 is already PHP 7.2

"php": "^7.2 || ^8.0",

@m-vo
Copy link
Member Author

m-vo commented Jan 19, 2022

Contao 4.9 is already PHP 7.2

Just realized this as well. This change only affects contao/image.

@ausi
Copy link
Member

ausi commented Jan 19, 2022

Pull request for widening the constraint for contao/filesystem: #3966

I would like to keep this pull request open as we have to merge this anyway as soon as the path-util library is incompatible with a new PHP version or has a security issue.

leofeyer pushed a commit that referenced this pull request Jan 19, 2022
Description
-----------

Alternative to #3957

Commits
-------

0b2d6f7 Add compatibility with symfony/filesystem 5.4
@leofeyer leofeyer removed this from the 4.9 milestone Jan 21, 2022
@leofeyer leofeyer closed this Mar 6, 2023
@m-vo m-vo deleted the symfony-path-util branch July 5, 2024 12:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants