Skip to content

Backport error message/build output improvements from CNB#1783

Merged
edmorley merged 1 commit intomainfrom
backport-error-message-improvements
May 2, 2025
Merged

Backport error message/build output improvements from CNB#1783
edmorley merged 1 commit intomainfrom
backport-error-message-improvements

Conversation

@edmorley
Copy link
Copy Markdown
Member

@edmorley edmorley commented May 2, 2025

Backports the error message/build output improvements made as part of:

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.

@edmorley edmorley self-assigned this May 2, 2025
@edmorley edmorley force-pushed the backport-error-message-improvements branch from 6ec5dc5 to 1f82947 Compare May 2, 2025 14:20
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.
@edmorley edmorley force-pushed the backport-error-message-improvements branch from 1f82947 to a834a2c Compare May 2, 2025 14:27
@edmorley edmorley marked this pull request as ready for review May 2, 2025 14:39
@edmorley edmorley requested a review from a team as a code owner May 2, 2025 14:39
@edmorley edmorley enabled auto-merge (squash) May 2, 2025 14:40
@edmorley edmorley merged commit 6fd8079 into main May 2, 2025
6 checks passed
@edmorley edmorley deleted the backport-error-message-improvements branch May 2, 2025 15:36
@heroku-linguist heroku-linguist bot mentioned this pull request May 6, 2025
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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants