WasatchPhotonics / ENLIGHTEN

Open-source spectroscopy application for controlling and taking measurements from Wasatch Photonics spectrometers.
https://wasatchphotonics.com/product-category/software/
MIT License
3 stars 6 forks source link

Reboot macOS builds #269

Closed samiebee43 closed 12 months ago

samiebee43 commented 1 year ago

Our latest macOS build is 2.7.3

If rebooting this build process looks anything like the process for Ubuntu, we may find some dependency problems.


The root of build-time dependency problems is that our use of Miniconda + Pyinstaller relies on conda and pip package managers which may fail (1) for wrapper libraries such as Qt (Pyside2) if there are no prebuilt binaries for that particular Python version and OS version (2) for soft libraries which are written for a different version of Python than target (more rare than case 1).

To future proof our build situation, it might be helpful to (A) Lightly virtualize our target platform. (B) Reuse local copies of all dependencies. We update Enlighten any time we update this local store, not vice versa. (C) Bias towards later Python versions. This step should be applied only when we update dependencies.

Step A is the most important one -- our problems with remote dependencies and Python version have almost always been because of missing OS specific wrapper lib binaries. B and C are about building even more resilience to the build system, despite any upstream changes.

Docker exists to solve problem A, but I'm not sure I want to containerize the program. I have a strong feeling that would create more problems than it solves.

I would prefer to instead have the capacity to produce our own binaries for our wrapper dependencies (PySide2).

Some of these problems may solve themselves over time as package indexes are updated, if that's the case, it would be prudent to lean into strategy B, such that we are not blind sighted by a changing upstream.


Building our own dependency binaries would also be nice if we switch to PySide6, which as of 2023 June 23, had a failing macOS build (on the pip index).

samiebee43 commented 12 months ago

@mzieg completed this and documented the process in README_MACOS.md

samiebee43 commented 12 months ago

(B) from this extended plan is most useful when we compile (wrapper) modules ourselves.. that can completely eschew situations where we need to use an old python version in order to keep a dependency.

(Such as Python37 on Ubuntu for PyQt5, we would just build it for Python latest and Ubuntu latest whenever we want)

In fact, it's possible to continue without any virtualization and focus on B & C. Though this requires more frequent platform specific builds.