Bug 294987 - devel/py-maturin does not install versioned binary maturin-${PYTHON_VER}
Summary: devel/py-maturin does not install versioned binary maturin-${PYTHON_VER}
Status: In Progress
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Some People
Assignee: Kai Knoblich
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2026-05-03 20:51 UTC by Hajime Murai
Modified: 2026-05-05 13:45 UTC (History)
0 users

See Also:
kai: maintainer-feedback+


Attachments
Fixed Makefile without USE_PYTHON= concurrent (1.40 KB, text/plain)
2026-05-03 20:51 UTC, Hajime Murai
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Hajime Murai 2026-05-03 20:51:46 UTC
Created attachment 270391 [details]
Fixed Makefile without USE_PYTHON= concurrent

Category: Ports & Packages
Port: devel/py-maturin
Maintainer: kai@FreeBSD.org
Affected version: DISTVERSION=1.13.1, PORTREVISION=1
FreeBSD version: 15.0-RELEASE-p8

--- Description ---

When building security/py-cryptography (PORTVERSION=46.0.7) on FreeBSD 15.0-RELEASE-p8, the build fails with the following error:

  FileNotFoundError: [Errno 2] No such file or directory: 'maturin-3.12'

The maturin Python package invokes a versioned binary 'maturin-${PYTHON_VER}' (e.g. 'maturin-3.12') at build time via maturin/__init__.py. However, devel/py-maturin only installs the unversioned binary '/usr/local/bin/maturin'; no versioned symlink or hard link is created.

The Makefile contains a post-patch target that attempts to substitute %%PYTHON_VER%% in ${WRKSRC}/maturin/__init__.py, but this does not result in a versioned binary being installed under ${PREFIX}/bin.

--- Steps to Reproduce ---

1. Install devel/py-maturin (DISTVERSION=1.13.1) for Python 3.12:
     cd /usr/ports/devel/py-maturin && make install clean

2. Confirm that only the unversioned binary is installed:
     ls /usr/local/bin/maturin*
     => /usr/local/bin/maturin   (maturin-3.12 is absent)

3. Attempt to build security/py-cryptography:
     cd /usr/ports/security/py-cryptography && make
     => FileNotFoundError: [Errno 2] No such file or directory: 'maturin-3.12'

--- Workaround ---

Manually creating a hard link resolves the issue:

     cd /usr/local/bin && ln maturin maturin-3.12

After this, security/py-cryptography builds successfully.

--- Suggested Fix ---

Add a post-install target to devel/py-maturin/Makefile that installs a versioned hard link (or symlink) for each Python flavour:

     post-install:
             cd ${STAGEDIR}${PREFIX}/bin && \
             ${LN} -f maturin maturin-${PYTHON_VER}

This ensures that the versioned binary name expected by dependent ports (e.g. security/py-cryptography) is present after installation.

--- Additional Notes ---

It may also be worth investigating whether the existing post-patch substitution of %%PYTHON_VER%% in maturin/__init__.py is functioning correctly for DISTVERSION=1.13.1, as upstream may have changed the relevant code path since the substitution was introduced.
Comment 1 Kai Knoblich freebsd_committer freebsd_triage 2026-05-05 13:45:36 UTC
(In reply to Hajime Murai from comment #0)

Hi, thanks for the detailed report and patch!

I checked it earlier using poudriere for all Python flavors (py310-py314) to build devel/py-maturin and security/py-cryptography which showed no issues so far.

Before I try to reproduce the scenario you described using portmaster, I wanted to ask just in case: Could the problem possibly be already solved with devel/py-installer 1.0.0_1 (via commit ports 644ec0bc04d2)?

The reason is that the problem you described has some similarities with the reports from bug #294631 which affected several Python ports, that have addtional scripts outside the Python site-lib directory, e.g. devel/py-build, when using in-place upgrades in the ports tree, e.g. with portmaster.