Switching main Python versions in FreeBSD
In my infinite (and possibly questionable) wisdom, I usually lock down various software to particular versions. This time I wanted to change the main Python from version 2.7 to version 3.6 on the FreeBSD builder at ${WORK}
.
In other words, in /etc/make.conf
and in /usr/local/etc/synth/LiveSystem-make.conf
, the first of these 3 lines
DEFAULT_VERSIONS+=python=2.7 DEFAULT_VERSIONS+=python2=2.7 DEFAULT_VERSIONS+=python3=3.6
was changed to this
DEFAULT_VERSIONS+=python=3.6 DEFAULT_VERSIONS+=python2=2.7 DEFAULT_VERSIONS+=python3=3.6
So far, so good,
Trouble arose when py27-setuptools-41.2.0
and py36-setuptools-41.2.0
both claimed ownership of the /usr/local/bin/easy_install
symlink.
pkg-static: py36-setuptools-41.2.0 conflicts with py27-setuptools-41.2.0 (installs files into the same place). Problematic file: /usr/local/bin/easy_install
Comparing against the files on my new laptop (a blog post on that might appear), I noticed the /usr/local/bin/easy_install
symlink appears only in py36-setuptools-41.2.0
and not in py27-setuptools-41.2.0
, and both packages are installed without any conflict.
I took a guess and figured I simply had to delete py27-setuptools-41.2.0.txz
from the builder’s package repository and rerun synth
(1).
My hunch was right. The world can continue spinning.
Dan Langille
With poudriere, I’ve started trying -z py27 or -z py36
With py27-make.conf containing:
DEFAULT_VERSIONS+=python=2.7
And py36-make.conf containing:
DEFAULT_VERSIONS+=python=3.6
The goal is to give users a mostly-PY36 or mostly PY27 environment. We are still using many ports which are 2.7-only