Poudriere with Overlays: overriding Makefile variables

Hi,

I am testing out repository overlays with Poudriere and have come across a minor roadblock when building the Python 3.12 package along with a custom Mk/Uses/python.mk file. I have successfully built Python 3.12 through Poudriere before when the Port was located at /usr/ports/lang/python312. However, the build fails when leveraging overlays:

make: "/overlays/custom/Mk/Uses/python.mk" line 548: Cannot open /usr/ports/lang/python312/Makefile.version
make: Fatal errors encountered -- cannot continue
[00:00:01] Error: Error looking up pre-build ports vars

The custom python.mk is referencing $PORTSDIR instead of the custom repository path $OVERLAYS:

Makefile:
# Protect partial checkouts from Mk/Scripts/functions.sh:export_ports_env().
.  if !defined(_PORTS_ENV_CHECK) || exists(${PORTSDIR}/${PYTHON_PORTSDIR})
.include "${PORTSDIR}/${PYTHON_PORTSDIR}/Makefile.version"
.  endif

Replacing $PORTSDIR with $OVERLAYS resolves the issue, but I'm not certain this is the best solution. There are a number of ports, such as databases/py-sqlite3 and x11-toolkits/py-tkinter that will require a similar modification in their Makefile:

Makefile:
DISTINFO_FILE=  ${PORTSDIR}/lang/python${PYTHON_SUFFIX}/distinfo

Instead of modifying every single Makefile, I believe another approach is to update py312-make.conf so it overrides the value of $PORTSDIR with the one from $OVERLAYS. Unfortunately, I am unable to figure out the proper way to do so. Here's what I've come up with so far (contents of py312-make.conf):

Makefile:
.if ${.CURDIR:M*/py-*}
.if defined(DISTINFO_FILE)
  DISTINFO_FILE=${OVERLAYS}/lang/python${PYTHON_SUFFIX}/distinfo
.endif
.endif

The goal is to override DISTINFO_FILE for specific Ports "on the fly" while building. Is this actually possible? If so, what's wrong with my syntax and/or approach?

Overview:
  • FreeBSD 14.2 host with an identical build jail.
  • Poudriere version: poudriere-git-3.4.2
  • Custom repo path: /usr/local/ports
  • Python 3.12 is under /usr/local/ports/lang/python312
  • Custom python.mk is placed in /usr/local/ports/Mk/Uses
List of Poudriere repositories:
PORTSTREE METHOD TIMESTAMP PATH
custom null 2024-12-16 14:08:39 /usr/local/ports
default git+https 2024-12-16 16:43:12 /usr/local/poudriere/ports/default
local null 2024-12-16 13:03:28 /usr/ports

Poudriere build command used:
screen poudriere bulk -j 142x64 -p default -O custom -f /usr/local/etc/poudriere.d/packages-hass -z py312

Custom python.mk has been modified to include versions 3.12 and 3.13 (line 319):
# What Python version and what Python interpreters are currently supported?
# When adding a version, please keep the comment in
# Mk/bsd.default-versions.mk in sync.
_PYTHON_VERSIONS= 3.13 3.12 3.11 3.10 3.9 3.8 2.7 # preferred first
_PYTHON_PORTBRANCH= 3.11 # ${_PYTHON_VERSIONS:[1]}
 
Back
Top