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

Exclude package aliases when generating output #15

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

ChaseOnTheWeb
Copy link

For a package with version aliases, the order of $packages seems to be inconsistent between install/require/update operations, which can cause a package in the manifest to switch back and forth between these versions.

My proposal is to filter out any package alias entries. Is there any reason we would need to know about them?

Example

Fresh project:

$ composer require --dev joachim-n/composer-manifest
$ composer require --dev grasmash/drupal-security-warning:1.x-dev

composer-manifest.yaml contains:

packages:
    grasmash/drupal-security-warning: '1.x-dev:848fd28335c984ca1ceb9454f7d636465db5c5f8'
    joachim-n/composer-manifest: 1.1.5
    symfony/polyfill-ctype: v1.27.0
    symfony/yaml: v6.2.7

But after:

$ composer update -w

Even if no packages were updated, composer-manifest.yaml now contains (first package version is different):

packages:
    grasmash/drupal-security-warning: 'dev-master:848fd28335c984ca1ceb9454f7d636465db5c5f8'
    joachim-n/composer-manifest: 1.1.5
    symfony/polyfill-ctype: v1.27.0
    symfony/yaml: v6.2.7

Then, with:

$ rm -rf vendor
$ composer install

We're back to:

packages:
    grasmash/drupal-security-warning: '1.x-dev:848fd28335c984ca1ceb9454f7d636465db5c5f8'
    joachim-n/composer-manifest: 1.1.5
    symfony/polyfill-ctype: v1.27.0
    symfony/yaml: v6.2.7

After this PR, version should be dev-master in all cases.

For a package with version aliases, the order of `$packages` seems to be inconsistent between install/require/update operations, which can cause a package in the manifest to switch back and forth between these versions.
@loopy3025
Copy link

I have pinned this to dev-master#9353b37dfe02489938e4e655e1e8b743db8f40d3 and tried it out. I've noticed that it's not just dev dependencies that are a problem in this situation. If I delete /vendor and composer.lock then run composer install, there are entire packages missing from composer-manifest.yml. I'm guessing it's dependencies. I have to run composer install immediately afterward or else I'll end up with a check dirty upstream.

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

Successfully merging this pull request may close these issues.

2 participants