Skip to content

[Runtime] Runtime from different package is not working #43802

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

Closed
peter-si opened this issue Oct 28, 2021 · 1 comment
Closed

[Runtime] Runtime from different package is not working #43802

peter-si opened this issue Oct 28, 2021 · 1 comment

Comments

@peter-si
Copy link

peter-si commented Oct 28, 2021

Symfony version(s) affected

5.3.7

Description

We have multiple Symfony apps and to simplify setup of them we have one library (call it symfony-boot) where all common packages, code, settings etc. are. I wanted to add our custom runtime to this library and use across all projects.

However when I run composer install (or dump-autoload) in actual project I'm getting an error from \Symfony\Component\Runtime\Internal\ComposerPlugin::updateAutoloadFile

  [InvalidArgumentException]                                                                                                  
  Class "\Websupport\Env\Symfony\WebSupportRuntime" listed under "extra.runtime.class" in your composer.json file not found. 

The only way to get it working is to place runtime:

  • directly in the project
  • to symfony/runtime lib (which of course is not feasible, it was just a debugging experiment)

How to reproduce

Quick and dirty:

  1. Create custom runtime class (can be an empty class extending one of existing Symfony runtime classes)
  2. Move it to any vendor library beside symfony/runtime (namespace has to match)
  3. Update composer.json extra.runtime.class with your class
  4. Run composer install

Right way:

  1. Create a library with runtime class (same as in Quick and dirty, but in separate library)
  2. composer require your library
  3. Update composer.json extra.runtime.class with your class
  4. Run composer install

Possible Solution

No response

Additional Context

No response

@nicolas-grekas
Copy link
Member

Fixed in #43376

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

No branches or pull requests

3 participants