[ https://issues.apache.org/jira/browse/KAFKA-4025?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15410798#comment-15410798 ]
ASF GitHub Bot commented on KAFKA-4025: --------------------------------------- GitHub user radai-rosenblatt opened a pull request: https://github.com/apache/kafka/pull/1708 KAFKA-4025 - make sure file.encoding system property is set to UTF-8 when invoking the rat task reset back to previous value after. You can merge this pull request into a Git repository by running: $ git pull https://github.com/radai-rosenblatt/kafka fix-build-on-windows Alternatively you can review and apply these changes as the patch at: https://github.com/apache/kafka/pull/1708.patch To close this pull request, make a commit to your master/trunk branch with (at least) the following in the commit message: This closes #1708 ---- commit cc249d06d98fd59ac42826aa2a894571a0967c34 Author: radai-rosenblatt <radai.rosenbl...@gmail.com> Date: 2016-08-07T02:21:58Z –KAFKA-4025 - make sure file.encoding system property is set to UTF-8 when invoking the rat task. reset back to previous value after ---- > build fails on windows due to rat target output encoding > -------------------------------------------------------- > > Key: KAFKA-4025 > URL: https://issues.apache.org/jira/browse/KAFKA-4025 > Project: Kafka > Issue Type: Bug > Environment: windows 7, either regular command prompt or git bash > Reporter: radai rosenblatt > Priority: Minor > Attachments: windows build debug output.txt > > > kafka runs a rat report during the build, using [the rat ant report > task|http://creadur.apache.org/rat/apache-rat-tasks/report.html], which has > no output encoding parameter. > this means that the resulting xml report is produced using the system-default > encoding, which is OS-dependent: > the rat ant task code instantiates the output writer like so > ([org.apache.rat.anttasks.Report.java|http://svn.apache.org/repos/asf/creadur/rat/tags/apache-rat-project-0.11/apache-rat-tasks/src/main/java/org/apache/rat/anttasks/Report.java] > line 196): > {noformat} > out = new PrintWriter(new FileWriter(reportFile));{noformat} > which eventually leads to {{Charset.defaultCharset()}} that relies on the > file.encoding system property. this causes an issue if the default encoding > isnt UTF-8 (which it isnt on windows) as the code called by > printUnknownFiles() in rat.gradle defaults to UTF-8 when reading the report > xml, causing the build to fail with: > {noformat} > com.sun.org.apache.xerces.internal.impl.io.MalformedByteSequenceException: > Invalid byte 1 of 1-byte UTF-8 sequence.{noformat} > (see complete output of {{gradlew --debug --stacktrace rat}} in attached file) -- This message was sent by Atlassian JIRA (v6.3.4#6332)