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

Skip generate autoload if <nothing to install> #10792

Closed
btxtiger opened this issue May 23, 2022 · 5 comments
Closed

Skip generate autoload if <nothing to install> #10792

btxtiger opened this issue May 23, 2022 · 5 comments
Labels
Milestone

Comments

@btxtiger
Copy link

Running composer install always runs composer dump-autoload afterwards, showing Generating optimized autoload files, even if the install output is Nothing to install, update or remove.

Always re-generating autoload files is an unnecessary step for us, that consumes too much time when handling docker containers.

But if we skip this during installation using --no-autoloader and there was a package installed, we need to manually run composer dump-autoload to update the autoload files.

I could not find any workaround yet. So I guess it should be possible to skip this behavior conditionally, if something/nothing was installed.

@Seldaek Seldaek added this to the 2.4 milestone May 24, 2022
@Seldaek
Copy link
Member

Seldaek commented May 24, 2022

Makes sense, let's try this for 2.4, we may need to keep track of the last autoload dump state (optimizations etc..) to make sure we redump it if the new mode isn't matching the old one.

@Seldaek
Copy link
Member

Seldaek commented Jul 17, 2022

After the attempt in #10899 and further consideration I'm gonna have to close this as not worth the risk/trouble.

@Seldaek Seldaek closed this as not planned Won't fix, can't repro, duplicate, stale Jul 17, 2022
@btxtiger
Copy link
Author

@Seldaek Just for clarification: it is also not an option to have this as optional (experimental) flag? The only other option to fix this for me, would be to parse the stdout for "Nothing to install, update or remove" which can break easily if the string was updated.

@Seldaek
Copy link
Member

Seldaek commented Jul 17, 2022

It just seems like a giant foot-gun so I'd rather not have it in even as an optional thing. Parsing output of install sounds relatively safe as if it does not match Nothing to install, update or remove anymore at worst you'll always redump the autoloader and get back to slower perf until you notice. These strings are really quite stable though.

@btxtiger
Copy link
Author

Okay, good to know that. Then I'm going forward with this implementation. Thanks

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

Successfully merging a pull request may close this issue.

2 participants