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

Projects
None yet
6 participants
@xabbuh
Copy link
Member

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

This comment has been minimized.

Copy link
Member

nicolas-grekas commented Feb 7, 2019

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

This comment has been minimized.

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

This comment has been minimized.

Copy link
Member

nicolas-grekas commented Feb 7, 2019

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

This comment has been minimized.

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.

@nicolas-grekas
Copy link
Member

nicolas-grekas left a comment

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

@fabpot

fabpot approved these changes Feb 13, 2019

@fabpot

This comment has been minimized.

Copy link
Member

fabpot commented Feb 13, 2019

Thank you @xabbuh.

@fabpot fabpot merged commit 05e0e16 into symfony:3.4 Feb 13, 2019

3 checks passed

continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
fabbot.io Your code looks good.
Details

fabpot added a commit that referenced this pull request Feb 13, 2019

bug #30090 [FrameworkBundle] add constraint validators before optimiz…
…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 xabbuh:issue-24222 branch Feb 13, 2019

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