Skip to content

php: improve support for metapackages #1147

@raboof

Description

@raboof

composer has the concept of 'metapackages', that only have dependencies an no 'own' code. An example of a metapackage is https://github.com/symfony/polyfill-php72 - this one doesn't even have dependencies.

I have a situation where beberlei/DoctrineExtensions 1.5.0 has a dependency on doctrine/orm 2.20.8. The derivation for doctrine/orm correctly has:

{"options":{"symlink":false,"versions":{"symfony/polyfill-php72":"v1.31.0"}},"type":"path","url":"/nix/store/1grysa45p9yl659apjr0yjqfm20mdfgy-symfony-polyfill-php72-v1.31.0/lib/vendor/symfony/polyfill-php72"}

However, beberlei/DoctrineExtensions has:

{"options":{"symlink":false,"versions":{"symfony/polyfill-php72":"v1.31.0"}},"type":"path","url":"/nix/store/jc76878ssh0kdh7x5ci1v1ylvn6j9k4c-doctrine-orm-2.20.8/lib/vendor/doctrine/orm/vendor/symfony/polyfill-php72"}

... which does not exist, causing it to fail with:

Running phase: unpackPhase
@nix { "action": "setPhase", "phase": "unpackPhase" }
Running phase: patchPhase
@nix { "action": "setPhase", "phase": "patchPhase" }
Running phase: updateAutotoolsGnuConfigScriptsPhase
@nix { "action": "setPhase", "phase": "updateAutotoolsGnuConfigScriptsPhase" }
Running phase: configurePhase
@nix { "action": "setPhase", "phase": "configurePhase" }
Running phase: buildPhase
@nix { "action": "setPhase", "phase": "buildPhase" }
No composer.lock file present. Updating dependencies to latest instead of installing from lock file. See https://getcomposer.org/install for more information.
Loading composer repositories with package information

In PathRepository.php line 163:
                                                                               
  The `url` supplied for the path (/nix/store/jc76878ssh0kdh7x5ci1v1ylvn6j9k4  
  c-doctrine-orm-2.20.8/lib/vendor/doctrine/orm/vendor/symfony/polyfill-php72  
  ) repository does not exist                                                  
                                                                               

install [--prefer-source] [--prefer-dist] [--prefer-install PREFER-INSTALL] [--dry-run] [--download-only] [--dev] [--no-suggest] [--no-dev] [--no-autoloader] [--no-progress] [--no-install] [--audit] [--audit-format AUDIT-FORMAT] [-v|vv|vvv|--verbose] [-o|--optimize-autoloader] [-a|--classmap-authoritative] [--apcu-autoloader] [--apcu-autoloader-prefix APCU-AUTOLOADER-PREFIX] [--ignore-platform-req IGNORE-PLATFORM-REQ] [--ignore-platform-reqs] [--] [<packages>...]

It's not yet super obvious to me whether we should adapt the build of doctrine/orm so that /nix/store/jc76878ssh0kdh7x5ci1v1ylvn6j9k4c-doctrine-orm-2.20.8/lib/vendor/doctrine/orm/vendor/symfony/polyfill-php72 does exist, or the build of beberlei/DoctrineExtensions so that it links directly to the polyfill instead.

Any pointers welcome!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions