Contributing to Picard 3.0

I see that work is continuing on Picard 3.0 with progress on Apple Silicon support. I have an Apple Silicon device and Python experience. I’d be happy to assist if you need beta testers or some development assistance.

I dug into the issue trackers and found this pull request which says “We will get back to this, but likely only after we have moved to PySide6 and there is at least a 6.7.1 release available on pypi.” As of 18 June 2024, PyPI has PySide6 6.7.2. The PySide6 branch has been dormant for two months.

From this analysis, it seems productive for me to pull down the PySide6 branch and try to get it building on my Apple Silicon machine now that PySide6 v6.7.2 is available. Is that correct?

2 Likes

IMO this might better be flagged using a Picard ticket on the Metabrainz Jira tickets web site.

@outsidecontext ?

If appropriate, I’d be happy to submit a ticket over there. I pinged here because it looked like that ticketing system is primarily for bug reporting. Looks like it requires a third account? (Atlassian + metabrainz.org + GitHub)

I’m more of a “when I have some time” contributor, helping out when I can. The two people leading the work on Picard are @Zas and @outsidecontext, and I’m sure they will welcome any contributions you can provide (especially testing and work on the macOS stuff).

If you’re in Matrix, there’s a room specifically for Picard Development (#musicbrainz-picard-dev:chatbrainz.org). You’re more than welcome to join us there as well.

I look forward to working with you.

Bob Swift (aka rdswift)

1 Like

Thanks for your interest in helping. Having someone with actual access to a Apple Silicon device would be great, as I’ve been flying blind so far.

The PySide6 experiment is dead for now, so. Encountered too many issues and instabilities, and config migration would have been a pain. So zas and I decided to abandon this approach and stay with PyQt, which is proven and stable. There had been two main reasons for considering PySide: 1. It’s released together with new Qt releases, so theoretically might be more up to date and 2. they did provide Apple Silicon binaries when PyQt did not yet.

But PyQt now provides Apple Silicon binaries, although with one downside that they only provide partially universal2 binaries. The PyQt6 packages on PyPI consist of two parts: The PyQt6 package, which contains the actual Python modules providing the Qt bindings, and the PyQt6-Qt6, which provides pre-compiled Qt6 binaries.

The PyQt6 package is available for macOS as a single universal2 binary. The PyQt6-Qt6 however has separate packages for arm64 and x86_64. AFAIK this is due to package size limits on PyPI.

I would have liked to provide a single universal package, but that is not a strict requirement. We could as well have two separate packages, one for arm64 and one for x86_64.

Currently there are multiple options to go about providing Apple Silicon support:

  1. Adapt the build process to build two separate app packages for arm64 and x86_64.
  2. Instead of using the Qt6 binaries from PyPI compile Qt6 ourselves. This probably also involves rebuilding PyQt6. I really wanted to avoid this overhead, though. Picard’s packaging is already complex enough.
  3. Use the Qt6 binaries from the PyQt6-Qt6 package, but combine the individual binary files for arm64 and x86_64 into a combined universal2 binary. I haven’t investigated further how feasible this is, the Qt6 packages consist of quite a few individual binaries. But theoretically the structure should be the same in both architectures and some script could combine the two architectures for each file.

If you want to help digging into this and providing a solution you are more then welcome. I personally lack both the time and a machine to properly test on. My current focus will be getting a bugfix release for Picard 2.12 out and then focusing on the new plugin system again, so it would be quite a while until I will get back to macOS packaging.

As rdswift wrote best would be to get in touch in the chat.

If you want some pointers building the Picard app package on macOS is done with PyInstaller. The production is being build with the macos* scripts in picard/scripts/package at master · metabrainz/picard · GitHub . The build is controlled by Gitlab CI with picard/.github/workflows/package-macos.yml at master · metabrainz/picard · GitHub

But for local development and testing when running Picard from the source tree the simple answer is actually that one needs to install pyinstaller with pip and then build the app bundle with pyinstaller --clean picard.spec. That would build the app bundle for the system, architecture, though, no universal binaries.

I had the basic changes for building universal2 packages in the branch at Commits · phw/picard · GitHub . As far as I could tell it worked except for the Qt6 binaries, as discussed above.

5 Likes

Awesome - this is the context I needed. Thanks for taking the time to brain dump. I’ll start poking in the directions indicated and ping the matrix chat when/if I have something meaningful to share.

Also, thank you for your work on this in general. Picard is a core part of my music experience. I currently run it via this Docker image on Unraid because (1) that’s where my music collection lives and (2) Apple Silicon. Unfortunately the releases lag a bit and it’s a bit clumsy running desktop software via the browser. It would be lovely to get a clean Picard experience on my primary workstation, do the curation there, and shuffle stuff off to the NAS after it’s tidied up.

3 Likes

Much appreciated, let me know if I can assist you in some way setting things up.

On a side note I just merged changes related to localized sorting that avoid segfaults on macOS. It looks like these might have been related to various crashes on macOS in the past. I was now also able to upgrade the builds to the latest PyQt6 / Qt6 without issues. This resolves some of the headaches :slight_smile:

4 Likes