Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Warn user about problematic locale settings #10996

Merged
merged 2 commits into from Nov 22, 2017
Merged

Conversation

@milch
Copy link
Collaborator

milch commented Nov 22, 2017

Some tools might silently fail or hang otherwise. See #10988

@googlebot googlebot added the cla: yes label Nov 22, 2017
@milch milch force-pushed the milch:warn-locale branch from d8f69ad to 502ddbe Nov 22, 2017
@milch milch force-pushed the milch:warn-locale branch from 502ddbe to 30cc58e Nov 22, 2017
@@ -22,6 +22,15 @@ def take_off
print_bundle_exec_warning(is_slow: (Time.now - before_import_time > 3))
end

unless ENV['LANG'].end_with?("UTF-8") || ENV['LC_ALL'].end_with?("UTF-8")

This comment has been minimized.

Copy link
@joshdholtz

joshdholtz Nov 22, 2017

Member

Does this compare need to be case insensitive? 🤔

This comment has been minimized.

Copy link
@milch

milch Nov 22, 2017

Author Collaborator

I'm not sure but I think it is better to err on the side of caution here: theoretically your locale setting has to match one of the outputs of locale -a, which uses the uppercased UTF-8 spelling

@milch milch merged commit 585b858 into fastlane:master Nov 22, 2017
2 checks passed
2 checks passed
ci/circleci Your tests passed on CircleCI!
Details
cla/google All necessary CLAs are signed
@milch milch deleted the milch:warn-locale branch Nov 22, 2017
@janpio

This comment has been minimized.

Copy link
Member

janpio commented Nov 22, 2017

Just noticed: The bundle exec fastlane test phase of the Circle build is full of this output now:

^D��^D��[07:32:19]: WARNING: fastlane requires your locale to be set to UTF-8. To learn more go to https://docs.fastlane.tools/getting-started/ios/setup/#set-up-environment-variables
[07:32:19]: WARNING: fastlane requires your locale to be set to UTF-8. To learn more go to https://docs.fastlane.tools/getting-started/ios/setup/#set-up-environment-variables
[07:32:19]: WARNING: fastlane requires your locale to be set to UTF-8. To learn more go to https://docs.fastlane.tools/getting-started/ios/setup/#set-up-environment-variables
[07:32:19]: WARNING: fastlane requires your locale to be set to UTF-8. To learn more go to https://docs.fastlane.tools/getting-started/ios/setup/#set-up-environment-variables

(and all through the test)

Intentional?

@milch

This comment has been minimized.

Copy link
Collaborator Author

milch commented Nov 22, 2017

Seems like we need to reconfigure circle? 😅

@milch

This comment has been minimized.

Copy link
Collaborator Author

milch commented Nov 22, 2017

@janpio See #11003, it's fixed now

@fastlane-bot

This comment has been minimized.

Copy link

fastlane-bot commented Nov 23, 2017

Hey @milch 👋

Thank you for your contribution to fastlane and congrats on getting this pull request merged 🎉
The code change now lives in the master branch, however it wasn't released to RubyGems yet.
We usually ship about once a week, and your PR will be included in the next one.

Please let us know if this change requires an immediate release by adding a comment here 👍
We'll notify you once we shipped a new release with your changes 🚀

@fastlane-bot

This comment has been minimized.

Copy link

fastlane-bot commented Nov 29, 2017

Congratulations! 🎉 This was released as part of fastlane 2.67.0 🚀

@funnel20

This comment has been minimized.

Copy link
Contributor

funnel20 commented Dec 1, 2017

After updating from Fastlane 2.64.1 to 2.68.0 I get several WARNINGs

Before
Martijns-MacBook-Pro:Frameit Martijn$ fastlane frameit silver
[23:23:14]: Seems like launching fastlane takes a while - please run
[23:23:14]:
[23:23:14]: $ [sudo] gem cleanup
[23:23:14]:
[23:23:14]: to uninstall outdated gems and make fastlane launch faster
[23:23:14]: Alternatively it's recommended to start using a Gemfile to lock your dependencies
[23:23:14]: To get started with a Gemfile, run
[23:23:14]:
[23:23:14]: $ bundle init
[23:23:14]: $ echo 'gem "fastlane"' >> Gemfile
[23:23:14]: $ bundle install
[23:23:14]:
[23:23:14]: After creating the Gemfile and Gemfile.lock, commit those files into version control
[23:23:14]: Get started using a Gemfile for fastlane https://docs.fastlane.tools/getting-started/ios/setup/#use-a-gemfile
[23:23:17]: Using device frames version 'latest'
[23:23:17]: Framing screenshot './screenshots/fr-FR/iPhone6-01_RemoteTab-589996837d813aace56d9a0cf7b764a0.png'
[23:23:25]: Added frame: '/Users/Martijn/iMKapps/debug/Frameit/screenshots/fr-FR/iPhone6-01_RemoteTab-589996837d813aace56d9a0cf7b764a0_framed.png'
[23:23:25]: Framing screenshot './screenshots/background.png'
[23:23:26]: Could not get title for screenshot ./screenshots/background.png. Please provide one in your Framefile.json

After
Martijns-MacBook-Pro:Frameit Martijn$ fastlane frameit silver
[23:26:02]: Seems like launching fastlane takes a while - please run
[23:26:02]:
[23:26:02]: $ [sudo] gem cleanup
[23:26:02]:
[23:26:02]: to uninstall outdated gems and make fastlane launch faster
[23:26:02]: Alternatively it's recommended to start using a Gemfile to lock your dependencies
[23:26:02]: To get started with a Gemfile, run
[23:26:02]:
[23:26:02]: $ bundle init
[23:26:02]: $ echo 'gem "fastlane"' >> Gemfile
[23:26:02]: $ bundle install
[23:26:02]:
[23:26:02]: After creating the Gemfile and Gemfile.lock, commit those files into version control
[23:26:02]: Get started using a Gemfile for fastlane https://docs.fastlane.tools/getting-started/ios/setup/#use-a-gemfile
[23:26:04]: WARNING: fastlane requires your locale to be set to UTF-8. To learn more go to https://docs.fastlane.tools/getting-started/ios/setup/#set-up-environment-variables
[23:26:05]: Using device frames version 'latest'
[23:26:05]: Framing screenshot './screenshots/fr-FR/iPhone6-01_RemoteTab-589996837d813aace56d9a0cf7b764a0.png'
[23:26:13]: Added frame: '/Users/Martijn/iMKapps/debug/Frameit/screenshots/fr-FR/iPhone6-01_RemoteTab-589996837d813aace56d9a0cf7b764a0_framed.png'
[23:26:13]: Framing screenshot './screenshots/background.png'
[23:26:14]: Could not get title for screenshot ./screenshots/background.png. Please provide one in your Framefile.json
[23:26:14]: WARNING: fastlane requires your locale to be set to UTF-8. To learn more go to https://docs.fastlane.tools/getting-started/ios/setup/#set-up-environment-variables
Martijns-MacBook-Pro:Frameit Martijn$ [23:26:14]: WARNING: fastlane requires your locale to be set to UTF-8. To learn more go to https://docs.fastlane.tools/getting-started/ios/setup/#set-up-environment-variables
[23:26:14]: WARNING: fastlane requires your locale to be set to UTF-8. To learn more go to https://docs.fastlane.tools/getting-started/ios/setup/#set-up-environment-variables

At the last it hang and I have to press CTRL-C to abort.

@milch

This comment has been minimized.

Copy link
Collaborator Author

milch commented Dec 1, 2017

@funnel20 Have you tried going to the link in the warning (https://docs.fastlane.tools/getting-started/ios/setup/#set-up-environment-variables) and setting the correct variables? Does it still show this error?

@funnel20

This comment has been minimized.

Copy link
Contributor

funnel20 commented Dec 1, 2017

@milch I'm sorry, I didn't. I did now, but I have no clue how to get these 2 EXPORT line in what.
Forgive me, but I really liked the concept of fastlane snapshot, fastlane frameit silver and fastlane deliver. That's all I know of your fantastic tool chain. And of Terminal basically...

I'm on a MacBook Pro with macOS 10.13.1, so if you can guide me (or extend the referred documentation) that would be much appreciated.

@milch

This comment has been minimized.

Copy link
Collaborator Author

milch commented Dec 1, 2017

Open your terminal, and run the following code (copy exactly as shown here):

echo -e "export LC_ALL=en_US.UTF-8\nexport LANG=en_US.UTF-8" >> ~/.bashrc

This will make sure all the necessary variables are set. Afterwards restart your terminal, and the warnings should not be shown anymore

@funnel20

This comment has been minimized.

Copy link
Contributor

funnel20 commented Dec 1, 2017

@milch Thanks a lot, you're the man!
Problem solved.

I think it can help other users to add this to the docu. Or I might be the dumbest...

@funnel20

This comment has been minimized.

Copy link
Contributor

funnel20 commented Dec 1, 2017

@milch Hmm, unfortunately the warning came back after several runs of frameit.
Any idea? I even restarted the MacBook.

@milch

This comment has been minimized.

Copy link
Collaborator Author

milch commented Dec 4, 2017

@funnel20 Do you still have this problem? Can you run echo $LANG from the terminal and see if the output is en_US.UTF-8?

I would add the script I posted to the docs, but it does not work generally for all setups. I made some guesses as to what your setup might be and it seems to have worked, at least at first.

@funnel20

This comment has been minimized.

Copy link
Contributor

funnel20 commented Dec 4, 2017

@milch Thanks for getting back to me. It's still there.
The output of that command is nothing:

Martijns-MacBook-Pro:Frameit Martijn$ echo $LANG

Martijns-MacBook-Pro:Frameit Martijn$ 

@milch

This comment has been minimized.

Copy link
Collaborator Author

milch commented Dec 4, 2017

That is weird, can you also run ls ~/.bashrc ~/.bash_profile ~/.zshrc ~/.config/fish/config.fish and echo $SHELL and post the output please?

@funnel20

This comment has been minimized.

Copy link
Contributor

funnel20 commented Dec 4, 2017

Here you go:

Martijns-MacBook-Pro:Frameit Martijn$ ls ~/.bashrc ~/.bash_profile ~/.zshrc ~/.config/fish/config.fish
ls: /Users/Martijn/.config/fish/config.fish: No such file or directory
/Users/Martijn/.bash_profile	/Users/Martijn/.bashrc		/Users/Martijn/.zshrc
Martijns-MacBook-Pro:Frameit Martijn$ echo $SHELL
/bin/bash
Martijns-MacBook-Pro:Frameit Martijn$ 
@milch

This comment has been minimized.

Copy link
Collaborator Author

milch commented Dec 4, 2017

Hmm, that's interesting... Can you try running the following two scripts and then restarting your Terminal, to see if that fixes the locale settings for you?

echo -e "export LC_ALL=en_US.UTF-8\nexport LANG=en_US.UTF-8" >> ~/.bash_profile
echo -e "export LC_ALL=en_US.UTF-8\nexport LANG=en_US.UTF-8" >> ~/.zshrc
@funnel20

This comment has been minimized.

Copy link
Contributor

funnel20 commented Dec 4, 2017

Martijns-MacBook-Pro:Frameit Martijn$ echo -e "export LC_ALL=en_US.UTF-8\nexport LANG=en_US.UTF-8" >> ~/.bash_profile
Martijns-MacBook-Pro:Frameit Martijn$ echo -e "export LC_ALL=en_US.UTF-8\nexport LANG=en_US.UTF-8" >> ~/.zshrc
Martijns-MacBook-Pro:Frameit Martijn$ echo $LANG

Martijns-MacBook-Pro:Frameit Martijn$ 

After restarting Terminal:

Martijns-MacBook-Pro:Frameit Martijn$ echo $LANG
en_US.UTF-8
Martijns-MacBook-Pro:Frameit Martijn$ 

And no more errors when running Frameit:

Martijns-MacBook-Pro:Frameit Martijn$ bundle exec fastlane frameit silver
[14:59:03]: Using device frames version 'latest'
[14:59:03]: Framing screenshot './screenshots/fr-FR/iPhone6-01_RemoteTab.png'
[14:59:10]: Added frame: '/Users/Martijn/iMKapps/debug/Frameit/screenshots/fr-FR/iPhone6-01_RemoteTab_framed.png'
[14:59:10]: Framing screenshot './screenshots/background.png'
[14:59:11]: Could not get title for screenshot ./screenshots/background.png. Please provide one in your Framefile.json
Martijns-MacBook-Pro:Frameit Martijn$ 

👍

@funnel20

This comment has been minimized.

Copy link
Contributor

funnel20 commented Dec 4, 2017

I hope this will now last longer then several days ago.

@milch

This comment has been minimized.

Copy link
Collaborator Author

milch commented Dec 4, 2017

Perfect! I don't know why, but it seems like your configuration file switched from ~/.bashrc to ~/.bash_profile within the last couple days. Maybe you installed an update, or some other tool that changed this? Honestly I've never seen a Mac using the ~/.bash_profile file before, only linux, so I don't know what could've caused this

@funnel20

This comment has been minimized.

Copy link
Contributor

funnel20 commented Dec 4, 2017

The only change that I can think of is the High Sierra root bug that auto-installed on last Friday:
https://support.apple.com/en-us/HT208315

Oh, and Bundler via gem install bundler

Both can be between my 2 posts that is was OK and NOK anymore. But due to how Github represents the post's elapsed time (3 days ago) instead of a real time stamp I can't determine if for sure.

@fastlane fastlane locked and limited conversation to collaborators Feb 3, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

6 participants
You can’t perform that action at this time.