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

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

Merged
merged 5 commits into from
Dec 9, 2024

Conversation

alexandre-daubois
Copy link
Contributor

@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
src/Command/CommandHelper.php Outdated Show resolved Hide resolved
src/Command/CommandHelper.php Outdated Show resolved Hide resolved
src/DependencyResolver/Package.php Outdated Show resolved Hide resolved
@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
Contributor 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

This is great, love to exclude windows.

@alexandre-daubois
Copy link
Contributor 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
Collaborator

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
Contributor 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
Collaborator

@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
19 checks passed
@Seldaek
Copy link

Seldaek commented Dec 11, 2024

It's now tagged as part of composer 2.8.4

@asgrim
Copy link
Collaborator

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