Skip to content

Composer update don't limit version to expected one #450

@steevanb

Description

@steevanb

See symfony/symfony#29581

Symfony version(s) affected: 4.0, 4.1 and 4.2

Description
I want to create a project with 4.1.* Symfony version, and don't use any 4.2 package.
Same bug when i want to create a project with 4.0.* Symfony version.
This problem will be the same for 4.2, when 4.3 will be released.

How to reproduce

composer create-project symfony/skeleton sf-4-1-9 4.1.9.1

(I have removed some dependencies to make output more readable)

Installing symfony/skeleton (v4.1.9.1)
  - Installing symfony/skeleton (v4.1.9.1): Downloading (100%)         
Created project in sf-4-1-9
Loading composer repositories with package information
Installing dependencies (including require-dev) from lock file
Package operations: 20 installs, 0 updates, 0 removals
  - Installing symfony/flex (v1.1.8): Loading from cache

Prefetching 11 packages 🎶 💨
  - Downloading (100%)

  - Installing symfony/console (v4.1.9): Loading from cache
  - Installing symfony/dotenv (v4.1.9): Loading from cache
  - Installing symfony/routing (v4.1.9): Loading from cache
  - Installing symfony/http-foundation (v4.1.9): Loading from cache
  - Installing symfony/event-dispatcher (v4.1.9): Loading from cache
  - Installing symfony/debug (v4.1.9): Loading from cache
  - Installing symfony/http-kernel (v4.1.9): Loading from cache
  - Installing symfony/finder (v4.1.9): Loading from cache
  - Installing symfony/filesystem (v4.1.9): Loading from cache
  - Installing symfony/dependency-injection (v4.1.9): Loading from cache
  - Installing symfony/config (v4.1.9): Loading from cache
  - Installing symfony/cache (v4.1.9): Loading from cache
  - Installing symfony/framework-bundle (v4.1.9): Loading from cache
  - Installing symfony/yaml (v4.1.9): Loading from cache

4.1.9 is installed, with it's dependencies as 4.1.9 too.
But if i do this :

rm -rf vendor && composer up

Dependencies i don't have in my composer.json will be installed as latest version (4.2.1 today):

Loading composer repositories with package information
Updating dependencies (including require-dev)
Package operations: 22 installs, 0 updates, 0 removals
  - Installing symfony/flex (v1.1.8): Loading from cache
  - Installing symfony/polyfill-mbstring (v1.10.0): Loading from cache
  - Installing symfony/console (v4.1.9): Loading from cache
  - Installing symfony/dotenv (v4.1.9): Loading from cache
  - Installing symfony/routing (v4.2.1): Loading from cache
  - Installing symfony/http-foundation (v4.2.1): Loading from cache
  - Installing symfony/contracts (v1.0.2): Loading from cache
  - Installing symfony/event-dispatcher (v4.2.1): Loading from cache
  - Installing symfony/debug (v4.2.1): Loading from cache
  - Installing symfony/http-kernel (v4.2.1): Loading from cache
  - Installing symfony/finder (v4.2.1): Loading from cache
  - Installing symfony/filesystem (v4.2.1): Loading from cache
  - Installing symfony/dependency-injection (v4.2.1): Loading from cache
  - Installing symfony/config (v4.2.1): Loading from cache
  - Installing symfony/var-exporter (v4.2.1): Loading from cache
  - Installing symfony/cache (v4.2.1): Loading from cache
  - Installing symfony/framework-bundle (v4.1.9): Loading from cache
  - Installing symfony/yaml (v4.1.9): Loading from cache

I've tried to use extra.symfony.require, but it didn't change anything.

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