java_maven workflow not up-to-date fails on utf-8 encoding issues of Maven output #6075
Labels
area/build
sam build command
stage/waiting-for-release
Fix has been merged to develop and is waiting for a release
Description:
This issue is not about the original encoding handling problem, but the fact, that current installer does not include the package which seems to fix that issue.
sam build
fails withError: JavaMavenWorkflow:MavenBuild - 'utf-8' codec can't decode byte 0xdf in position 76813: invalid continuation byte
.--debug
shows the error originates from\aws_lambda_builders\workflows\java_maven\maven.py", line 31
which is this:LOG.debug("Maven logs: %s", stdout.decode("utf8").strip())
This is weird as there are preexisting issues (ie. #1164 ) related to this, which got closed already. And fun fact is, that the
aws_lambda_builders
included with CLI installer does not seem to be the same as current content of the repository for that package. at leastmaven.py
now uses an util for decoding maven output, instead direcly usingdecode()
with hardcodedutf-8
.Steps to reproduce:
sam.cmd build Function --template project\.aws-sam\temp-template.yaml --build-dir project\.aws-sam\build
Observed result:
SAM build fails after Maven finishes successfully:
If, however, I update the installed
maven.py
to sayLOG.debug("Maven logs: %s", stdout.decode(encoding="utf8", errors="replace").strip())
the whole build passes without issue, also cannot identify where the replacement was done.Expected result:
I'd expect Maven output to be copied as-is, and in general, console output encoding should have no impact on the build process...
Additional environment details (Ex: Windows, Mac, Amazon Linux etc)
sam --version
: SAM CLI, version 1.98.0sam --info
The text was updated successfully, but these errors were encountered: