Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Older macOS versions? #1256

Closed
The-Compiler opened this issue Jul 17, 2020 · 7 comments
Closed

Older macOS versions? #1256

The-Compiler opened this issue Jul 17, 2020 · 7 comments

Comments

@The-Compiler
Copy link

Area for Triage:
Apple

Question, Bug, or Feature?:
Question/Feature


I'm not sure if this really is the right place to ask, but it seems to me like the most fitting one: Are there any plans to add environments for older macOS versions? While trying to move release building for my qutebrowser project to GitHub Actions, I noticed that only macOS 10.15 is available. From my experience, a binary built on macOS 10.15 will not work correctly on older versions (but the reverse works fine), so I'm currently building on macOS 10.13 High Sierra (which is the oldest version I want to support). Thus, this currently keeps me from automating building of releases, unfortunately.

@vmapetr
Copy link
Contributor

vmapetr commented Jul 17, 2020

Hi @The-Compiler !
For Github Actions, we're not planning to add macOS versions older than Catalina, but it may change in the future. However, we're support macOS 10.14 for Azure DevOps.

@andy-mishechkin
Copy link
Contributor

Hello, @The-Compiler.
According to #461, we have no plans to add previous versions in the nearest time.

@Safihre
Copy link

Safihre commented Jan 30, 2021

For anyone also looking into this to build Python-packages or use PyInstaller to build an .app: Python actually offers support for this, by setting the MACOSX_DEPLOYMENT_TARGET environment variable.
However, it is not possible using the Python versions installed on the GA workers, because they are compiled on macOS 10.15 or newer.
Simply getting the official Python installer make the magic work! 🥳
Just make sure to use python3 and pip3 in your commands.

EDIT 2022: make sure to checkout our workflow to see how to compile or get PyInstaller, Cffi and Cryptography to work on macOS 10.9 and above!
https://github.com/sabnzbd/sabnzbd/blob/0347907044ee2a8b060c9a53ca362c8210f6e83b/.github/workflows/build_release.yml#L80

jobs:
  build_macos:
    name: Build macOS binary
    runs-on: macos-latest
    env:
      # We need the official Python, because the GA ones only support newer macOS versions
      # The deployment target is picked up by the Python build tools automatically
      PYTHON_VERSION: 3.9.1
      MACOSX_DEPLOYMENT_TARGET: 10.9
    steps:
    - uses: actions/checkout@v2
    - name: Get Python
      run: curl https://www.python.org/ftp/python/${PYTHON_VERSION}/python-${PYTHON_VERSION}-macosx10.9.pkg -o "python.pkg"
    - name: Install Python
      run: |
        sudo installer -pkg python.pkg -target /
    - name: Install Python dependencies
      run: |
        python3 --version
        pip3 install --upgrade -r requirements.txt

Anyone can use this snippet: http://unlicense.org/

StefanLobbenmeier added a commit to StefanLobbenmeier/yt-dlp that referenced this issue Jun 18, 2022
StefanLobbenmeier added a commit to StefanLobbenmeier/yt-dlp that referenced this issue Jun 18, 2022
@StefanLobbenmeier
Copy link

@Safihre could you add http://unlicense.org/ to your comment so that anyone can use the snippet in their project? I think otherwise it is implicitly published as MIT: https://opensource.stackexchange.com/a/7900

@Safihre
Copy link

Safihre commented Jun 18, 2022

@StefanLobbenmeier Done. Maybe bit outdated.
I included a link to our current workflow, which has some nice other tricks of how to compile PyInstaller, Cffi and Cryptography for macOS 10.9 and above.
https://github.com/sabnzbd/sabnzbd/blob/0347907044ee2a8b060c9a53ca362c8210f6e83b/.github/workflows/build_release.yml#L80

@StefanLobbenmeier
Copy link

StefanLobbenmeier commented Jun 18, 2022

Ahh so you managed to get both a universal binary and support for older macOS versions?

(if I want to use the linked GitHub action I probably also need a confirmation that this can be used without gplv3 licence)

@Safihre
Copy link

Safihre commented Jun 18, 2022

@StefanLobbenmeier Yes indeed, we have a release that's fully universal2 version that also supports 10.9+. In package.py there's a check to see if each binary (executable but also the Python extensions) is universal2. Because I learned the hard way that often only when a specific line of Python code is executed, it will crash on M1 due to missing ARM support in some extension.
https://github.com/sabnzbd/sabnzbd/blob/0347907044ee2a8b060c9a53ca362c8210f6e83b/builder/package.py#L345
Anyone is indeed free to see how we do it and modify it for their projects.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants