Skip to content

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

@peter-si

Description

@peter-si

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions