Skip to content

Commit

Permalink
Workaround the Gradle crash due to non ASCII chars. (flutter#26024)
Browse files Browse the repository at this point in the history
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: 😄
  • Loading branch information
amirh authored and kangwang1988 committed Feb 12, 2019
1 parent 4b5fe59 commit 02d3a95
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions .cirrus.yml
Expand Up @@ -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
Expand Down

0 comments on commit 02d3a95

Please sign in to comment.