Describe the bug
I have a small sed replacement command that mass replaces sprintf with snprintf in cocos2d-x sources. 2 files in that repository contain an invalid byte sequence that chokes sed in UTF-8 locale, but setting LC_CTYPE=C makes it ignore those bytes on regular mac. That does not happen on GitHub Actions macOS runner.
To Reproduce
Steps to reproduce the behavior:
- Add the following command to your workflow file:
# sprintf is deprecated on most platforms. LC_CTYPE=C as edtaa3func.cpp/.h contain illegal byte sequence that chokes sed on macOS
find external/cocos2d-x -type f \( -name "*.cpp" -o -name "*.hpp" -o -name "*.c" -o -name "*.h" \) | LC_CTYPE=C xargs sed -i -e "s/sprintf(\([a-zA-Z][a-zA-Z_0-9]*\),/snprintf(\1,sizeof(\1),/g"
where external/cocos2d-x refers to cocos2d-x repository and files triggering sed to choke on macOS being external/cocos2d-x/external/edtaa3func/edtaa3func.cpp and external/cocos2d-x/external/edtaa3func/edtaa3func.h
2. Run the workflow job
3. See error:
+ find external/cocos2d-x -type f '(' -name '*.cpp' -o -name '*.hpp' -o -name '*.c' -o -name '*.h' ')'
+ LC_CTYPE=C
+ xargs sed -i -e 's/sprintf(\([a-zA-Z***[a-zA-Z_0-9****\),/snprintf(\1,sizeof(\1),/g'
sed: RE error: illegal byte sequence
##[error***Process completed with exit code 1.
Expected behavior
When I run the same command on my mac, it succeeds due to setting LC_CTYPE=C right before xargs, but judging from the output of GitHub runner, you guys seem to split that variable setting into something separate, which then doesn't set that variable for the downstream process
Runner Version and Platform
Version of your runner? 2.311.0
OS of the machine running the runner?
macOS
12.7.1
21G920
What's not working?
Please include error messages and screenshots.
Job Log Output
+ find external/cocos2d-x -type f '(' -name '*.cpp' -o -name '*.hpp' -o -name '*.c' -o -name '*.h' ')'
+ LC_CTYPE=C
+ xargs sed -i -e 's/sprintf(\([a-zA-Z***[a-zA-Z_0-9****\),/snprintf(\1,sizeof(\1),/g'
sed: RE error: illegal byte sequence
##[error***Process completed with exit code 1.
Describe the bug
I have a small sed replacement command that mass replaces sprintf with snprintf in cocos2d-x sources. 2 files in that repository contain an invalid byte sequence that chokes sed in UTF-8 locale, but setting LC_CTYPE=C makes it ignore those bytes on regular mac. That does not happen on GitHub Actions macOS runner.
To Reproduce
Steps to reproduce the behavior:
where
external/cocos2d-xrefers to cocos2d-x repository and files triggering sed to choke on macOS beingexternal/cocos2d-x/external/edtaa3func/edtaa3func.cppandexternal/cocos2d-x/external/edtaa3func/edtaa3func.h2. Run the workflow job
3. See error:
Expected behavior
When I run the same command on my mac, it succeeds due to setting
LC_CTYPE=Cright before xargs, but judging from the output of GitHub runner, you guys seem to split that variable setting into something separate, which then doesn't set that variable for the downstream processRunner Version and Platform
Version of your runner? 2.311.0
OS of the machine running the runner?
macOS
12.7.1
21G920
What's not working?
Please include error messages and screenshots.
Job Log Output