Skip to content

Should composer play nice with make? #2764

Closed
@mtibben

Description

@mtibben

I'm working on a codebase using make. The makefile looks like

vendor: composer.lock
    composer install

test: vendor
    ./bin/phpunit

This works well, because make knows that in order to run phpunit, it should build the vendor directory by running composer install. Once it has been run once, make knows that the timestamp of vendor is greater than composer.lock, so doesn't need to run it again if I make test. And when composer.lock does get changed, make knows to rerun composer install.

The problem occurs when composer.lock changes with a trivial change (e.g. the description might be changed) which means that composer doesn't need to do anything when composer install is run.

Now make thinks that vendor is out of date, and will run composer install each time I need to make test.

I got around this problem by adding touch vendor to the vendor target. This works around the problem, but it seems to me that this is something composer should be doing when composer install is run.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions