www/firefox: Python(?) issues building under poudriere (stable/14)

From: David Wolfskill <david_at_catwhisker.org>
Date: Sat, 11 May 2024 14:29:29 UTC
TL;DR: As the Subject says; log & info at
https://www.catwhisker.org/~david/FreeBSD/ports/firefox/

Additional detail:
I have 2 broad categories of FreeBSD machines here at home (all amd64):
* Development machines (a build machine & some laptops)
* Production machines (a multi-homed "traffic cop"/gateway & a main
  machine)

The development machines get updated daily, tracking stable/14 & head
(on dfferent slices); installed ports are updated daily on stable/14
using portmaster (except for www/chromium).  The laptops have a
slightly-customized kernel; the build machine runs GENERIC.

The production machines get updated weekly (Sunday mornings), with the
just-built snapshot of stable/14 (courtesy of the build machine).  The
build machine also runs poudriere-devel to build packages for the
production machines (and for the laptops, in the case of chromium).

Package-building is done on a weekly cycle (augmented by as-needed
chromium-specific runs); in order to try to save a bit of time on
"update day" (Sunday), I make an initial package-building run on
Saturday (which, not so coincidentally, is today).

Usually, this process is ... well, boring.  (Which is a Very Good Thing,
as I remind my colleagues at work -- especially when I'm shepherding a
new release.)  It also goes a fairly long way toward ensuring that the
machines I use have "consistent" environments: there is no "piecemeal
updating" going on here.

Last week, poudriere failed to build firefox (on both Saturday and
Sunday, IIRC).  While that was moderately annoying, it didn't seem
fatal: the previously-built firefox had already been installed on the
one production machine that has it.  And the laptops (that build firefox
using portmaster) didn't seem to have a problem building & using it.

But the port has since been updated (to 126.0_1,2.  And poudriere
has complained again.  So this time, I have copied the poudriere
log of the failed build to
https://www.catwhisker.org/~david/FreeBSD/ports/firefox/ (and also
made a compressed copy; my Internet connectivity leaves a fair bit
to be desired).

Specific information for this failure:
The build machine was (and is) running:

FreeBSD freebeast.catwhisker.org 14.1-STABLE FreeBSD 14.1-STABLE #135 stable/14-n267652-91df7d335dd4: Sat May 11 10:47:37 UTC 2024     root@freebeast.catwhisker.org:/common/S1/obj/usr/src/amd64.amd64/sys/GENERIC amd64 1401500 1401500

The ports tree is at: main-n662668-8e136401b5b9

poudriere is poudriere-git-3.4.99.20240424

The fatal error in the log appears to be a Python ImportError about
	Undefined symbol "sqlite3_enable_load_extension"

...
/wrkdirs/usr/ports/www/firefox/work/.mozbuild/srcdirs/firefox-126.0-10171689b53e/_virtualenvs/build/bin/python -m mozbuild.action.file_generate /wrkdirs/usr/ports/www/firefox/work/firefox-126.0/toolkit/components/telemetry/build_scripts/gen_scalar_enum.py main toolkit/components/telemetry/TelemetryScalarEnums.h toolkit/components/telemetry/.deps/TelemetryScalarEnums.h.pp toolkit/components/telemetry/.deps/TelemetryScalarEnums.h.stub /wrkdirs/usr/ports/www/firefox/work/firefox-126.0/toolkit/components/telemetry/Scalars.yaml
./TelemetryEventData.h.stub
/wrkdirs/usr/ports/www/firefox/work/.mozbuild/srcdirs/firefox-126.0-10171689b53e/_virtualenvs/build/bin/python -m mozbuild.action.file_generate /wrkdirs/usr/ports/www/firefox/work/firefox-126.0/toolkit/components/telemetry/build_scripts/gen_event_data.py main toolkit/components/telemetry/TelemetryEventData.h toolkit/components/telemetry/.deps/TelemetryEventData.h.pp toolkit/components/telemetry/.deps/TelemetryEventData.h.stub /wrkdirs/usr/ports/www/firefox/work/firefox-126.0/toolkit/components/telemetry/Events.yaml
Traceback (most recent call last):
  File "/usr/local/lib/python3.9/runpy.py", line 197, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "/usr/local/lib/python3.9/runpy.py", line 87, in _run_code
    exec(code, run_globals)
  File "/wrkdirs/usr/ports/www/firefox/work/firefox-126.0/python/mozbuild/mozbuild/action/file_generate.py", line 154, in <module>
    sys.exit(main(sys.argv[1:]))
  File "/wrkdirs/usr/ports/www/firefox/work/firefox-126.0/python/mozbuild/mozbuild/action/file_generate.py", line 85, in main
    spec.loader.exec_module(module)
  File "<frozen importlib._bootstrap_external>", line 850, in exec_module
  File "<frozen importlib._bootstrap>", line 228, in _call_with_frames_removed
  File "/wrkdirs/usr/ports/www/firefox/work/firefox-126.0/toolkit/components/glean/build_scripts/glean_parser_ext/run_glean_parser.py", line 11, in <module>
    import cpp
  File "/wrkdirs/usr/ports/www/firefox/work/firefox-126.0/toolkit/components/glean/build_scripts/glean_parser_ext/cpp.py", line 14, in <module>
    from glean_parser import metrics, util
  File "/wrkdirs/usr/ports/www/firefox/work/firefox-126.0/third_party/python/glean_parser/glean_parser/metrics.py", line 15, in <module>
    from . import pings
  File "/wrkdirs/usr/ports/www/firefox/work/firefox-126.0/third_party/python/glean_parser/glean_parser/pings.py", line 14, in <module>
    from . import util
  File "/wrkdirs/usr/ports/www/firefox/work/firefox-126.0/third_party/python/glean_parser/glean_parser/util.py", line 17, in <module>
    import diskcache  # type: ignore
  File "/wrkdirs/usr/ports/www/firefox/work/firefox-126.0/third_party/python/diskcache/diskcache/__init__.py", line 9, in <module>
    from .core import Cache, Disk, EmptyDirWarning, JSONDisk, UnknownFileWarning, Timeout
  File "/wrkdirs/usr/ports/www/firefox/work/firefox-126.0/third_party/python/diskcache/diskcache/core.py", line 14, in <module>
    import sqlite3
  File "/usr/local/lib/python3.9/sqlite3/__init__.py", line 57, in <module>
    from sqlite3.dbapi2 import *
  File "/usr/local/lib/python3.9/sqlite3/dbapi2.py", line 27, in <module>
    from _sqlite3 import *
ImportError: /usr/local/lib/python3.9/lib-dynload/_sqlite3.cpython-39.so: Undefined symbol "sqlite3_enable_load_extension"
gmake[2]: *** [backend.mk:684: toolkit/components/glean/.deps/HistogramGIFFTMap.h.stub] Error 1
gmake[2]: *** Waiting for unfinished jobs....
....

The only difference in port options I find between the laptops &
poudriere is that the laptops have:

     SNDIO=off: Sndio audio support

while poudriere shows:

OPTIONS_FILE_SET+=SNDIO


Finally (for this post), I admit that I've never really picked up Python
(and that SQL-related things are things I tend to muddle through, then
write scripts to handle so I don't need to try to think about them any
more).

So: Do I need to fix my process?  Is this actually symptomatic of
something that warrants a bug report?

Thanks!

Peace,
david
-- 
David H. Wolfskill                              david@catwhisker.org
Please do not mistake "authoritarian" for "conservative" -- or vice versa.

See https://www.catwhisker.org/~david/publickey.gpg for my public key.