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

Drop forceful loading of annotations #10321

Merged
merged 1 commit into from
Dec 19, 2022

Conversation

greg0ire
Copy link
Member

Since doctrine/annotations 1.10, autoloading is used when everything else has failed. Using registerFile() has been deprecated in favor of that later on.

Since doctrine/annotations 1.10, autoloading is used when everything
else has failed. Using registerFile() has been deprecated in favor of
that later on.
@greg0ire greg0ire requested a review from derrabus December 19, 2022 19:04
@derrabus derrabus added this to the 2.14.0 milestone Dec 19, 2022
@derrabus derrabus merged commit c4835cc into doctrine:2.14.x Dec 19, 2022
@greg0ire greg0ire deleted the drop-annotation-forceful-loading branch December 19, 2022 19:16
derrabus added a commit to derrabus/orm that referenced this pull request Dec 19, 2022
* 2.14.x:
  Drop forceful loading of annotations (doctrine#10321)
  Document stdClass structures used by CommitOrderCalculator (doctrine#10315)
  Psalm 5.3.0 (doctrine#10317)
  PHPStan 1.9.4 (doctrine#10318)
  add apcu enabled check if apcu extension loaded (doctrine#10310) (doctrine#10311)
  Add TypedFieldMapper for automatic mapping of typed PHP fields to DBAL types (doctrine#10313)
derrabus added a commit to derrabus/orm that referenced this pull request Dec 19, 2022
* 2.14.x:
  Drop forceful loading of annotations (doctrine#10321)
  Document stdClass structures used by CommitOrderCalculator (doctrine#10315)
  Psalm 5.3.0 (doctrine#10317)
  PHPStan 1.9.4 (doctrine#10318)
  add apcu enabled check if apcu extension loaded (doctrine#10310) (doctrine#10311)
  Add TypedFieldMapper for automatic mapping of typed PHP fields to DBAL types (doctrine#10313)
@mlocati
Copy link
Contributor

mlocati commented Jan 24, 2023

This is a breaking change and shouldn't have been included in a dot release...

We have this line in our code:

\Doctrine\Common\Annotations\AnnotationRegistry::registerFile('doctrine/orm/lib/Doctrine/ORM/Mapping/Driver/DoctrineAnnotations.php');

And it now breaks the execution with an E_COMPILE_ERROR error:

Doctrine\Common\Annotations\AnnotationRegistry::registerFile():
Failed opening required 'doctrine/orm/lib/Doctrine/ORM/Mapping/Driver/DoctrineAnnotations.php'

@greg0ire
Copy link
Member Author

I had no idea this was used directly like that outside the package itself, so to me it wasn't a breaking change and was therefore OK to include in a minor release. It is mentioned in the UPGRADE.md though, so I guess I should have looked better. Let me know if you think reverting this will be beneficial to your users or if it is not worth it considering you have a fix at concretecms/concretecms#11185

@mlocati
Copy link
Contributor

mlocati commented Jan 24, 2023

Many projects have hundreds of dependencies, and checking the changelog of all of them is not feasible.
That's why we have semver: breaking changes (like removing publicly accessible methods and files) should be done only in new major versions.
Yep, we fixed the issue, but I was speaking in general, and I don't think that publishing a new version fixes the issue, users simply have to live with it now 😉

@derrabus
Copy link
Member

Semver does not protect you if you bypass the public API of a package. This package's file structure is not part of its public API. If you include specific files directly you are basically on your own.

@greg0ire
Copy link
Member Author

Also, technically everything is a breaking change. For instance, a change to the README can be a breaking change if you do the following in your project:

if (md5(file_get_contents('vendor/doctrine/orm/README.md')) === 'some_hash_here') {
    // do stuff
}

Another example:
xkcd workflow

So if everything is a breaking change, nothing is, and it's up to us maintainers to decide what's a breaking change and what isn't. We try to listen though, but you'll have to admit the lecture on semver wasn't necessary, and that the attitude some of your contributors have towards us is not exactly going geared towards understanding and listening: concretecms/concretecms@18b8216

@mlocati
Copy link
Contributor

mlocati commented Jan 24, 2023

Semver does not protect you if you bypass the public API of a package.

What's this document?

@greg0ire
Copy link
Member Author

Likewise, if you think we're in the wrong, the right thing to do IMO is not to point it out and attempt to embarrass us in the process. Just state what your argument plainly.

Example:

Granted, files are not usually part of the public API of a package, but the documentation of doctrine/annotations made an exception at some point about this particular type of files.

What's so hard about being nice to your fellow maintainers? And even, for the interest of your project, how is this going to make us want to care about your issues?

@mlocati
Copy link
Contributor

mlocati commented Jan 24, 2023

When exactly have I been so rude?

@greg0ire
Copy link
Member Author

When exactly have I said you were?

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

Successfully merging this pull request may close these issues.

3 participants