Skip to content

Allow Symfony 7 #793

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

Merged
merged 2 commits into from
Dec 31, 2023
Merged

Allow Symfony 7 #793

merged 2 commits into from
Dec 31, 2023

Conversation

greg0ire
Copy link
Contributor

No description provided.

@greg0ire
Copy link
Contributor Author

@jaapio I believe

guides/composer.json

Lines 7 to 9 in bb3a291

"platform": {
"php": "8.1.2"
},
prevents properly checking that this works. What should be done?

@jaapio
Copy link
Member

jaapio commented Dec 30, 2023

I think we can remove that as long we make sure we do not commit stuff to the lockfile which is not compatible with php 8.1

@greg0ire
Copy link
Contributor Author

Why do we have a lockfile in the first place? If it's for preventing dev tooling such as phpstan or phpunit from suddenly breaking the build, maybe we should switch to using constraints without ^ or ~ in composer.json, and unversioned composer.lock?

@jaapio
Copy link
Member

jaapio commented Dec 30, 2023

I'm used to commit the lock file, also for libraries, because the lock file makes sense in terms of making sure everyone working on this project is using the same dependencies as start. You see this in all phpDocumentor projects.

It does not harm to have it, and it speeds up the initial installation of a project, because composer doesn't have to do the resolving.

@greg0ire
Copy link
Contributor Author

greg0ire commented Dec 31, 2023

I think we can remove that as long we make sure we do not commit stuff to the lockfile which is not compatible with php 8.1

This makes contributions a bit more complicated. Instead, I'll try using --ignore-platform-req=php where appropriate.

Regarding version of the composer.lock I believe the speedup is (now that we use Composer 2) quite negligible:

With composer.lock: composer install 2.02s user 1.54s system 116% cpu 3.065 total
Without: composer install 2.52s user 1.59s system 118% cpu 3.465 total

So you get 500 ms.

By committing it, you make sure people get a green build when they start contributing, but only locally, since composer.lock is disregarded in every job with highest or lowest dependencies. Worse, if the highest jobs do break, then you make it harder for contributors to reproduce the issue: They need to run composer update (after this PR, with --ignore-platform-req=php) in order to reproduce the issue.

It also means there are more jobs than necessary, since you have locked jobs. I think you could challenge it, but with --ignore-platform-req=php, I think that's not a requirement for this PR 🙂

@greg0ire
Copy link
Contributor Author

🤔 hopefully this won't cause any issues for the lowest dependencies jobs 🤞

@greg0ire
Copy link
Contributor Author

greg0ire commented Dec 31, 2023

Speaking of speedup: https://github.com/phpDocumentor/guides/actions/runs/7369898764/job/20055701284?pr=793#step:5:85

Composer is operating significantly slower than normal because you do not have the PHP curl extension enabled.

@greg0ire
Copy link
Contributor Author

Argh, the option I used is not a good solution, because of 8.1-highest. I will try something else.

@greg0ire greg0ire force-pushed the sf7 branch 3 times, most recently from 4807bc5 to e973716 Compare December 31, 2023 10:54
@greg0ire
Copy link
Contributor Author

Found a solution. Blocked by phpDocumentor/.github#35

@greg0ire greg0ire closed this Dec 31, 2023
@greg0ire greg0ire reopened this Dec 31, 2023
@jaapio
Copy link
Member

jaapio commented Dec 31, 2023

Thanks @greg0ire, merged your other pr. Let me know when you need a review.

@greg0ire greg0ire marked this pull request as ready for review December 31, 2023 12:03
@greg0ire greg0ire force-pushed the sf7 branch 2 times, most recently from 6c378bd to 6b1a78c Compare December 31, 2023 12:03
This new version should allow us to upgrade to higher dependencies than
before, by eliminating the platform constraint when appropriate.
@greg0ire
Copy link
Contributor Author

@jaapio please review

@jaapio jaapio merged commit 672d266 into phpDocumentor:main Dec 31, 2023
@jaapio
Copy link
Member

jaapio commented Dec 31, 2023

Thanks!

@greg0ire greg0ire deleted the sf7 branch December 31, 2023 16:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants