Skip to content

Beets: Update to v2.11.0 - #7178

Draft
mreid-tt wants to merge 15 commits into
SynoCommunity:masterfrom
mreid-tt:beets-2.11.0
Draft

Beets: Update to v2.11.0#7178
mreid-tt wants to merge 15 commits into
SynoCommunity:masterfrom
mreid-tt:beets-2.11.0

Conversation

@mreid-tt

@mreid-tt mreid-tt commented Jun 6, 2026

Copy link
Copy Markdown
Contributor

Description

  • Beets: Update to v2.11.0, migrate to Python 3.14, add autobpm plugin

Package Changes

  • Beets: SPK_VERS 2.5.1 → 2.11.0, SPK_REV 12 → 13, Python 3.12 → 3.14, requires DSM 7.2+
  • New plugins: autobpm (via librosa/llvmlite)
  • cross/llvm-20.0: Minimal LLVM 20 build for llvmlite, configured with BUILD_SHARED_LIBS=OFF, LLVM_BUILD_LLVM_DYLIB=ON, target-specific arch, and LLVM_ENABLE_ZSTD=OFF. Uses ADDITIONAL_CONFIGURE_ARGS (framework cmake command reads CONFIGURE_ARGS, not CMAKE_ARGS).
  • cross/openblas: New dependency for scipy
  • python/pycairo: 1.28.0 → 1.29.0
  • spk/python314: Added crossenv requirements for numpy, scipy, scikit-learn, numba, lap, soxr

Framework

  • Meson properties (tc_vars.mk): Adds needs_exe_wrapper = true and longdouble_format for numpy/scipy cross-compilation.
  • Meson cross-file cleanup: Removes duplicate pkgconfig lines.
  • Conditional meson cross-file (wheel-env.mk): Only passes cross-file for non-x64.
  • Per-package pip args (crossenv.mk, compile.mk): Injects cross-file args for meson packages, cmake args for soxr, and SETUPTOOLS_SCM_PRETEND_VERSION for soxr (version detection fails without git tags). Adds LD_LIBRARY_PATH and npymath override for scipy. Fixed PATH ordering (build-bin after system PATH to avoid using cross-compiled Python on host).

Fixes #

Checklist

  • Build rule all-supported completed successfully
  • New installation of package completed successfully
  • Package upgrade completed successfully (Manually install the package again)
  • Package functionality was tested
  • Any needed documentation is updated/created

Type of change

  • Package update
  • Includes small framework changes

@mreid-tt mreid-tt self-assigned this Jun 6, 2026
@mreid-tt
mreid-tt requested a review from th0ma7 June 6, 2026 15:09
@mreid-tt

mreid-tt commented Jun 6, 2026

Copy link
Copy Markdown
Contributor Author

Basic testing was successful:

mreid@DSM72:~$ beet --version
beatport: The 'beatport' plugin is deprecated and will be removed in version 3.0.0.
beets version 2.11.0
Python version 3.14.5
plugins: autobpm, beatport, chroma, discogs, embedart, emby, fetchart, kodi, lastgenre, lastimport, lyrics, metasync, plexupdate, replaygain, scrub, sonosupdate

EDIT: Also tested the long-elusive plugin autobpm:

mreid@DSM72:~$ export PYTHONWARNINGS="ignore"
mreid@DSM72:~$ beet autobpm -f title:"Hostage"
autobpm: Computed BPM for /var/services/homes/mreid/music/Sia/1000 Forms Of Fear/05 Hostage.mp3: 144
mreid@DSM72:~$ beet ls -f '$artist - $title: $bpm BPM' title:"Hostage"
Sia - Hostage: 144 BPM

@th0ma7

th0ma7 commented Jul 3, 2026

Copy link
Copy Markdown
Contributor

I just noticed your review ask on this one, sorry for the delay. Super interesting hooks you've added. It's using current pip options while this should be updated to allow using newer pip (or build) methods to pass arguments. Also needs to be divided on sub PRs.

Mind if i look further in the codebase to see how best to include your proposed changes? Noting that fully supporting cmake and meson with pip (and or build) as always been on my todo list, real glad you managed to get this working somehow.

@mreid-tt

Copy link
Copy Markdown
Contributor Author

hey @th0ma7, I've rebased the beets-2.11.0 branch onto the current master, which includes the recent framework restructuring (mk file renames). The build passes for x64-7.2 and aarch64-7.2, but fails on armv7-7.2.

The armv7 failure is in scipy's meson build: when cross-compiling for 32-bit ARM, pkg-config finds the native (x86_64) Python's .pc file. This returns -I paths to the native Python headers, where pyconfig.h defines SIZEOF_LONG = 8 (64-bit). The armv7 cross-compiler defines LONG_BIT = 32, so pyport.h's sanity check fails:

#error "LONG_BIT definition appears wrong for platform (bad gcc/glibc config?)."

The native Python headers happen to work on 64-bit targets (aarch64, x64) because LONG_BIT matches.

We have two options:

  1. Fix: Add rsc:lib/pkgconfig/python*.pc to cross/python314/PLIST (~24 KB). This makes the cross Python's .pc files available to dependent packages via the standard dependency merge, so pkg-config finds them before falling back to the native ones.

  2. Drop armv7: Add armv7 to UNSUPPORTED_ARCHS in the beets Makefile. scipy with LLVM/OpenBLAS on 32-bit ARM is a heavy build for a niche use case.

Any preference or other ideas to consider?

@th0ma7

th0ma7 commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

Re-reading this i believe the problem is elsewhere. Adding the pc file to the plist won't change anything: it only serves for the spk packaging, but if you look close enough the .pc files are into the target/lib/pkgconfig directory.

The main reason why you're seing this is due to you environment: the spk-meta are meant to add the proper entries into PKG_CONFIG_LIBDIR and all the _FLAGS. Look at the structure under mk/spksrc.spk/ where the exports and variable mangling are done.

Your code for beets to generate a meson dependent package from pip is exactly the direction I want to take to avoid when ever possible of using spksrc/python exceptions. But the framework needs a lot of adjustments to occur in the first place to properly allow this, in particular the need yo migrate to new variables allowing the use of a more recent pip (and that's just one of the few i believe).

I have the gcc overlay then a handful of minor things before completing the broader framework changes. I could realistically resume work on the python part of the framework and see how to fully integrate this functionality over the Fall period. Otherwise can try to assist but this requires a lot of cycles...

@mreid-tt

Copy link
Copy Markdown
Contributor Author

Hey @th0ma7, thanks for taking the time to consider this. Your reasoning makes sense, and I agree that our long-term goal should be to simplify the packaging framework and make Python packages more sustainable to maintain.

Since beets isn't a high-demand package, I'll leave this PR as a draft for now until you have some cycles to look at that part of the framework.

@mreid-tt
mreid-tt marked this pull request as draft July 29, 2026 11:56
Without a python binary in the meson cross-file, import('python') resolves
the build-machine (host) python, whose headers break 32-bit cross builds
(LONG_BIT mismatch, e.g. scipy on armv7). Generate a cross-file fragment
declaring the crossenv cross-python and pass it alongside the existing
meson cross-files for pip-built meson wheels.
meson-python reads setup args from [tool.meson-python.args] for every meson
invocation, including the metadata-generation setup that does not receive
config-settings. Inject the --cross-file configure args there so cross
compilation is consistent (fixes pycairo sanity-check failure on ARM).
pycairo compiles bindings for cairo-xcb.h, which includes xcb/xcb.h.
Without cross/libxcb the header is missing on cross builds.
The pygobject crossenv installs pycairo from the wheelhouse; the pins must
match python/pycairo (now 1.29.0) or pip rebuilds from source without
cross-files and fails.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants