project-everest / everest

https://project-everest.github.io/
Apache License 2.0
193 stars 29 forks source link

Update build machines to Python 3.x / Scons 3.0.0 #48

Closed BarryBo closed 4 years ago

BarryBo commented 7 years ago

Vale master and FStar barrybo_scons branch are both compatible with Scons 3.0.

The issue is that although Scons 3 itself can run on Python 2.7 or 3.x, the scripts we write are also executed by the Python language, and we risk writing code that runs on 2.7 and fails on 3.0, or vice versa. Much easier to simply require Python 3.x in our build.

I would like to switch all of Everest to Scons 3 running in Python 3.5 or higher before pushing my changes to FStar master. That way, the FStar community doesn't have to deal with a downstream upgrade to Scons 3/Python3.

On Ubuntu systems, "sudo apt-get install python3 python3-pip", "pip install scons" should install Python 3.5 and Scons 3. It is safe to uninstall "python" and "pip" to clear out the Python 2.7 binaries.

On Windows, install Python3 Windows x64 from https://www.python.org/downloads/windows/. It comes with pip. Then there are two options, and I don't know which is better. The scons team recommend installing scons via virtualenv (https://pypi.python.org/pypi/virtualenv). That creates a clone of the Python files/environment in a separate directory tree, and can then install scons inside. I had success running "pip install --egg scons" from an elevated command prompt. That put scons.bat under my Python install, and in my PATH. The "--egg" switch is marked as deprecated, but it works around a Windows-specific incompatibility with the Python installer script.

s-zanella commented 4 years ago

The everest script now checks that the appropriate versions of Python 3.x and Scons are present. If they aren't (when run with --yes) downloads and installs them. All our Docker images run everest --yes at some point.