Re: git: c17ddfbf66e2 - main - lang/python: add bytecode trigger

From: Matthias Andree <matthias.andree_at_tu-dortmund.de>
Date: Mon, 27 Feb 2023 21:10:41 UTC
Am 18.02.23 um 08:42 schrieb Antoine Brodin:
> On Wed, Feb 15, 2023 at 9:36 PM Charlie Li <vishwin@freebsd.org> wrote:
>>
>> The branch main has been updated by vishwin:
>>
>> URL: https://cgit.FreeBSD.org/ports/commit/?id=c17ddfbf66e2801ec620d49979aca3d7077d7002
>>
>> commit c17ddfbf66e2801ec620d49979aca3d7077d7002
>> Author:     Charlie Li <vishwin@FreeBSD.org>
>> AuthorDate: 2023-02-15 20:57:06 +0000
>> Commit:     Charlie Li <vishwin@FreeBSD.org>
>> CommitDate: 2023-02-15 21:35:07 +0000
>>
>>      lang/python: add bytecode trigger
>>
>>      Facilitates compiling, writing and removing bytecode files (.pyc)
>>      in site-packages after all pkg transactions have been completed.
>>
>>      Technical details: https://wiki.freebsd.org/Python/CompiledPackages
>>
>>      Fixes reports of Python port builds as root failing on filesystem
>>      violations due to bytecode file writes where the port did not include
>>      them in the package.
>>
>>      For those ports/packages that currently package bytecode, some
>>      checksum mismatches on those files may occur. This is harmless and
>>      will be rectified, in large as part of a USE_PYTHON=distutils
>>      overhaul to reduce churn.
>>
>>      While here, implement a long-standing todo item of letting lang/python
>>      ports use python.mk bits. Not only does this obviate duplicate
>>      variables in each Makefile, but SUB_LIST (also added) is used for
>>      these triggers.
>>
>>      Co-authored by: tcberner
>>      Approved by: tcberner (mentor)
>>      Differential Revision: https://reviews.freebsd.org/D34739
> 
> Hello,
> 
> There are some errors with this trigger:
> 
> Installing py39-sphinx-5.3.0,1...
>> => Cleaning stale bytecode files...
> pkg-static: Failed to execute lua trigger: [string "function
> cleanup(directory)..."]:21: attempt to get length of a nil value
> (local 'res')
> pkg-static: lua script failed
> 
> Installing py39-breathe-4.34.0...
>> => Cleaning stale bytecode files...
> pkg-static: Failed to execute lua trigger: attempt to index a nil value
> pkg-static: lua script failed
> 
> Antoine

This has been unanswered in 9 days and obviously the triggers are not 
ready for prime-time. I have reverted this breaking change in a9d9d3a4 
(and yes, PORTREVISIONS are going forward - quite a bit of an effort of 
getting the revert hopefully right without messing with port versions).

Charlie, please go back to https://reviews.freebsd.org/D34739, fix up 
everything in the lua script, request an -exp run, clean up the 
fall-out, and then commit.