[Bug 262948] Mk/Uses/scons.mk works only with default python version, not 3.9

From: <bugzilla-noreply_at_freebsd.org>
Date: Wed, 30 Mar 2022 20:10:21 UTC
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=262948

            Bug ID: 262948
           Summary: Mk/Uses/scons.mk works only with default python
                    version, not 3.9
           Product: Ports & Packages
           Version: Latest
          Hardware: Any
                OS: Any
            Status: New
          Severity: Affects Only Me
          Priority: ---
         Component: Ports Framework
          Assignee: portmgr@FreeBSD.org
          Reporter: dvl@FreeBSD.org
                CC: ports-bugs@FreeBSD.org

When building databases/mongodb36 or databases/mongodb40 with
DEFAULT_VERSIONS+=python=3.9, I would encounter this error:

build/opt/mongo/db/repl/replication_coordinator.o failed: CalledProcessError :
Command '['/usr/local/bin/python3.8', 'buildscripts/idl/idlc.py', '--include',
'src', 'src/mongo/db/logical_session_id.idl', '--write-dependencies']' returned
non-zero exit status 1.
===> Compilation failed unexpectedly.


I tracked it down to:

===>   mongodb36-3.6.23 depends on file: /usr/local/bin/python3.9 - found
===>   mongodb36-3.6.23 depends on file: /usr/local/bin/scons-3.8 - not found
===>   Installing existing package /packages/All/scons-py38-4.3.0.pkg
[130R-head-py39-job-04] Installing scons-py38-4.3.0...
[130R-head-py39-job-04] `-- Installing py38-setuptools-57.0.0...
[130R-head-py39-job-04] |   `-- Installing python38-3.8.13...
[130R-head-py39-job-04] |   `-- Extracting python38-3.8.13: .......... done
[130R-head-py39-job-04] `-- Extracting py38-setuptools-57.0.0: .......... done
[130R-head-py39-job-04] Extracting scons-py38-4.3.0: .......... done


With help from skered, I found a fix:

diff --git a/Mk/Uses/scons.mk b/Mk/Uses/scons.mk
index 8c598a6983dc..18e5d9e457f2 100644
--- a/Mk/Uses/scons.mk
+++ b/Mk/Uses/scons.mk
@@ -14,6 +14,7 @@ IGNORE+=      USES=scons takes no arguments
 .  endif

 _SCONS_PYTHON_VER=     ${PYTHON3_DEFAULT}
+_SCONS_PYTHON_VER=     ${_PYTHON_VERSION}

 _SCONS_PYTHON_FLAVOR=  py${_SCONS_PYTHON_VER:S|.||}



There are other fixes to the ports themselves to get them to build, but that's
what gets the right and expected version of scons. The ports also needed
devel/py-yaml and devel/py-cheetah3 as BUILD_DEPENDS.

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