Skip to content

Instantly share code, notes, and snippets.

@MartinRogalla
Last active June 5, 2018 18:24
Show Gist options
  • Select an option

  • Save MartinRogalla/3f99742012f20db6a41c779f1837f106 to your computer and use it in GitHub Desktop.

Select an option

Save MartinRogalla/3f99742012f20db6a41c779f1837f106 to your computer and use it in GitHub Desktop.
Building servo/servo on MacOS

Situation

Had a small issue with a locale when building servo/servo. I'll share this, in case someone else has the same issue.

brew install automake pkg-config python cmake yasm
pip install virtualenv

brew install openssl

export OPENSSL_INCLUDE_DIR="$(brew --prefix openssl)/include"
export OPENSSL_LIB_DIR="$(brew --prefix openssl)/lib"

./mach build --dev

Problem

Afterwards I get a trace containing (note: replaced my user-path w/ --USER-PATH-REMOVED--):

INFO: Installing setuptools, pip, wheel...
INFO:   Complete output from command --USER-PATH-REMOVED--...rtualenv/bin/python2 - setuptools pip wheel:
INFO:   Traceback (most recent call last):
INFO:   File "<stdin>", line 23, in <module>
INFO:   File "--USER-PATH-REMOVED--mozjs_sys-0.51.1/mozjs/python/virtualenv/virtualenv_support/pip-8.1.1-py2.py3-none-any.whl/pip/__init__.py", line 215, in main
INFO:   File "--USER-PATH-REMOVED--mozjs_sys-d4d4cc1e26ce451a/out/_virtualenv/lib/python2.7/locale.py", line 581, in setlocale
INFO:     return _setlocale(category, locale)
INFO: locale.Error: unsupported locale setting
INFO: ----------------------------------------
INFO: ...Installing setuptools, pip, wheel...done.
INFO: Traceback (most recent call last):
INFO:   File "--USER-PATH-REMOVED--mozjs_sys-0.51.1/mozjs/python/virtualenv/virtualenv.py", line 2316, in <module>
INFO:     main()
INFO:   File "--USER-PATH-REMOVED--mozjs_sys-0.51.1/mozjs/python/virtualenv/virtualenv.py", line 708, in main
INFO:     symlink=options.symlink)
INFO:   File "--USER-PATH-REMOVED--mozjs_sys-0.51.1/mozjs/python/virtualenv/virtualenv.py", line 941, in create_environment
INFO:     download=download,
INFO:   File "--USER-PATH-REMOVED--mozjs_sys-0.51.1/mozjs/python/virtualenv/virtualenv.py", line 897, in install_wheel
INFO:     call_subprocess(cmd, show_stdout=False, extra_env=env, stdin=SCRIPT)
INFO:   File "--USER-PATH-REMOVED--mozjs_sys-0.51.1/mozjs/python/virtualenv/virtualenv.py", line 792, in call_subprocess
INFO:     % (cmd_desc, proc.returncode))
INFO: OSError: Command --USER-PATH-REMOVED--...rtualenv/bin/python2 - setuptools pip wheel failed with error code 1

Solution

The problem here is that for some reason my locale wasn't set correctly. To resolve this I ran export LC_ALL=en_US.UTF-8 and added the following to my ~/.bashrc:

# Locale
export LANG=en_US.UTF-8
export LC_ALL=en_US.UTF-8
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment