[FreeBSD-Ports-Announce] [HEADS UP]: Conflict-free python packages for different python versions

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view

[FreeBSD-Ports-Announce] [HEADS UP]: Conflict-free python packages for different python versions

Marcus von Appen-2
On behalf of the FreeBSD python team, I'd like to announce the availability of
concurrent, conflict-free python package support in the ports tree.


  FreeBSD supports different python versions and flavours to be installed at
  the same time, such as e.g. Python 2.7 and Python 3.3. Ports installing
  python modules however always assume that that they are installed
  for only one python version.

  To overcome the flaw in the ports tree that a single port, which is about to
  be installed for different python versions at the same time, will install
  conflicting files into the same directories, a change in how those ports are
  built and installed was necessary.

What does that mean for port and pkg users?

  If you are using the ports tree to build your own ports from scratch, it
  won't have any impact as of now, since the underlying package installers, be
  it pkg or the pkg_* tools, can't install multiple packages from the same
  source port yet.

  If you are using pkg or the pkg_* tools to install binary packages, it won't
  have any impact as well, since they can't install multiple packages from the
  same source port yet.

  You should be aware of some directory and file name changes, though, that
  eventually will occur on updates. A python module may use the python version
  prefix for the doc and example directories and create scripts and binaries
  with a python version suffix.

  Right now, a port devel/py-foo might install

    * documentation into/usr/local/share/doc/foo,
    * examples into /usr/local/share/examples/foo,
    * a script /usr/local/bin/foo

  The announced change (along with an update to the port) will cause it to use
  a python version prefix for the directories and a version suffix for the
  scripts (and binaries). This means, that the port will install

    * documentation into /usr/local/share/doc/py27-foo (for lang/python27)
    * documentation into /usr/local/share/doc/py32-foo (for lang/python32)
    * documentation into /usr/local/share/doc/py33-foo (for lang/python33)
    * examples into /usr/local/share/examples/py27-foo (for lang/python27)
    * examples into /usr/local/share/examples/py32-foo (for lang/python32)
    * examples into /usr/local/share/examples/py33-foo (for lang/python33)
    * a script /usr/local/bin/foo-2.7 (for lang/python27)
    * a script /usr/local/bin/foo-3.2 (for lang/python32)
    * a script /usr/local/bin/foo-3.3 (for lang/python33)
    * a symlink /usr/local/bin/foo pointing to the script for the current
      default python version (e.g. foo-2.7 or foo-3.3)

  Please note that the current installation behaviour will not be changed
  automatically. Ports that shall support conflict-free packages, must receive
  an update first.

If you are not a port maintainer, committer or developer, you can stop
reading now.

What about maintainers and port developers?

  Please read the CHANGES. The change makes use of USES=uniquefiles:dirs.
  Thus, if you are maintaining a port, which shall become conflict-free,
  set the new PYTHON_CONCURRENT_INSTALL knob to yes. The port must be
  stage-safe to use the knob.

  Please ensure that you do not set DATADIR, DOCSDIR, WWWDIR, EXAMPLESDIR or
  ETCDIR explicitly in the port Makefile, since the uniquefiles USES will try
  to prefix those. The change will also add a suffix to binaries and scripts
  that will be installed into ${PREFIX}/bin, ${PREFIX}/sbin, ${PREFIX}/libexec
  and create a symlink for the default python version on demand. If you are
  using a manually maintained pkg-plist, you may need to adjust it using the
  PYTHON_PKGNAMEPREFIX and PYTHON_VER variables to properly substitute
  plist entries. If you are using PYDISTUTILS_AUTOPLIST, you usually do not
  have take care of any plist modifications.

  The rule of thumb is that most end-user applications, service daemons and
  similar tools do not need to be installed concurrently for different python
  versions. Python modules however will gain an immediate benefit, since they
  can be provided for different python versions at the same time without
  forcing the user to install them manually from another location.

  We chose the knob to be an opt-in, rather than an opt-out solution, due to
  various constraints, such as a full package rebuild, the requirement to
  check all python-related ports prior to the commit and to keep the immediate
  impact for users as small as possible.

  If you have any specific questions about how to update your port, do not
  hesitate to ask the FreeBSD python team.


attachment0 (188 bytes) Download Attachment