[chore] Fix make update-otel
on macOS
#35587
Merged
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.
Description:
When working on #35580, it seemed that
make update-otel
was not properly updating thebuilder-config.yaml
files. I traced this down to theupdatehelper
script not working as intended. This turned out to be because it uses some features of thesed
utility which do not exist on macOS, causing no updates to be made.The
\s
(whitespace) regex class is a GNU extension forsed
; the POSIX-compatible equivalent is[[:space:]]
(related SO question).Moreover, on macOS, the
-i
(in-place) option requires an argument, even if empty; otherwise the-e
following it is parsed as that argument, creating an unnecessary backup file (related SO question).Testing:
I manually tested this change as part of developing the aforementioned PR; the script seems to work on macOS now. It would be good for someone to test this change on Linux to make sure nothing has broken there.