Opened 14 months ago

Closed 14 months ago

Last modified 5 months ago

#67096 closed defect (fixed)

build_getjobsarg's mishandling of build.cmd causes it to add jobs arg incorrectly

Reported by: ryandesign (Ryan Carsten Schmidt) Owned by: jmroot (Joshua Root)
Priority: Normal Milestone: MacPorts 2.9.0
Component: base Version: 2.8.1
Keywords: Cc: jmroot (Joshua Root)
Port: python-1.0

Description

In both the scons and cmake-language-server ports, trying to switch them from python 3.10 to python 3.11 resulted in this inscrutable error:

python -m build: error: unrecognized arguments: -j8

It looks like the python portgroup only adds the jobs arg when not ${python.pep517}, and ${python.pep517} is on by default for python 3.11 and later.

But MacPorts base adds the jobs arg whenever ${build.cmd} matches *make*, *ninja*, or *scons*. The python portgroup misuses ${build.cmd} when ${python.pep517}, setting it to ${python.bin} -m build --wheel --no-isolation --outdir ${workpath}. The base check for whether this matches *make* triggers for the cmake-language-server port, and the check for whether this matches *scons* triggers for the scons port, because of the inclusion of ${workpath}.

Setting ${build.cmd} to the build command and putting the args in either ${build.pre_args} or ${build.post_args} should solve the problem.

Change History (4)

comment:1 Changed 14 months ago by jmroot (Joshua Root)

Component: portsbase
Summary: python portgroup's misuse of build.cmd causes base to add jobs argbuild_getjobsarg's mishandling of build.cmd causes it to add jobs arg incorrectly

comment:2 Changed 14 months ago by jmroot (Joshua Root)

Owner: set to jmroot
Resolution: fixed
Status: newclosed

In 2fafcefd752f326433e80636867be76775bb3531/macports-base (master):

build_getjobsarg improvements

Only match against the actual command name in build.cmd, not the path
leading up to it or args being passed to it. Only pass an explicit -j1
when needed to prevent parallel build, i.e. with ninja.

Closes: #67096

comment:3 Changed 14 months ago by jmroot (Joshua Root)

In 34731012e4e3d9969ccb37ae098f166171e7fb2f/macports-ports (master):

python pg: workaround for build_getjobsarg bug

See: #67096

comment:4 Changed 5 months ago by jmroot (Joshua Root)

Milestone: MacPorts 2.9.0
Note: See TracTickets for help on using tickets.