Workaround the Gradle crash due to non ASCII characters.#26024
Workaround the Gradle crash due to non ASCII characters.#26024amirh merged 1 commit intoflutter:masterfrom
Conversation
1340331 to
933de9f
Compare
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: 😄
933de9f to
b54e22e
Compare
|
Rather than doing this in our cirrus config, how about making the flutter tool filter all the environment variables? That would solve the problem for our users too. |
|
I'm not sure we want to do this for our users, if you have your locale properly set to UTF8 it won't crash (which I want to believe is the case on most end user machines), and touching environment variables we know nothing about sounds dangerous. Note that I did it in the cirrus script and not in bots/test.dart as I wanted to keep a consistent temp-workaround here and in flutter/plugins#1031. Hopefully this workaround will be very temporary (and will be replaced by a less temporary workaround - set a UTF8 locale on the Cirrus image). |
|
Fair enough. My worry is that people will run into this and not know what to do (it took us forever to figure it out too). If we could have the |
|
Agreed regarding having the flutter tool show a warning, the reason it isn't trivial is that I'm not sure how to detect the bad state, e.g I know you need a non-ASCII character in the environment, and a locale that is not properly set to handle UTF8, though I don't currently know how to characterize the error (if you follow my attempt description on #24935 you'll see that just checking the value of LANG is not enough). |
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 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: 😄
More details (including my failed attempts to set a UTF8 locale on Cirrus) here: #24935