Welcome to the Inedo Forums! Check out the Forums Guide for help getting started.

If you are experiencing any issues with the forum software, please visit the Contact Form on our website and let us know!

Composer feed: metapackage is not saved as a local package



  • Hello.
    I keep trying to use composer feed in a real project.
    There are packages with the metapackage type in composer. If you install such a package from a feed that has a connector on packagest.org, then such a package is not saved in proget as a local package. There is no corresponding folder in vendors, although it is in composer.lock.

    For example:

    composer reinstall -vvv --prefer-dist --no-scripts symfony/polyfill-php70
    

    But if you try to download the zip of such a package directly, the package appears.

    I think this is a mistake. All packages that are in composer.lock must be stored in proget.

    Thank you.


  • inedo-engineer

    Hi @vdubrovskyi_1854 ,

    I'm not an expert on how Composer handles packages, but so far as I can tell the behavior you’re seeing is expected and is how metapackage types are handled.

    A metapackage does not contain any files and is not installed into the vendor/ directory. It exists only to define dependencies on other packages. There is no contents in the package and thus, there is nothing for Composer to fetch.

    Because of this:

    • It will appear in composer.lock as part of dependency resolution
    • It will not create a directory under vendor/
    • The content itself is not be fetched (downloaded) from Composer
    • Only the Composer API is queried

    ProGet can only cache a package when a download/fetch occurs. Since metapackages are not fetched, there is nothing to cache.

    When you downloaded manually, you are deviating from Composer’s normal install behavior for metapackages -- so that's why it appears.

    In summary, this behavior is expected and not an error in ProGet. Unfortunately there's no way for ProGet to cache these packages, since Composer never downloads them.

    Hope that helps,

    Alana



  • Yes, that's all logical. But it completely breaks the approach with promotion. I can't promote a package that doesn't exist.

    Why doesn't proget cache the metadata of a package without zip?


  • inedo-engineer

    Hi @vdubrovskyi_1854 ,

    Unfortunately this is just how composer works; it never requests the metapackage from the server (i.e. ProGet) nor does it upload the composer.lock file to ProGet.

    There is obviously no way for ProGet to "guess" what metapackages you may want. Obviously, ProGet does not automatically download/install every metapackage from the upstream repository. That's obviously not behavior anyone would want, and we will not add it to ProGet.

    You have two options:

    1. Modify the behavior of composer to request these packages from ProGet,
    2. Writing a script to parse your composer.lock and then download and/or promote those files within ProGet

    Hope that helps,

    Alana


Log in to reply
 

Inedo Website HomeSupport HomeCode of ConductForums GuideDocumentation