Skip to content

Comments

Add support for os-families-exclude in extensions composer.json#116

Merged
asgrim merged 5 commits intophp:mainfrom
alexandre-daubois:os-composer-json
Dec 9, 2024
Merged

Add support for os-families-exclude in extensions composer.json#116
asgrim merged 5 commits intophp:mainfrom
alexandre-daubois:os-composer-json

Conversation

@alexandre-daubois
Copy link
Member

@alexandre-daubois alexandre-daubois commented Nov 20, 2024

Fix #106

Allows to specify OS families which the extension is incompatible with:

{
    "name": "myvendor/myext",
    "php-ext": {
        "extension-name": "myext",
        "configure-options": [
            // ...
        ],
        "os-families-exclude": ['windows', 'darwin']
    }
}

When the syntax is validated, I'll create a PR in Composer to allow the new key in the Package::$phpExt property.

Related to ThePHPF/pie-design#29

@alexandre-daubois alexandre-daubois changed the title Add support for os-families in extensions composer.json Add support for os-families-exclude in extensions composer.json Nov 20, 2024
@alexandre-daubois alexandre-daubois force-pushed the os-composer-json branch 2 times, most recently from a303ebf to 71003c8 Compare November 20, 2024 11:59
@asgrim asgrim added the enhancement New feature or request label Nov 20, 2024
@alexandre-daubois alexandre-daubois force-pushed the os-composer-json branch 4 times, most recently from 51387f8 to 0c2998a Compare November 21, 2024 14:42
@alexandre-daubois
Copy link
Member Author

Revamped the whole PR to address your comments.

  • Things are done in ResolveDependencyWithComposer instead of CommandHelper
  • An enum holding OS families is added
  • It is added to the TargetPlatform
  • PhpBinaryPath is used to determine the OS family, just like the OS

@alexandre-daubois alexandre-daubois marked this pull request as ready for review November 22, 2024 09:30
@tillkruss
Copy link
Contributor

This is great, love to exclude windows.

@alexandre-daubois
Copy link
Member Author

Remaining CS warnings should be fixed once composer/composer#12218 is merged

@alexandre-daubois alexandre-daubois force-pushed the os-composer-json branch 5 times, most recently from 03d24dc to afdcbab Compare December 3, 2024 09:27
@asgrim
Copy link
Contributor

asgrim commented Dec 9, 2024

PR composer/composer#12218 is now merged; please can you update the composer req, that should fix the static analysis

@alexandre-daubois
Copy link
Member Author

Here you go, all green! 🙂

@asgrim asgrim self-assigned this Dec 9, 2024
@asgrim asgrim added this to the 0.3.0 milestone Dec 9, 2024
Copy link
Contributor

@asgrim asgrim left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@asgrim asgrim merged commit 72b239c into php:main Dec 9, 2024
@Seldaek
Copy link

Seldaek commented Dec 11, 2024

It's now tagged as part of composer 2.8.4

@asgrim
Copy link
Contributor

asgrim commented Dec 11, 2024

Thanks @Seldaek !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

How to require an specific OS

4 participants