-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Handle download progress, indentation, and "already enabled" printing inside installer plugin #803
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
Open
dzuelke
wants to merge
7
commits into
main
Choose a base branch
from
installer-dlprogress-and-indent
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6384234
to
101b8f9
Compare
Malax
approved these changes
May 19, 2025
101b8f9
to
9be8898
Compare
…roku-20 world The old test would, even if our implementation broke, never install a native ext-xmlrpc anymore, because we no longer have PHP 7. Updated to use PHP 8 and an ext-newrelic polyfill for a version that is only available until PHP 8.3. The whole thing should yield PHP 8.4, and not downgrade to 8.3 on the native extension install attempt.
…er plugin Instead of having our caller re-write the "nice output" file descriptor to achieve the desired indent level, we print it with the correct indent in the first place. With this, we can also add a progress meter that is useful e.g. in local CNB installs over slow network connections, as the downloads take longer than the installs, meaning a build might hang for quite some time without and progress output, until, suddenly, the names of the packages installed are printed in fairly quick succession. This progress meter is disabled in the classic buildpack, because Heroku Dashboard currently trips over the ANSI cursor control codes and ends up swallowing quite a lot of lines. GUS-W-18506658
Rather than in bin/compile's attempt-native-installs-of-polyfill-provided-packages loop, we can figure out if a requested package doesn't actually trigger an install event inside the plugin. This can happen when a polyfill declares that it provides a particular package, but that package is already there (e.g. because the extension is bundled with PHP and always enabled). We previously had to handle this on the caller side in bin/compile by tee-ing the installer output to a special file we'd inspect afterwards, since a successful install of a ".native" variant of a package and a "nothing to install or update" outcome both resulted in a 0 exit status, so we could only tell the two apart by checking the output. GUS-W-18557233
This allows us to also test a 'composer require' for a native extension replacing a polyfill
… install attempts
Turns out 60 seconds is not always enough for a build (since during the build, there are no transfers obviously, so it kicks in together with GIT_HTTP_LOW_SPEED_LIMIT=1000)
9be8898
to
f0170e7
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Instead of having our caller re-write the "nice output" file descriptor to achieve the desired indent level, we print it with the correct indent in the first place.
With this, we can also add a progress meter that is useful e.g. in local CNB installs over slow network connections, as the downloads take longer than the installs, meaning a build might hang for quite some time without and progress output, until, suddenly, the names of the packages installed are printed in fairly quick succession.
This progress meter is disabled in the classic buildpack, because Heroku Dashboard currently trips over the ANSI cursor control codes and ends up swallowing quite a lot of lines.
GUS-W-18506658
Instead of having special logic in
bin/compile
's attempt-native-installs-of-polyfill-provided-packages loop, we can figure out if a requested package doesn't actually trigger an install event from inside the plugin.This can happen when a polyfill declares that it provides a particular package, but that package is already there (e.g. because the extension is bundled with PHP and always enabled).
We previously had to handle this on the caller side in
bin/compile
bytee
ing the installer output to a special file we'd inspect afterwards, since a successful install of a ".native
" variant of a package and a "nothing to install or update" outcome both resulted in a0
exit status, so we could only tell the two apart by checking the output.GUS-W-18557233