drush icon indicating copy to clipboard operation
drush copied to clipboard

[support] How service files vs. version ranges works in reality

Open mxr576 opened this issue 3 years ago • 0 comments

It looks like on the first sight that services files vs. version supports works like usual semver constrains (like in composer.json). However, based on my testing it looks like

        "drush": {
            "services": {
                "drush.services.yml": "^10"
            }
        },

also makes Drush commands provided by a module supported on Drush 11 automatically. Is it correct? Is there a reason why ^ does not follow the same rules as elsewhere? As a contrib module developer it is important to understand this hidden* behavior because probably then always >=10.0.0 <11 constraints should be used if you would like to stay on the safe side.

re: hidden*: Only this line indicates to me that version constraints like ^ works differently here. Maybe that requires further, explicit clarification?

If a future Drush extension is written such that it only works with Drush 10 and later, then its entry would read "drush.services.yml": "^10", and Drush 9 would not load the extension's commands.

mxr576 avatar May 03 '22 08:05 mxr576