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

[FrameworkBundle] add constraint validators before optimizations #30090

Merged
merged 1 commit into from Feb 13, 2019

Conversation

xabbuh
Copy link
Member

@xabbuh xabbuh commented Feb 6, 2019

Q A
Branch? 3.4
Bug fix? yes
New feature? no
BC breaks? no
Deprecations? no
Tests pass? yes
Fixed tickets #24222
License MIT
Doc PR

@nicolas-grekas
Copy link
Member

I'm not sure, but can that break anything? Like compiler passes that add the tag? Aren't all compiler passes that use hasDefinition "affected" btw - ie decorating their target service breaks them? In which case, shouldn't the solution be inside the pass itself/themselves - eg using has/findDefinition?

Sorry that's a lot of questions, but I'm always suspicious with these kind of changes :)

@xabbuh
Copy link
Member Author

xabbuh commented Feb 7, 2019

Like compiler passes that add the tag?

That's for sure possible. That would have to be solved by running custom compiler passes with a higher priority. I am afraid there is not much we can do otherwise if we want to solve the linked issue.

Aren't all compiler passes that use hasDefinition "affected" btw - ie decorating their target service breaks them? In which case, shouldn't the solution be inside the pass itself/themselves - eg using has/findDefinition?

That was my initial solution for this (see #24223), but in fact that's not the issue we need to solve here (while I still think we could possibly improve existing compiler passes in such a way).

@nicolas-grekas
Copy link
Member

So, this issue can happen with any pass, isn't it?
I'm not sure that potentially breaking fine working apps to support a new use case is legit.
What alternatives do we have? Marking this as unsupported would be fine to me also if there is none.
WDYT?

@xabbuh
Copy link
Member Author

xabbuh commented Feb 7, 2019

Not really, because all (if I didn't miss any) our other compiler passes dealing with tags are already registered at the before optimization stage so decorating them works just fine.

IMO this is not a new use case. Decorating used to work fine in the past until we accidentally broke that by moving the compiler pass.

Copy link
Member

@nicolas-grekas nicolas-grekas left a comment

Choose a reason for hiding this comment

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

OK, let's do this, #20116 contains no details anyway...

@fabpot
Copy link
Member

fabpot commented Feb 13, 2019

Thank you @xabbuh.

@fabpot fabpot merged commit 05e0e16 into symfony:3.4 Feb 13, 2019
fabpot added a commit that referenced this pull request Feb 13, 2019
…ations (xabbuh)

This PR was merged into the 3.4 branch.

Discussion
----------

[FrameworkBundle] add constraint validators before optimizations

| Q             | A
| ------------- | ---
| Branch?       | 3.4
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #24222
| License       | MIT
| Doc PR        |

Commits
-------

05e0e16 add constraint validators before optimizations
@xabbuh xabbuh deleted the issue-24222 branch February 13, 2019 09:41
This was referenced Mar 3, 2019
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.

None yet

6 participants