You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Support building from a local directory / non-Packagist source #79
This would be useful to test if what I've written into composer.json is correct and whether the build actually works, before committing to my changes by pushing them into a public repository and submitting them to Packagist.
This includes both the test after the initial pie-ification and before submission to Packagist and also tests after adding or removing configure flags.
With the PR #83, this becomes possible, and the following steps will enable you to download/build/install source code for a PIE package that has not yet been published to Packagist:
Then you can use the package as normal, (using whatever version constraint is appropriate, e.g. foo/bar:* for local repo, foo/bar:dev-branch-name for a GH repo, e.g.:
bin/pie info foo/bar:dev-pie (useful for checking the ./configure options available in PIE)
Given the above possibility, maybe adding a new pie CLI option to combine (i.e. it would add the repository into pie.json for you), maybe something like:
Since repository configuration can actually get quite advanced, I'm not sure we could get a fully comprehensive syntax in the CLI for defining all possible kinds of repositories, so maybe just providing the basics would suffice? I'm open to feedback on how we actually would do this though, perhaps there is a better way :D
@macintoshplus I am not sure what your latest comment means, or how it relates to building from different Composer repositories, which is what the OP is asking about. The sources and dist keys don't exist in composer.json. It sounds like you are trying to solve a separate problem, so please can you open a separate ticket :)
Why the with-php-config option? The repository is not added into the composer.json project file?
No, PIE does not use your consuming project's composer.json to install extensions (yet - although it has been discussed). It uses a pie.json specific to each target PHP version. This is because Composer installs dependencies for your project (in vendor/) as you are probably aware, but PHP extensions are global per PHP install, so we have a pie.json per PHP install that you have. If you have one PHP install on your machine, and php-config is in your $PATH, then you do not need to specify --with-php-config (this is the most common scenario). So when you use these commands, PIE is modifying $PIE_WORKING_DIRECTORY/php8.3_<somehash>/pie.json repositories (which is what PIE uses to manage extension dependencies, per "Target PHP" installation).
Activity
asgrim commentedon Oct 28, 2024
Thanks - this should be possible once #48 is complete 👍
asgrim commentedon Nov 14, 2024
With the PR #83, this becomes possible, and the following steps will enable you to download/build/install source code for a PIE package that has not yet been published to Packagist:
asgrim:adapt-to-use-composer-installer(see PR Adapt to use composer installer #83)pie info -v foo/bar:dev-pie(doesn't actually matter what command really)pie.jsonpie.jsonfor your target PHP, e.g. in~/.config/pie/php8.3_<hash>/pie.jsonpie.jsonmanually to add the repository for what you're trying to do:Example for a GitHub repo:
{ "repositories": [ { "type": "vcs", "url": "https://github.com/foo/bar" } ] }Example for a local repo:
{ "repositories": [ { "type": "path", "url": "/path/to/foo/bar" } ] }foo/bar:*for local repo,foo/bar:dev-branch-namefor a GH repo, e.g.:bin/pie info foo/bar:dev-pie(useful for checking the./configureoptions available in PIE)bin/pie download -v foo/bar:dev-piebin/pie build -v foo/bar:dev-pie --enable-some-optionbin/pie install -v foo/bar:dev-pie --enable-some-optionGiven the above possibility, maybe adding a new
pieCLI option to combine (i.e. it would add the repository intopie.jsonfor you), maybe something like:--path-repository=/path/to/foo/bar--vcs-repository=https://github.com/foo/barUsage examples:
bin/pie install --path-repository=/path/to/foo/bar foo/bar:*bin/pie install --vcs-repository=https://github.com/foo/bar foo/bar:*Since repository configuration can actually get quite advanced, I'm not sure we could get a fully comprehensive syntax in the CLI for defining all possible kinds of repositories, so maybe just providing the basics would suffice? I'm open to feedback on how we actually would do this though, perhaps there is a better way :D
macintoshplus commentedon Nov 19, 2024
Is it possible to add a custom repository like private composer into the
pie.jsonfile?It's to allow a repository to help distribute extension code sources or pre-built DLL. Especially the oldest extensions.
asgrim commentedon Nov 19, 2024
I have not tried a private repo, feel free to try it, the above guide may help :)
macintoshplus commentedon Nov 19, 2024
asgrim commentedon Nov 19, 2024
@macintoshplus I am not sure what your latest comment means, or how it relates to building from different Composer repositories, which is what the OP is asking about. The
sourcesanddistkeys don't exist incomposer.json. It sounds like you are trying to solve a separate problem, so please can you open a separate ticket :)macintoshplus commentedon Nov 19, 2024
Right @asgrim, I have open #110.
asgrim commentedon Jan 20, 2025
As an update to this, I'm working on a separate command to list/add/remove repositories from a target PHP in PIE. It'll be something like:
pie repository:list --with-php-config=/path/to/php-configpie repository:add vcs https://github.com/asgrim/example-pie-extension --with-php-config=/path/to/php-configpie repository:remove https://github.com/asgrim/example-pie-extension --with-php-config=/path/to/php-configpie repository:add path /path/to/your/local/extension --with-php-config=/path/to/php-configpie repository:remove /path/to/your/local/extension --with-php-config=/path/to/php-configAssuming there are no objections/issues/concerns/etc, this should make the next release :)
macintoshplus commentedon Jan 24, 2025
Why the
with-php-configoption? The repository is not added into thecomposer.jsonproject file?asgrim commentedon Jan 24, 2025
No, PIE does not use your consuming project's
composer.jsonto install extensions (yet - although it has been discussed). It uses apie.jsonspecific to each target PHP version. This is because Composer installs dependencies for your project (invendor/) as you are probably aware, but PHP extensions are global per PHP install, so we have apie.jsonper PHP install that you have. If you have one PHP install on your machine, andphp-configis in your$PATH, then you do not need to specify--with-php-config(this is the most common scenario). So when you use these commands, PIE is modifying$PIE_WORKING_DIRECTORY/php8.3_<somehash>/pie.jsonrepositories (which is what PIE uses to manage extension dependencies, per "Target PHP" installation).macintoshplus commentedon Jan 24, 2025
Ok. I can't ask Pie to install all PHP Ext for my project based on
composerconfiguration?asgrim commentedon Jan 24, 2025
I did already directly answer that: