Feat/pgo v3 - #1138
Feat/pgo v3#1138henderkes wants to merge 90 commits into
Conversation
|
StaticPHP Test Bot Detected: Extensions: |
|
(I tested with static-php/packages v3 branch, php 8.5 zig on rpm. Tests with Alpine and gcc are still to finish in a few hours when ci runs.) |
|
Wair, why is curl a target like php and not a package/library? We don't compile the exe right? |
We could compile curl.exe, which shows that StaticPHP is not only suitable for building static PHP, but also for other projects. Just like we already support building pkg-config and re2c. Making them targets simply makes reasonable.
|
…ith different pkg_root_path set
…fined behaviour sanitizer)
Okay, added curl.exe on Windows too. Also figured out the root cause of the BUILD_CC patch minilua crash (zigs undefined behaviour sanitizer tripping up, if you run |
|
Oh, there's even an issue running the binaries despite no undefined sanitizer that I can't reproduce locally or in docker. Very weird. |
| } | ||
|
|
||
| public function config(array $packages = [], bool $include_suggests = false): array | ||
| public function config(array $packages = []): array |
There was a problem hiding this comment.
Directly and permanently relying on PackageInstaller's resolved packages prevents SPCConfigUtil from being used in standalone commands or other vendor-mode scenarios. I suggest splitting this into two methods: keep config() as is, and add function configForResolvedPackages(array $roots, array $resolvedPackages, array $phpExtras = []) {} to distinguish the use cases.
spc-configretains its original semantics.- The build process respects the actual resolution results from
PackageInstaller. - It avoids linking
suggeststhat haven't been built. - It does not rely on implicit DI state.
- Unit tests only require passing arrays, eliminating the need to construct a full installer instance.
- Identical inputs consistently yield identical outputs.
There was a problem hiding this comment.
I will apply fix for SPCConfigUtil in a separate new branch. This is not strictly part of PGO.
There was a problem hiding this comment.
This seems a bit tricky; I think it would be better to split the various changes into separate PRs for review and merging. I have already completed some unrelated changes in #1214, and I am about to create a PR for the SPCConfigUtil refactoring (including the relevant files). Once all the changes unrelated to PGO have been merged, I will review the pgo-v3 changes and submit them to a new, clean branch.
| name: opentelemetry | ||
| type: pie | ||
| repo: open-telemetry/ext-opentelemetry | ||
| build-root: ext |
There was a problem hiding this comment.
How about subdir? build-root is definitely ambiguous. Also, move all the previous metadata.source-root here.
There was a problem hiding this comment.
build-dir?
subdir doesn't say what that directory is used for
There was a problem hiding this comment.
Keep using source-root? build-dir sounds ambiguous too (out-of-source building). The name source-root also corresponds to our API getSourceRoot(). Although it still doesn't accurately describe our needs, it essentially redirects the source root.
There was a problem hiding this comment.
Two diffrremt things, we need both of them.
There was a problem hiding this comment.
Another approach is to completely redirect everything using source-root, eliminating the need to worry about subdirectories during in-tree extension builds:
- All artifacts are uniformly extracted to source/{name}
- During static compilation of PHP extensions, a symbolic link is created to the root directory or the specified source-root to php-src/ext/{name}
- Shared extensions remain unaffected
There was a problem hiding this comment.
After doing this, our previous source-root and the current source-root for PHP extensions are actually the same thing.
There was a problem hiding this comment.
Are you sure that doesn't have edge cases with extension configs resolving to absolute paths before? If it's working with all extensions I think that's a good idea.
The test still set the removed metadata.source-root key, so it asserted a subdir that getSourceRoot() never applied. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011pkXY3NUGDanB7c1RGj8eA
What does this PR do?
Checklist before merging
*.phpor*.json, run them locally to ensure your changes are valid:composer cs-fixcomposer analysecomposer testbin/spc dev:sort-configsrc/globals/test-extensions.php.extension testortest extensionsto trigger full test suite.