cctbx / cctbx_project

Computational Crystallography Toolbox
https://cci.lbl.gov/docs/cctbx
Other
214 stars 111 forks source link

bootstrap base fails with (inactive) unicode conda environments #341

Open ndevenish opened 5 years ago

ndevenish commented 5 years ago
$ conda create -p "some_🤔"
$ ./bootstrap.py base --use-conda

Performing actions: base
Installing base packages using:
  python modules/cctbx_project/libtbx/auto_build/install_conda.py --builder=cctbx --install_conda

  removing .pyc files in /Users/nickd/dials/dist_1.14/modules, walk? True
  removed 1 files
===== Running in .: base
modules/cctbx_project/libtbx/auto_build/install_conda.py:319: UnicodeWarning: Unicode equal comparison failed to convert both arguments to Unicode - interpreting them as being unequal
  consistency_check.append(env in conda_info['envs'])
Traceback (most recent call last):
  File "modules/cctbx_project/libtbx/auto_build/install_conda.py", line 719, in <module>
    run()
  File "modules/cctbx_project/libtbx/auto_build/install_conda.py", line 711, in run
    verbose=namespace.verbose)
  File "modules/cctbx_project/libtbx/auto_build/install_conda.py", line 326, in __init__
    """)
RuntimeWarning:
There is a mismatch between the conda settings in your home directory
and what "conda info" is reporting. This is not a fatal error, but if
an error is encountered, please check that your conda installation and
environments exist and are working.

Process failed with return code 1
bkpoon commented 5 years ago

Oops, I didn't change the raise when I changed RuntimeError to RuntimeWarning. I just committed e85a70581599585a10ff6e19e109dcc69a254e06, which should fix the problem.

Also, if you want to build with Unicode paths, Python 3 will be needed. Otherwise, SCons will likely have UnicodeDecodeError issues.

ndevenish commented 5 years ago

Hi Billy,

This fixes the symptom but not the cause, from that log, which is:

modules/cctbx_project/libtbx/auto_build/install_conda.py:318: UnicodeWarning: Unicode equal comparison failed to convert both arguments to Unicode - interpreting them as being unequal

From the fact that in python2 conda_base is treated as a str, not a unicode, and being compared to a unicode string. I'm not installing to a unicode path, but a cctbx-unrelated one exists in the system conda environment.

Worryingly, this even happens if I launch bootstrap with python3 bootstrap.py - it looks like bootstrap.py - at least - is making bad assumptions about the interpreter in https://github.com/cctbx/cctbx_project/blob/86ea48ba2e317d910ce469bc7304f30c393504ce/libtbx/auto_build/bootstrap.py#L1603-L1605