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

PHPC-2420: Initial composer.json for pie support #1624

Merged
merged 1 commit into from
Sep 4, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
72 changes: 72 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
{
Copy link
Member

@jmikola jmikola Sep 3, 2024

Choose a reason for hiding this comment

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

I spent a while getting pie running locally (had to chase down missing extensions for azjezz/psl) just to find out that it doesn't support a validate command to check this JSON file. Well, at least I'll have it ready for future use 🤷

Copy link
Member Author

Choose a reason for hiding this comment

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

I'll use the opportunity to summon @asgrim, as they'd be in a better place to give you an idea of if and when to expect a pie validate command.

Copy link

Choose a reason for hiding this comment

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

You can actually just use composer validate; the schema for the php-ext bit is actually built in there.

"name": "mongodb/mongodb-extension",
Copy link
Member

Choose a reason for hiding this comment

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

Would "mongodb/mongodb" conflict with PHPLIB, even though the package type differs ("php-ext" vs. "library")? I suppose I'm asking whether the pie packages will share the same namespace with everything else in Packagist.

Copy link
Member Author

Choose a reason for hiding this comment

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

Indeed, extensions and packages all share the same namespace, so we can't choose mongodb/mongodb as a name.

"type": "php-ext",
"keywords": ["database", "driver", "mongodb", "persistence"],
"homepage": "https://jira.mongodb.org/browse/PHPC",
"license": "Apache-2.0",
"authors": [
{ "name": "Andreas Braun", "email": "andreas.braun@mongodb.com" },
{ "name": "Jeremy Mikola", "email": "jmikola@gmail.com" },
{ "name": "Jérôme Tamarelle", "email": "jerome.tamarelle@mongodb.com" }
],
"require": {
"php": ">=7.4,<9",
"ext-date": "*",
"ext-json": "*"
},
"php-ext": {
"extension-name": "ext-mongodb",
"configure-options": [
{
"name": "enable-mongodb-developer-flags",
"description": "Enable developer flags",
"needs-value": true
},
{
"name": "enable-mongodb-coverage",
"description": "Enable code coverage",
"needs-value": true
},
{
"name": "with-mongodb-system-libs",
"description": "Use system libraries for libbson, libmongoc, and libmongocrypt",
"needs-value": true
},
{
"name": "with-mongodb-client-side-encryption",
"description": "Enable client-side encryption (auto/yes/no)",
"needs-value": true
Copy link
Member

Choose a reason for hiding this comment

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

Noted that there is no way to specify a default value. Php\Pie\ConfigureOption appears to be where the parsing for this object lives.

Copy link
Member Author

Choose a reason for hiding this comment

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

@asgrim confirmed that configure options are only passed to configure if they are explicitly given during the installation process. Thus, the default is implicitly applied by our configuration scripts. As I understand it, this is different from pecl which always passes the configured flags and relies on the defined default value when the user does not input their own value.

Copy link
Member

Choose a reason for hiding this comment

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

Got it. I was worried needs-value: true would require all of these options to be specified at the time of package installation. Rather, it just requires a value iff the user specifies the option. That sounds like an improvement over PECL.

},
{
"name": "with-mongodb-snappy",
"description": "Enable Snappy for compression (auto/yes/no)",
"needs-value": true
},
{
"name": "with-mongodb-zlib",
"description": "Enable zlib for compression (auto/system/bundled/no)",
"needs-value": true
},
{
"name": "with-mongodb-zstd",
"description": "Enable zstd for compression (auto/yes/no)",
"needs-value": true
},
{
"name": "with-mongodb-sasl",
"description": "Enable SASL for Kerberos authentication (auto/cyrus/no)",
"needs-value": true
},
{
"name": "with-mongodb-ssl",
"description": "Enable crypto and TLS (auto/openssl/libressl/darwin/no)",
"needs-value": true
},
{
"name": "enable-mongodb-crypto-system-profile",
"description": "Use system crypto profile (OpenSSL only) (yes/no)",
"needs-value": true
}
]
}
}
Copy link
Member

Choose a reason for hiding this comment

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

Missing newline.