Backport error message/build output improvements from CNB#1783
Merged
Conversation
6ec5dc5 to
1f82947
Compare
Backports the error message/build output improvements made as part of: - heroku/buildpacks-python#352 - heroku/buildpacks-python#353 - heroku/buildpacks-python#354 - heroku/buildpacks-python#355 Plus: - applies similar changes to equivalent error messages that only exist in the classic buildpack (eg the Pipenv errors) - switches to use of contractions as per the CX team's style guidelines GUS-W-18225347. GUS-W-18421778.
1f82947 to
a834a2c
Compare
colincasey
approved these changes
May 2, 2025
Merged
edmorley
added a commit
that referenced
this pull request
May 6, 2025
The `cat --show-nonprinting` approach added in #1783 to aid the visualisation of invisible characters (such as ASCII control characters) also escapes carriage return characters (to `^M`), which we don't want. (But sadly this isn't mentioned in the manpage for `cat`.) Instead, `sed` is now used which replaces anything not matching the `:print:` and `:space:` groups with the Unicode substitution character (`�`) - which means the classic buildpack now also matches the CNB's behaviour: https://github.com/heroku/buildpacks-python/blob/f2fdd00edf0f63b298cf88c82377885c88666440/src/python_version_file.rs#L16-L19 For a mapping of what `:print:` and `:space:` cover, see the chart at the bottom of this page: https://en.cppreference.com/w/cpp/string/byte/isprint GUS-W-18225347.
edmorley
added a commit
that referenced
this pull request
May 6, 2025
From looking at metrics, I noticed that the `cat --show-nonprinting` approach added in #1783 to aid the visualisation of invisible characters (such as ASCII control characters) also escapes carriage return characters (to `^M`), which we don't want. Instead, `sed` is now used which replaces anything not matching the `:print:` and `:space:` groups with the Unicode substitution character (`�`) - which means the classic buildpack now also matches the CNB's behaviour: https://github.com/heroku/buildpacks-python/blob/f2fdd00edf0f63b298cf88c82377885c88666440/src/python_version_file.rs#L16-L19 For a mapping of what `:print:` and `:space:` cover, see the chart at the bottom of this page: https://en.cppreference.com/w/cpp/string/byte/isprint GUS-W-18225347.
edmorley
added a commit
that referenced
this pull request
May 6, 2025
From looking at metrics, I noticed that the `cat --show-nonprinting` approach added in #1783 to aid the visualisation of invisible characters (such as ASCII control characters) also escapes carriage return characters (to `^M`), which we don't want. Instead, `sed` is now used which replaces anything not matching the `:print:` and `:space:` groups with the Unicode substitution character (`�`) - which means the classic buildpack now also matches the CNB's behaviour: https://github.com/heroku/buildpacks-python/blob/f2fdd00edf0f63b298cf88c82377885c88666440/src/python_version_file.rs#L16-L19 For a mapping of what `:print:` and `:space:` cover, see the chart at the bottom of this page: https://en.cppreference.com/w/cpp/string/byte/isprint GUS-W-18225347.
edmorley
added a commit
that referenced
this pull request
May 6, 2025
From looking at metrics, I noticed that the `cat --show-nonprinting` approach added in #1783 to aid the visualisation of invisible characters (such as ASCII control characters) also escapes carriage return characters (to `^M`), which we don't want. Instead, `sed` is now used which replaces anything not matching the `:print:` and `:space:` groups with the Unicode substitution character (`�`) - which means the classic buildpack now also matches the CNB's behaviour: https://github.com/heroku/buildpacks-python/blob/f2fdd00edf0f63b298cf88c82377885c88666440/src/python_version_file.rs#L16-L19 For a mapping of what `:print:` and `:space:` cover, see the chart at the bottom of this page: https://en.cppreference.com/w/cpp/string/byte/isprint GUS-W-18225347.
edmorley
added a commit
that referenced
this pull request
May 6, 2025
From looking at metrics, I noticed that the `cat --show-nonprinting` approach added in #1783 to aid the visualisation of invisible characters (such as ASCII control characters) also escapes carriage return characters (to `^M`), which we don't want. Instead, `sed` is now used which replaces anything not matching the `:print:` and `:space:` groups with the Unicode substitution character (`�`) - which means the classic buildpack now also matches the CNB's behaviour: https://github.com/heroku/buildpacks-python/blob/f2fdd00edf0f63b298cf88c82377885c88666440/src/python_version_file.rs#L16-L19 For a mapping of what `:print:` and `:space:` cover, see the chart at the bottom of this page: https://en.cppreference.com/w/cpp/string/byte/isprint GUS-W-18225347.
edmorley
added a commit
that referenced
this pull request
May 6, 2025
From looking at metrics, I noticed that the `cat --show-nonprinting` approach added in #1783 to aid the visualisation of invisible characters (such as ASCII control characters) also escapes carriage return characters (to `^M`), which we don't want. Instead, `sed` is now used which replaces anything not matching the `:print:` and `:space:` groups with the Unicode substitution character (`�`) - which means the classic buildpack now also matches the CNB's behaviour: https://github.com/heroku/buildpacks-python/blob/f2fdd00edf0f63b298cf88c82377885c88666440/src/python_version_file.rs#L16-L19 For a mapping of what `:print:` and `:space:` cover, see the chart at the bottom of this page: https://en.cppreference.com/w/cpp/string/byte/isprint GUS-W-18225347.
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
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.
Backports the error message/build output improvements made as part of:
runtime.txtbuildpacks-python#352.python-versionbuildpacks-python#353.python-versioncontains invisible characters buildpacks-python#354Plus:
GUS-W-18225347.
GUS-W-18421778.