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

allow doctrine/persistence v2 #635

Closed
rieschl opened this issue Nov 4, 2020 · 21 comments
Closed

allow doctrine/persistence v2 #635

rieschl opened this issue Nov 4, 2020 · 21 comments

Comments

@rieschl
Copy link

rieschl commented Nov 4, 2020

This library currently requires doctrine/persistence ^1.3 but not ^2.0.
This prevents updating doctrine/doctrine-module and thus also prevents upgrading doctrine/common to v3.

Could the constraint be loosened to allow ^1.3 || ^2.0?

Is anyone on that?

@TomHAnderson
Copy link
Member

This module is my responsibility. I think updating that dependency would be fine and I'll look into it.

@rieschl
Copy link
Author

rieschl commented Nov 4, 2020

This module is my responsibility. I think updating that dependency would be fine and I'll look into it.

thanks! say something if you want any help.

@greg0ire
Copy link
Member

greg0ire commented Nov 4, 2020

Here is a similar PR: doctrine/DoctrineBundle#1181 that you can use as a source of inspiration :)

@driehle
Copy link
Member

driehle commented Nov 14, 2020

This module is my responsibility. I think updating that dependency would be fine and I'll look into it.

Thanks, greatly appreciated!

@TomHAnderson
Copy link
Member

TomHAnderson commented Nov 15, 2020

There will be a number of steps to make this happen

  • Update doctrine-module 4.1.x to coding-standard 8.2
  • Update doctrine-orm-module to 3.1.x and drop support for persistence 1.x. Use doctrine-module 4.1.x as a template for package versions.

I'll update this list as needed.

@rieschl
Copy link
Author

rieschl commented Nov 15, 2020

2. Update doctrine-orm-module to 3.1.x and drop support for persistence 1.x. 

I haven't really looked into it, yet, but with the forward compatibility layer in doctrine-persistence 1.3 shouldn't it be possible to "just" use ^1.3 || ^2.0 as constraint?

@TomHAnderson
Copy link
Member

Inspect the composer.json for doctrine-module 4.1. That branch is just for 2.8 compatibility.

@TomHAnderson
Copy link
Member

As you can see orm 2.7 does not supporrt inflector 2. The work on doctrine-module 4.1.x was done in anticipation of the next major release of orm. You're correct that you cannot use doctrine-module 4.1.x but neither can the orm; so what is it you're trying to do?

Problem 1
- doctrine/orm[v2.7.3, ..., 2.7.4] require doctrine/inflector ^1.0 -> satisfiable by doctrine/inflector[1.4.0, 1.4.1, 1.4.2, 1.4.3].
- You can only install one version of a package, so only one of these can be installed: doctrine/inflector[1.4.0, 1.4.1, 1.4.2, 1.4.3, 2.0.3].
- doctrine/doctrine-module 4.1.0 requires doctrine/inflector ^2.0 -> satisfiable by doctrine/inflector[2.0.3].
- doctrine/orm[v2.7.0, ..., v2.7.2] require doctrine/common ^2.11 -> found doctrine/common[v2.11.0, ..., 2.13.3] but it conflicts with your root composer.json require (^3.0).
- Root composer.json requires doctrine/doctrine-module ^4.1 -> satisfiable by doctrine/doctrine-module[4.1.0].
- Root composer.json requires doctrine/orm ^2.7 -> satisfiable by doctrine/orm[v2.7.0, ..., 2.7.4].

@TomHAnderson
Copy link
Member

TomHAnderson commented Nov 16, 2020

@rieschl in your original post you say

This prevents updating doctrine/doctrine-module

To what version are you trying to update doctrine-module?

@rieschl
Copy link
Author

rieschl commented Nov 16, 2020

To what version are you trying to update doctrine-module?

Nothing in particular. I was just doing a composer update and composer outdated and saw that doctrine-module 4.1.0 is already there and checked, why composer doesn't install that.
Everything is working. With this issue I just wanted to give you a heads up that this package still uses doctrine-persistence v1 🙂

@TomHAnderson
Copy link
Member

Will not address at this time. The doctrine/doctrine-module should be required based on this module and not included in composer independently.

@rieschl
Copy link
Author

rieschl commented Nov 18, 2020

Will not address at this time. The doctrine/doctrine-module should be required based on this module and not included in composer independently.

Sorry, I think I didn't express myself correctly. doctrine/doctrine-module is required indirectly because of this module. I just opened this issue to point out that this module still requires v1 of doctrine-persistence, which will probably cause composer package update issues soon 🙂

@TomHAnderson
Copy link
Member

When a non-beta version of orm requires updates they will be made here at that time.

@rtek
Copy link

rtek commented Dec 4, 2020

@TomHAnderson nudging this one since doctrine 2.8 was just released resulting in a downgrade to 3.0.5

Lock file operations: 0 installs, 6 updates, 1 removal
  - Removing doctrine/reflection (1.2.2)
  - Upgrading doctrine/common (2.13.3 => 3.1.0)
  - Upgrading doctrine/doctrine-module (4.0.6 => 4.1.0)
  - Downgrading doctrine/doctrine-orm-module (3.1.1 => 3.0.5)
  - Upgrading doctrine/inflector (1.4.3 => 2.0.3)
  - Upgrading doctrine/orm (2.7.5 => 2.8.0)
  - Upgrading doctrine/persistence (1.3.8 => 2.1.0)

@driehle
Copy link
Member

driehle commented Dec 6, 2020

@TomHAnderson I think this is now really a big bug: Since the requirement for persistance ^1.3 was introduced with doctrine-orm-module 3.0.6 and earlier releases did not have such a requirement at all, the downgrade mentioned by @rtek occurs.

We should fix this as soon as possible, since unexpected errors may occur when downgrading to a version which does specify any persistance version at all. Shall I create a new ticket or will you re-open this one? (Why was this ticket actually closed at all?)

@TomHAnderson TomHAnderson reopened this Dec 6, 2020
@TomHAnderson
Copy link
Member

TomHAnderson commented Dec 6, 2020

@driehle , @rtek , Thanks for being on top of the persistence requirement.

I have a problem with Persistence v2 that all namespaces have changed (the Common has been dropped). There are two maintained branches here:

3.0.x & 3.1.x; The difference is 3.1.x has Migrations v3. If I change all the namespaces in this repo to match the latest persistence then it causes a problem with versioning.

3.1.x would move to 3.2.x.
3.0.x has no place to move. For continued support of Migrations 2 in 3.0 with support for persistence v2 the version could only increment to 3.0.x + 0.0.1 which is fine for composer but it means support for persistence v1 will be blocked in the 3.0.x branch.

I am leaning towards only supporting persistence v2 in 3.1.x (and change to 3.2.x) so support for persistence v1 will continue in the 3.1.x branch. That of course means all users upgrading to persistence v2 will require an upgrade of migrations too. That migrations upgrade is a configuration change, IMHO. So I'm comfortable moving 3.1.x to 3.2.x and dropping support for 3.0.x. I'd love to hear your opinions on this change.

@TomHAnderson
Copy link
Member

Nevermind all that; 1.3.3^ supports the new namespace

@rieschl
Copy link
Author

rieschl commented Dec 7, 2020

Nevermind all that; 1.3.3^ supports the new namespace

That's what I meant, initially ^^ Sorry if I didn't express myself correctly.

-> Require at least ^1.3, change namespaces to v2 variant because 1.3 has the forward compatibility layer and then allow ^1.3 || ^2.0 in composer.json.

I think I already have a branch with those changes (but probably not up to date), if you like to have a PR.

@TomHAnderson
Copy link
Member

@rtek
Copy link

rtek commented Jan 18, 2021

@TomHAnderson - I'm still having trouble getting doctrine/orm ^2.8 to work with the orm module. It looks like doctrine/doctrine-module 4.0.3 supported doctrine/persistence ^2.0 but it got reverted back to ^1.3 in 4.0.6.

Sorry for bringing the other repo into this, but this seemed most relevant to this discussion as users of the orm module. I'm trying to avoid locking at doctrine/doctrine-module 4.0.3 since it looks like dropping doctrine/persistance ^2.0 was an oversight.

K@K-07 MINGW64 /c/server/root/oss/doctrine/doctrine-orm-module
$ cat composer.json
{
    "name": "rtek/rtek",
    "require": {
        "doctrine/doctrine-orm-module": "^3.1"
    }
}

K@K-07 MINGW64 /c/server/root/oss/doctrine/doctrine-orm-module
$ composer require doctrine/orm ^2.8 -W
./composer.json has been updated
Running composer update doctrine/orm --with-all-dependencies
Loading composer repositories with package information
Updating dependencies
Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - doctrine/doctrine-orm-module is locked to version 3.1.2 and an update of this package was not requested.
    - Conclusion: don't install doctrine/persistence 2.1.0 (conflict analysis result)
    - doctrine/doctrine-orm-module 3.1.2 requires doctrine/doctrine-module ^4.0 -> satisfiable by doctrine/doctrine-module[4.1.1].
    - doctrine/doctrine-orm-module 3.1.2 requires doctrine/orm ^2.6.4 -> satisfiable by doctrine/orm[2.8.0, 2.8.1].
    - doctrine/orm[2.8.0, ..., 2.8.1] require doctrine/persistence ^2.0 -> satisfiable by doctrine/persistence[2.0.0, 2.0.1, 2.1.0].
    - You can only install one version of a package, so only one of these can be installed: doctrine/persistence[v1.0.0, ..., 1.3.8, 2.0.0, 2.0.1, 2.1.0].
    - doctrine/doctrine-module 4.1.1 requires doctrine/persistence ^1.3.7 -> satisfiable by doctrine/persistence[1.3.7, 1.3.8].
    - Conclusion: don't install doctrine/persistence 1.3.8 (conflict analysis result)

Use the option --with-all-dependencies (-W) to allow upgrades, downgrades and removals for packages currently locked to specific versions.

Installation failed, reverting ./composer.json and ./composer.lock to their original content.

@driehle
Copy link
Member

driehle commented Jan 19, 2021

@rtek See my comment doctrine/DoctrineModule#723 (comment) for background in this. Early versions of DoctrineModule were lacking the requirement of persistence at all, which is why now you experience being downgraded to quite old versions. 4.0.2 is not compatible with persistence 2.0, it simply lacks the requirement of persistence 1.3.

You should, for now, run a composer require doctrine/doctrine-module:4.1.0, i.e. explicitly require the 4.1.0 release. That got orm 2.8 running for me. Still hoping for a release of 4.1.2 in near future.

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

No branches or pull requests

5 participants