Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 30 Aug 2016 22:58:32 +0000
From:      bugzilla-noreply@freebsd.org
To:        freebsd-ports-bugs@FreeBSD.org
Subject:   [Bug 212273] Mk/Uses/python.mk: [PATCH] PYTHON_VERSION improperly propagated through DEPENDS_ARGS
Message-ID:  <bug-212273-13@https.bugs.freebsd.org/bugzilla/>

next in thread | raw e-mail | index | archive | help
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D212273

            Bug ID: 212273
           Summary: Mk/Uses/python.mk: [PATCH] PYTHON_VERSION improperly
                    propagated through DEPENDS_ARGS
           Product: Ports & Packages
           Version: Latest
          Hardware: Any
                OS: Any
            Status: New
          Keywords: patch
          Severity: Affects Some People
          Priority: ---
         Component: Ports Framework
          Assignee: portmgr@FreeBSD.org
          Reporter: m.r.sopacua@gmail.com
                CC: freebsd-ports-bugs@FreeBSD.org
          Keywords: patch

Created attachment 174236
  --> https://bugs.freebsd.org/bugzilla/attachment.cgi?id=3D174236&action=
=3Dedit
Fix PYTHON_VERSION propagation.

In the following (not so corner) case, the propagation of PYTHON_VERSION
through DEPENDS_ARGS will result in dependency bugs:

PYTHON_VERSION?=3D python${_PYTHON_VERSION}
DEPENDS_ARGS+=3D PYTHON_VERSION=3D${PYTHON_VERSION}

So, on a submake through the depends target and Mk/Scripts/do-depends.sh
PYTHON_VERSION will be set.  Assume to python3.4. If a dependency specifies:
USES=3D python:2

A warning is shown and a version is looked for that matches the port's desi=
re.
In this case _PYTHON_VERSION (with leading underscore) will be set to 2.7.
However, since "Command line variables" are imported into the Makefile's
variables it will be set already, so the downgraded version is not respecte=
d.

How to Repeat:
0. Add DEFAULT_VERSIONS+=3Dpython=3D3.4 to /etc/make.conf
1. Pre-build devel/py-setuptools and ensure package lives in correct place =
for
USE_PACKAGE_DEPENDS to work.
2. Uninstall setuptools
3. make -C ${PORTSDIR}/editors/libreoffice -DUSE_PACKAGE_DEPENDS clean depe=
nds

Expected result:
Full build of libreoffice dependencies

Actual result:
=3D=3D=3D>   serf-1.3.8_1 depends on file: /usr/local/bin/scons - not found
=3D=3D=3D> install_depends "/usr/ports/devel/scons" "full-package" ""
/!\ WARNING /!\
needs Python 2.7 at most. But a port depending on this one specified 3.4

=3D=3D=3D>   NOTICE:

The scons port currently does not have a maintainer. As a result, it is
more likely to have unresolved issues, not be up-to-date, or even be remove=
d in
the future. To volunteer to maintain this port, please create an issue at:

https://bugs.freebsd.org/bugzilla

More information about port maintainership is available at:

https://www.freebsd.org/doc/en/articles/contributing/ports-contributing.htm=
l#maintain-port

=3D=3D=3D>  License MIT accepted by the user
=3D=3D=3D>   scons-2.5.0 depends on file: /usr/local/sbin/pkg - found
=3D=3D=3D> Fetching all distfiles required by scons-2.5.0 for building
=3D=3D=3D>  Extracting for scons-2.5.0
=3D> SHA256 Checksum OK for scons-2.5.0.tar.gz.
=3D=3D=3D>  Patching for scons-2.5.0
=3D=3D=3D>  Applying FreeBSD patches for scons-2.5.0
=3D=3D=3D>   scons-2.5.0 depends on package: py27-setuptools27>0 - not found
=3D=3D=3D> install_depends "/usr/ports/devel/py-setuptools27" "full-package"
"PYTHON_VERSION=3Dpython3.4"
=3D=3D=3D>   Installing existing package
/var/packages/devstation/All/py34-setuptools34-23.1.0.txz
[pkg.earth.jail] Installing py34-setuptools34-23.1.0...
[pkg.earth.jail] Extracting py34-setuptools34-23.1.0: 100%
Message from py34-setuptools34-23.1.0:
*******************************************************************

  Only /usr/local/bin/easy_install-3.4 script has been installed
  since Python 3.4 is not the default Python version.

*******************************************************************
=3D=3D=3D>   scons-2.5.0 depends on package: py27-setuptools27>0 - not found
*** Error code 1

Note:
The lines with =3D=3D=3D> install_depends is shown by an inserted debug out=
put in
Mk/Scripts/do-depends.sh:

diff --git a/Mk/Scripts/do-depends.sh b/Mk/Scripts/do-depends.sh
index 399a999..74534d8 100644
--- a/Mk/Scripts/do-depends.sh
+++ b/Mk/Scripts/do-depends.sh
@@ -170,6 +170,7 @@ for _line in ${dp_RAWDEPENDS} ; do
   fi

   # Now actually install the dependencies
+  echo "=3D=3D=3D> install_depends \"${origin}\" \"${target}\" \"${depends=
_args}\""
   install_depends "${origin}" "${target}" "${depends_args}"
   # Recheck if the installed dependency validates the pattern except for
/nonex
   [ "${fct}" =3D "false" ] || ${fct} "${pattern}"

This shows:
a) The warning message about downgrading the package version
b) The unchanged PYTHON_VERSION being propagated.

The patch fixes the issue. Whether keeping this PYTHON_VERSION around later
screws up _PYTHON_FEATURE_CONCURRENT, is currently beyond my scope.

P.S. While researching Mk/Scripts/do-depends.sh it also showed two cases wh=
ere
depends_args is overwritten instead of appended to before install_depends is
called. I'm currently assuming that's intentional.

--=20
You are receiving this mail because:
You are on the CC list for the bug.=



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-212273-13>