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

make symfony/console dependency optional #1002

Closed
kaznovac opened this issue Aug 7, 2019 · 11 comments
Closed

make symfony/console dependency optional #1002

kaznovac opened this issue Aug 7, 2019 · 11 comments

Comments

@kaznovac
Copy link

kaznovac commented Aug 7, 2019

i have a case where i don't execute commands in production environment, so i don't need 'symfony/console' and registration of the commands in the production code.

@SenseException
Copy link
Member

Is there any negative impact for creating this short proposal? Please evaluate about what your current use case is and what you want to gain by making console optional.

@MatTheCat
Copy link
Contributor

I guess nobody wants dependecies they won't use.

@kaznovac
Copy link
Author

@SenseException less code in production => less code audit and smaller attack surface.
also compiled container is smaller (one can create compiler pass to manually remove unwanted services) => better performance

@alcaeus
Copy link
Member

alcaeus commented Aug 24, 2019

Generally, I don't have a problem reducing the scope of our dependencies. However, with the current discussion around PHP 7.4 breaking a lot of those "optional" dependencies in the Symfony DI container (see symfony/symfony#32995), I'd rather wait until we've found a proper solution to that problem.

That said, if we do decide to make symfony/console (or any other dependencies for that matter) optional, I have no problem doing that in a minor release: you shouldn't rely on transitive dependencies, so I don't consider this a BC break. I'll put this on the roadmap for 2.x and we'll see where the road goes.

@alcaeus alcaeus added this to 2.x in Roadmap Aug 24, 2019
@MatTheCat
Copy link
Contributor

symfony/symfony#32995 has been fixed 🎉

@stof
Copy link
Member

stof commented Mar 17, 2020

is DoctrineBundle really the only package making your keep symfony/console as a requirement rather than a dev requirement ? AFAIK, removing the Symfony console entirely on prod servers will be quite complex (at least because of the cache warmup).

@MatTheCat
Copy link
Contributor

I see your point @stof so it’s a shame I cannot recall what my project became 🤔

@ostrolucky
Copy link
Member

Agreed with @stof, removing symfony/console doesn't look realistic to do for symfony project and optional dependencies handling is always awkward to do. Anybody still think it's worth removing this dependency? @doctrine/team-symfony-integration @greg0ire

@stof
Copy link
Member

stof commented Mar 18, 2020

Well, as I'm almost sure that it will still be impossible to remove symfony/console from the project, having this dependency in the bundle does not hurt (as it does not add a new dependency in the project), and it avoids the pain of managing compatible versions of optional dependencies. So my vote is for the status quo here.

@fabpot
Copy link
Member

fabpot commented Mar 18, 2020

I would also vote for not removing symfony/console here. If you are using DoctrineBundle, I'm 99% sure that you will get this dependency somehow anyway (1% is for someone who would try really hard to work around it).

@ostrolucky
Copy link
Member

Good. Let's close then.

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

No branches or pull requests

7 participants