From 3782b6abf2e14adb1706ff104ecbae7bf4ea4187 Mon Sep 17 00:00:00 2001 From: Amir Hardon Date: Thu, 3 Jan 2019 16:27:47 -0800 Subject: [PATCH] Workaround the Gradle crash due to non ASCII chars. (#26024) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cirrus puts the PR description and commit message in environment variables. These messages tend to have non ASCII characters sometimes (like emojis), which triggers a Gradle bug (gradle/gradle#3117) resulting in Gradle crashing without a helpful error message. The real solution to this problem should be fixing the Gradle bug. The better workaround on the Flutter side would be to set a UTF8 locale on the Cirrus machine, but I have yet figured out how to do it. For now to avoid more people from hitting this I'm working around by temporarily unsetting the Cirrus environment variables with the PR description and commit message. A non ASCII character to make sure it works: 😄 --- .cirrus.yml | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/.cirrus.yml b/.cirrus.yml index cf5b523ebf..0eac9ba226 100644 --- a/.cirrus.yml +++ b/.cirrus.yml @@ -67,7 +67,19 @@ task: env: SHARD: build_tests test_script: + # Unsetting CIRRUS_CHANGE_MESSAGE and CIRRUS_COMMIT_MESSAGE as they + # might include non-ASCII characters which makes Gradle crash. + # See: https://github.com/flutter/flutter/issues/24935 + # This is a temporary workaround until we figure how to properly configure + # a UTF8 locale on Cirrus (or until the Gradle bug is fixed). + # TODO(amirh): Set the locale to UTF8. + - echo "$CIRRUS_CHANGE_MESSAGE" > /tmp/cirrus_change_message.txt + - echo "$CIRRUS_COMMIT_MESSAGE" > /tmp/cirrus_commit_message.txt + - export CIRRUS_CHANGE_MESSAGE="" + - export CIRRUS_COMMIT_MESSAGE="" - dart ./dev/bots/test.dart + - export CIRRUS_CHANGE_MESSAGE=`cat /tmp/cirrus_change_message.txt` + - export CIRRUS_COMMIT_MESSAGE=`cat /tmp/cirrus_commit_message.txt` container: cpu: 4 memory: 12G